
    gal_loadjscssfile = function(filename, filetype, fn) {
        if (filetype == "js") {
            var fileref = document.createElement("script");
            fileref.setAttribute("type", "text/javascript");
            fileref.setAttribute("src", filename);
        } else if (filetype == "css") {
            var fileref = document.createElement("link");
            fileref.setAttribute("rel", "stylesheet");
            fileref.setAttribute("type", "text/css");
            fileref.setAttribute("href", filename);
        }
        if (typeof fileref != "undefined")
            document.getElementsByTagName("head")[0].appendChild(fileref);

        if (typeof fn != "undefined") {
            if (fileref.readyState) {  //IE
                fileref.onreadystatechange = function() {
                    if (fileref.readyState == "loaded" ||
                            fileref.readyState == "complete") {
                        fileref.onreadystatechange = null;
                        fn();
                    }
                };
            } else {  //Others
                fileref.onload = function() {
                    fn();
                };
            }
        }
    }
var callBack_count = 0;   
var MAX_CALLBACK = 3;
function callBack_Helper() {
    callBack_count++;
    if (callBack_count == MAX_CALLBACK) {
        callBack();
    }
}    

gal_loadjscssfile("http://gallery.kokteyl.com/Rating.js","js");
gal_loadjscssfile("http://yui.yahooapis.com/2.7.0/build/fonts/fonts-min.css", "css");
gal_loadjscssfile("http://yui.yahooapis.com/2.7.0/build/carousel/assets/skins/sam/carousel.css", "css");
gal_loadjscssfile("http://gallery.kokteyl.com/rating.css", "css");
var GAL_APP_ROOT = "http://gallery.kokteyl.com";

gal_loadjscssfile("http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js","js", callBack_Helper1);

