﻿//////////////////////// PRODUCTIMAGE ////////////////////////////////////////////////


function changePic(str)
{


    document.getElementById('img500').src = 'images/spinner.gif';
    document.getElementById('spnyukluyor').style.display='';
    document.getElementById('cell500').vAlign = 'middle';
    var abc = setTimeout('document.getElementById("img500").src="' + str + '"',500);
    var def = setTimeout('document.getElementById("spnyukluyor").style.display="none"',500);


}



function changePicCI(str,capt, imgind, isci)
{

    document.getElementById('ImageBCI').src = str;
    document.getElementById('img500CI').src = 'images/spinner.gif';
    document.getElementById('tdLargeImage').align = 'right';
    document.getElementById('spnyukluyorCI').style.display='';
       if (isci == "1")
       {
               document.getElementById('spCaption').innerText = capt;

    }

    document.getElementById('cell500CI').vAlign = 'middle';
    var abc = setTimeout('resmiyukle(1,"CI","' + imgind + '", "' + isci + '")',500);
}


function resmiyukle(count,tbl,imgind, isci)
{

    var c ;

    c = document.getElementById('ImageBCI');
       var b = new Image();
    b.src = c.src;



    if(navigator.appName.indexOf("Microsoft") > -1 )
    {
                if(!c.complete  || (b.width==28 && b.height==30) || (b.width==0 && b.height==0))
                {
                                       if (count >= 6)
                                       {
                                               document.getElementById('spnyukluyor').style.display='none';
                                               document.getElementById('spnyukluyorCI').style.display='none';
                                               //buraya
                                       }
                                       else
                                       {
                                               count++;
                                               setTimeout('resmiyukle(' + count.toString()  +',"' + tbl + '", "' + imgind + '", "' + isci + '")',2500);
                                               return;
                                       }
                }

                else
                {
                                       document.getElementById('cell500CI').vAlign = 'top';
                               }

    }

    else
       {
               document.getElementById('cell500CI').vAlign = 'top';
       }


       document.getElementById('img500CI').src = b.src;
       document.getElementById('spnyukluyorCI').style.display='none';


       if (isci == "1")
       {

               var strHtml ;
               strHtml = "<input class='btn' type=button value='Evet' id='spnYes' onclick=\"voteToImage('" + imgind + "','5');\"  runat='server'>&nbsp;&nbsp;<input class='btn' type=button value='Hayır' id='spnNo' onclick=\"voteToImage('" + imgind + "','1');\" runat='server'>";
               document.getElementById('tdVote').innerHTML  = strHtml;

               imgisvoted(imgind);
               getimagesurvstat(imgind);
       }

       document.getElementById('tdLargeImage').align = 'Center';
}



//Dictionary








