fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;

with(menuStyle=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=0;
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ddffdd";
oncolor="#000099";
padding=4;
pagebgcolor="#82B6D7";
pagecolor="black";
separatorcolor="#999999";
separatorsize=1;
subimage="";
subimagepadding=2;
}

with(menuStyleMainTop=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=0;
fontsize="14px";
fontweight="bold";
fontstyle="normal";
headerbgcolor="";
headercolor="";
offbgcolor="transparent";
offcolor="#FFFFFF";
onbgcolor="transparent";
oncolor="#e5b951";
padding=9;
pagebgcolor = "transparent";
pagecolor="#e5b951";
separatorcolor="#FFF";
separatorsize=1;
separatorheight=13;
subimage="";
subimagepadding=4;
}

with(menuStyleMainTopSub=new mm_style()){
bordercolor="#333";
borderstyle="solid";
borderwidth=1;
fontsize="12px";
fontweight="bold";
fontstyle="normal";
headerbgcolor="";
headercolor="";
offbgcolor="#749ccb";
offcolor="#FFFFFF";
onbgcolor="#5578a5";
oncolor="#e5b951";
padding=5;
pagebgcolor="#5578a5";
pagecolor="#e5b951";
separatorcolor="#333";
separatorsize=1;
subimage="";
subimagepadding=4;
rawcss="padding-left:5px;";
}

with(menuStyleSearch=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=0;
fontsize="14px";
fontstyle="normal";
headerbgcolor="";
headercolor="";
offbgcolor="transparent";
offcolor="#FFFFFF";
onbgcolor="transparent";
oncolor="#e5b951";
padding=9;
pagebgcolor="#82B6D7";
pagecolor="#e5b951";
separatorcolor="#FFF";
separatorsize=0;
subimage="";
subimagepadding=4;
}

with(menuStyleTerritories=new mm_style()){
bordercolor="transparent";
borderstyle="solid";
borderwidth=0;
fontsize="12px";
fontweight="bold";
fontstyle="normal";
headerbgcolor="";
headercolor="";
offbgcolor="transparent";
offcolor="transparent";
onbgcolor="transparent";
oncolor="transparent";
padding=0;
pagebgcolor="transparent";
pagecolor="transparent";
separatorcolor="transparent";
separatorsize=0;
subimagepadding=0;
}

with(menuStyleTerritoriesSub=new mm_style()){
bordercolor="#333";
borderstyle="solid";
borderwidth=1;
fontsize="12px";
fontweight="bold";
fontstyle="normal";
headerbgcolor="";
headercolor="";
offbgcolor="#749ccb";
offcolor="#FFFFFF";
onbgcolor="#5578a5";
oncolor="#e5b951";
padding=5;
pagebgcolor="#5578a5";
pagecolor="#e5b951";
separatorcolor="#333";
separatorsize=1;
subimage="";
subimagepadding=0;

}



with(milonic=new menuname("MegaMenuSearch")){
style=menuStyleSearch;
itemheight="105px";
itemwidth="285px";
left="offset=-176px";
top="offset=-9px";
aI("type=form;text=`<div id=\"megaMenuSearch\"><h1><img src=\"images/lbl_keywordsearch.gif\" width=\"194\" height=\"29\" alt=\"Keyword Search\" title=\"Keyword Search\" /></h1><p>Type a keyword below: <span id=\"alertMessage\" class=\"alert\"></span></p><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td class=\"leftCell\"><div id=\"cellContainer\"><div id=\"magGlass\"><img src=\"images/icon_magglass.png\" width=\"38\" height=\"40\" alt=\"\" title=\"\" /></div><input id=\"txtSearch\" type=\"text\" maxlength=\"255\" onKeyPress=\"return submitenter(this,event)\"/></div></td><td><input type=\"image\" src=\"images/btn_sitesearch.gif\" alt=\"GO\" title=\"GO\" onclick=\"validateSearchForm()\"/></td></tr></table></div></div>`;");
}

drawMenus();

function validateSearchForm() {	
	if (Trim(document.getElementById('txtSearch').value).length) {
		document.getElementById('alertMessage').innerHTML = '';
		parent.document.location='search.aspx?searchtext='+document.getElementById('txtSearch').value;
	} else {
		
		document.getElementById('alertMessage').innerHTML = 'Please enter keywords';
		document.getElementById('txtSearch').focus;
	}
}

//trims the field values of any extra spaces
function Trim(value) {
	var reLeadTrim = /^\s+/;
	var reTrailTrim = /\s+$/;
	value = value.replace(reLeadTrim, '');
	value = value.replace(reTrailTrim, '');
	return value;
}

function submitenter(myfield,e) {
	var keycode;
	if (window.event) { 
		keycode = window.event.keyCode;
	} else if (e) {
		keycode = e.which;
	} else { 
		return true;
	}

	if (keycode == 13) {
		return validateSearchForm();
	} else {
		return true;
	}
}
