//
//  doProductSearch()
//
function doProductSearch()
{
	//
	//  Trim any leading and trailing whitespace from the textfields before submitting the form.
	//	
	var trimmedStr = trim(document.ProductSearch.PN.value);
	document.ProductSearch.PN.value = trimmedStr;
	var trimmedStr = trim(document.ProductSearch.D.value);
	document.ProductSearch.D.value = trimmedStr;
	var trimmedStr = trim(document.ProductSearch.FL.value);
	document.ProductSearch.FL.value = trimmedStr;
	var trimmedStr = trim(document.ProductSearch.FH.value);
	document.ProductSearch.FH.value = trimmedStr;
	var trimmedStr = trim(document.ProductSearch.DRL.value);
	document.ProductSearch.DRL.value = trimmedStr;
	var trimmedStr = trim(document.ProductSearch.DRH.value);
	document.ProductSearch.DRH.value = trimmedStr;
	
	//
	//  Make sure the user specified valid criteria.
	//
	if ((document.ProductSearch.FL.value != "" || document.ProductSearch.FH.value != "") && 
		(document.ProductSearch.DRL.value != "" || document.ProductSearch.DRH.value != "")) {
			alert("Data was entered in both Frequency and Data Rate Fields.  You may only specify the Frequency fields or the Data Rate fields, not both.");
			document.ProductSearch.FL.focus();
			return false;
	}
 	if ((document.ProductSearch.FL.value == "" && document.ProductSearch.FH.value != "")) {
	    alert("Please enter data in both the Low and High Frequency fields or only the Low Frequency Field.");
		document.ProductSearch.FL.focus();
		return false;
 	}
	if ((document.ProductSearch.DRL.value == "" && document.ProductSearch.DRH.value != "")) {
		alert("Please enter data in both the Low and High Data Rate fields or only the Low Data Rate Field.");
		document.ProductSearch.DRL.focus();
		return false;
	}
	
	/*if (document.ProductSearch.FL.value == "" && document.ProductSearch.FH.value == "" && 
	    document.ProductSearch.DRL.value == "" && document.ProductSearch.DRH.value == "" &&
		document.ProductSearch.PN.value == "" && document.ProductSearch.D.value == "" &&
		(document.ProductSearch.A.value == "7" || document.ProductSearch.A.value == "") && 
		(document.ProductSearch.PT.value == "8" || document.ProductSearch.PT.value == "")) {
	    	alert("Please enter Search Criteria.");
			document.ProductSearch.PN.focus();
			return false;
	}
	*/
	return true;
}

function iefixdropdowns(value)
{
	if (value=='hide')
	{
		$("#A").hide();
		$("#PT").hide();
		$("#FM").hide();
		$("#DRM").hide();
	}
	else
	{
		$("#A").show();
		$("#PT").show();
		$("#FM").show();
		$("#DRM").show();
	}
}
$(document).ready(function(){
	if ( $.browser.msie && $.browser.version < 7 )
	{
		//use our proudcts menu handler
        $("#useourproducts_menu").hover(function()
            {
                //hide all that might be open
            	$("#useourproducts_submenu").hide();
            	//show the selected one
                $("#useourproducts_submenu").slideDown(150);
				
				iefixdropdowns('hide');

            },
            function()
            {
	            //hide the menu
                $("#useourproducts_submenu").hide();
				iefixdropdowns('show');

            }
        );
		
		//add trigger to close when exiting container space
        $("#useourproducts_submenu").hover(
        	function()//mouseover
            {
                //show the selected one
                $("#useourproducts_submenu").show();
				iefixdropdowns('hide');
            },
            function () {//mouseout
            	$("#useourproducts_submenu").hide();
				iefixdropdowns('show');
            }
        );
	}
});