// shows the drop down menu 

function showDDNav(){
	args = showDDNav.arguments;
	if(br=="N"){
		var args, theObj;
		args = showDDNav.arguments;
		theObj = eval(args[1]);
  		if (theObj) if(theObj.visibility=='hide'){theObj.visibility = 'show';}
	}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if (theObj) if(theObj.style.visibility=='hidden'){hideElement('SELECT');theObj.style.visibility = 'visible'}
		}
	else{return}
}


// hides the drop down menu 

function hideDDNav(){
	args = hideDDNav.arguments;
	if(br=="N"){
		var args, theObj;
		args = hideDDNav.arguments;
		theObj = eval(args[1]);
		if (theObj) if(theObj.visibility=='show'){theObj.visibility = 'hide';}
	}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if (theObj) if(theObj.style.visibility=='visible'){showElement('SELECT');theObj.style.visibility = 'hidden'}
		}
	else{return}
}


// hides drop down menu when menu is active

function hideDiv(){
	args = hideDiv.arguments;
	if(br=="N"){}
	else if(br=="IE"){
		theObj=eval(args[0]);
		// calculate active size of menu
		leftDiv=theObj.offsetLeft +2
		rightDiv=theObj.offsetLeft + theObj.clientWidth -2
		topDiv=theObj.offsetTop +2
		bottomDiv=theObj.offsetTop + theObj.clientHeight -2
		if(window.event.clientY > bottomDiv || 
			window.event.clientY < topDiv || 
			window.event.clientX < leftDiv || 
			window.event.clientX > rightDiv)
			{theObj.style.visibility = 'hidden';showElement('SELECT');}				
		}
	else{return}
}


// highlight menuitem

function divOver(){
	args = divOver.arguments;
	if(br=="N"){}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if(theObj.style.backgroundColor="#F6C682"){
			theObj.style.backgroundColor="#F6C682";
		}
	}
	else{return}
}

// highlight off menuitem

function divOut(){
	args = divOut.arguments;
	if(br=="N"){}
	else if(br=="IE"){
	theObj=eval(args[0]);
		if(theObj.style.backgroundColor="#004474"){
			theObj.style.backgroundColor="#400000";
		}
	}
	else{return}
}


// highlight on menuitem in netscape

function menuOver(){
	var args, theMenu;
	args = menuOver.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor="#004474" 
}


// highlight off menuitem in netscape

function menuOut(){
	var args, theMenu;
	args = menuOut.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor="#400000" 
}

// goes to specified url

function gotoUrl(){
	args = gotoUrl.arguments;
	location.href=args[0]
}


// hides specified tag

function hideElement(HTMLtag)
{
	for (i = 20; i < document.all.tags(HTMLtag).length; i++)
	{
		obj = document.all.tags(HTMLtag)[i];
		obj.style.visibility = "hidden";
	}
}


// shows specified tag

function showElement(HTMLtag)
{
	for (i = 1; i < document.all.tags(HTMLtag).length; i++)
	{
		obj = document.all.tags(HTMLtag)[i];
		obj.style.visibility = "visible";
	}
}


// build the divs for IE

var tdID = 0
function doDiv(){
	args = doDiv.arguments;
	var divID = args[0];
	var x = args[1];
	var divLeft = args[2];
	var arrowPos = args[3];
	var divTop = args[4];
	
	objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; left:"+ divLeft +"px; top:"+ divTop +"px; width:170px; z-index:300; background-color:#F6C682; visibility:hidden; padding-left:2;\" onMouseover=\"showDDNav('document.all[\\'"+ divID +"\\']')\"  onMouseout=\"hideDiv('document.all[\\'" + divID + "\\']')\">"
	objDiv += "<div id=\"arrow\" style=\"position:relative; background-color:#F6C682; width:170px;\"><img src=images/navspace.gif width=2 height=2 align="+ arrowPos +"></div>"
	
	for (y = 0; y < 14; y++){
	    if(menuData[x][y][0]!=null){
		objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:#400000; width:170px;\" onMouseover=\"divOver('document.all[\\'x" + tdID + "\\']')\" onMouseout=\"divOut('document.all[\\'x" + tdID + "\\']')\"><span class=\"nav\" onClick=\"gotoUrl('"+menuData[x][y][1]+"')\">"+ menuData[x][y][0] +"&nbsp;</span></div>"
		tdID = tdID +1
		}
	}
	
	objDiv +="<div id=\"line\" style=\"position:relative; background-color:#400000; width:170px; height:2px;\"><img src=images/navbar2.gif width=172 height=2></div></div>"
	
	document.write(objDiv);
}


// build the layers for netscape

