﻿function ResetForm()
{
    document.forms[0].reset();
    return false;
}

 function ResetDefaultFired()
        {
        
           __defaultFired = false;
        }


function checkAll(objRef)

{

    var GridView = objRef.parentNode.parentNode.parentNode;

    var inputList = GridView.getElementsByTagName("input");

    for (var i=0;i<inputList.length;i++)

    {

        //Get the Cell To find out ColumnIndex

        var row = inputList[i].parentNode.parentNode;

        if(inputList[i].type == "checkbox"  && objRef != inputList[i])
        {
            if (objRef.checked)
            {
                //If the header checkbox is checked check all checkboxes
                inputList[i].checked=true;
            }
            else
            {
                //If the header checkbox is checked uncheck all checkboxes
                inputList[i].checked=false;
            }
        }
    }
} 

function SetValidatorDisable(id)
{
  var myVal = document.getElementById(id); 
  ValidatorEnable(myVal, false); 
}
function SetValidatorEnable(id)
{
  var myVal = document.getElementById(id); 
  ValidatorEnable(myVal, true); 
}

function Check_Click(objRef)

{

    //Get the Row based on checkbox
    var row = objRef.parentNode.parentNode;

   
    //Get the reference of GridView
    var GridView = row.parentNode;

   

    //Get all input elements in Gridview
    var inputList = GridView.getElementsByTagName("input");



    for (var i=0;i<inputList.length;i++)

    {

        //The First element is the Header Checkbox
        var headerCheckBox = inputList[0];

       

        //Based on all or none checkboxes are checked check/uncheck Header Checkbox

        var checked = true;

        if(inputList[i].type == "checkbox" && inputList[i] != headerCheckBox)

        {

            if(!inputList[i].checked)

            {

                checked = false;

                break;

            }

        }

    }

    headerCheckBox.checked = checked;

   

}  

 function OpenColorwindow(notesurl)
        {
          
           var Colors = window.open(notesurl,'Colors','toolbar=no,resize=yes,location=no,status=no,scrollbars=yes,width=700,height=400,top=160,left=60');
           return false;
              
        }
        
         function OpenCrossselwindow(notesurl)
        {
          
           var Colors = window.open(notesurl,'CrossSellProduct','toolbar=no,resize=yes,location=no,status=no,scrollbars=yes,width=700,height=400,top=160,left=60');
           return false;

       }

       function OpenKidSizewindow(notesurl) {

           var Colors = window.open(notesurl, 'CrossSellProduct', 'toolbar=no,resize=yes,location=no,status=no,scrollbars=yes,width=400,height=300,top=120,left=550');
           if (Colors) Colors.focus();

           return false;

       }

       function OpenTrackingNumber(notesurl) {

           var Colors = window.open(notesurl, 'CrossSellProduct', 'toolbar=no,resize=yes,location=no,status=no,scrollbars=yes,width=375,height=250,top=300,left=550');
           if (Colors) Colors.focus();

           return false;

       }
      
                
        
    
        
        
        
        
  //// for hiding menu      
function switchMenu(obj)
{
    var el = document.getElementById(obj);
	if ( el.style.display != "none" )
	{
	    el.style.display = 'none';
	}
	else
	{
		el.style.display = '';
	}
}




function Closewindow()
  {
   
  self.close();
    
  }   
  
  
function clickButton(e, buttonid){
      
      var evt = e ? e : window.event;

      var bt = document.getElementById(buttonid);
   
      if(bt){

          if ((evt.keyCode == 13)||(event.which == 13))
          {                
               bt.click();
             
               return false;
           

          }

      }
}
  
           
