
    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_2130" src="http://gallery.kokteyl.com/Contents/photos/200910/19/50bfb833c6c146c88d6c563120a55e41_s.jpg" alt="Gaziantepspor Fenerbahçe" viewCount="8334" contentId="2130" rating="7" rateCount="3" /></li>');
    
    document.write('<li><img id="imgCnt_2129" src="http://gallery.kokteyl.com/Contents/photos/200910/19/a70c673936564b37839f7e5e55a97861_s.jpg" alt="Gaziantepspor Fenerbahçe" viewCount="181" contentId="2129" rating="21" rateCount="8" /></li>');
    
    document.write('<li><img id="imgCnt_2062" src="http://gallery.kokteyl.com/Contents/photos/200910/18/7f238279afbf49aabd08f30d0ad9a568_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="31793" contentId="2062" rating="581" rateCount="204" /></li>');
    
    document.write('<li><img id="imgCnt_2061" src="http://gallery.kokteyl.com/Contents/photos/200910/18/0cb80670fa4744838c9fb9150c8c1157_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="1201" contentId="2061" rating="210" rateCount="66" /></li>');
    
    document.write('<li><img id="imgCnt_2060" src="http://gallery.kokteyl.com/Contents/photos/200910/18/a7e16b5cfbc649f28b6e7df58228809b_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="1109" contentId="2060" rating="178" rateCount="38" /></li>');
    
    document.write('<li><img id="imgCnt_2059" src="http://gallery.kokteyl.com/Contents/photos/200910/18/1e42f04c60684557b1e549782c8446ed_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="1016" contentId="2059" rating="596" rateCount="125" /></li>');
    
    document.write('<li><img id="imgCnt_2058" src="http://gallery.kokteyl.com/Contents/photos/200910/18/c095d769306543949255b928090ae55c_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="690" contentId="2058" rating="98" rateCount="21" /></li>');
    
    document.write('<li><img id="imgCnt_2057" src="http://gallery.kokteyl.com/Contents/photos/200910/18/ea68c372a147451a8a08680e656ed9f4_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="699" contentId="2057" rating="36" rateCount="9" /></li>');
    
    document.write('<li><img id="imgCnt_2056" src="http://gallery.kokteyl.com/Contents/photos/200910/18/2405046259e047db9753b417b896bfe1_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="675" contentId="2056" rating="256" rateCount="52" /></li>');
    
    document.write('<li><img id="imgCnt_2055" src="http://gallery.kokteyl.com/Contents/photos/200910/18/a0eb726af7574ef49ef1e11a791ad3b5_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="629" contentId="2055" rating="176" rateCount="36" /></li>');
    
    document.write('<li><img id="imgCnt_2019" src="http://gallery.kokteyl.com/Contents/photos/200910/18/3ea13b73eddc48e9a8bd781dae184452_s.jpg" alt="Fenerbahçe" viewCount="22139" contentId="2019" rating="1996" rateCount="418" /></li>');
    
    document.write('<li><img id="imgCnt_2018" src="http://gallery.kokteyl.com/Contents/photos/200910/18/a7a0981379ee4269b8fffb080d3b1fac_s.jpg" alt="Fenerbahçe" viewCount="4106" contentId="2018" rating="548" rateCount="188" /></li>');
    
    document.write('<li><img id="imgCnt_2017" src="http://gallery.kokteyl.com/Contents/photos/200910/18/32b7a5c1b5e84d97a5829e3d3c48cf6b_s.jpg" alt="Fenerbahçe" viewCount="2247" contentId="2017" rating="581" rateCount="239" /></li>');
    
    document.write('<li><img id="imgCnt_2016" src="http://gallery.kokteyl.com/Contents/photos/200910/18/709e170d095a41b08820d63d883febbd_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="9004" contentId="2016" rating="183" rateCount="52" /></li>');
    
    document.write('<li><img id="imgCnt_2015" src="http://gallery.kokteyl.com/Contents/photos/200910/18/4174990a605c4b5fab9667d80c277ee1_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="2403" contentId="2015" rating="90" rateCount="37" /></li>');
    
    document.write('<li><img id="imgCnt_2014" src="http://gallery.kokteyl.com/Contents/photos/200910/18/b8fde9b0582f4eeaa18880bbd1a9c7e9_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="2366" contentId="2014" rating="46" rateCount="17" /></li>');
    
    document.write('<li><img id="imgCnt_2013" src="http://gallery.kokteyl.com/Contents/photos/200910/18/027dcc4703114517af1eca9fd20bf100_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="2099" contentId="2013" rating="70" rateCount="24" /></li>');
    
    document.write('<li><img id="imgCnt_2012" src="http://gallery.kokteyl.com/Contents/photos/200910/18/6b9d1a6186b64c2b94ffb0228e8ceb1d_s.jpg" alt="Gaziantepspor - Fenerbahçe" viewCount="1927" contentId="2012" rating="97" rateCount="36" /></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='';
    });
}

