var star = strAppPath + "images/star.gif"
var starover = strAppPath + "images/star_over.gif"

function RatingMouseOver(i)
{    
    if(i==1)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=star;
        document.getElementById('imgstar3').src=star;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;        
    }
    else if(i==2)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=star;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;
    }
    else if(i==3)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=starover;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;
    }
    else if(i==4)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=starover;
        document.getElementById('imgstar4').src=starover;
        document.getElementById('imgstar5').src=star;
    
    }
    else if(i==5)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=starover;
        document.getElementById('imgstar4').src=starover;
        document.getElementById('imgstar5').src=starover;
    }
}

function functionRatingArtImageCall(objRank)
{	

	var UserLginmsg=AjaxUtilsMethods.RatingArtImageCall(objRank,document.getElementById("hdnPID").value,functionRatingArtImageCallres).value;		
}
   
function functionRatingArtImageCallres()
{    
	alert('Thanks for rating');
}

function BindRatingMouseOut()
{    
	var j=AjaxUtilsMethods.BindArtRate(document.getElementById("hdnPID").value).value;	
	var Ary=new Array();		
	Ary = StrSplit(j,"-"); 
	
	var i=Ary[0];
	
	if(i==1)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=star;
        document.getElementById('imgstar3').src=star;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;        
    }
    else if(i==2)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=star;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;
    }
    else if(i==3)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=starover;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;
    }
    else if(i==4)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=starover;
        document.getElementById('imgstar4').src=starover;
        document.getElementById('imgstar5').src=star;
    
    }
    else if(i==5)
    {
        document.getElementById('imgstar1').src=starover;
        document.getElementById('imgstar2').src=starover;
        document.getElementById('imgstar3').src=starover;
        document.getElementById('imgstar4').src=starover;
        document.getElementById('imgstar5').src=starover;
    }
    else
    {
        document.getElementById('imgstar1').src=star;
        document.getElementById('imgstar2').src=star;
        document.getElementById('imgstar3').src=star;
        document.getElementById('imgstar4').src=star;
        document.getElementById('imgstar5').src=star;
    }
    
    document.getElementById('spanid').innerHTML= i;
    document.getElementById('spnTOtal').innerHTML= Ary[1];
    
}

var temp=BindRatingMouseOut();



var strImages1="";
var strImages2="";
var strlinkslist1="";
var strlinkslist2="";

