
    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_1832" src="http://gallery.kokteyl.com/Contents/photos/200910/04/ea8d249426214f34b2daf770811e6ce0_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="18275" contentId="1832" rating="2010" rateCount="411" /></li>');
    
    document.write('<li><img id="imgCnt_1831" src="http://gallery.kokteyl.com/Contents/photos/200910/04/e57f87e5802b4f94aaf6537295644ddc_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1214" contentId="1831" rating="590" rateCount="120" /></li>');
    
    document.write('<li><img id="imgCnt_1830" src="http://gallery.kokteyl.com/Contents/photos/200910/04/28bf8485b90d417c9e681c8096995eb7_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1163" contentId="1830" rating="568" rateCount="116" /></li>');
    
    document.write('<li><img id="imgCnt_1829" src="http://gallery.kokteyl.com/Contents/photos/200910/04/a024f4a421bf4767a1d99510a8ab24d5_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1109" contentId="1829" rating="512" rateCount="104" /></li>');
    
    document.write('<li><img id="imgCnt_1828" src="http://gallery.kokteyl.com/Contents/photos/200910/04/44054cc0d6a64ae3abc9a8bbc32abc40_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="789" contentId="1828" rating="559" rateCount="114" /></li>');
    
    document.write('<li><img id="imgCnt_1827" src="http://gallery.kokteyl.com/Contents/photos/200910/04/5ae11e6d33b24d488602fbeb0891804f_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="753" contentId="1827" rating="141" rateCount="36" /></li>');
    
    document.write('<li><img id="imgCnt_1826" src="http://gallery.kokteyl.com/Contents/photos/200910/04/9c703585de0f4adba9c9a2ec524ae919_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="774" contentId="1826" rating="609" rateCount="124" /></li>');
    
    document.write('<li><img id="imgCnt_1825" src="http://gallery.kokteyl.com/Contents/photos/200910/04/702e468f8e0f423c9af6b181ae7978fa_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="772" contentId="1825" rating="672" rateCount="137" /></li>');
    
    document.write('<li><img id="imgCnt_1824" src="http://gallery.kokteyl.com/Contents/photos/200910/04/518e629f5b524f1ea8cd0d8f99f86476_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1439" contentId="1824" rating="1530" rateCount="311" /></li>');
    
    document.write('<li><img id="imgCnt_1823" src="http://gallery.kokteyl.com/Contents/photos/200910/04/237374bd41584934842296790ae2ae88_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="705" contentId="1823" rating="936" rateCount="191" /></li>');
    
    document.write('<li><img id="imgCnt_1822" src="http://gallery.kokteyl.com/Contents/photos/200910/04/700e28a8ee8f46948509dcd3ab917aee_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="732" contentId="1822" rating="1026" rateCount="211" /></li>');
    
    document.write('<li><img id="imgCnt_1821" src="http://gallery.kokteyl.com/Contents/photos/200910/04/6e5674486d344545957bd1baeccffe2d_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="692" contentId="1821" rating="497" rateCount="103" /></li>');
    
    document.write('<li><img id="imgCnt_1820" src="http://gallery.kokteyl.com/Contents/photos/200910/04/8e18ab9035414cf3abe61a14ffa07421_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="499" contentId="1820" rating="436" rateCount="89" /></li>');
    
    document.write('<li><img id="imgCnt_1819" src="http://gallery.kokteyl.com/Contents/photos/200910/04/2afaa82bf0394bd4b9b5f512d683aee8_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="492" contentId="1819" rating="515" rateCount="108" /></li>');
    
    document.write('<li><img id="imgCnt_1818" src="http://gallery.kokteyl.com/Contents/photos/200910/04/96ca9f71632341009452d7745af7c122_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="12175" contentId="1818" rating="9123" rateCount="1910" /></li>');
    
    document.write('<li><img id="imgCnt_1817" src="http://gallery.kokteyl.com/Contents/photos/200910/04/c906b8c4c9a54f4ba560a5e63ac36a70_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1224" contentId="1817" rating="599" rateCount="125" /></li>');
    
    document.write('<li><img id="imgCnt_1816" src="http://gallery.kokteyl.com/Contents/photos/200910/04/c262c257317c4daaa6cdc05c6d064eb6_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1129" contentId="1816" rating="489" rateCount="104" /></li>');
    
    document.write('<li><img id="imgCnt_1815" src="http://gallery.kokteyl.com/Contents/photos/200910/04/8342aa5d0055466183b2ab4d3daa8387_s.jpg" alt="Fenerbahçe Alex" viewCount="1116" contentId="1815" rating="1029" rateCount="211" /></li>');
    
    document.write('<li><img id="imgCnt_1814" src="http://gallery.kokteyl.com/Contents/photos/200910/04/d6747fb95ea9492e8a69094ab95a8014_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1082" contentId="1814" rating="333" rateCount="74" /></li>');
    
    document.write('<li><img id="imgCnt_1813" src="http://gallery.kokteyl.com/Contents/photos/200910/04/bf9a86cc99894d69b5696c6fb5d37e3c_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1082" contentId="1813" rating="302" rateCount="69" /></li>');
    
    document.write('<li><img id="imgCnt_1812" src="http://gallery.kokteyl.com/Contents/photos/200910/04/b3769b8b237e4bec80d5b6923b2f9866_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1064" contentId="1812" rating="1641" rateCount="335" /></li>');
    
    document.write('<li><img id="imgCnt_1811" src="http://gallery.kokteyl.com/Contents/photos/200910/04/62ece0d8f68b4cf9b8bfc379cea07193_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="1082" contentId="1811" rating="287" rateCount="63" /></li>');
    
    document.write('<li><img id="imgCnt_1810" src="http://gallery.kokteyl.com/Contents/photos/200910/04/d307f5aead744378a931561890517daa_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="885" contentId="1810" rating="48" rateCount="27" /></li>');
    
    document.write('<li><img id="imgCnt_1809" src="http://gallery.kokteyl.com/Contents/photos/200910/04/7da0ed013ac44753a04035fac181940a_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="33704" contentId="1809" rating="1654" rateCount="384" /></li>');
    
    document.write('<li><img id="imgCnt_1808" src="http://gallery.kokteyl.com/Contents/photos/200910/04/1c605fec56eb470f8598c31b522740b2_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="3360" contentId="1808" rating="612" rateCount="145" /></li>');
    
    document.write('<li><img id="imgCnt_1807" src="http://gallery.kokteyl.com/Contents/photos/200910/04/75091616a3f6476c8cda51685b258236_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="3368" contentId="1807" rating="572" rateCount="134" /></li>');
    
    document.write('<li><img id="imgCnt_1806" src="http://gallery.kokteyl.com/Contents/photos/200910/04/86ce6319fe40432db5aa490e9de714d6_s.jpg" alt="Fenerbahçe - Gençlerbirliği" viewCount="3205" contentId="1806" rating="760" rateCount="182" /></li>');
    
    document.write('<li><img id="imgCnt_1711" src="http://gallery.kokteyl.com/Contents/photos/200910/03/58426ebc77a449a28ca6d9e22dd8db92_s.jpg" alt="Fenerbahçe Antrenman" viewCount="54837" contentId="1711" rating="11842" rateCount="2540" /></li>');
    
    document.write('<li><img id="imgCnt_1710" src="http://gallery.kokteyl.com/Contents/photos/200910/03/8acecc021da34ff0af3a33539dae0251_s.jpg" alt="Fenerbahçe Antrenman" viewCount="6062" contentId="1710" rating="1312" rateCount="332" /></li>');
    
    document.write('<li><img id="imgCnt_1709" src="http://gallery.kokteyl.com/Contents/photos/200910/03/d015fec3ee0441d89f8fc22edb6b8e7f_s.jpg" alt="Fenerbahçe Antrenman " viewCount="5986" contentId="1709" rating="2437" rateCount="824" /></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='';
    });
}

