
//Set Browser varibles
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;

//////////////////////////////////////////////////////

	hovercolor   = "#CC0000";		// color name/code
	bgcolor      = "#2D009B";			// color name/code
	background   = "";		// picture url

	menu_border  = 1;			// IE only
	border_color = "#000000";	// IE only

	arrow_pic    = "/ezpayplus/corprate_website/images/arrowright.gif"; // url of arrow picture for submenus

	arrow = "<IMG SRC='"+arrow_pic+"' HEIGHT=8 BORDER=0 ALT=''>";

	var UpperSelected = 100;

//////////////////////////////////////////////////////

	//set to load in the body tag this calls the scrolling function for Netscape and initializes other needed stuff
	function init(maintop){

		myMainTop = (maintop)?(maintop):(35);

		//disable scrolling menu - checkIt();

		if(document.layers) { document.layers["menubar"].visibility = "visible"; }
		else { document.getElementById("menubar").style.visibility = "visible"; }

		if(document.layers) { document.layers["body"].top = myMainTop+"px"; }
		else { document.getElementById("body").style.top = myMainTop+"px"; }
	}

	//Used to scroll the menu on the page
	function checkIt(){
		if(document.layers){
			document.layers['menubar'].top = window.pageYOffset;
			if(layer) for(menu=0; menu<Layer.length; menu++) { if(Layer[menu]) { eval(layer).top = window.pageYOffset + Layer[menu].top; } }
			setTimeout('checkIt()',20);
		}
		else {
			document.getElementById("menubar").style.top = document.body.scrollTop;
			if(layer) for(menu=0; menu<Layer.length; menu++) { if(Layer[menu]) { eval(layer).top = document.body.scrollTop + Layer[menu].top; } }
		}
	}

//////////////////////////////////////////////////////

No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;
layer = (document.layers && No3) ? "document.layers['L'+menu]" : "document.getElementById('L'+menu).style";
var timer;

//Used to hide the select tags in IE
var goSelectTag=new Array();
function fToggleTags() {
	if(document.all){
		with(document.all.tags("SELECT")) {
			for(i=0; i<length; i++){
				item(i).style.visibility="hidden";
				goSelectTag[goSelectTag.length]=item(i);
			}
		}
	}
}

function Show(){
	if(layer) {
		if(timer) clearTimeout(timer);
		for(menu=0; menu<Layer.length; menu++) { if(Layer[menu]) { eval(layer).visibility = "hidden"; } }
		for(i=0; i<arguments.length; i++) { menu=arguments[i]; eval(layer).visibility = "visible"; }
	}
	//Added to hide the selection inputs of forms
	if( arguments.length ){
		fToggleTags();
	}
	else {
	  for(var i in goSelectTag) goSelectTag[i].style.visibility="visible";
	  goSelectTag.length=0;
	}
}
function Hide() {
	timer = setTimeout("Show()", 500);
}

//////////////////////////////////////////////////////

	function LayerSpecs(Left,Top) {
		if(No3) {
			this.left  = Left;
			this.top   = Top;
			this.info  = "";
			T=0;
			for(i=2; i<arguments.length; i++) {
				if(document.layers) { this.info += "<LAYER onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\""+bgcolor+"\"' WIDTH="+Width+" POSITION=RELATIVE TOP="+T+">&nbsp;"+arguments[i]+"</LAYER>"; }
				else { this.info += "<TR><TD NOWRAP class='lmenu' onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\"\"'>"+arguments[i]+"</TD></TR>"; }
				T+=20;
			}
		}
	}

	function MenuItem2(Title,Width,SubID, LinkURL, LinkTarget){
		this.title = (Title)?Title:null;
		this.width = (Width)?Width:null;
		this.subid = (SubID)?SubID:0;
		this.url = (LinkURL)?LinkURL:'#';
		this.target = (LinkTarget)?LinkTarget:'_self';
	}

	//Display the lower menu bar
	function draw_menubar(){

		document.write( "<span id='menubar' style='position: absolute; left: 0; top: -1; visibility: hidden; z-index: 1000;'>" );
		document.write( "<table class='lmenu' cellpadding=2 cellspacing=0 width='100%'><tr>" );

		itemWidths = 0
		for(i=0;i<lowMenuItems.length;i++){

			document.write( "<td nowrap class='lmenu' width='"+( lowMenuItems[i].width - 5 )+"' onMouseOver=\"this.bgColor='"+hovercolor+"';\" onMouseOut=\"this.bgColor='"+bgcolor+"';\">" );
			document.write( "&nbsp;" );

			if( lowMenuItems[i].subid )
				document.write( "<a href='#' onClick='return false;' onMouseOver='Show("+lowMenuItems[i].subid+")' onMouseOut='Hide("+lowMenuItems[i].subid+")' class='lmenu'>" );
			else
				document.write( "<a href='"+lowMenuItems[i].url+"' target='"+lowMenuItems[i].target+"' class='lmenu'>" );

			document.write( lowMenuItems[i].title );
			document.write( "</a>" );
			document.write( "</td>" );
			itemWidths += lowMenuItems[i].width;
		}
		table_width_total = (ie) ? document.body.offsetWidth : window.innerWidth;

		document.write( "<td class='lmenu' width='"+( table_width_total - itemWidths )+"'>&nbsp;</td>" );
		document.write( "</tr></table>" );
		document.write( "</span>" );
	}