function Thumbimagelist()
{
    var MID=document.getElementById('hdnMID').value;
    var CID=document.getElementById('hdnCID').value;
    var PID=document.getElementById("hdnPID").value;
    
    /*if(document.getElementById('SpnIncription')!=null)
    {		
        if(document.getElementById('SpnIncription').innerHTML=="")
        {
            document.getElementById('trInscription').style.display="none";
        }
		else
		{
			document.getElementById('trInscription').style.display="";
		}
    }*/

    if(document.getElementById('hdnoption1')!=null)
    {
        if(document.getElementById('hdnoption1').value=="")
        {
            document.getElementById('troption1').style.display="none";
        }
    }
    if(document.getElementById('hdnoption2')!=null)
    {
        if(document.getElementById('hdnoption2').value=="")
        {
            document.getElementById('troption2').style.display="none";
        }
    }
    if(document.getElementById('hdnoption3')!=null)
    {
        if(document.getElementById('hdnoption3').value=="")
        {
            document.getElementById('troption3').style.display="none";
        }
    }
    
    try
    {
        if(document.getElementById('hdnVideoPath')!=null)
        {
	        if(document.getElementById('hdnVideoPath').value==strAppPath + "ArtistVideoAudio/")
            {
		       document.getElementById('aVideoPath').onclick="";
		       document.getElementById('aVideoPath1').onclick="";
		    }
        }
    }
    catch(ex){}    

    try
    {
        if(document.getElementById('hdnIsCollected')!= null)
        {
            if(document.getElementById('hdnIsCollected').value=="True")
            {
                document.getElementById('trrating').style.display="none";
                document.getElementById('trratingSpace').style.display="none";
            }
        }
    }
    catch(ex){}
    
    var response = AjaxUtilsMethods.BindProductDetailsByManfIDAndCategoryID(MID,CID,PID);  
    var ds = response.value;    
    var strString="<table cellpadding='0' cellspacing='0' width='100%' border='0'>";
        
    if(ds != null && typeof(ds) == "object" && ds.Tables != null)
    {   
        if(ds.Tables[0].Rows.length>0)
        {   
            var i=0;
            document.getElementById('trProductDisplay').innerHTML="";              
             for(i=0; i<ds.Tables[0].Rows.length; i++)
            {                   
				if(ds.Tables[0].Rows[i].defaultImage !="")
				{   				    
					if(strImages1.length==0)
					{
						strImages1 += "/" + StrReplace(ds.Tables[0].Rows[i].defaultImage,"_T_","_S_");
						strlinkslist1 += "/products/" +  ds.Tables[0].Rows[i].PrdSlugName + '_' + ds.Tables[0].Rows[i].productID + ".aspx";
					}
					else
					{
						strImages1 += ",/" + StrReplace(ds.Tables[0].Rows[i].defaultImage,"_T_","_S_");
						strlinkslist1 += ",/products/" +  ds.Tables[0].Rows[i].PrdSlugName + '_' + ds.Tables[0].Rows[i].productID + ".aspx";
					}				
				}
           }
           
           strString =  strString + "<tr><td width='100%' colspan='2' valign='top'><table width='100%' cellspacing='0' cellpadding='0' border='0' align='right'>";
		   strString =  strString + "<tr style='position:relative; text-align:right' height='100px' align='right'><td width='20' align='right'><input id='scrollarrowleft' src='" + strAppPath + "images/arrow_left.gif' type='image' border='0' align='absmiddle' onmouseover=\"zxcScroller(\'h\',\'tst1\',\'start\',-1);\" onclick=\"return false;\" onmouseout=\"zxcScroller(\'h\',\'tst1\',\'stop\');\" value=\"rotate\" /></td><td width='410' style='padding-left: 1px' align='left'><div id='tst1' style=\"overflow: hidden; position: relative; width: 410px; height: 85px;\" onmouseout=\"this.hrun='start';\" onmouseover=\"this.hrun='stop';\"></div></td>";
           strString =  strString + "<td width='20' align='left'><input id='scrollarrow' src='"+ strAppPath + "images/arrow.gif' type='image' border='0' align='absmiddle' onmouseover=\"zxcScroller(\'h\',\'tst1\',\'start\',1);\" onclick=\"return false;\" onmouseout=\"zxcScroller(\'h\',\'tst1\',\'stop\');\" value=\"rotate\" /></td></tr></table></td><td width='21%'>&nbsp;</td></tr>"                      
           strString =  strString + "<tr><td colspan='2'>&nbsp;</td></tr>";
           strString=strString + "</table>"     
                     
           document.getElementById('trProductDisplay').innerHTML=strString;                 
        }
        else
        {
            document.getElementById('trProductDisplay').innerHTML="";
            document.getElementById('trProductmoreavailable').style.display="none";
        }
    }
    else
    {   
         document.getElementById('trProductDisplay').innerHTML="";
         document.getElementById('trProductmoreavailable').style.display="none";
    } 




//method added by srinivas on 29-11-2010 for displaying you may be also interested in feature
 var result = AjaxUtilsMethods.BindTagProductDetailsByPID(PID);
     //var ds = null;
     var ds = result.value;
     var strString1 = "<table cellpadding='0' cellspacing='0' width='100%' border='0'>";
   
     if (ds != null && typeof (ds) == "object" && ds.Tables != null) {
         if (ds.Tables[0].Rows.length > 0) {
             var i = 0;
           
             document.getElementById('trTagProductDisplay').innerHTML = "";
             for (i = 0; i < ds.Tables[0].Rows.length; i++) {
                 if (ds.Tables[0].Rows[i].defaultImage != "") {
                     if (strImages2.length == 0) 
                     {
                         strImages2 += "/" + StrReplace(ds.Tables[0].Rows[i].defaultImage, "_T_", "_S_");
                         strlinkslist2 += "/products/" + ds.Tables[0].Rows[i].PrdSlugName + '_' + ds.Tables[0].Rows[i].productID + ".aspx";
                     }
                     else 
                     {
                         strImages2 += ",/" + StrReplace(ds.Tables[0].Rows[i].defaultImage, "_T_", "_S_");
                         strlinkslist2 += ",/products/" + ds.Tables[0].Rows[i].PrdSlugName + '_' + ds.Tables[0].Rows[i].productID + ".aspx";
                     }
                 }
             }
             //alert(ds.Tables[0].Rows.length);
             strString1 = strString1 + "<tr><td width='100%' colspan='2' valign='top'><table width='100%' cellspacing='0' cellpadding='0' border='0' align='right'>";
             strString1 = strString1 + "<tr style='position:relative; text-align:right' height='100px' align='right'><td width='20' align='right'><input id='scrollarrowleft' src='" + strAppPath + "images/arrow_left.gif' type='image' border='0' align='absmiddle' onmouseover=\"zxcScroller(\'h\',\'tst2\',\'start\',-1);\" onclick=\"return false;\" onmouseout=\"zxcScroller(\'h\',\'tst2\',\'stop\');\" value=\"rotate\" /></td><td width='410' style='padding-left: 1px' align='left'><div id='tst2' style=\"overflow: hidden; position: relative; width: 410px; height: 85px;\" onmouseout=\"this.hrun='start';\" onmouseover=\"this.hrun='stop';\"></div></td>";
             strString1 = strString1 + "<td width='20' align='left'><input id='scrollarrow' src='"+ strAppPath + "images/arrow.gif' type='image' border='0' align='absmiddle' onmouseover=\"zxcScroller(\'h\',\'tst2\',\'start\',1);\" onclick=\"return false;\" onmouseout=\"zxcScroller(\'h\',\'tst2\',\'stop\');\" value=\"rotate\" /></td></tr></table></td><td width='21%'>&nbsp;</td></tr>"
             strString1 = strString1 + "<tr><td colspan='2'>&nbsp;</td></tr>";
             strString1 = strString1 + "</table>"
             //alert(strString1);
             document.getElementById('trTagProductDisplay').innerHTML = strString1;
         }
         else {
             document.getElementById('trTagProductDisplay').innerHTML = "";
             document.getElementById('trTagProductmoreavailable').style.display = "none";
         }
     }
     else 
     {
         document.getElementById('trTagProductDisplay').innerHTML = "";
         document.getElementById('trTagProductmoreavailable').style.display = "none";
     }
    
}