function callBack_Helper1() {
    gal_loadjscssfile("http://yui.yahooapis.com/2.7.0/build/element/element-min.js","js", callBack_Helper2);
}    
function callBack_Helper2() {
    gal_loadjscssfile("http://yui.yahooapis.com/2.7.0/build/carousel/carousel-min.js","js", callBack_Helper);
    gal_loadjscssfile("http://yui.yahooapis.com/2.7.0/build/animation/animation-min.js","js", callBack_Helper);
}    
gal_loadjscssfile("http://gallery.kokteyl.com/Rating.js","js", callBack_Helper);
document.write('<style type="text/css"> .rating ul { background: url(http://gallery.kokteyl.com/rating.gif) top left repeat-x; } .rating li.current-rating { background: url(http://gallery.kokteyl.com/rating.gif) left bottom; } .rating li a:hover { background: url(http://gallery.kokteyl.com/rating.gif) left center; } #container, #content-rating, #spotlight { width:450px !important;}</style>');
document.write('<div id="container" style="display:none"><ol id="carousel">');

    document.write('<li><img id="imgCnt_2115" src="http://gallery.kokteyl.com/Contents/photos/200910/18/bbc4fe7803cc4dc6aea0a471e584f0c1_s.jpg" alt="Galatasaray Arda Turan" viewCount="23505" contentId="2115" rating="1300" rateCount="560" /></li>');
    
    document.write('<li><img id="imgCnt_2114" src="http://gallery.kokteyl.com/Contents/photos/200910/18/d2cf080ec6fb44d09b86a39dd5e8bc1e_s.jpg" alt="Trabzonspor Hugo Bross " viewCount="778" contentId="2114" rating="532" rateCount="129" /></li>');
    
    document.write('<li><img id="imgCnt_2113" src="http://gallery.kokteyl.com/Contents/photos/200910/18/bfe891cef3824930a91b5f857c795da5_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="814" contentId="2113" rating="184" rateCount="136" /></li>');
    
    document.write('<li><img id="imgCnt_2112" src="http://gallery.kokteyl.com/Contents/photos/200910/18/be971785b5b948f0afd51b773e693fe4_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="724" contentId="2112" rating="159" rateCount="39" /></li>');
    
    document.write('<li><img id="imgCnt_2111" src="http://gallery.kokteyl.com/Contents/photos/200910/18/5987eb6905c64a2ba57b5856c0fb0fbf_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="560" contentId="2111" rating="51" rateCount="11" /></li>');
    
    document.write('<li><img id="imgCnt_2110" src="http://gallery.kokteyl.com/Contents/photos/200910/18/fab62d44305a4d82b983b0a1f502ebe8_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="9441" contentId="2110" rating="2055" rateCount="1201" /></li>');
    
    document.write('<li><img id="imgCnt_2109" src="http://gallery.kokteyl.com/Contents/photos/200910/18/6468f1557b93444aacda40527863dd33_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="976" contentId="2109" rating="1237" rateCount="300" /></li>');
    
    document.write('<li><img id="imgCnt_2108" src="http://gallery.kokteyl.com/Contents/photos/200910/18/b77773e6fda341b5a186b24f4e581abe_s.JPG" alt="Galatasaray " viewCount="945" contentId="2108" rating="213" rateCount="144" /></li>');
    
    document.write('<li><img id="imgCnt_2107" src="http://gallery.kokteyl.com/Contents/photos/200910/18/e90eae268de742aea3a79b1b59ff237f_s.JPG" alt="Galatasaray " viewCount="781" contentId="2107" rating="158" rateCount="102" /></li>');
    
    document.write('<li><img id="imgCnt_2106" src="http://gallery.kokteyl.com/Contents/photos/200910/18/a04361bed8334ca88798e5d6ffcebe3b_s.JPG" alt="Galatasaray " viewCount="679" contentId="2106" rating="195" rateCount="102" /></li>');
    
    document.write('<li><img id="imgCnt_2105" src="http://gallery.kokteyl.com/Contents/photos/200910/18/90383488cad24112910de5feea584cdc_s.jpg" alt="Galatasaray " viewCount="730" contentId="2105" rating="103" rateCount="23" /></li>');
    
    document.write('<li><img id="imgCnt_2104" src="http://gallery.kokteyl.com/Contents/photos/200910/18/cb3a696f9a6d4bf3b0631d399aae828a_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="782" contentId="2104" rating="350" rateCount="75" /></li>');
    
    document.write('<li><img id="imgCnt_2103" src="http://gallery.kokteyl.com/Contents/photos/200910/18/cedb51d745984bf090407bc8dca9cd3d_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="656" contentId="2103" rating="246" rateCount="54" /></li>');
    
    document.write('<li><img id="imgCnt_2102" src="http://gallery.kokteyl.com/Contents/photos/200910/18/9e383f9085864c25a2bab6f59a45398a_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="626" contentId="2102" rating="99" rateCount="53" /></li>');
    
    document.write('<li><img id="imgCnt_2101" src="http://gallery.kokteyl.com/Contents/photos/200910/18/6297c13619c3434481401d785bb45f38_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="633" contentId="2101" rating="40" rateCount="11" /></li>');
    
    document.write('<li><img id="imgCnt_2100" src="http://gallery.kokteyl.com/Contents/photos/200910/18/959a6297eae249fea91c970041e2cd84_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="641" contentId="2100" rating="40" rateCount="14" /></li>');
    
    document.write('<li><img id="imgCnt_2099" src="http://gallery.kokteyl.com/Contents/photos/200910/18/02eff96d487242c587a3cade8c0be796_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="580" contentId="2099" rating="40" rateCount="12" /></li>');
    
    document.write('<li><img id="imgCnt_2098" src="http://gallery.kokteyl.com/Contents/photos/200910/18/ff211b43eb7a4173a8987485160d8050_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="603" contentId="2098" rating="212" rateCount="44" /></li>');
    
    document.write('<li><img id="imgCnt_2097" src="http://gallery.kokteyl.com/Contents/photos/200910/18/9391d5da48fe42669a29dc9f61047df2_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="545" contentId="2097" rating="130" rateCount="76" /></li>');
    
    document.write('<li><img id="imgCnt_2096" src="http://gallery.kokteyl.com/Contents/photos/200910/18/da73cbe89b014b69b67987bc6f003ec9_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="590" contentId="2096" rating="113" rateCount="25" /></li>');
    
    document.write('<li><img id="imgCnt_2095" src="http://gallery.kokteyl.com/Contents/photos/200910/18/a944d59d45514bb08fda30023cee9f1d_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="492" contentId="2095" rating="167" rateCount="112" /></li>');
    
    document.write('<li><img id="imgCnt_2094" src="http://gallery.kokteyl.com/Contents/photos/200910/18/9f1fe878e8944c139aef6461828e8285_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="469" contentId="2094" rating="130" rateCount="85" /></li>');
    
    document.write('<li><img id="imgCnt_2093" src="http://gallery.kokteyl.com/Contents/photos/200910/18/0aff1be08dec403a857630637d5907b5_s.JPG" alt="Galatasaray - Trabzonspor" viewCount="522" contentId="2093" rating="237" rateCount="87" /></li>');
    
    document.write('<li><img id="imgCnt_2092" src="http://gallery.kokteyl.com/Contents/photos/200910/18/42742cb5ac7b48a7b63b69ed7eef04c9_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="521" contentId="2092" rating="54" rateCount="30" /></li>');
    
    document.write('<li><img id="imgCnt_2091" src="http://gallery.kokteyl.com/Contents/photos/200910/18/b91fb01f5a8646d596d448d1ad149e03_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="472" contentId="2091" rating="64" rateCount="35" /></li>');
    
    document.write('<li><img id="imgCnt_2090" src="http://gallery.kokteyl.com/Contents/photos/200910/18/b74c79b655744033b1657700d073e6a8_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="437" contentId="2090" rating="57" rateCount="31" /></li>');
    
    document.write('<li><img id="imgCnt_2089" src="http://gallery.kokteyl.com/Contents/photos/200910/18/cae45679cc8d45599302fb48138f45f1_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="491" contentId="2089" rating="95" rateCount="20" /></li>');
    
    document.write('<li><img id="imgCnt_2088" src="http://gallery.kokteyl.com/Contents/photos/200910/18/92f56a98cb2849e59b9540653987781a_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="446" contentId="2088" rating="110" rateCount="22" /></li>');
    
    document.write('<li><img id="imgCnt_2087" src="http://gallery.kokteyl.com/Contents/photos/200910/18/1fef663988364d0bb344e738d0e052ec_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="482" contentId="2087" rating="138" rateCount="56" /></li>');
    
    document.write('<li><img id="imgCnt_2086" src="http://gallery.kokteyl.com/Contents/photos/200910/18/2cc9373aeeae46baa86bfea560e651d5_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="407" contentId="2086" rating="60" rateCount="12" /></li>');
    
    document.write('<li><img id="imgCnt_2085" src="http://gallery.kokteyl.com/Contents/photos/200910/18/c2d250aced05464cb0646fa8dbe98f6d_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="404" contentId="2085" rating="65" rateCount="13" /></li>');
    
    document.write('<li><img id="imgCnt_2084" src="http://gallery.kokteyl.com/Contents/photos/200910/18/51aeb648e52443eaa77bdb789cab687d_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="412" contentId="2084" rating="56" rateCount="12" /></li>');
    
    document.write('<li><img id="imgCnt_2083" src="http://gallery.kokteyl.com/Contents/photos/200910/18/913d666975224196a70cc24a9c92a939_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="390" contentId="2083" rating="51" rateCount="11" /></li>');
    
    document.write('<li><img id="imgCnt_2082" src="http://gallery.kokteyl.com/Contents/photos/200910/18/0518858ef19f4047ac29db20312d0359_s.jpg" alt="Galatasaray - Trabzonspor" viewCount="392" contentId="2082" rating="46" rateCount="10" /></li>');
    
    document.write('<li><img id="imgCnt_1951" src="http://gallery.kokteyl.com/Contents/photos/200910/17/a2d251a0bfb543209a80f0ccbb0c6fc2_s.jpg" alt="Trabzonspor Antrenman" viewCount="113205" contentId="1951" rating="3695" rateCount="1139" /></li>');
    
    document.write('<li><img id="imgCnt_1950" src="http://gallery.kokteyl.com/Contents/photos/200910/17/1a4e038fe62a4a2da5ef1efbcef5b2ad_s.jpg" alt="Trabzonspor Antrenman" viewCount="3370" contentId="1950" rating="851" rateCount="328" /></li>');
    
    document.write('<li><img id="imgCnt_1949" src="http://gallery.kokteyl.com/Contents/photos/200910/17/ece120eff32c4704ab6db6ce4089f223_s.jpg" alt="Trabzonspor Antrenman" viewCount="3230" contentId="1949" rating="1107" rateCount="412" /></li>');
    
