﻿//Appliances  JScript File
function MM_openBrWindow(theURL,winName,features)

{ //v2.0
  window.open(theURL,winName,features);
}
function dispalyDetail()
 {
    document.getElementById('divProductList').style.display = 'none';
    document.getElementById('innercontent').style.display = 'block';
    return false;
 } 
function closeFriend(divId)
{      
    var divName="ucAppliancesProductRight_"+divId;
    document.getElementById(divName).style.display="none";
} 
 function openHideAppDiv(divToOpen,divToHide1)
 {
 //alert(document.getElementById(divToOpen));
       document.getElementById("ucAppliancesProductRight_"+divToOpen).style.display='block';
     if(divToOpen=="divfeaturelist")
     {
        document.getElementById('ucAppliancesProductRight_imgFeatures').src="../GodrejAppliances/images/btn_feature1.jpg";
        document.getElementById('ucAppliancesProductRight_imgFeatures').style.cursor="default";
        document.getElementById("divFeatureTab").style.display='block';
        if(document.getElementById('ucAppliancesProductRight_imgSpec'))
        {
            document.getElementById('ucAppliancesProductRight_imgSpec').src="../GodrejAppliances/images/btn_speci.jpg";
            document.getElementById('ucAppliancesProductRight_imgSpec').style.cursor="pointer";
            document.getElementById("divSpecTab").style.display='block';
        }
        
//     alert(document.getElementById('ucAppliancesProductRight_imgFeatures'));
//     alert(document.getElementById('divFeatureTab').style.display);
     }
     if(divToOpen=="divSpec")
     {
        document.getElementById('ucAppliancesProductRight_imgSpec').src="../GodrejAppliances/images/btn_speci1.jpg";
        
        document.getElementById('ucAppliancesProductRight_imgSpec').style.cursor="default";
        document.getElementById("divSpecTab").style.display='block';
        
        if(document.getElementById('ucAppliancesProductRight_imgFeatures'))
        {
            document.getElementById('ucAppliancesProductRight_imgFeatures').src="../GodrejAppliances/images/btn_feature.jpg";
            document.getElementById('ucAppliancesProductRight_imgFeatures').style.cursor="pointer";
            document.getElementById("divFeatureTab").style.display='block';
        }
     }
    /* if(document.getElementById("ucAppliancesProductRight_"+divToOpen))
     {
        document.getElementById("ucAppliancesProductRight_"+divToOpen).style.display='block';
     }
     if(document.getElementById("ucAppliancesProductRight_"+divToHide1))
     {
        document.getElementById("ucAppliancesProductRight_"+divToHide1).style.display='none';
     }*/
    document.getElementById("ucAppliancesProductRight_"+divToHide1).style.display='none';
 }
  function showImageOnMouseOver(imgId)
 {

    if(imgId=="divfeaturelist")
     {
        document.getElementById('ucAppliancesProductRight_imgFeatures').src="../GodrejAppliances/images/btn_feature1.jpg";
        document.getElementById('ucAppliancesProductRight_imgSpec').src="../GodrejAppliances/images/btn_speci.jpg";
     }
    else if(imgId=="divSpec")
     {
        document.getElementById('ucAppliancesProductRight_imgSpec').src="../GodrejAppliances/images/btn_speci1.jpg";
        document.getElementById('ucAppliancesProductRight_imgFeatures').src="../GodrejAppliances/images/btn_feature.jpg";
     }
 }
 function showImageOnMouseOut(imgId)
 {
    if(imgId=="divfeaturelist")
     {
        document.getElementById('ucAppliancesProductRight_imgFeatures').src="../GodrejAppliances/images/btn_feature1.jpg";
        document.getElementById('ucAppliancesProductRight_imgSpec').src="../GodrejAppliances/images/btn_speci.jpg";
     }
     else if(imgId=="divSpec")
     {
        document.getElementById('ucAppliancesProductRight_imgSpec').src="../GodrejAppliances/images/btn_speci1.jpg";
        document.getElementById('ucAppliancesProductRight_imgFeatures').src="../GodrejAppliances/images/btn_feature.jpg";
     }
 }
 function openHideDivs(divToOpen,divToHide)
 {
     document.getElementById(divToOpen).style.display='block';
     document.getElementById(divToHide).style.display='none';
 }
 
function  ValidateLogin()
{    

    if (document.getElementById("ucAppliancesRightLogin_txtId").value=="")
    {
        alert("Please Enter User Name");
        document.getElementById("ucAppliancesRightLogin_txtId").focus();
        return false;    		
    }   
    if (document.getElementById("ucAppliancesRightLogin_txtPass").value=="")
    {
        alert("Please Enter Password");
        document.getElementById("ucAppliancesRightLogin_txtPass").focus();
        return false;    		
    }
    return true;
}

