function showHideGSearch(menu,vCount)
{
	for(i=1;i<=vCount;i++)
	{
		document.getElementById(menu+i).style.display='';
		document.getElementById(menu).style.display='none';
		document.getElementById("closeAll").style.display='';
	}
}
function showHideGSearch2(menu,vCount)
{
	for(i=1;i<=vCount;i++)
	{
		document.getElementById(menu+i).style.display='none';
		document.getElementById(menu).style.display='';
		document.getElementById("closeAll").style.display='none';
	}
}


function searchVal(theform)
{
	if ( (theform.searchtext.value<=0) && (theform.selCategory.value<=0) && (theform.partnum.value<=0))
	{
		alert("Please enter the search keyword or Select the category.");
		theform.searchtext.focus();
		return false;
	}


	if(isNaN(trim(theform.txtMin.value)))
	{
		alert("Search product min price should be numeric.");
		theform.txtMin.focus();
		return false;	
	}
	if(isNaN(trim(theform.txtMax.value)))
	{
		alert("Search product max price should be numeric.");
		theform.txtMax.focus();
		return false;	
	}
	if((theform.txtMin.value>0) && (theform.txtMax.value>0) )
	{
		if(parseInt(theform.txtMin.value) > parseInt(theform.txtMax.value))
		{
			alert("Search product max price should be greater than min price.");
			theform.txtMax.focus();
			return false;	
		}
	}
	return true;
}

function goSearch(mykeyCode){

if(mykeyCode == "13"){
	if(searchVal(document.search))
	{
		document.search.submit();
	}
}

}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,imgLarge=MM_preloadImages.arguments; for(i=0; i<imgLarge.length; i++)
    if (imgLarge[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=imgLarge[i];}}
}
