
    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_5961" src="http://gallery.kokteyl.com/Contents/photos/201002/06/4b38d5b8092f4508aacadce4503463cd_s.jpg" alt="Kayserispor - Galatasaray " viewCount="20073" contentId="5961" rating="627" rateCount="169" /></li>');
    
    document.write('<li><img id="imgCnt_5960" src="http://gallery.kokteyl.com/Contents/photos/201002/06/1f6ef88ea7814c0cad1c2689b67911f4_s.jpg" alt="Kayserispor - Galatasaray " viewCount="874" contentId="5960" rating="92" rateCount="23" /></li>');
    
    document.write('<li><img id="imgCnt_5959" src="http://gallery.kokteyl.com/Contents/photos/201002/06/f2271f2a725f4bd28a23cf63440445f9_s.jpg" alt="Kayserispor - Galatasaray " viewCount="864" contentId="5959" rating="138" rateCount="32" /></li>');
    
    document.write('<li><img id="imgCnt_5958" src="http://gallery.kokteyl.com/Contents/photos/201002/06/7c6c666fe5124068b8030c8004aac123_s.jpg" alt="Kayserispor - Galatasaray " viewCount="861" contentId="5958" rating="335" rateCount="257" /></li>');
    
    document.write('<li><img id="imgCnt_5957" src="http://gallery.kokteyl.com/Contents/photos/201002/06/a32b8c6df46543e59b605b1ae8a0f31f_s.jpg" alt="Kayserispor - Galatasaray " viewCount="627" contentId="5957" rating="260" rateCount="128" /></li>');
    
    document.write('<li><img id="imgCnt_5956" src="http://gallery.kokteyl.com/Contents/photos/201002/06/aa25af2fc6c8456f850cdd75f1d5b6fe_s.jpg" alt="Kayserispor - Galatasaray " viewCount="704" contentId="5956" rating="396" rateCount="120" /></li>');
    
    document.write('<li><img id="imgCnt_5955" src="http://gallery.kokteyl.com/Contents/photos/201002/06/ce706d6b1f274cf49ce38424d034a121_s.jpg" alt="Kayserispor - Galatasaray " viewCount="697" contentId="5955" rating="50" rateCount="38" /></li>');
    
    document.write('<li><img id="imgCnt_5954" src="http://gallery.kokteyl.com/Contents/photos/201002/06/b58b49499ba245f4841ce2fe5e614589_s.jpg" alt="Kayserispor - Galatasaray " viewCount="835" contentId="5954" rating="355" rateCount="73" /></li>');
    
    document.write('<li><img id="imgCnt_5953" src="http://gallery.kokteyl.com/Contents/photos/201002/06/a087090049594262822a88751c0efa4e_s.jpg" alt="Kayserispor - Galatasaray " viewCount="613" contentId="5953" rating="85" rateCount="18" /></li>');
    
    document.write('<li><img id="imgCnt_5952" src="http://gallery.kokteyl.com/Contents/photos/201002/06/620c494ca68046ef940e91fe436fe01e_s.jpg" alt="Kayserispor - Galatasaray " viewCount="581" contentId="5952" rating="234" rateCount="52" /></li>');
    
    document.write('<li><img id="imgCnt_5951" src="http://gallery.kokteyl.com/Contents/photos/201002/06/d3e8a2ddbe7c4931898e193ef7284d09_s.jpg" alt="Kayserispor - Galatasaray " viewCount="616" contentId="5951" rating="9" rateCount="2" /></li>');
    
    document.write('<li><img id="imgCnt_5950" src="http://gallery.kokteyl.com/Contents/photos/201002/06/925c79e6d76f4b418dd3c2c4da47ed65_s.jpg" alt="Kayserispor - Galatasaray " viewCount="621" contentId="5950" rating="279" rateCount="56" /></li>');
    
    document.write('<li><img id="imgCnt_5949" src="http://gallery.kokteyl.com/Contents/photos/201002/06/b164f64fc1c3407a9b6dba88a7b494f3_s.jpg" alt="Kayserispor - Galatasaray " viewCount="5717" contentId="5949" rating="497" rateCount="103" /></li>');
    
    document.write('<li><img id="imgCnt_5948" src="http://gallery.kokteyl.com/Contents/photos/201002/06/33da196799224ce78430dab3d17d7bc5_s.jpg" alt="Arda Turan" viewCount="815" contentId="5948" rating="35" rateCount="7" /></li>');
    
    document.write('<li><img id="imgCnt_5947" src="http://gallery.kokteyl.com/Contents/photos/201002/06/2cae9d6f5c9f46f8aa48436695a30f19_s.jpg" alt="Kayserispor - Galatasaray " viewCount="820" contentId="5947" rating="7" rateCount="3" /></li>');
    
    document.write('<li><img id="imgCnt_5946" src="http://gallery.kokteyl.com/Contents/photos/201002/06/e4c8c1421e524404aad230074a7349bb_s.jpg" alt="Kayserispor - Galatasaray " viewCount="817" contentId="5946" rating="84" rateCount="24" /></li>');
    
    document.write('<li><img id="imgCnt_5945" src="http://gallery.kokteyl.com/Contents/photos/201002/06/8bfb37a4acfd4b5993c4d32bac38f9a4_s.jpg" alt="Kayserispor - Galatasaray " viewCount="593" contentId="5945" rating="8" rateCount="2" /></li>');
    
    document.write('<li><img id="imgCnt_5943" src="http://gallery.kokteyl.com/Contents/photos/201002/06/29b4ec8861684922bacf0af575bbdd7d_s.jpg" alt="Kayserispor - Galatasaray " viewCount="651" contentId="5943" rating="106" rateCount="22" /></li>');
    
    document.write('<li><img id="imgCnt_5942" src="http://gallery.kokteyl.com/Contents/photos/201002/06/c43276ed3497439aa10c585426bb8ee6_s.jpg" alt="Kayserispor - Galatasaray " viewCount="648" contentId="5942" rating="81" rateCount="17" /></li>');
    
    document.write('<li><img id="imgCnt_5941" src="http://gallery.kokteyl.com/Contents/photos/201002/06/66613f6d6de540a685d98ff95b9ff540_s.jpg" alt="Kayserispor - Galatasaray " viewCount="642" contentId="5941" rating="13" rateCount="5" /></li>');
    
    document.write('<li><img id="imgCnt_5940" src="http://gallery.kokteyl.com/Contents/photos/201002/06/97d784b383f54f6d94a10c4840435d26_s.jpg" alt="Kayserispor - Galatasaray " viewCount="19921" contentId="5940" rating="79" rateCount="20" /></li>');
    
    document.write('<li><img id="imgCnt_5939" src="http://gallery.kokteyl.com/Contents/photos/201002/06/a326bbf8920d497db0155e4e5f61a76b_s.jpg" alt="Kayserispor - Galatasaray " viewCount="1358" contentId="5939" rating="63" rateCount="18" /></li>');
    
    document.write('<li><img id="imgCnt_5938" src="http://gallery.kokteyl.com/Contents/photos/201002/06/3a1a18b2e1f54796b39ec60a0951ddd6_s.jpg" alt="Kayserispor - Galatasaray " viewCount="1462" contentId="5938" rating="43" rateCount="11" /></li>');
    
    document.write('<li><img id="imgCnt_5937" src="http://gallery.kokteyl.com/Contents/photos/201002/06/027204cc2a5d40f7a45197fabe393f5a_s.jpg" alt="Kayserispor - Galatasaray " viewCount="2349" contentId="5937" rating="81" rateCount="17" /></li>');
    
    document.write('<li><img id="imgCnt_5936" src="http://gallery.kokteyl.com/Contents/photos/201002/06/eabef740f62e41439733dfcc8d10ca12_s.jpg" alt="Kayserispor - Galatasaray " viewCount="2174" contentId="5936" rating="256" rateCount="55" /></li>');
    
    document.write('<li><img id="imgCnt_5935" src="http://gallery.kokteyl.com/Contents/photos/201002/06/1fb4fe70feaa4691b49158a3253efa37_s.jpg" alt="Kayserispor - Galatasaray " viewCount="1473" contentId="5935" rating="256" rateCount="55" /></li>');
    
    document.write('<li><img id="imgCnt_5934" src="http://gallery.kokteyl.com/Contents/photos/201002/06/1f06d7ba069643e3b5aa07406a763d15_s.jpg" alt="Kayserispor - Galatasaray " viewCount="1464" contentId="5934" rating="504" rateCount="107" /></li>');
    
    document.write('<li><img id="imgCnt_5917" src="http://gallery.kokteyl.com/Contents/photos/201002/06/10873056f51442b0a1b7b12aa3c3669c_s.jpg" alt="Galatasaray " viewCount="39179" contentId="5917" rating="1206" rateCount="280" /></li>');
    
    document.write('<li><img id="imgCnt_5916" src="http://gallery.kokteyl.com/Contents/photos/201002/06/9345ee2189784240a12e5939a3d25b9c_s.jpg" alt="Kayserispor Antrenman" viewCount="3870" contentId="5916" rating="2412" rateCount="555" /></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='';
    });
}