function ResetRegistration()
{      
    document.getElementById("ucAppliancesRightRegistration_lblMessage").innerHTML = '';
    document.getElementById("ucAppliancesRightRegistration_TxtUserName").value="";
    document.getElementById("ucAppliancesRightRegistration_TxtEmailId").value="";
    document.getElementById("ucAppliancesRightRegistration_TxtPassword").value="";
    document.getElementById("ucAppliancesRightRegistration_TxtConfirmPassword").value="";
    //document.getElementById("ucAppliancesRightRegistration_lblMessage").value="";  
    return false;
}
        
function  ValidateRegistration()
{    

    if (document.getElementById("ucAppliancesRightRegistration_TxtUserName").value=="")
    {       
        alert("Please Enter User Name");
        document.getElementById("ucAppliancesRightRegistration_TxtUserName").focus();
        return false;    		
    }       
    if (document.getElementById("ucAppliancesRightRegistration_TxtUserName").value.length < 6)
    {
        alert("Please enter User Name more than 6 characters");
        document.getElementById("ucAppliancesRightRegistration_TxtUserName").focus();
        return false;    		
    }
      var Elem=document.getElementById("ucAppliancesRightRegistration_TxtUserName");
         if((Trim(Elem.value)).length == 0)
      {
              alert("User Name is Invalid");
	         document.getElementById("ucAppliancesRightRegistration_TxtUserName").focus();
	         return false;  
      } 
      else if(!CheckValid(document.getElementById('ucAppliancesRightRegistration_TxtUserName').value,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890&_."))
        {
            alert("Please enter valid User Name");
		    document.getElementById("ucAppliancesRightRegistration_TxtUserName").focus();
	         return false;          
         } 
    
    if (document.getElementById("ucAppliancesRightRegistration_TxtEmailId").value=="")
    {
        alert("Please Enter Email Id");
        document.getElementById("ucAppliancesRightRegistration_TxtEmailId").focus();
        return false;    		
    }
    if(!IsValidEmail(document.getElementById('ucAppliancesRightRegistration_TxtEmailId').value))
    {
        alert('Enter valid Email Id and try again.');
        document.getElementById('ucAppliancesRightRegistration_TxtEmailId').focus();
        return false;
    }
    if(document.getElementById("ucAppliancesRightRegistration_TxtPassword").value=="")
    {
        alert("Please Enter Password");
        document.getElementById("ucAppliancesRightRegistration_TxtPassword").focus();
        return false;    		
    }
    else if(document.getElementById("ucAppliancesRightRegistration_TxtPassword").value.length <6)
    {
        alert("Password should be of minimum 6 characters");
        document.getElementById("ucAppliancesRightRegistration_TxtPassword").focus();
        return false;    		
    }
    if(document.getElementById("ucAppliancesRightRegistration_TxtConfirmPassword").value=="")
    {
        alert("Please Enter Confirm Password");
        document.getElementById("ucAppliancesRightRegistration_TxtConfirmPassword").focus();
        return false;    		
    }

    var pwd=document.getElementById("ucAppliancesRightRegistration_TxtPassword").value;
    var confirmpwd=document.getElementById("ucAppliancesRightRegistration_TxtConfirmPassword").value;
    
    if(pwd != confirmpwd)
    {
        alert("Password doesn’t match");
       // document.getElementById("ucAppliancesRightRegistration_TxtConfirmPassword").value="";
       // document.getElementById("ucAppliancesRightRegistration_TxtConfirmPassword").focus();
        return false; 
    }    		           
    return true;
}
        
        
        
        

    
    function ShowFeedback(status)
    {     
        //alert('Called');
        //alert(status);
        ResetControl("Feedback");
        if(status)
        {
            document.getElementById("ucAppliancesProductRight_divfeedback").style.display="block";
            document.getElementById("ucAppliancesProductRight_divfriend").style.display="none";
        }  
        else
            document.getElementById("ucAppliancesProductRight_divfeedback").style.display="none"; 
    }
    
//Hide all Menu Item on mouse over event of UL 
//Written By:-Vinit(05/05/09)
function ShowFriend(status)
    {     
        //alert('Called');
        //alert(status);
        ResetControl("Friend");
        if(status)
        {
            document.getElementById("ucAppliancesProductRight_divfriend").style.display="block";
            document.getElementById("ucAppliancesProductRight_divfeedback").style.display="none";  
        }
        else
            document.getElementById("ucAppliancesProductRight_divfriend").style.display="none"; 
    }
    
 //Reseting the Feedback and Friend controls   
 function ResetControl(str)
 {
    if(str=="Feedback")
    {
        document.getElementById("ucAppliancesProductRight_txtName").value="";
        document.getElementById("ucAppliancesProductRight_txtEmail").value="";
        document.getElementById("ucAppliancesProductRight_txtContactNo").value="";
        document.getElementById("ucAppliancesProductRight_txtAddress").value="";
        document.getElementById("ucAppliancesProductRight_txtDescription").value="";
        return false;
    }
    else if(str=="Friend")
    {
       /* document.getElementById("ucAppliancesProductRight_txtYourEmail").value="";
        document.getElementById("ucAppliancesProductRight_txtFriendEmail").value="";
        document.getElementById("ucAppliancesProductRight_txtFDescription").value="";*/
           document.getElementById("ucAppliancesProductRight_txtYourName").value="";
            document.getElementById("ucAppliancesProductRight_txtFriendName").value="";
            document.getElementById("ucAppliancesProductRight_txtYourEmail").value="";
            document.getElementById("ucAppliancesProductRight_txtFriendEmail").value="";
            document.getElementById("ucAppliancesProductRight_txtFDescription").value="";
            document.getElementById("ucAppliancesProductRight_chkFriend").checked=false;
        return false;
    }
 }
 
 function CheckValid(chars,validchars)
{   
    var blnresult=true;
    for(var i=0;i<chars.length&&blnresult==true;i++)
    {
        var cchar=chars.charAt(i);
        if(validchars.indexOf(cchar)==-1)
        {
            blnresult=false;
        }
    }
     return blnresult;
 }
 
  //Validating the Feedback and Friend controls
 function IsValid(str)
 {
 
 
    if(str=="Feedback")
    {
        if(document.getElementById("ucAppliancesProductRight_txtName").value=="")
        {
            alert("Please enter Name");
            document.getElementById("ucAppliancesProductRight_txtName").focus();
            return false;
        }
        else if(!CheckValid(document.getElementById('ucAppliancesProductRight_txtName').value,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&_. "))
        {
            alert("Please enter valid Name");
		    document.getElementById("ucAppliancesProductRight_txtName").focus();
	         return false;          
         } 
           var Elem=document.getElementById("ucAppliancesProductRight_txtName");
         if((Trim(Elem.value)).length == 0)
      {
              alert("Please enter valid Name");
	         document.getElementById("ucAppliancesProductRight_txtName").focus();
	         return false;  
      } 
        if(document.getElementById("ucAppliancesProductRight_txtEmail").value=="")
        {
            alert("Please enter Email");
            document.getElementById("ucAppliancesProductRight_txtEmail").focus();
            return false;
        }
        else
        {
            if(!IsValidEmail(document.getElementById("ucAppliancesProductRight_txtEmail").value))
            {
                alert('Enter valid Email Id and try again.');
                document.getElementById("ucAppliancesProductRight_txtEmail").focus();
                return false;
            }
        }
        if(document.getElementById("ucAppliancesProductRight_txtContactNo").value=="")
        {        
            alert("Please enter ContactNo.");
            document.getElementById("ucAppliancesProductRight_txtContactNo").focus();
            return false;
        }
      else if(!CheckValid(document.getElementById('ucAppliancesProductRight_txtContactNo').value,"0123456789"))
        {
            alert("Please enter ContactNo.");
	        document.getElementById("ucAppliancesProductRight_txtContactNo").focus();
            return false;       
        }
        else if(document.getElementById("ucAppliancesProductRight_txtContactNo").value.length < 5)
        {
            alert("ContactNo no. should be of minimum 5 digits");
	        document.getElementById("ucAppliancesProductRight_txtContactNo").focus();
            return false;       
        }
//        else
//        {
//            var field=document.getElementById("ucAppliancesProductRight_txtContactNo");
//            if (field.value.length ==0 || field.value.length < 5) 
//            {
//                 alert('ContactNo no. should be of minimum 5 digits');
//                 document.getElementById("ucAppliancesProductRight_txtContactNo").focus();
//                 return false;
//            }            
//        }
         if(document.getElementById("ucAppliancesProductRight_txtAddress").value=="")
        {
            alert("Please enter Address");
            document.getElementById("ucAppliancesProductRight_txtAddress").focus();
            return false;
        }
        if(document.getElementById("ucAppliancesProductRight_txtDescription").value=="")
        {
            alert("Please enter Description");
            document.getElementById("ucAppliancesProductRight_txtDescription").focus();
            return false;
        }
        return true;        
    }
     if(str=="Friend")
    {
//    if(document.getElementById("ucAppliancesProductRight_txtFriendName").value=="")
//        {
//            alert("Please enter Friend Name");
//            document.getElementById("ucAppliancesProductRight_txtFriendName").focus();
//            return false;
//        }
if(document.getElementById("ucAppliancesProductRight_txtFriendName").value!="")
{
       if(!CheckValid(document.getElementById('ucAppliancesProductRight_txtFriendName').value,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&_.  "))
        {
            alert("Friend's Name is invalid");
		    document.getElementById("ucAppliancesProductRight_txtFriendName").focus();
	        return false;       
         } 
           var Elem=document.getElementById("ucAppliancesProductRight_txtFriendName");
         if((Trim(Elem.value)).length == 0)
      {
              alert("Friend's name is invalid");
	         document.getElementById("ucAppliancesProductRight_txtFriendName").focus();
	         return false;  
      } 
      }
       if(document.getElementById("ucAppliancesProductRight_txtFriendEmail").value=="")
        {
            alert("Please enter friend's email");
            document.getElementById("ucAppliancesProductRight_txtFriendEmail").focus();
            return false;
        }        
        
        if(!IsValidEmail(document.getElementById("ucAppliancesProductRight_txtFriendEmail").value))
        {
            alert("Friend's Email is invalid");
            document.getElementById("ucAppliancesProductRight_txtFriendEmail").focus();
            return false;
        } 
//          if(document.getElementById("ucAppliancesProductRight_txtYourName").value=="")
//        {
//            alert("Please enter Your Name");
//            document.getElementById("ucAppliancesProductRight_txtYourName").focus();
//            return false;
//        }     
if(document.getElementById("ucAppliancesProductRight_txtYourName").value!="")
{   
      if(!CheckValid(document.getElementById('ucAppliancesProductRight_txtYourName').value,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&_.  "))
        {
            alert("Your Name is invalid");
		    document.getElementById("ucAppliancesProductRight_txtYourName").focus();
	        return false;       
         }   
         var Elem=document.getElementById("ucAppliancesProductRight_txtYourName");
         if((Trim(Elem.value)).length == 0)
      {
              alert("Your name is invalid");
	         document.getElementById("ucAppliancesProductRight_txtYourName").focus();
	         return false;  
      }  
       }
          if(document.getElementById("ucAppliancesProductRight_txtYourEmail").value=="")
        {
            alert("Please enter Your Email");
            document.getElementById("ucAppliancesProductRight_txtYourEmail").focus();
            return false;
        }
        else
        {
            if(!IsValidEmail(document.getElementById("ucAppliancesProductRight_txtYourEmail").value))
            {
                alert('Your Email is invalid');
                document.getElementById("ucAppliancesProductRight_txtYourEmail").focus();
                return false;
            }
        }  
        //Modified by Tarun Dabral        
//         if(document.getElementById("ucAppliancesProductRight_txtYourEmail").value==(document.getElementById("ucAppliancesProductRight_txtFriendEmail").value))
//        {
//            alert("Your Email and Your Friend's Email Should be Different");
//            document.getElementById("ucAppliancesProductRight_txtFriendEmail").focus();
//            return false;
//        }     
             
       if(document.getElementById("ucAppliancesProductRight_txtFDescription").value=="")
        {
            alert("Please enter Description");
            document.getElementById("ucAppliancesProductRight_txtFDescription").focus();
            return false;
        }
        return true;        
    }
 }
   
function searchres()
  {
    //alert('On Load' + window.event.keyCode );
    if(window.event && window.event.keyCode == 13)
    {
     //alert('In key ');
    }    
    else
        return true; 
  }  



    //============================================================================================================
    //By Vikas ....
    //For Compare Products Functionality 
    function showcompareselimg(id,imgid)
    {    
     //alert(imgid);
       if(document.getElementById(id).checked==true)
       document.getElementById(imgid).src='images/btn_compare1.gif';     
       else
        document.getElementById(imgid).src='images/btn_compare.gif';    
    }
       var selectedModelName='';  
     function countNumOfSelectedProducts()
		{
			var numberSelected=0;		
		    var totCount = document.product.models.length 
    	    for (var i=0; i < totCount; i++)
    	     {    	
        	    if (document.product.models[i].checked==true)
        	    {        	   
            	    numberSelected++;            	
            	    selectedModelName=document.product.models[i].value;            	
                }            
  		    }  		
 		    return numberSelected;
	    }	
	   
		function getIds()
		{	
				var c_value = "";
				var numberSelected=0;				
				
				if(countNumOfSelectedProducts() < 2 || countNumOfSelectedProducts() > 3)
				{
				    alert('Please select 2 or 3 Products to compare');				   			
			       return false;				
				}
				else
				{	
				   c_value="";			 
				   for (var i=0; i < document.product.models.length; i++)
				   {				
				     if(document.product.models[i].checked)
					    {
					        numberSelected++;					     
					        c_value = c_value + document.product.models[i].id + ",";					   
					    }										
				   }				 
				}			    
				var UrlParams="";
				var mySplitResult = c_value.split(",");		
				 	var fo = document.product;   
				  for(i = 0; i < mySplitResult.length-1; i++)
				   {
							UrlParams  = UrlParams +  "PID" + i + "=" + mySplitResult[i] + "&";					
				   }
				  
				   UrlParams.substring(0,UrlParams.length); 
				   var str =UrlParams;
				   var ProdURL = str.substring(0, str.length-1); 
			       //ProdURL="product.aspx?id=6&menuid=346&Count="+numberSelected+"&"+ProdURL;
			       //window.parent.location = ProdURL;
 				ProdURL="productscompare.aspx?Count="+numberSelected+"&"+ProdURL;	
                     newwin=window.open(ProdURL,'newC','width=685,height=700,top=50,left=100,scrollbars=yes,resizable=yes');
                   newwin.focus();	
				      
			return false;					
		}
		
    function searchProducts(cntrl)
    {     //alert('');
      var search;
   
      if(cntrl=="Inner")
      {
       //alert('Inner');
        search=document.getElementById('ucAppliancesInnerRight_txtsearch').value;
        if((Trim(search).length) == 0)
        {
	        alert("Please Enter Search Keyword");
	        document.getElementById("ucAppliancesInnerRight_txtsearch").focus();
	        return false;  	        		
        }
        return true;
      }
      if(cntrl=="Product")
      {
//      alert('Product');
          search=document.getElementById('ucAppliancesProductRight_txtsearch').value;
          if((Trim(search).length) == 0)
            {
	            alert("Please Enter Search Keyword");
	            document.getElementById("ucAppliancesProductRight_txtsearch").focus();
	            return false;  	           		
            } 
            return true;
      }
    
      return true;
    }		
		
		//============================================================================================================
		//Vikas
		// For Highlighting the Category Selected
		ID=0;
     CHkEVENT=0;
     
     //ID=document.getElementById("HdnCHKEvent").value;
     //CHkEVENT= document.getElementById("HdnCONTROLID").value;
     function dispalyDetail()
     {
        document.getElementById('appliances_content').style.display = 'none';
        document.getElementById('divDetail').style.display = 'block';
        return false;
     }

     
function GetCategoryCSS(id,checkevent) 
     {     
         if(checkevent == 0)
          {
           document.getElementById(id).className='navi_button_hover';
           return false;
          }
         if(checkevent ==1)
          {
          document.getElementById(id).className='navi_button_hover';  
            return false;        
          }
          if(checkevent ==2)
          {         
           //Higllighting the Selected Category on Mouseout
           if(document.getElementById("HdnCONTROLID").value == id)
           {
            document.getElementById(id).className='navi_button_hover'; 
            document.getElementById(id).style.cursor="default";                       
           }
           else
           {
           document.getElementById(id).className='navi_button';
           }
            return false;
          }
          if(checkevent ==3)
          {
           //alert("in cat" + id);
            //if(id != "lnkType_undefined")
              // {alert(id); 
              if(document.getElementById(id))
              {
                   document.getElementById(id).className='navi_button_hover';  
                   document.getElementById("HdnCONTROLID").value=id; 
                   document.getElementById(id).style.cursor="default";                
                   document.getElementById(id).href='javascript:;';
                   
              }        
                          
                   return false;
              //  }
          }
      return false;
     }
function GetSubSubCategoryCSS(id,checkevent) 
     {     
         if(checkevent == 0) //OnClick 
          {
           document.getElementById(id).className='directcooltitlebold';
           return false;
          }
         if(checkevent ==1) //OnMouseover 
          {
          //document.getElementById(id).className='directcooltitle';  
         
          if(document.getElementById("HdnSubSubControlID").value == id)
           {
            document.getElementById(id).className='directcooltitlebold';                       
           }
           else
           {
           document.getElementById(id).className='directcoollink';
           //alert(document.getElementById(id).className);
           }
            return false;        
          }
          if(checkevent ==2)//OnMouseOut 
          {         
           //Higllighting the Selected Category on Mouseout
           if(document.getElementById("HdnSubSubControlID").value == id)
           {
            document.getElementById(id).className='directcooltitlebold'; 
             document.getElementById(id).style.cursor="default";                       
           }
           else
           {
           document.getElementById(id).className='directcoollink';
           }
            return false;
          }
          if(checkevent ==3)
          {     
            //alert("in SubSub" + id);
            if(document.getElementById(id))
               {
                document.getElementById(id).className='directcooltitlebold';          
                document.getElementById("HdnSubSubControlID").value=id;
                document.getElementById(id).style.cursor="default";                
                document.getElementById(id).href='javascript:;';           
               return false;
               }
                        
               return false;
          }
      return false;
     }     
function defaultunload()
{    
  
   var qs = new Querystring();
   var qs_Sub_CatID = qs.get("subcatid");
   var qs_CatID = qs.get("catid");  
   var qs_SubSub_CatID= qs.get("subsubcatid");
    //alert(qs_SubSub_CatID);
   if(qs_SubSub_CatID != 0) 
   {      
      // alert(qs_SubSub_CatID);
      
      qs_Sub_CatID="lnkType_"+qs_Sub_CatID;
      GetCategoryCSS(qs_Sub_CatID,3); 
        
      qs_SubSub_CatID="lnkSubSubType_"+qs_SubSub_CatID;
       GetSubSubCategoryCSS(qs_SubSub_CatID,3); 
        return false;
        event.returnvalue=false;    
   }
   if(qs_Sub_CatID != 0) 
   {
       // alert("Sub Cat ID" + qs_Sub_CatID);
        qs_Sub_CatID="lnkType_"+qs_Sub_CatID;
        GetCategoryCSS(qs_Sub_CatID,3); 
        return false;
        event.returnvalue=false; 
   }
   else if(qs_Sub_CatID == 0  && qs_CatID!=0) 
   {   
             	//Refrigerators  
		         
            if(qs_CatID==91)
             {
		//Frost Free - 117
                //Direct Cool- 124 
                  qs_Sub_CatID="lnkType_"+117;
             }
             //Air Conditioners
             if(qs_CatID==92)
             {                
		  //Split AC - 122
                  //Windows AC - 123 
                  qs_Sub_CatID="lnkType_"+122; 
                  //ucAppliancesProductRight_divFrostFree
             }
             //Washing machines
             if(qs_CatID==93)
             {
		   //SEMI Automatic  - 116
                   //Fully Automatic - 115
                   qs_Sub_CatID="lnkType_"+115;                  
             }
             //Microwave Ovens
             if(qs_CatID==94)
             {
		  //Convention - 118
                  //Grill - 119
                  // SOLO - 120
                  //Steam - 121
                  qs_Sub_CatID="lnkType_"+118; 
             }   
			 //TV
             if(qs_CatID==415)
             {
		  //LED - 458
                  //LCD - 459
                  // SLIM - 460
                  //FLAT - 461
                  qs_Sub_CatID="lnkType_"+458; 
             }  
        GetCategoryCSS(qs_Sub_CatID,3); 
        return false;
        event.returnvalue=false;          
   }      
}
window.onload=defaultunload;//defaultload
	
//END Highlight Selected=====================================================================================


//***************************Added By:-Vinit(12/05/2009)*****************************************
//***********************Show and Hide Rating Star according to rate*****************************	
function setStar(sel_rate)
{
    for(var i=1;i<=5;i++)
    {
        if(document.getElementById('ucAppliancesProductRight_imgStar'+i)!=null)
        {
            document.getElementById('ucAppliancesProductRight_imgStar'+i).src='../GodrejAppliances/images/star.gif';
        }
    }
    for(var i=1;i<=sel_rate;i++)
    {
        if(document.getElementById('ucAppliancesProductRight_imgStar'+i)!=null)
        {
            document.getElementById('ucAppliancesProductRight_imgStar'+i).src='../GodrejAppliances/images/star1.gif';
        }

    } 
}
function hideStar(rate)
{
    var rate=document.getElementById('ucAppliancesProductRight_hdnRating').value;
    //alert('out =='+rate);
    for(var i=1;i<=5;i++)
    {
        if(document.getElementById('ucAppliancesProductRight_imgStar'+i)!=null)
        {
           document.getElementById('ucAppliancesProductRight_imgStar'+i).src='../GodrejAppliances/images/star.gif';
        }
    }
    for(var i=1;i<=rate;i++)
    {
        if(document.getElementById('ucAppliancesProductRight_imgStar'+i)!=null)
        {
            document.getElementById('ucAppliancesProductRight_imgStar'+i).src='../GodrejAppliances/images/star1.gif';
        }
    }
}
   
//****************************************** FOR LEFT MENU   **************************************************
 //Dynamically displaying the sub sub menu list catProduct
//Written By:-Vinit(23/03/09)
    function IsVisible(IdNumber,Status)
    {  
      var count=0;        
        var subCategoryCount=document.getElementById("ucAppliancesInnerLeft_hdnCategoryCount").value;
        //var subCategoryStatus=document.getElementById("ucAppliancesInnerLeft_hdnCategoryStatus").value;
	   // var subCatid='subCategory'+subCategoryStatus;
	     //alert(subCategoryCount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subCategory'+a1[count];
            //alert(UlId);
            //alert(subsubid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	    

        if(Status)
        {
            //alert('Hi');
            var ULid='subCategory'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }            
    }      
   function IsNotVisible()
    {        
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;
        var subCategoryCount=document.getElementById("ucAppliancesInnerLeft_hdnCategoryCount").value;
       
	    //var subCatid='subCategory'+subCategoryStatus;
	    //alert(subCategoryCount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subCategory'+a1[count];
            //alert(UlId);
            //alert('subCatid ='+subCatid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }  	 
    }   
    //End of Category Section (Product and SubCategory List)

    //Start of SubCategory Item and Product
    function SubSubCatVisible(IdNumber,Status)
    {        
        var count=0;        
        var subCategoryCount=document.getElementById("ucAppliancesInnerLeft_hdnsubCategoryCount").value;
        var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubCategory'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }  
        if(Status)
        {
            var ULid='subsubCategory'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }       
    }
   function SubSubCatUnVisible()
    {      
      var count=0;
       
        var subCategoryCount=document.getElementById("ucAppliancesInnerLeft_hdnsubCategoryCount").value;
    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubCategory'+a1[count];
                   
                document.getElementById(UlId).style.display="none";
        }
      	 
    }
//End of SubCategory Section (Product and SubCategory List)


 //Dynamically displaying the sub menu list 
   //Written By:-Vinit(08/05/09)
    function showSecondLevelMenu(IdNumber,Status)
    {   
       
        var count=0;        
        var subCategoryCount=document.getElementById("ucAppliancesInnerTop_hdnsubmenucount").value;       
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subMenuUl'+a1[count];            
            document.getElementById(UlId).style.display="none";
        }	    

        if(Status)
        {
            //alert('Hi');
            var ULid='subMenuUl'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }            
    }

//************************************************************************************************************     
    
    
//Other Functions********************************************************************************************
function LTrim(str)
	{
		var whitespace = new String(" \t\n\r");
		var s = new String(str);

		if (whitespace.indexOf(s.charAt(0)) != -1) 
		{
			var j=0, i = s.length;
			while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
				j++;
			s = s.substring(j, i);
		}
		return s;
	}
	function RTrim(str)
	{
		var whitespace = new String(" \t\n\r");
		var s = new String(str);
		if (whitespace.indexOf(s.charAt(s.length-1)) != -1) 
		{

			var i = s.length - 1;       
			while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
			i--;
			s = s.substring(0, i+1);
		}
		return s;
	}
	function Trim(str)
	{
		return RTrim(LTrim(str));
	}
      
   function CheckValid(chars,validchars)
    {   
         var blnresult=true;
        for(var i=0;i<chars.length&&blnresult==true;i++)
            {
                 var cchar=chars.charAt(i);
                 if(validchars.indexOf(cchar)==-1)
                    {
                        blnresult=false;
                    }        
            }
         return blnresult;
     }     
     
        function Querystring()
   {  
     //get the query string, ignore the ? at the front.
	var querystring=location.search.substring(1,location.search.length);
    // parse out name/value pairs separated via &
    var args = querystring.split('&');
    // split out each name = value pair
	for (var i=0;i<args.length;i++)
	{
        var pair = args[i].split('=');
		// Fix broken unescaping
		temp = unescape(pair[0]).split('+');
		name = temp.join(' ');
		temp = unescape(pair[1]).split('+');
		value = temp.join(' ');
		this[name]=value;
	}
    this.get=Querystring_get;
    }
 
function Querystring_get(strKey,strDefault)
{
  var value=this[strKey];
 if (value==null)
	{
			value=strDefault;
	}
	return value;
}
function IsValidEmail(stremail,empty)
{
    if(stremail=='' && empty)
        return true;
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    return filter.test(stremail);
}  
//************************************************************************************************************

//Showing and Hiding the Watch Now Div Window 
function showVideo(shodDiv1,shodDiv2,videoname)
{
   
    document.getElementById(shodDiv1).style.display='block';
    document.getElementById(shodDiv2).style.display='block';  
    var strPlayer="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"592\" height=\"430\"><param name=\"movie\" value=\"Flash/video_plyer2_final.swf?filename=../Videos/"+ videoname +"\" /><param name=\"quality\" value=\"high\"/><param name=\"scale\" value=\"exactfit\"/><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"Flash/video_plyer2_final.swf?filename=../Videos/"+ videoname +"\" quality=\"high\" scale=\"exactfit\" allowFullScreen=\"true\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"592\" height=\"430\"></embed></object>";
    document.getElementById('divPlayer').innerHTML = strPlayer;
   
}

function hideVideo(shodDiv1,shodDiv2)
{  
    document.getElementById(shodDiv1).style.display='none';
    document.getElementById(shodDiv2).style.display='none';     
    document.getElementById('divPlayer').innerHTML = '';
}

//=============================
function closeRate(divId)
{      
    var divName="ucAppliancesProductRight_"+divId;
    document.getElementById(divName).style.display="none";
} 

function showprodlarge()
{
  document.getElementById('tran_bg_div_prod').style.display='block';
  document.getElementById('prod_inner_div1').style.display='block';  
}

function hideprodlarge()
{  
    document.getElementById('tran_bg_div_prod').style.display='none';
    document.getElementById('prod_inner_div1').style.display='none'; 
}
function closePassword(divId)
{      
    var divName="ucApplianceRightforgotpassword_"+divId;
    document.getElementById(divName).style.display="none";
} 

function Clear(divId)
    {
    document.getElementById("ucApplianceRightforgotpassword_lblError").innerHTML = '';
    document.getElementById("ucApplianceRightforgotpassword_txtEmailId").value="";
    }
    function showWhatsNew(divid)
{
  document.getElementById(divid).style.display='block';  
}

function hideWhatsNew(divid)
{  
    document.getElementById(divid).style.display='none';
}

function closeRate(divId)
{      
    var divName="ucAppliancesProductRight_"+divId;
    document.getElementById(divName).style.display="none";
} 
function closePassword(divId)
{      
    var divName="ucAppliancesProductRight_"+divId;
    document.getElementById(divName).style.display="none";
} 
function closePassword(divId)
{      
    var divName="ucApplianceRightforgotpassword_"+divId;
    document.getElementById(divName).style.display="none";
} 

function Clear(divId)
    {
    document.getElementById("ucApplianceRightforgotpassword_lblError").innerHTML = '';
    document.getElementById("ucApplianceRightforgotpassword_txtEmailId").value="";
    }
    function closeregister(divId)
{      
    var divName="ucAppliancesRightRegistration_"+divId;
    document.getElementById(divName).style.display="none";
} 

 function closeforget(divId)
{      
    var divName="ucApplianceRightforgotpassword_"+divId;
    document.getElementById(divName).style.display="none";
} 
function  ValidateEmail()
{    

    if (document.getElementById("ucApplianceRightforgotpassword_txtEmailId").value=="")
    {
        alert("Please Enter Email ID");
        document.getElementById("ucApplianceRightforgotpassword_txtEmailId").focus();
        return false;    	
    }  
    
      if(!IsValidEmail(document.getElementById('ucApplianceRightforgotpassword_txtEmailId').value))
    {
        alert('Enter valid Email Id and try again.');
        document.getElementById('ucApplianceRightforgotpassword_txtEmailId').focus();
        return false;
    }
    return true;
    }
	function printContent(id)
{
    str=document.getElementById(id).innerHTML
    newwin=window.open('','printwin','left=100,top=100,width=400,height=400,scrollbars=1,resizable=1')
    newwin.document.write('<HTML>\n<HEAD>\n')
    newwin.document.write('<TITLE>Print Page</TITLE>\n')
    newwin.document.write('<script>\n')
    newwin.document.write('function chkstate(){\n')
    newwin.document.write('if(document.readyState=="complete"){\n')
    newwin.document.write('window.close()\n')
    newwin.document.write('}\n')
    newwin.document.write('else{\n')
    newwin.document.write('setTimeout("chkstate()",2000)\n')
    newwin.document.write('}\n')
    newwin.document.write('}\n')
    newwin.document.write('function print_win(){\n')
    newwin.document.write('window.print();\n')
    newwin.document.write('chkstate();\n')
    newwin.document.write('}\n')
    newwin.document.write('<\/script>\n')
	newwin.document.write('<link rel="stylesheet" type="text/css" href="../css/appliances.css" media="print" />\n')
    newwin.document.write('</HEAD>\n')
    newwin.document.write('<BODY onload="print_win()">\n')
    newwin.document.write(str)
    newwin.document.write('</BODY>\n')
    newwin.document.write('</HTML>\n')
    newwin.document.close()
}

function LTrim(str)
	{
		var whitespace = new String(" \t\n\r");
		var s = new String(str);

		if (whitespace.indexOf(s.charAt(0)) != -1) 
		{
			var j=0, i = s.length;
			while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
				j++;
			s = s.substring(j, i);
		}
		return s;
	}
	function RTrim(str)
	{
		var whitespace = new String(" \t\n\r");
		var s = new String(str);
		if (whitespace.indexOf(s.charAt(s.length-1)) != -1) 
		{

			var i = s.length - 1;       
			while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
			i--;
			s = s.substring(0, i+1);
		}
		return s;
	}
	function Trim(str)
	{
		return RTrim(LTrim(str));
	}
    //




function hideAllSecondLevelMenu()
    {       //alert('Called');   
        var count=0;        
        var subCategoryCount=document.getElementById("ucAppliancesInnerTop_hdnsubmenucount").value;       
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subMenuUl'+a1[count];            
            document.getElementById(UlId).style.display="none";
        }           
    }

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
} 