//////////////////////////////////////////////

	var Layer = new Array();

	var lowMenuItems = new Array();

	lowMenuItems[lowMenuItems.length] = new MenuItem2( 'Start', 75, 0, '../default.asp', '_top' );

	lowMenuItems[lowMenuItems.length] = new MenuItem2( 'Features', 100, 1);

	Layer[1] =	new LayerSpecs(76,22,
	'<A CLASS="lmenu" HREF="/corp_website2/onlinetimeentry.asp" onMouseOver="Show(1)" TARGET="_self">- Time Entry </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/datawarehouse.asp" onMouseOver="Show(1)" TARGET="_self">- Data access </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/docs/CertifiedPayrollFlowSheet.pdf" onMouseOver="Show(1)" TARGET="_blank">- Certified Payroll </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/docs/EmployeeOnBoard.pdf" onMouseOver="Show(1)" TARGET="_blank">- Employee Onboarding </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/security.asp" onMouseOver="Show(1)" TARGET="_self">- Security </A>');

	lowMenuItems[lowMenuItems.length] = new MenuItem2( 'Product Demos', 125, 2);

	RunningDemoSite = 'https://www.ezpayplus.com/ezpayplus/default.asp';		/* '/corp_website2/running_demo.asp'; */
	WindowName = 'demo';
	WindowSetup = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=800,height=600';

	Layer[2] =	new LayerSpecs(176,22,
	'<A CLASS="lmenu" HREF="#" onClick="window.open(RunningDemoSite,WindowName,WindowSetup);return false;" onMouseOver="Show(2)" TARGET="_self">- Demo </A>' +arrow,
	'<A CLASS="lmenu" HREF="/corp_website2/with_representative.asp" onMouseOver="Show(2)" TARGET="_self">- Contact a Representative </A>' );

	EmployeeDemoSite = 'https://www.ezpayplus.com/dazzler/employee/index.htm';
	EmployerDemoSite = 'https://www.ezpayplus.com/dazzler/employer/index.htm';
	PEODemoSite = 'https://www.ezpayplus.com/dazzler/PEO/index.htm';

	Layer[3] =	new LayerSpecs(296,27,
	'<A CLASS="lmenu" HREF="#" onClick="window.open(EmployeeDemoSite,WindowName,WindowSetup);return false;" onMouseOver="Show(2,3)" TARGET="_self">- As an employee </A>' ,
	'<A CLASS="lmenu" HREF="#" onClick="window.open(EmployerDemoSite,WindowName,WindowSetup);return false;" onMouseOver="Show(2,3)" TARGET="_self">- As an employer </A>' ,
	//'<A CLASS="lmenu" HREF="#" onMouseOver="Show(2,3)" TARGET="_self">- As multi-client </A>' ,
	'<A CLASS="lmenu" HREF="#" onClick="window.open(PEODemoSite,WindowName,WindowSetup);return false;" onMouseOver="Show(2,3)" TARGET="_self">- As PEO </A>'  );
	//'<A CLASS="lmenu" HREF="#" onMouseOver="Show(2,3)" TARGET="_self">- Time Entry </A>' );

	lowMenuItems[lowMenuItems.length] = new MenuItem2( 'FAQ', 75, 0, '/corp_website2/faq/index.html', '_faq' );

	lowMenuItems[lowMenuItems.length] = new MenuItem2( 'Documentation', 125, 4);

	Layer[4] =	new LayerSpecs(376,22,
	'<A CLASS="lmenu" HREF="#" onMouseOver="Show(4,5)" TARGET="_self">- PEO Users Manual </A>' +arrow,
	'<A CLASS="lmenu" HREF="#" onMouseOver="Show(4,6)" TARGET="_self">- PEO Client Guides</A>' +arrow,
	'<A CLASS="lmenu" HREF="#" onMouseOver="Show(4,8)" TARGET="_self">- Time Entry </A>' +arrow);

	Layer[5] =	new LayerSpecs(510,27,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_users_manual_complete.asp" onMouseOver="Show(4,5)" TARGET="_self">- Complete Manual </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_users_manual_chapter1.asp" onMouseOver="Show(4,5)" TARGET="_self">- PEO Utilities </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_users_manual_chapter2.asp" onMouseOver="Show(4,5)" TARGET="_self">- Client Utilities </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_users_manual_chapter3.asp" onMouseOver="Show(4,5)" TARGET="_self">- Worksite Employee Access </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_users_manual_chapter4.asp" onMouseOver="Show(4,5)" TARGET="_self">- Payroll Processing Online </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_users_manual_chapter5.asp" onMouseOver="Show(4,5)" TARGET="_self">- Implementation </A>' );

	Layer[6] =	new LayerSpecs(510,45,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_client_guides_employee.asp" onMouseOver="Show(4,6)" TARGET="_self">- Worksite Employee </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_client_guides_client.asp" onMouseOver="Show(4,6)" TARGET="_self">- Client Company </A>' ,
	'<A CLASS="lmenu" HREF="/corp_website2/peo_client_guides_staff.asp" onMouseOver="Show(4,6)" TARGET="_self">- PEO Staff </A>',
	'<A CLASS="lmenu" HREF="/corp_website2/peo_client_guides_quick.asp" onMouseOver="Show(4,6)" TARGET="_self">- Quick Start </A>');

	Layer[7] =	new LayerSpecs(510,63,
	'<A CLASS="lmenu" HREF="/corp_website2/marketing_genericmaterials.asp" onMouseOver="Show(4,7)" TARGET="_self">- Generic Materials </A>' );

	Layer[8] =	new LayerSpecs(510,63,
	'<A CLASS="lmenu" HREF="/download.asp?file=/corp_website2/docs/NewTimeEntry/NewTimeEntry training for PEO.doc" onMouseOver="Show(4,8)" TARGET="_self">- PEO </A>' ,
	'<A CLASS="lmenu" HREF="/download.asp?file=/corp_website2/docs/NewTimeEntry/ezPayPlus New 2004 Time Entry for Client.doc" onMouseOver="Show(4,8)" TARGET="_self">- Client </A>' ,
	'<A CLASS="lmenu" HREF="/download.asp?file=/corp_website2/docs/NewTimeEntry/Rollout plan for ezPayPlus upgrade for PEO.doc" onMouseOver="Show(4,8)" TARGET="_self">- Rollout </A>' );

	lowMenuItems[lowMenuItems.length] = new MenuItem2( 'Contact', 75, 0, '/corp_website2/contact.asp', '_self' );

	/*	Create Your Lower Menu Item layers below by typing:
		 Layer[incrementing number] = new LayerSpecs(Left Position, Top Position, Width, List of Links Seperated by Commas)
		 If a layer has a sublayer, add onMouseOver="Show(Layer Number to Open, Current Layer, Any Layers Opened before the current layer (seperated by commas)
	*/

////////////////////////////////////////////////////////////////

	j = (Layer[0]) ? 0:1;

	for(i=j; i<Layer.length; i++) {
		if(document.layers && No3) { document.write("<LAYER onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' POSITION=ABSOLUTE VISIBILITY=HIDDEN BGCOLOR='"+bgcolor+"' BACKGROUND='"+background+"' TOP="+Layer[i].top+" LEFT="+Layer[i].left+">"+Layer[i].info+"</LAYER>"); }
		else { document.write("<SPAN onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' STYLE='position:absolute; visibility:hidden; background:"+background+"; top:"+Layer[i].top+"; left:"+Layer[i].left+"; z-index: 2000;'><TABLE class='lmenu_item' cellpadding=2 cellspacing=0>"+Layer[i].info+"</TABLE></SPAN>"); }
	}

	//Accually draw the lower menu bar
	draw_menubar();

	//For IE set the scroll event
	//if(document.all) window.onscroll=checkIt;

////////////////////////////////////////////////////////////////