function initImageScroller()
{
    var ImgAry1=new Array();
    var ImgAry2=new Array();
    var ImgAry3 = new Array();

    Tempcall=Thumbimagelist();

    // Image 1
    if(strImages1 != "")
    {
        strImages1=StrSplit(strImages1,","); //strImages1.split(",");
        rotateimagelist1=strImages1;

        strlinkslist1 =StrSplit(strlinkslist1,","); //strlinkslist1.split(",");
        linkslist1=strlinkslist1;
    }
    
    if(strImages1 != "")
    {
        for(i=0;i<rotateimagelist1.length;i++)
        {       
	        ImgAry1[i]=[ImgPath+rotateimagelist1[i],'',linkslist1[i]];	    	    
        }
        if(rotateimagelist1.length<=5)
        {
	        document.getElementById('scrollarrow').style.display="none";
	        document.getElementById('scrollarrowleft').style.display="none";
        }

        zxcScrollContent('tst1',ImgAry1,'85*85','82*82','100*50',50);
        zxcScroller('h','tst1','stop');
    }



 // added by srinivas on 30-11-2010

 if (strImages2 != "") 
    {
        strImages2 = StrSplit(strImages2, ","); 
        rotateimagelist2 = strImages2;

        strlinkslist2 = StrSplit(strlinkslist2, ","); 
        linkslist2 = strlinkslist2;
    }
    
     if(strImages2 != "")
    {
        for (i = 0; i < rotateimagelist2.length; i++) {
            ImgAry3[i] = [ImgPath + rotateimagelist2[i], '', linkslist2[i]];
        }
        if (rotateimagelist2.length <= 5) {
            document.getElementById('scrollarrow').style.display = "none";
            document.getElementById('scrollarrowleft').style.display = "none";
        }
    
        zxcScrollContent('tst2', ImgAry3, '85*85', '82*82', '100*50', 50);
        zxcScroller('h', 'tst2', 'stop');
    }
}
addLoadEvent(initImageScroller);


