﻿//IMAGE PAGINATON FUNCTION
 
 function rotatingImage(incurrentIndex,clickType)
 {     
   var currentIndex=parseInt(incurrentIndex);      
   var imgSrc_list=document.getElementById("hdnimgSrc_list").value;
   var imgSrc_list_300=document.getElementById("hdnimgSrc_list_300").value;
   var arr_imgSrc_list=new Array();
   var arr_imgSrc_list_300=new Array();
   arr_imgSrc_list=imgSrc_list.split("$");
   arr_imgSrc_list_300=imgSrc_list_300.split("$");
   var imgArr_Length=arr_imgSrc_list.length;      
   if(imgArr_Length>1)
   {              
    if(currentIndex==1)
    {        
     var PcurrentIndex=currentIndex-1;
     currentIndex=currentIndex+1;
     document.getElementById("dv_productImage_Pagination").innerHTML="<a href=# onclick=rotatingImage('"+currentIndex+"','N')>Next Picture ></a>";        
     //document.getElementById("dv_productImage").innerHTML="<img src=\""+arr_imgSrc_list[PcurrentIndex]+"\" />";
     document.getElementById("dv_productImage").innerHTML="<img src='http://www.spiritvoyage.com/" + arr_imgSrc_list[PcurrentIndex] + "'  border=0  onMouseover = \"showhint('<img src=http://www.spiritvoyage.com/" + arr_imgSrc_list_300[PcurrentIndex] + "  >', this, event, '300px')\" >";
    }
    else if(currentIndex==imgArr_Length)
    {        
     var NcurrentIndex=currentIndex-1;
     currentIndex=currentIndex-1;
     document.getElementById("dv_productImage_Pagination").innerHTML="<a href=# onclick=rotatingImage('"+currentIndex+"','P')>< Previous</a>";        
     //document.getElementById("dv_productImage").innerHTML="<img src=\""+arr_imgSrc_list[NcurrentIndex]+"\" />";        
     document.getElementById("dv_productImage").innerHTML="<img src='http://www.spiritvoyage.com/" + arr_imgSrc_list[NcurrentIndex] + "'  border=0  onMouseover = \"showhint('<img src=http://www.spiritvoyage.com/" + arr_imgSrc_list_300[NcurrentIndex] + "  >', this, event, '300px')\" >";        
    }
    else if((currentIndex>1) && (currentIndex<imgArr_Length))
    {       
     var NcurrentIndex=currentIndex-1;
     var NcurrentIndex_val=currentIndex+1;       
     var PcurrentIndex=currentIndex-1;
     var PcurrentIndex_val=currentIndex-1;            
     document.getElementById("dv_productImage_Pagination").innerHTML="<a href=# onclick=rotatingImage('"+PcurrentIndex_val+"','P')>< Previous</a> | <a href=# onclick=rotatingImage('"+NcurrentIndex_val+"','N')>Next ></a>";                
     if(clickType=="N")
     {          
       //document.getElementById("dv_productImage").innerHTML="<img src=\""+arr_imgSrc_list[NcurrentIndex]+"\" />";         
       document.getElementById("dv_productImage").innerHTML="<img src='http://www.spiritvoyage.com/" + arr_imgSrc_list[NcurrentIndex] + "'  border=0  onMouseover = \"showhint('<img src=http://www.spiritvoyage.com/" + arr_imgSrc_list_300[NcurrentIndex] + "  >', this, event, '300px')\" >";        
     }
     else if(clickType=="P")
     {          
       //document.getElementById("dv_productImage").innerHTML="<img src=\""+arr_imgSrc_list[PcurrentIndex]+"\" />";
       document.getElementById("dv_productImage").innerHTML="<img src='http://www.spiritvoyage.com/" + arr_imgSrc_list[PcurrentIndex] + "'  border=0  onMouseover = \"showhint('<img src=http://www.spiritvoyage.com/" + arr_imgSrc_list_300[PcurrentIndex] + "  >', this, event, '300px')\" >";        
     }
   }
   //imgchk();
 } 
      
} 
 
 //SIZE DROP DOWN SELECTION STARTS FROM HERE-------
 
 function changerecommendContent_forSize(val,alsoBought_div,description_div)
 {   
    
    if(val!="")
    {
        var MasterId=document.getElementById("hdnMasterId").value;
        var ColorId=document.getElementById("ddlColor").value;
        if(ColorId!="")
        {
            if(MasterId!="")
            {
                var xmlHttpReq_recommend = false;
                var self_recommend = this;
                if (window.XMLHttpRequest) 
                {
                    self_recommend.xmlHttpReq_recommend = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) 
                {
                    self_recommend.xmlHttpReq_recommend = new ActiveXObject("Microsoft.XMLHTTP");
                }
                self_recommend.xmlHttpReq_recommend.open('POST', "http://www.spiritvoyage.com/ajaxClothingItem.aspx", true);
                self_recommend.xmlHttpReq_recommend.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                self_recommend.xmlHttpReq_recommend.onreadystatechange = function() 
                {
                    if (self_recommend.xmlHttpReq_recommend.readyState < 4) 
                    {      
                        setWaitContent_recommend(alsoBought_div,description_div)                       
                    }
                    if (self_recommend.xmlHttpReq_recommend.readyState == 4) 
                    {      
                        alert(self_recommend.xmlHttpReq_recommend.responseText);
                        var arrResponse=new Array();
                        if(self_recommend.xmlHttpReq_recommend.responseText.indexOf('|' != -1))
                        {
                          arrResponse=self_recommend.xmlHttpReq_recommend.responseText.split("|");
                        }        
                        var chekDataAvailability=arrResponse[1];
                        var chekStockAvailability=arrResponse[2];                      
                        if(chekDataAvailability=="1")
                        {                          
                          var checkCartButton=arrResponse[3];
                        //var insertNewImageSRC=arrResponse[4]; 
                        //var insertNewPaginationSRC=arrResponse[5];
                        //var totalImageSRCList=arrResponse[6];
                        //var totalImageSRCList_300= arrResponse[7];                        
                        //document.getElementById("dv_productImage").innerHTML=insertNewImageSRC;                            
                        //document.getElementById("dv_productImage_Pagination").innerHTML=insertNewPaginationSRC;                          
                        //document.getElementById("hdnimgSrc_list").value=totalImageSRCList;
                        //document.getElementById("hdnimgSrc_list_300").value=totalImageSRCList_300;
                          if(chekStockAvailability="1")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="In Stock";
                          }
                          else if(chekStockAvailability="0")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
                          }
                          //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------
                          
                          
                          document.getElementById("dv_cartButton").style.display="block";
                          document.getElementById("dv_cartButton").innerHTML=checkCartButton;
                          setContent_recommend(arrResponse[0],alsoBought_div)
			              changealsoBoughtContent_forSize(val,alsoBought_div,description_div);
			            }
			            else if(chekDataAvailability=="0")
			            {			              
			              document.getElementById("dv_recommend_Wait").innerHTML="";
			              document.getElementById("dv_alsobought_Wait").innerHTML="";
						  document.getElementById("dv_description_Wait").innerHTML="";
			              document.getElementById("dv_recommend").style.display="block"; 
	                      document.getElementById("dv_alsobought").style.display="block";
						  document.getElementById("dv_description").style.display="block";
						  document.getElementById("dv_cartButton").style.display="none";
						  document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
						   //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------						  
			            }
                    }
                }
                self_recommend.xmlHttpReq_recommend.send("color="+ColorId+"&size="+val+"&Iid="+MasterId+"&mode=1&randN="+Math.random()); 
            } 
        }       
    } 
    
     
 }
 
 function setContent_recommend(content,dvName)
 {    
    document.getElementById("dv_recommend_Wait").innerHTML="";
    document.getElementById("dv_recommend").style.display="block";    
    var contentHolder=document.getElementById("dv_recommend");    
    contentHolder.innerHTML=content;
     
 }
 function setWaitContent_recommend(dvName,description_div)
 {
    var contentHolder=document.getElementById("dv_recommend_Wait");   
	var contentHolder2=document.getElementById("dv_alsobought_Wait");
	var contentHolder3=document.getElementById("dv_description_Wait");
	document.getElementById("dv_recommend").style.display="none"; 
	document.getElementById("dv_alsobought").style.display="none"; 
	document.getElementById("dv_description").style.display="none";
    contentHolder.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
	contentHolder2.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";
	contentHolder3.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";
	 
 } 
 
 function changealsoBoughtContent_forSize(val,alsoBought_div,description_div)
 {   
  
    if(val!="")
    {
        var MasterId=document.getElementById("hdnMasterId").value;
        var ColorId=document.getElementById("ddlColor").value;
        if(ColorId!="")
        {
            if(MasterId!="")
            {
                var xmlHttpReq_alsoBought = false;
                var self_alsoBought = this;
                if (window.XMLHttpRequest) 
                {
                    self_alsoBought.xmlHttpReq_alsoBought = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) 
                {
                    self_alsoBought.xmlHttpReq_alsoBought = new ActiveXObject("Microsoft.XMLHTTP");
                }
                self_alsoBought.xmlHttpReq_alsoBought.open('POST', "http://www.spiritvoyage.com/ajaxClothingItem.aspx", true);
                self_alsoBought.xmlHttpReq_alsoBought.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                self_alsoBought.xmlHttpReq_alsoBought.onreadystatechange = function() 
                {
                    if (self_alsoBought.xmlHttpReq_alsoBought.readyState < 4) 
                    {      
                        setWaitContent_alsoBought(alsoBought_div,description_div)                       
                    }
                    if (self_alsoBought.xmlHttpReq_alsoBought.readyState == 4) 
                    {      
                        var arrResponse=new Array();
                        if(self_alsoBought.xmlHttpReq_alsoBought.responseText.indexOf('|' != -1))
                        {
                          arrResponse=self_alsoBought.xmlHttpReq_alsoBought.responseText.split("|");
                        }        
                        var chekDataAvailability=arrResponse[1];                        
                        var chekStockAvailability=arrResponse[2];//------  1                                                
                        if(chekDataAvailability=="1")
                        {                          
                          //---------  2  Start
                          var checkCartButton=arrResponse[3];
                          if(chekStockAvailability=="1")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="In Stock";
                          }
                          else if(chekStockAvailability=="0")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
                          }
                          
                           //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------
                          
                          document.getElementById("dv_cartButton").style.display="block";
                          document.getElementById("dv_cartButton").innerHTML=checkCartButton;                          
                          //----------  2  End                          
                          setContent_alsoBought(arrResponse[0],alsoBought_div)
			              changeLongDescContent_forSize(MasterId,val,ColorId,description_div);
			            }
			            else if(chekDataAvailability=="0")
			            {
			              document.getElementById("dv_alsobought_Wait").innerHTML="";
			              document.getElementById("dv_description_Wait").innerHTML="";
			              document.getElementById("dv_alsobought").style.display="block"; 
	                      document.getElementById("dv_description").style.display="block";	                      
	                      //-----------  3  Start
                          document.getElementById("dv_cartButton").style.display="none";
                          document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
                          //-----------  3  Start
                          
                           //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------	                      
			            }
                    }
                }
                self_alsoBought.xmlHttpReq_alsoBought.send("color="+ColorId+"&size="+val+"&Iid="+MasterId+"&mode=2&randN="+Math.random()); 
            } 
        }       
    }
    
      
 }
 
 function setContent_alsoBought(content,dvName)
 {    
    document.getElementById("dv_alsobought_Wait").innerHTML="";
    document.getElementById("dv_alsobought").style.display="block";    
    var contentHolder=document.getElementById(dvName);    
    contentHolder.innerHTML=content;
     
 }
 function setWaitContent_alsoBought(dvName,description_div)
 {
    var contentHolder=document.getElementById("dv_alsobought_Wait");   
	var contentHolder2=document.getElementById("dv_description_Wait");
	document.getElementById("dv_alsobought").style.display="none"; 
	document.getElementById("dv_description").style.display="none"; 
    contentHolder.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
	contentHolder2.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";
	 	
 }
 
 function changeLongDescContent_forSize(MasterId,val,ColorId,description_div)
 {   
    var xmlHttpReq_itemDesc = false;
    var self_itemDesc = this;
    if (window.XMLHttpRequest) 
    {
        self_itemDesc.xmlHttpReq_itemDesc = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) 
    {
        self_itemDesc.xmlHttpReq_itemDesc = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self_itemDesc.xmlHttpReq_itemDesc.open('POST', "http://www.spiritvoyage.com/ajaxClothingItem.aspx", true);
    self_itemDesc.xmlHttpReq_itemDesc.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self_itemDesc.xmlHttpReq_itemDesc.onreadystatechange = function() 
    {
        if (self_itemDesc.xmlHttpReq_itemDesc.readyState < 4) 
        {      
            setWaitContent_itemDesc(description_div)                       
        }
        if (self_itemDesc.xmlHttpReq_itemDesc.readyState == 4) 
        {      
            setContent_itemDesc(self_itemDesc.xmlHttpReq_itemDesc.responseText,description_div)            
            imgchk();                       
        }
    }
    self_itemDesc.xmlHttpReq_itemDesc.send("color="+ColorId+"&size="+val+"&Iid="+MasterId+"&mode=3&randN="+Math.random());
    
     
 }
 
 function setContent_itemDesc(content,dvName)
 {   
    document.getElementById("dv_description_Wait").innerHTML="";    
    document.getElementById("dv_description").style.display="block";     
    var contentHolder=document.getElementById(dvName);        
    contentHolder.innerHTML=content;	
     
 }
 function setWaitContent_itemDesc(dvName)
 {
    var contentHolder=document.getElementById("dv_description_Wait"); 
    document.getElementById("dv_description").style.display="none";    
    contentHolder.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
     
 }
 
 
 //COLOR DROP DOWN SELECTION STARTS FROM HERE------
 
 function changerecommendContent_forColor(val,alsoBought_div,description_div)
 {   
    if(val!="")
    {
        var MasterId=document.getElementById("hdnMasterId").value;
        var SizeId=document.getElementById("ddlSize").value;
        if(SizeId!="")
        {
            if(MasterId!="")
            {
                var xmlHttpReq_recommend = false;
                var self_recommend = this;
                if (window.XMLHttpRequest) 
                {
                    self_recommend.xmlHttpReq_recommend = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) 
                {
                    self_recommend.xmlHttpReq_recommend = new ActiveXObject("Microsoft.XMLHTTP");
                }
                self_recommend.xmlHttpReq_recommend.open('POST', "http://www.spiritvoyage.com/ajaxClothingItem.aspx", true);
                self_recommend.xmlHttpReq_recommend.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                self_recommend.xmlHttpReq_recommend.onreadystatechange = function() 
                {
                    if (self_recommend.xmlHttpReq_recommend.readyState < 4) 
                    {      
                        setWaitContent_recommend_forColor(alsoBought_div,description_div)                       
                    }
                    if (self_recommend.xmlHttpReq_recommend.readyState == 4) 
                    {      
                        var arrResponse=new Array();
                        if(self_recommend.xmlHttpReq_recommend.responseText.indexOf('|' != -1))
                        {
                          arrResponse=self_recommend.xmlHttpReq_recommend.responseText.split("|");
                        }        
                        var chekDataAvailability=arrResponse[1];
                        var chekStockAvailability=arrResponse[2];                         
                        if(chekDataAvailability=="1")
                        {
                          var checkCartButton=arrResponse[3];
//var insertNewImageSRC=arrResponse[4];
//var insertNewPaginationSRC=arrResponse[5];
//var totalImageSRCList=arrResponse[6]; 
//var totalImageSRCList_300=arrResponse[7];
//document.getElementById("dv_productImage").innerHTML=insertNewImageSRC;
//document.getElementById("dv_productImage_Pagination").innerHTML=insertNewPaginationSRC;                          
//document.getElementById("hdnimgSrc_list").value=totalImageSRCList; 
//document.getElementById("hdnimgSrc_list_300").value=totalImageSRCList_300;                           
                          if(chekStockAvailability="1")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="In Stock";
                          }
                          else if(chekStockAvailability="0")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
                          }
                          
                           //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------
                          
                          document.getElementById("dv_cartButton").style.display="block";
                          document.getElementById("dv_cartButton").innerHTML=checkCartButton;
                          setContent_recommend_forColor(arrResponse[0],alsoBought_div)
			              changealsoBoughtContent_forColor(val,alsoBought_div,description_div);
			            }           
			            else if(chekDataAvailability=="0")
			            {
						  document.getElementById("dv_recommend_Wait").innerHTML="";
			              document.getElementById("dv_alsobought_Wait").innerHTML="";
						  document.getElementById("dv_description_Wait").innerHTML="";
			              document.getElementById("dv_recommend").style.display="block"; 
	                      document.getElementById("dv_alsobought").style.display="block";
						  document.getElementById("dv_description").style.display="block";
						  document.getElementById("dv_cartButton").style.display="none";
						  document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";	
						  
						   //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------					  
			            }     		            
                    }
                }
                self_recommend.xmlHttpReq_recommend.send("color="+val+"&size="+SizeId+"&Iid="+MasterId+"&mode=1&randN="+Math.random()); 
            } 
        }       
    } 
     
 }
 
 function setContent_recommend_forColor(content,dvName)
 {
	document.getElementById("dv_recommend_Wait").innerHTML="";
    document.getElementById("dv_recommend").style.display="block";    
    var contentHolder=document.getElementById("dv_recommend");    
    contentHolder.innerHTML=content;
     
 }
 function setWaitContent_recommend_forColor(dvName,description_div)
 {	
	var contentHolder=document.getElementById("dv_recommend_Wait");   
	var contentHolder2=document.getElementById("dv_alsobought_Wait");
	var contentHolder3=document.getElementById("dv_description_Wait");
	document.getElementById("dv_recommend").style.display="none"; 
	document.getElementById("dv_alsobought").style.display="none"; 
	document.getElementById("dv_description").style.display="none";
    contentHolder.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
	contentHolder2.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";
	contentHolder3.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
	
	 
 } 
 
 function changealsoBoughtContent_forColor(val,alsoBought_div,description_div)
 {   
    if(val!="")
    {
        var MasterId=document.getElementById("hdnMasterId").value;
        var SizeId=document.getElementById("ddlSize").value;
        if(SizeId!="")
        {
            if(MasterId!="")
            {
                var xmlHttpReq_alsoBought = false;
                var self_alsoBought = this;
                if (window.XMLHttpRequest) 
                {
                    self_alsoBought.xmlHttpReq_alsoBought = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) 
                {
                    self_alsoBought.xmlHttpReq_alsoBought = new ActiveXObject("Microsoft.XMLHTTP");
                }
                self_alsoBought.xmlHttpReq_alsoBought.open('POST', "http://www.spiritvoyage.com/ajaxClothingItem.aspx", true);
                self_alsoBought.xmlHttpReq_alsoBought.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                self_alsoBought.xmlHttpReq_alsoBought.onreadystatechange = function() 
                {
                    if (self_alsoBought.xmlHttpReq_alsoBought.readyState < 4) 
                    {      
                        setWaitContent_alsoBought_forColor(alsoBought_div,description_div)                       
                    }
                    if (self_alsoBought.xmlHttpReq_alsoBought.readyState == 4) 
                    {      
                        var arrResponse=new Array();
                        if(self_alsoBought.xmlHttpReq_alsoBought.responseText.indexOf('|' != -1))
                        {
                          arrResponse=self_alsoBought.xmlHttpReq_alsoBought.responseText.split("|");
                        }        
                        var chekDataAvailability=arrResponse[1];
                        var chekStockAvailability=arrResponse[2];//------  1                        
                        if(chekDataAvailability=="1")
                        {
                          //---------  2  Start
                          var checkCartButton=arrResponse[3];
                          if(chekStockAvailability=="1")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="In Stock";
                          }
                          else if(chekStockAvailability=="0")
                          {
                            document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
                          }
                          
                           //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------
                          
                          document.getElementById("dv_cartButton").style.display="block";
                          document.getElementById("dv_cartButton").innerHTML=checkCartButton;                          
                          //----------  2  End
                          setContent_alsoBought_forColor(arrResponse[0],alsoBought_div)
			              changeLongDescContent_forColor(MasterId,SizeId,val,description_div);
			            }           
			            else if(chekDataAvailability=="0")
			            {
			              document.getElementById("dv_alsobought_Wait").innerHTML="";
			              document.getElementById("dv_description_Wait").innerHTML="";
			              document.getElementById("dv_alsobought").style.display="block"; 
	                      document.getElementById("dv_description").style.display="block";
	                      //-----------  3  Start
                          document.getElementById("dv_cartButton").style.display="none";
                          document.getElementById("dv_stockInformation").innerHTML="Out Of Stock";
                          //-----------  3  Start
                          
                           //--IsdropShip strts--------
                           CheckIsDropShip();
                          //--IsdropShip ends--------
			            }		            
                    }
                }
                self_alsoBought.xmlHttpReq_alsoBought.send("color="+val+"&size="+SizeId+"&Iid="+MasterId+"&mode=2&randN="+Math.random()); 
            } 
        }       
    }
    
      
 }
 
 function setContent_alsoBought_forColor(content,dvName)
 {
    document.getElementById("dv_alsobought_Wait").innerHTML="";
    document.getElementById("dv_alsobought").style.display="block"; 
    var contentHolder=document.getElementById(dvName);    
    contentHolder.innerHTML=content;	
     
 }
 function setWaitContent_alsoBought_forColor(dvName,description_div)
 {
	var contentHolder=document.getElementById("dv_alsobought_Wait");   
	var contentHolder2=document.getElementById("dv_description_Wait");
	document.getElementById("dv_alsobought").style.display="none"; 
	document.getElementById("dv_description").style.display="none"; 
    contentHolder.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
	contentHolder2.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";
	
	 		
 }
 
 function changeLongDescContent_forColor(MasterId,SizeId,val,description_div)
 {    
    var xmlHttpReq_itemDesc = false;
    var self_itemDesc = this;
    if (window.XMLHttpRequest) 
    {
        self_itemDesc.xmlHttpReq_itemDesc = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) 
    {
        self_itemDesc.xmlHttpReq_itemDesc = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self_itemDesc.xmlHttpReq_itemDesc.open('POST', "http://www.spiritvoyage.com/ajaxClothingItem.aspx", true);
    self_itemDesc.xmlHttpReq_itemDesc.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self_itemDesc.xmlHttpReq_itemDesc.onreadystatechange = function() 
    {
        if (self_itemDesc.xmlHttpReq_itemDesc.readyState < 4) 
        {      
            setWaitContent_itemDesc_forColor(description_div)                       
        }
        if (self_itemDesc.xmlHttpReq_itemDesc.readyState == 4) 
        {      
            setContent_itemDesc_forColor(self_itemDesc.xmlHttpReq_itemDesc.responseText,description_div)            
            imgchk();                       
        }
    }
    self_itemDesc.xmlHttpReq_itemDesc.send("color="+val+"&size="+SizeId+"&Iid="+MasterId+"&mode=3&randN="+Math.random());
    
     
 }
 
 function setContent_itemDesc_forColor(content,dvName)
 {
    document.getElementById("dv_description_Wait").innerHTML="";
    document.getElementById("dv_description").style.display="block"; 
    var contentHolder=document.getElementById(dvName);    
    contentHolder.innerHTML=content;
    	
     
 }
 function setWaitContent_itemDesc_forColor(dvName)
 {
    var contentHolder=document.getElementById("dv_description_Wait"); 
    document.getElementById("dv_description").style.display="none";    
    contentHolder.innerHTML="<img src=\"http://www.spiritvoyage.com/Pictures/loading.gif\" />";	
     
 }
 function CheckIsDropShip()
 {
       if(document.getElementById("IsDropShip")!=null)
       {
            if(String(document.getElementById("IsDropShip").value)=="1")
            {
                if(document.getElementById("dv_stockInformation")!=null)
                {
                   document.getElementById("dv_stockInformation").innerHTML="";
                }
            }
       }
 }