function doLayer(){
	args = doLayer.arguments;
	var nestLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerLeft = args[2];
	var layerTop = args[4];

	if(navigator.platform.indexOf("Win") < 0){layerInc=15;layerStyle="navMenu";}
	else{layerInc=22;layerStyle="navMenu";}	
		
	objDiv = "<layer id=\""+ layerID +"\" Z-INDEX=100 BGCOLOR=\"#400000\" width=170 LEFT="+ layerLeft +" TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showDDNav('','document.layers[\\'"+ layerID +"\\']')\" onmouseout=\"hideDDNav('','document.layers[\\'"+ layerID +"\\']')\">"
	objDiv +="<layer id=\"line\" BGCOLOR=\"#400000\" width=170 HEIGHT=4 Z-INDEX=700><center><img src=images/navbar.gif width=172 height=2></center></layer>"
	
	var nestTop=3
		for (y = 0; y < 14; y++){
		    if(menuData[x][y][0]!=null){
			
	objDiv += "<layer id=\"x"+nestLayerID+"\" CLIP=\"2,0,147,22\" class=\""+ layerStyle +"\" Z-INDEX=700 BGCOLOR=\"#F6C682\" HEIGHT=21 width=170 TOP="+ nestTop +" onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\"><a id=navstyle href=javascript:gotoUrl('"+menuData[x][y][1]+"')><font color=#FFFFFF>"+ menuData[x][y][0]
	objDiv +="</font></a></layer>"		

	nestLayerID=nestLayerID+1
	nestTop=nestTop+layerInc
	objDiv +="<layer id=\"line2\" BGCOLOR=\"#400000\" width=170 HEIGHT=5 Z-INDEX=700 TOP="+ nestTop +"><center><img src=images/navbar.gif width=172 height=2></center></layer>"
	nestTop=nestTop+2
			}
		}
	objDiv +="<layer id=\"lineEnd\" BGCOLOR=\"#400000\" width=170 HEIGHT=4 Z-INDEX=700 TOP="+ nestTop +"></layer></layer>"

	document.write(objDiv)
}


//=====================================================
// THIS BELOW IS THE SECTION THAT SHOWS UP AS DROWDOWN
// THIS SECTION COULD BE COPIED DIRECTLY INTO THE PAGE
// BY ROGEE ROGERS - May 18, 2003
//=====================================================

// SET BROWSERS
var br
if(navigator.appName == 'Netscape' && document.layers != null){br="N";}
else if(navigator.appName == 'Microsoft Internet Explorer' && document.all != null){br="IE";}
else{br=null}

// DECLARE ARRAYS
menuData = new Array()
for (i=0; i < 8; i++) {
	menuData[i] = new Array(40)
	for (j=0; j < 14; j++) {
		menuData[i][j] = new Array(2)
	}
}

// SECTION01 - HOME
menuData[0][0][0]="&nbsp;&nbsp;&raquo; Home Page";
menuData[0][0][1]="index.php";
menuData[0][1][0]="&nbsp;&nbsp;&raquo; Contact Us";
menuData[0][1][1]="about.contact.php";
menuData[0][2][0]="&nbsp;&nbsp;&raquo; Copyright";
menuData[0][2][1]="about.copyright.php";
menuData[0][3][0]="&nbsp;&nbsp;&raquo; Privacy";
menuData[0][3][1]="about.privacy.php";
menuData[0][4][0]="&nbsp;";
menuData[0][4][1]="javascript:void();";
menuData[0][5][0]="&nbsp;&nbsp;&raquo; Coupon Center";
menuData[0][5][1]="coupons.php";
menuData[0][6][0]="&nbsp;&nbsp;&raquo; Advertisements";
menuData[0][6][1]="ads.php";
menuData[0][7][0]="&nbsp;&nbsp;&raquo; TV Commercials";
menuData[0][7][1]="commercials.php";

// SECTION02 - NEW VEHICLES
menuData[1][0][0]="&nbsp;&nbsp;&raquo; New Vehicles";
menuData[1][0][1]="new.vehicles.php";
menuData[1][1][0]="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Chevrolet";
menuData[1][1][1]="new.chevrolet.php";
menuData[1][2][0]="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cadillac";
menuData[1][2][1]="new.cadillac.php";
menuData[1][5][0]="&nbsp;&nbsp;&raquo; Get a Quick Quote";
menuData[1][5][1]="new.quickquote.php";
menuData[1][6][0]="&nbsp;&nbsp;&raquo; Schedule Test Drive";
menuData[1][6][1]="new.testdrive.php";
menuData[1][7][0]="&nbsp;&nbsp;&raquo; <B>Inventory SEARCH</B>";
menuData[1][7][1]="new.inventory.php";