document.write('</ol></div>');
document.write('<div id="spotlight"></div>');

document.write('<div id="content-rating" style="display:none;margin:auto;">');
document.write('<div id="descriptionTxt"></div>');
document.write('<div id="dvGalleryText" style="display:none">Türkiye-Turkcell Süper Ligi</div>');

document.write('<div id="dvRating" class="rating" style="margin:auto;width:450px;background-color:#EEEEEE;">');
document.write('<table style="border-spacing: 0; border-collapse: collapse;" align=center>');
document.write('<tr><td><ul>');
document.write('<li id="current-rating" class="current-rating" style="width: 0px;"></li>');
document.write('<li><a href="#" onclick="this.blur();Gallery.rateContent(1); return false;" class="star-1">1</a></li>');
document.write('<li><a href="#" onclick="this.blur();Gallery.rateContent(2); return false;" class="star-2">2</a></li>');
document.write('<li><a href="#" onclick="this.blur();Gallery.rateContent(3); return false;" class="star-3">3</a></li>');
document.write('<li><a href="#" onclick="this.blur();Gallery.rateContent(4); return false;" class="star-4">4</a></li>');
document.write('<li><a href="#" onclick="this.blur();Gallery.rateContent(5); return false;" class="star-5">5</a></li>');
document.write('</ul></td>');
document.write('<td align="left"><span id="rating-count" class="rating-count"></span></td>');
document.write('<td><span id="view-count" class="rating-count"></span></td>');
document.write('</tr></table></div>');



