var ff_company = new Array(
["/ourcompany.html","About EDCO"],
["/employees.aspx","Employee Pictures"],
["/employment.html","Employment"],
["/facility/index.html","Facility"],
["/cameras.html","Showroom Live Cams"],
["/blog.php","Edco's Blog"]
);

var ff_customers = new Array(
["/artrequirements.html","Art Requirements"],							 
["/completionnotice.html","Completion Notice"],
["/custom/index.html","Custom Design Services"],
["/samples.html","Inscription Guide"],
["/productiontime.html","Production Time"],
["/shipping.html","Shipping"]
);

var ff_help = new Array(

);

var tt = new Array(
['','',''],
['Company','company','company'],
['Customer Service','customers','customers'],
['Help','help','help']
);



var dd_ns4 = (document.layers) ? 1 : 0;
var dd_ie4 = (document.all) ? 1 : 0;
var dd_dom = ((document.getElementById) && (!dd_ie4)) ? 1 : 0; // ns6
var isOver = false;
var timer = null;
var cmTop = 0;
var cmLeft = 0;

// dd_ns4 redraw on resize
if (dd_ns4) {
        origWidth = innerWidth;
        origHeight = innerHeight;
}

function reDo() {
        if (innerWidth != origWidth || innerHeight != origHeight) {location.reload();}
}

if (dd_ns4) onresize = reDo;
if (dd_dom) onload = InitObj;


document.write("<div id=\"gnddhome\"></div>");
	
//build dropdowns
for ( i = 1 ; i < tt.length ; i++ ) {  // runs it threw the loop
	var ff = eval("ff_" + tt[i][1]);       // runs threw and sets the ff_ array # and the first variable in the array.	
	var divNum = "gndd" + tt[i][2];        // runs threw and sets the ff_ array # and the Second variable in the array.	
	var strDiv = "<div class=\"cm\" id=\"" + divNum + "\" onMouseOver=\"OverLayer();\" onMouseOut=\"OutLayer('"+ divNum + "');\">";
	strDiv = strDiv + "<table cellspacing=1 cellpadding=1 bgcolor=Black width=225 border=0><tr valign=top><td nowrap class=cmLff width=225>";	
	for ( j = 0 ; j < ff.length ; j++ ) {   // runs it threw the loop
		var linkString = new String(ff[j][0]);  // Url String going threw the loop starting at 0 
		if (linkString.indexOf('http:') == -1) ff[j][0] = "" + ff[j][0];		//******
		strDiv = strDiv + "&nbsp\;&nbsp\;&nbsp\;&#183\;&nbsp\;<a  href='" + ff[j][0] + "'>" + ff[j][1] + "</a><br>"; // writes out the actual links.
	}
	strDiv = strDiv + "<br></td></tr></table></div>\n";    // makes the ending of the table.
	document.write(strDiv);  // tells it to write it.
}
//End of dropdowns






function InitObj() {
	for (i = 1; i < tt.length; i++) { 
		whichEl = "gndd" + tt[i][2];
		if (dd_dom) {
			whichEl = document.getElementById(whichEl);
		}
		else {	
			whichEl = (dd_ns4) ? document.layers[whichEl] : document.all[whichEl].style;
		} 
		whichEl.onmouseover = OverLayer;
		whichEl.onmouseout = OutLayer;
	}


}
InitObj();



function ShowLayer(showEl,event) {
	if (showEl == "gnddhome") return;
	clearTimeout(timer);
	HideAllLayers();
	
	if (dd_dom) {
		var whichEl = document.getElementById(showEl);
	

	}
	else {	
		var whichEl = (dd_ns4) ? document.layers[showEl] : document.all[showEl].style;
	
	}
	
	
//POSITIONING OF DIVS	
	whichAnchor = showEl + "A";      //this area set the div into position.  showEl is the name ex. gnddnfl + A =  gnddnflA
	if (dd_ie4) {										// if you are IE the do this
		if (document.all[whichAnchor]){    // is whichAnchor, which is showEl at the point of show 
			cmTop = findy(document.all[whichAnchor]) + 20;   //then go ahead and set it 20 from top 
			cmLeft = findx(document.all[whichAnchor]) - 20;   
			 

		}
	}
	if (dd_ns4) {
		if (document.anchors[whichAnchor]) {
			cmTop = document.anchors[whichAnchor].y + 20;
			cmLeft = document.anchors[whichAnchor].x - 20;
		}
	}
	if (dd_dom){
		if (document.anchors[whichAnchor]){
			var myObject = document.anchors[whichAnchor];
			while (myObject.offsetParent) {
				cmTop  = cmTop  + myObject.offsetTop;
				cmLeft = cmLeft + myObject.offsetLeft;
				myObject = myObject.offsetParent
			}
		}
	}
	
	
	if (dd_dom) {
		whichEl.style.visibility = "visible";
		whichEl.style.top = cmTop + 20;
                if (showEl != 'gnddmore' && showEl) {
                        if (cmLeft > 640) cmLeft = 592;
                }
		whichEl.style.left = cmLeft;		
	}
	
	else {	
		whichEl.visibility = "visible";
		whichEl.top = cmTop;
                if (showEl != 'gnddmore' && showEl) {
                        if (cmLeft > 640) cmLeft = 592;
                }
		whichEl.left = cmLeft;
	} 	
	cmTop = 0; cmLeft = 0;
}



function findy(item) {
	if (item.offsetParent) {
		return item.offsetTop + findy(item.offsetParent);
	}
	else {
		return item.offsetTop;
	}
}

function findx(item) {
	if (item.offsetParent) {
		return item.offsetLeft + findx(item.offsetParent);
	}
	else {
		return item.offsetLeft;
	}
}

//End of POSITIONING




function HideAllLayers() {
	if (dd_dom) {
		var divTemp = document.getElementsByTagName('div');
		for (i = 0; i < divTemp.length; i++) { 
			var divString = new String(divTemp[i].id);
			if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
		}
	}	
	if (dd_ie4) {
		var divTemp = document.all.tags("div");
		for (i = 0; i < divTemp.length; i++) { 
			var divString = new String(divTemp[i].id);
			if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
			
		}
	}
	if (dd_ns4) {
		for (i = 0; i < document.layers.length; i++) { 
			var divString = new String(document.layers[i].name);
			if (divString.indexOf('gndd') != -1) document.layers[i].visibility = "hidden";
		}
	}
}

function OverLayer() { clearTimeout(timer); isOver = true; }

function OutLayer() {  // so  when the mouse is off the SPOT, then set time out make variable isOver set False and set time to execute 
clearTimeout(timer);   //function HideAllLayers  in 300 microseconds.
	isOver = false; 
	timer = setTimeout("HideAllLayers()",300);
}


