function CHHideMenu()
{
	count=document.LANSA.CHPRCTCNT.value;
	for(i=1;i<=count;i++)
	{
   if(document.getElementById('Submenu_'+i) != null)
   {
          document.getElementById('Submenu_'+i).style.display="none";
   }
	}
}
function CHHandleMenu(parm)
{

    CHHideMenu();        
    document.getElementById('Submenu_'+parm).style.display="block";
  //documment.getElementById('testdiv').style.display="none";
}

function CHshowvideo()
{
    documment.getElementById('testdiv').style.display="block";

 }
function CHPCategoryDetails(catid)
{
   document.LANSA.W01CATID.value=catid;
   document.LANSA.CHPRBFLAG.value='M';
   HandleEvent('CHPCATLST','WR_CATLST');
}
function CHPSubcategoryDetails(catid)
{
document.LANSA.W01CATID.value=catid;
document.LANSA.CHPRBFLAG.value='M';
HandleEvent('CHPPRDLST','WR_PRDLST');
}

function CHPCAZIPValidate(str)
{
 if(str.length>7)
 {
   return false;
 }
 else
 {
  var patt1=/[A-z][0-9][A-z][ ][0-9][A-z][0-9]{1}/g;
  if(patt1.test(str)==true)
  {
     return true;
  }
  else
  {
    return false;
  }
 }
}

function CHPUSZIPValidate(str)
{
 if(str.length>10)
 {
   return false
 }
 else
 {
  var patt1=/[0-9]{5}[-][0-9]{4}/g;
  if(patt1.test(str)==true)
  {
     return true;
  }
  else
  {
    var patt1=/[0-9]{5}/g;
  if((patt1.test(str)==true) && (str.length == 5))
  {
     return true;
  }
   else
    {
    return false;
    }
  }
 }
}

function CHPBreadcrumbNav(selval,url)
{
   document.LANSA.CHPRSELNO.value=selval;
   document.LANSA.CHPRBFLAG.value='B'
   document.LANSA.W01FLGFLD.value=' ';
   HandleEventUrl(url);
}

function CHPLeftMenuNav(url)
{
   document.LANSA.W01FLGFLD.value=' ';
   document.LANSA.CHPRBFLAG.value='L'
 HandleEventUrl(url);
}
function CHPHowtoNav(url)
{
   document.LANSA.W01FLGFLD.value=' ';
   document.LANSA.CHPRBFLAG.value='M'
 HandleEventUrl(url);
}
function HandleEventUrl(url, techServ, actionRequest, partition,
language, optForm, optTarget, optProtocol, optSessionKey, optDebugMode)
{
 if( optForm == null )
 {
  optForm= document.LANSA;
 }
 var prevAction = optForm.action;
  var prevTarget = optForm.target;
  var action=url;
  optForm.action = action;
   optForm.target = (optTarget) ? optTarget : "";
   optForm.submit();
   optForm.target = prevTarget;
   optForm.action = prevAction;
 }

function CHPPriceValidate(str)
{
  if(str != '')
  {
  var patt=/^[+]?[0-9]*$/g;
  if(patt.test(str) == true)
  {
    alert(str+'test1');
     return true;
  }
  else
  {
   alert(str+'test2');
    return false;
 }
}
}
 function CHPCheckDec(stext,id)
 {
  var re = /^[0-9]*$/;
  if (!re.test(stext))
             {stext=stext.replace(/[^0-9]/g,"");
             document.getElementById(id).value=stext;
  }
 }
function CHPCallSignUp(url)
{
   elementValue = document.LANSA.S01SUBEML.value;
   if((elementValue == '') || (elementValue == 'Enter email address'))
   {
      alert('Please enter email address');
      document.LANSA.S01SUBEML.focus();
      return;
   }
   //var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
   var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]+$/;
   if(emailPattern.test(elementValue) == true)
   {
   // HandleEvent('CHPSGBCW','WR_SGBCW');
    CHPAjaxExec();
   }
   else
   {
      alert('Please enter a valid email address');
      document.LANSA.S01SUBEML.focus();
      return;
   }
 }




