// JScript File

   function SelectALL(spanChk){

   // Added as ASPX uses SPAN for checkbox
   var oItem = spanChk.children;
   var theBox= (spanChk.type=="checkbox") ? 
        spanChk : spanChk.children.item[0];
   xState=theBox.checked;
   elm=theBox.form.elements;

   for(i=0;i<elm.length;i++)
     if(elm[i].type=="checkbox")
     {
       if (  
        elm[i].id!=theBox.id
        && elm[i].id !="chk_IsActive"
        && elm[i].id !="chk_IsDeleted") 
        {
            if(elm[i].checked!=xState)
                elm[i].click();
         }

     }
 }
 
   function DeSelectAll(spanChk){

   // Added as ASPX uses SPAN for checkbox
   var oItem = spanChk.children;
   var theBox= (spanChk.type=="checkbox") ? 
        spanChk : spanChk.children.item[0];
   xState=theBox.checked;
   elm=theBox.form.elements;

   for(i=0;i<elm.length;i++)
     if(elm[i].type=="checkbox" && 
              elm[i].id!=theBox.id)
     {
       
       if(elm[i].checked==xState)
         elm[i].click();
       
     }
 }
 
 function sethighlighted(pThisRow)
{
    pThisRow.style.backgroundColor="#e0d9a2";
}

function resethighlight(pThisRow, pClass)
{
    pThisRow.style.backgroundColor="#efe3b9";
}	

function HandleEditorCommand(editor)
{
 if(event.command=='PostBack'&& event.commandvalue=='Delete')
  {
   //tell the CuteEditor don't handle it .
    event.returnValue=confirm("Are you sure you want to delete this record?");
   }
}


function Select_Value_Set(pSelect, pValue)
{
   lSelect = document.getElementById(pSelect);
 //  alert("select:"+pSelect);
//   alert("value:"+pValue);
   if ( lSelect != null)
   {
      for(index = 0; index < lSelect.length; index++)
      {
         if(lSelect[index].value == pValue)
         {
            lSelect.selectedIndex = index;
         }
      }
    }
    else 
    {
    alert(pSelect);
    }
}




/*
ClientValidationFunction, Custom Validator

If you are using JScript, the function must be in this form: 

 function ValidationFunctionName(source, arguments)
 

the string from the input control to validate is accessed by using the Value property of the arguments parameter. 
Return the result of the validation by setting the IsValid property of the arguments parameter.

Example:

void ServerValidation (object source, ServerValidateEventArgs args)
 {
    args.IsValid = (CheckBox1.Checked == true);
 }

*/
function NoPoBox(source, arguments)
{
     lValue  = arguments.Value.toLowerCase();
     if (lValue.indexOf("po box") > -1 || lValue.indexOf("p.o. box") > -1 || lValue.indexOf("p o  box") > -1 )
      {
         arguments.IsValid=false;
      }
      else 
      {
         arguments.IsValid=true;
      }

}



function AddToCart(pID)
{
     lEvalForm = "hf_FormID_" +pID;
     lEvalFormType = "hf_FormType_" +pID;
     lEvalQty = "ddl_QuickAdd_"+pID;
     lFormID = document.getElementById(lEvalForm);
     lQuantity = document.getElementById(lEvalQty);
     lType = document.getElementById(lEvalFormType);
     window.location.href="Vendora_Home.aspx?ATC=T&FMID="+lFormID.value+"&FT="+lType.value+"&QT="+lQuantity.value+"";
 
}

function AddToCartSearch(pID)
{
     lEvalForm = "hf_FormID_" +pID;
     lEvalFormType = "hf_FormType_" +pID;
     lEvalQty = "ddl_QuickAdd_"+pID;
     lFormID = document.getElementById(lEvalForm);
     lQuantity = document.getElementById(lEvalQty);
     lType = document.getElementById(lEvalFormType);
     window.location.href="Vendora_Search.aspx?ATC=T&FMID="+lFormID.value+"&FT="+lType.value+"&QT="+lQuantity.value+"";
 
}

function soh(id) 
{ 
	
	
    if (document.getElementById) 
    { // DOM3 = IE5, NS6
		
        if (document.getElementById(id).style.display == "none")
       {
          document.getElementById(id).style.display = 'block';
			
          //filter(("img"+id),'imgin');
		  if (	document.getElementById("label" + id) != null)
		  {
            document.getElementById("label" + id).innerHTML=" (Click for less)";
          }
		} 
       else 
       {
			
	        //filter(("img"+id),'imgout');
			
	        document.getElementById(id).style.display = 'none';
	        if (document.getElementById("label" + id) != null)
	        {
			    document.getElementById("label" + id).innerHTML=" (Click for more)";
			}
		}	
	
       } 
      else 
       { 
		
	if (document.layers) 
                {	
			
	    if (document.id.display == "none")
                    {
				
	        document.id.display = 'block';
				
	        //filter(("img"+id),'imgin');
			
                    } 
	    else 
                   {
				
	            //  filter(("img"+id),'imgout');	
				
	             document.id.display = 'none';
			
                    }
		
         } 
        else 
        {
			
	if (document.all.id.style.visibility == "none")
        {
				
	        document.all.id.style.display = 'block';
			
        } 
       else 
       {
				
           // filter(("img"+id),'imgout');
				
           document.all.id.style.display = 'none';
		}
		
     }
	
    }

}
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

