﻿var inttotal;
 var intpageCount;
 var rowanmember;
  var photoname = new Array();
 var imageurl = new Array();
 var description = new Array();
 var yarns = new Array();
 var pdfurl= new Array();
  var photonameold,imageurlold,descriptionold,yarnsold,pdfurlold,vardateold;
   function OnBindEvents(id)
  {
        document.getElementById('ctl00_headingName').innerHTML=photonameold;
        document.getElementById('ctl00_imagename').innerHTML='<img src="/events-image/big/' + imageurl[id] + '" height="310px" width="260px" alt="'+photoname[id]+'">';
       // document.getElementById('tdDescription').innerHTML= description[id];
      return false;
  }
  function OnBindBook(id)
  {
      document.getElementById('ctl00_headingName').innerHTML=photoname[id];
    document.getElementById('ctl00_imagename').innerHTML='<img src="/book-image/big/' + imageurl[id] + '" height="310px" width="260px"  alt="'+photoname[id]+'">';
    document.getElementById('ctl00_tdDescription').innerHTML= description[id];
      return false;
  }
  function OnBindBooknew(id)
  {
     document.getElementById('ctl00_imagename').innerHTML='<img src="/book-image/big/' + id + '" height="310px" width="260px"  alt="'+id+'">';
     return false;
  }
  function OldBindBook()
  {
        document.getElementById('ctl00_headingName').innerHTML=photonameold;
        document.getElementById('ctl00_imagename').innerHTML='<img src="/book-image/big/' + imageurlold + '" height="310px" width="260px" alt="'+photonameold+'">';
        document.getElementById('ctl00_tdDescription').innerHTML= descriptionold;
      return false;
  }
  function OnBindBook1()
  {
    alert("Restricted access for members only");
    return false;
  }
  function OnBindTutorialold()
  {
    document.getElementById('ctl00_imagename').innerHTML='<img src="/editorial-image/big/' + imageurlold + '" height="310px" width="260px" alt="'+photonameold+'">';
    document.getElementById('ctl00_tdDescription').innerHTML= descriptionold;
      return false;
  }
  function OnBindTutorial(id)
  {
    document.getElementById('ctl00_divstepname').innerHTML= photoname[id] ;
    document.getElementById('ctl00_tdstepimage').innerHTML='<img src="/tutorial-image/big/' + imageurl[id] + '" height="310px" width="260px" alt="'+photoname[id]+'" >';
    document.getElementById('ctl00_divstepDescription').innerHTML= description[id];
    return false;
  }
  function OldBind()
  {
        document.getElementById('ctl00_headingName').innerHTML=photonameold;
        document.getElementById('ctl00_imagename').innerHTML='<img src="/editorial-image/big/' + imageurlold + '" height="260px" width="340px" alt="'+photonameold+'">';
        document.getElementById('ctl00_tdDescription').innerHTML= descriptionold;
      return false;
  }
  function OnBindPhotoShoot(id)
  {
      document.getElementById('ctl00_headingName').innerHTML=photoname[id];
    document.getElementById('ctl00_imagename').innerHTML='<img src="/editorial-image/big/' + imageurl[id] + '" height="310px" width="260px"  alt="'+photoname[id]+'">';
    document.getElementById('linkYarns').innerHTML= '<div><strong>RELATED YARNS : </strong>'+description[id]+'</div>';
                    document.getElementById('linkdesgnname').innerHTML=yarns[id];

      return false;
  }
  function OnBindPhotoShoot1()
  {
    alert("Restricted access for members only");
    return false;
  }
  function OnBindYarns(id)
  {
    document.getElementById('ctl00_imagename').innerHTML='<img src="/yarn-image/big/' + imageurl[id] + '" height="260px" width="340px"  alt="'+photoname[id]+'" >';
    document.getElementById('divShade').innerHTML= photoname[id];

    return false;
  }
   function OnBindYarns1()
  {
    alert("Restricted access for members only");
    return false;
  }
  function OnBindconsultantold()
  {
    document.getElementById('ctl00_imagename').innerHTML='<img src="/editorial-image/big/' + imageurlold + '" height="260px" width="340px" >';
    document.getElementById('ctl00_tdDescription').innerHTML= descriptionold;
      return false;
  }
    function OnBindconsultant(id)
  {
    document.getElementById('ctl00_imagename').innerHTML='<img src="/editorial-image/big/' + imageurl[id] + '" height="310px" width="260px" >';
     //  document.getElementById('ctl00_headingName').innerHTML= photoname[id]+'  '+'<a href="#" onclick="return OnBindconsultantold();">privews</a>';

    document.getElementById('ctl00_tdDescription').innerHTML= description[id];
      return false;
  }

  function onDisplayPage(no)
  {
  inttotal=document.getElementById('ctl00_HdTotal').value;
    for(intcount=(no*3)-3;intcount<(no*3);intcount++)
    {
        if(inttotal>intcount)
        {
    
            document.getElementById('ctl00_other'+intcount).style.display="";
         }
    }
  }
  function onDisplayPagetxt()
  {
    no=document.getElementById('ctl00_TxtGo').value
    inttotal=document.getElementById('ctl00_HdTotal').value;
    if(intpageCount<1)
    {
        intpageCount=1;
    }
     if(no=='')
    {
        alert("Please enter the value");	
        document.getElementById('ctl00_TxtGo').value="";
        document.getElementById('ctl00_TxtGo').focus();	     
        return false;
    }        
    if(!IsNumeric(no))
    {
        alert("Please enter the numeric only");		  
        document.getElementById('ctl00_TxtGo').value="";    
        document.getElementById('ctl00_TxtGo').focus();
        return false;
    }
    if(no==0)	
    {
        alert("Please enter the value 1 to " + intpageCount);
        document.getElementById('ctl00_TxtGo').value="";
        document.getElementById('ctl00_TxtGo').focus();
        return false;
    }                                
    if(no>intpageCount)	
    {
        alert("Please enter the value 1 to " + intpageCount);
        document.getElementById('ctl00_TxtGo').value="";
        document.getElementById('ctl00_TxtGo').focus();
        return false;
    }	    
    for(intcount=0;intcount<inttotal;intcount++)
    {
        document.getElementById('ctl00_other'+intcount).style.display="none";
         
    }    
    for(intcount=(no*3)-3;intcount<(no*3);intcount++)
    {
        if(inttotal>intcount)
        {       
            document.getElementById('ctl00_other'+intcount).style.display="";
         }
             document.getElementById('ctl00_LblTotal').innerHTML='Page '+ no +' of '+intpageCount;

    }
    document.getElementById('ctl00_TxtGo').value="";
    return false;
  }
  function IsNumeric(strString)
    //  check for valid numeric strings	
    {
    var strValidChars = "0123456789.-";
    var strChar;
    var blnResult = true;

    if (strString.length == 0) return false;

    //  test strString consists of valid characters listed above
    for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
    return blnResult;
    }
  function ShoppingCheck()
  {
    var quan;
    quan=document.getElementById('ctl00_TxtQut').value
   
     if(quan=='')
    {
        alert("Please enter the quantity");	
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();	     
        return false;
    }        
    if(!IsNumeric(quan))
    {
        alert("Please enter the numeric only");		  
        document.getElementById('ctl00_TxtQut').value="";    
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }
    if(quan==0)	
    {
        alert("Please enter the value  one or more");
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }    
    else
    {
        WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$imgShapping', '', false, '', '/ShadeCardsPrice.aspx', false, false));
        return true;
    }
  }
  function ShoppingCheckBook()
  {
    var quan;
    quan=document.getElementById('ctl00_TxtQut').value
   
     if(quan=='')
    {
        alert("Please enter the quantity");	
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();	     
        return false;
    }        
    if(!IsNumeric(quan))
    {
        alert("Please enter the numeric only");		  
        document.getElementById('ctl00_TxtQut').value="";    
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }
    if(quan==0)	
    {
        alert("Please enter the value  one or more");
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }    
    else
    {
        WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$imgShapping', '', false, '', '/booksPrice.aspx', false, false));
        return true;
    }
  }
    function ShoppingCheckMagazine()
  {
    var quan;
    quan=document.getElementById('ctl00_TxtQut').value
   
     if(quan=='')
    {
        alert("Please enter the quantity");	
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();	     
        return false;
    }        
    if(!IsNumeric(quan))
    {
        alert("Please enter the numeric only");		  
        document.getElementById('ctl00_TxtQut').value="";    
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }
    if(quan==0)	
    {
        alert("Please enter the value  one or more");
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }    
    else
    {
        WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$imgShapping', '', false, '', '/magazinePrice.aspx', false, false));
        return true;
    }
  }
  function StoriesDisplay(j)
  {
    for (i=0;i<3;i++)
	{
	   document.getElementById('ctl00_trstoriesdis'+i).style.display="none"
	   document.getElementById('ctl00_trstoriesimage'+i).style.display="none"
	}	
	
	if(document.getElementById('ctl00_trstoriesdis'+j).style.display=="none")
	{	
        document.getElementById('ctl00_trstoriesdis'+j).style.display=""
        document.getElementById('ctl00_trstoriesimage'+j).style.display=""
    }
    else
    {
        document.getElementById('ctl00_trstoriesdis'+j).style.display="none"
        document.getElementById('ctl00_trstoriesimage'+j).style.display="none"
    }
	return false;
  }
    function ShoppingCheckWorkShop()
  {
    var quan;
    quan=document.getElementById('ctl00_TxtQut').value
   
     if(quan=='')
    {
        alert("Please enter the quantity");	
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();	     
        return false;
    }        
    if(!IsNumeric(quan))
    {
        alert("Please enter the numeric only");		  
        document.getElementById('ctl00_TxtQut').value="";    
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }
    if(quan==0)	
    {
        alert("Please enter the value  one or more");
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }    
    else
    {
        WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$imgShapping', '', false, '', '/workshopPrice.aspx', false, false));
        return true;
    }
  }
  
   function DisplayPage(id)
  {
   	inttotal=document.getElementById('ctl00_HdTotal').value;
    for(intcount=0;intcount<inttotal;intcount++)
    {
        document.getElementById('ctl00_other'+intcount).style.display="none";
         
    }    
    for(intcount=(id*3)-3;intcount<(id*3);intcount++)
    {
        if(inttotal>intcount)
        {       
            document.getElementById('ctl00_other'+intcount).style.display="";                
        }      
     }
      CreatePaging(intpageCount, id) ;    
      return  false;
  }

function ShoppingCheckRowan()
  {
    var quan;
    quan=document.getElementById('ctl00_TxtQut').value
   if(rowanmember=='1')
   {
        alert("you should not select the more than one membership ");	
        	     
        return false;
   
   }
     if(quan=='')
    {
        alert("Please enter the quantity");	
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();	     
        return false;
    }        
    if(!IsNumeric(quan))
    {
        alert("Please enter the numeric only");		  
        document.getElementById('ctl00_TxtQut').value="";    
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }
    if(quan==0)	
    {
        alert("Please enter the value  one or more");
        document.getElementById('ctl00_TxtQut').value="";
        document.getElementById('ctl00_TxtQut').focus();
        return false;
    }    
    else
    {
        WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$imgShapping', '', false, '', '/RowaninternationalPrice.aspx', false, false));
        return true;
    }
  }