document.write('<div style="clear:both"></div>');
document.write('</div>');

document.body.className = document.body.className + " yui-skin-sam";
function resizeImage(obj, width) {
    if (obj.width > width) {
        obj.width = width;
    }
    obj.style.visibility = "visible";
}
function callBack() {
    YAHOO.util.Event.onDOMReady(function(ev) {
        var spotlight = YAHOO.util.Dom.get("spotlight"),
            descriptionTxt = YAHOO.util.Dom.get("descriptionTxt");
            
        Gallery.Carousel = new YAHOO.widget.Carousel("container", { animation: { speed: 0.5}, revealAmount: 15, selectOnScroll:false, isCircular:true, numVisible: 4});
	Gallery.Carousel.STRINGS.PAGER_PREFIX_TEXT = "Sayfa";
        Gallery.Carousel.on("itemSelected", function(index) {
            // item has the reference to the Carousel's item
            var item = Gallery.Carousel.getElementForItem(index);

            if (item) {
                var imageElem = Gallery.getImageElement(item);
                var imageSrc = Gallery.getImageSrc(imageElem);
                var bigImgElem = document.createElement("img");
                spotlight.innerHTML = "<img src=\"" + imageSrc + "\" onclick=\"Gallery.Carousel.selectNextItem();\" style=\"cursor:pointer;visibility:hidden\" onload=\"resizeImage(this,450);\">";
                
                var altText = imageElem.getAttribute("alt");
                if (altText) {
                    descriptionTxt.innerHTML = "<div>" + altText + "</div>";
                } else {
                    descriptionTxt.innerHTML = document.getElementById("dvGalleryText").innerHTML;
                }
                

                var contentId = imageElem.getAttribute("contentId");

                Gallery.init(contentId);

                var contents = Gallery.getCookie("gal_content_view");
                var blExists = Gallery.checkExists(contents, contentId);
                
                
                var rating = imageElem.getAttribute("rating");
                var rateCount = imageElem.getAttribute("rateCount");
                var viewCount = imageElem.getAttribute("viewCount");

                document.getElementById("rating-count").innerHTML = rateCount == 0 ? " ilk oy veren sen ol!" : rateCount + " kişi oy vermiş.";
                document.getElementById("view-count").innerHTML = viewCount + " kişi fotoğrafı görmüş.";
                document.getElementById("current-rating").style.width = rateCount == 0 ? 0 : (parseInt(17 * rating / rateCount, 10)) + "px";
                

                if (!blExists) {
                    Gallery.viewContent(contentId);
                    contents = Gallery.addToCookie(contents, contentId);
                    Gallery.setCookie("gal_content_view", contents, null, "/", null, null);
                }
            }
        });
        Gallery.Carousel.render(); // get ready for rendering the widget
        Gallery.Carousel.show();   // display the widget

        document.getElementById("container").style.display='';
        document.getElementById("content-rating").style.display='';
    });
}

