var id_list = new Array();
var on_drop_down = '';
var x_offset = 0;
var y_offset = 0;
var url = "";

function w(i) { document.writeln(i); }

function redir(i)
{
	//var k = location.href;
	if (i.indexOf("http://") < 0 || i.indexOf("https://") < 0) { window.open(i, "_self"); }
	else { location.href=i; }
}

function show(i){ document.getElementById(i).style.display='block'; }

function hide(i){ document.getElementById(i).style.display='none'; }

function set_on_dd(i, t)
{
	on_drop_down = t;
	i.onmouseout = function() { on_drop_down = ''; }
}

function ch_class(i, str)
{
	var oclass = i.className;
	i.className = str;
	i.onmouseout = function() { i.className = oclass; }
}

function pos(obj, dir)
{
	var i = 0;
	if(obj.offsetParent)
	{
		while(obj.offsetParent)
		{
			if(dir == "x") { i += obj.offsetLeft; }
			else if(dir == "y") { i += obj.offsetTop; }
			obj = obj.offsetParent;
		}
	}
	else if(dir == "x") { if(obj.x) { i += obj.x; } }
	else if(dir == "y") { if(obj.y) { i += obj.y; } }
	return i;
}

function drop_down(pd, id, i)
{
	var x = document.getElementById(id);
	
	if(pd == 1)
	{
		show(id);
		x.style.top = pos(i, 'y') + y_offset;
		x.style.left = pos(i, 'x') + x_offset;
		setTimeout("drop_down(0,'" + id + "')", 1000);
		for(var z = 0; z < id_list.length; z++) { var t = 'nav' + z; if(t != id) { hide(t); } }
	}
	else
	{
		if(on_drop_down == "") { hide(id); }
		else { setTimeout("drop_down(0,'" + on_drop_down + "')", 1000); }
	}
}

function build_dd()
{
	w('<table border="0" cellpadding="0" cellspacing="0"><tr>');
	
	for(var z = 0; z < id_list.length; z++)
	{
		var x = id_list[z].split(/,/);
		var sublist = (x.length / 2)-1;
		
		w('<td style="padding: 0px 10px 0px 10px;">');
		w('<span onmouseover="drop_down(1,\'nav'+z+'\',this); set_on_dd(this,\'nav'+z+'\');" class="navbar_main_menu">');
		w('<a href="'+x[1]+'" onmouseover="ch_class(this,\'anav_active\');" class="anav">'+x[0].replace(/ /gi, "&nbsp;")+'</a>');
		w('</span>');
		w('<div id="nav'+z+'" style="display:none;position:absolute;">');
		w('<table onmouseover="set_on_dd(this,\'nav'+z+'\');" width="100" class="navbar_dd_table">');
		
		for(var p = 0; p < sublist; p++)
		{
			w('<tr>');
			w('<td class="navbar_dd" onmouseover="ch_class(this,\'navbar_dd_active\');" onclick="redir(\''+x[(p*2)+3]+'\');">');
			w(x[(p*2) + 2].replace(/ /gi, "&nbsp;"));
			w('</td>');
			w('</tr>');
		}

		w('</table></div></td>');
	
		if(z < id_list.length - 1)
		{
			w('<td class="navbar_main_menu">|</td>');
		}
	}
	
	w('</tr></table>');
}

x_offset = -12;
y_offset = 19;
url = "65.36.163.97";
id_list[0] = "Home,http://www.sachsconsulting.com/index.html";
id_list[1] = "Company,http://www.sachsconsulting.com/company.htm";
id_list[2] = "Products,http://www.sachsconsulting.com/products.htm,  Overview,http://www.sachsconsulting.com/products.htm,  Anti-Fraud Hotline,http://www.sachsconsulting.com/antifraud.htm,  Intrusion Prevention,http://www.sachsconsulting.com/intrusion_prevention.htm,  RightFax Solutions,http://www.sachsconsulting.com/rightfax.htm,  SurfControl Web Filtering,http://www.sachsconsulting.com/surfcontrol.htm,  Trend Virus Protection,http://www.sachsconsulting.com/trendmicro.htm,  Vaultwest Data Storage,http://www.sachsconsulting.com/vaultwest.htm,  Vulnerability Management  , http://www.sachsconsulting.com/vulnerability.htm,  Patch Management, http://www.sachsconsulting.com/shavlik.htm,  Document Imaging,DocumentImaging.htm,  Email Encryption, http://www.sachsconsulting.com/zixmail.html,  Secure Endpoints, http://www.sachsconsulting.com/safend.html,  Continuous Backup, http://www.sachsconsulting.com/neverfail.html  ";
id_list[3] = "Clients,http://www.sachsconsulting.com/clients.htm,  Overview,http://www.sachsconsulting.com/clients.htm,  Testimonials,http://www.sachsconsulting.com/testimonial1.htm";
id_list[4] = "Outsource your CIO,http://www.sachsconsulting.com/outsource_cio_cto.htm";
id_list[5] = "News,http://www.sachsconsulting.com/news.htm";
id_list[6] = "What We Do,http://www.sachsconsulting.com/what_we_do.htm,  Overview,http://www.sachsconsulting.com/what_we_do.htm,  Banking Services  ,http://www.sachsconsulting.com/banking_services.htm";
id_list[7] = "Contact Us,http://www.sachsconsulting.com/contact.htm,  Overview,http://www.sachsconsulting.com/contact.htm,  Request Info  ,http://www.sachsconsulting.com/request_more_info.asp";
//id_list[8] = "Logins, #, ACH IRD, http://www.sachsconsulting.com/ACHLogin.htm, Help Desk,https://www.sachsconsulting.com/HelpDesk/Default.aspx";
//id_list[8] = "Logins, #,Help Desk,https://www.sachsconsulting.com/HelpDesk/Default.aspx";
//id_list[8] = "Help Desk,https://www.sachsconsulting.com/HelpDesk/Default.aspx";
build_dd();