// SECTION03 - PRE-OWNED
menuData[2][0][0]="&nbsp;&nbsp;&raquo; <B>Inventory SEARCH</B>";
menuData[2][0][1]="preowned.inventory.php";
menuData[2][1][0]="&nbsp;&nbsp;&raquo; About our Vehicles";
menuData[2][1][1]="preowned.php";
menuData[2][2][0]="&nbsp;&nbsp;&raquo; Trade-In Appraisal";
menuData[2][2][1]="preowned.tradein.php";
menuData[2][3][0]="&nbsp;&nbsp;&raquo; Vehicle Coupons";
menuData[2][3][1]="coupons.php?what=VEHICLES";

// SECTION04 - FINANCE
menuData[3][0][0]="&nbsp;&nbsp;&raquo; Finance Department";
menuData[3][0][1]="financing.dept.php";
menuData[3][2][0]="&nbsp;&nbsp;&raquo; <b>Credit Application</b>";
menuData[3][2][1]="finance.creditapp.php";
menuData[3][5][0]="&nbsp;&nbsp;&raquo; Payment Calculator";
menuData[3][5][1]="finance.calculator.php";
menuData[3][6][0]="&nbsp;";
menuData[3][6][1]="javascript:void();";
menuData[3][7][0]="&nbsp;&nbsp;&raquo; Advertisements";
menuData[3][7][1]="ads.php";
menuData[3][8][0]="&nbsp;&nbsp;&raquo; TV Commercials";
menuData[3][8][1]="commercials.php";

// SECTION05 - SERVICE
menuData[4][0][0]="&nbsp;&nbsp;&raquo; Service Department";
menuData[4][0][1]="service.dept.php";
menuData[4][1][0]="&nbsp;&nbsp;&raquo; <b>Appointments</b>";
menuData[4][1][1]="service.appointment.php";
menuData[4][2][0]="&nbsp;&nbsp;&raquo; Service Coupons";
menuData[4][2][1]="coupons.php?what=SERVICE";

// SECTION06 - PARTS
menuData[5][0][0]="&nbsp;&nbsp;&raquo; Parts Department";
menuData[5][0][1]="parts.dept.php";
menuData[5][1][0]="&nbsp;&nbsp;&raquo; <b>Parts Request</b>";
menuData[5][1][1]="parts.request.php";
menuData[5][2][0]="&nbsp;&nbsp;&raquo; Parts Coupons";
menuData[5][2][1]="coupons.php?what=PARTS";

// SECTION07 - ABOUT US
menuData[6][0][0]="&nbsp;&nbsp;&raquo; Our Company";
menuData[6][0][1]="about.company.php";
menuData[6][1][0]="&nbsp;&nbsp;&raquo; Our Staff";
menuData[6][1][1]="about.staff.php";
menuData[6][2][0]="&nbsp;&nbsp;&raquo; <b>Contact Us</b>";
menuData[6][2][1]="about.contact.php";
menuData[6][3][0]="&nbsp;&nbsp;&raquo; Locate Us";
menuData[6][3][1]="about.locate.php";
menuData[6][4][0]="&nbsp;&nbsp;&raquo; Employment";
menuData[6][4][1]="about.jobs.php";

// SECTION08 - SALES
menuData[7][0][0]="&nbsp;&nbsp;&raquo; Sales Department";
menuData[7][0][1]="sales.dept.php";
menuData[7][1][0]="&nbsp;&nbsp;&raquo; Coupon Center";
menuData[7][1][1]="coupons.php";
menuData[7][2][0]="&nbsp;&nbsp;&raquo; Advertisements";
menuData[7][2][1]="ads.php";
menuData[7][3][0]="&nbsp;&nbsp;&raquo; TV Commercials";
menuData[7][3][1]="commercials.php";



// SET DROPDOWN POSITION FOR BROWSERS
if(br=="N"){
	doLayer('section01',0,58, 'left',99)
	doLayer('section02',1,116,'left',99)
	doLayer('section03',2,235,'left',99)
	doLayer('section04',3,435,'left',99)
	doLayer('section05',4,443,'left',99)
	doLayer('section06',5,534,'left',99)
	doLayer('section07',6,624,'left',99)
	doLayer('section08',7,345,'left',99)
}else if(br=="IE"){
	doDiv('section01',0,60, 'left',101)
	doDiv('section02',1,118,'left',101)
	doDiv('section03',2,237,'left',101)
	doDiv('section04',3,437,'left',101)
	doDiv('section05',4,445,'left',101)
	doDiv('section06',5,536,'left',101)
	doDiv('section07',6,626,'left',101)
	doDiv('section08',7,347,'left',101)

}else{}
