/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "http://www.atlanticlimo-ga.com/images/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("nav3_about.gif","nav3_services.gif","nav3_fleet.gif","nav3_promotions.gif","nav3_quote.gif","nav3_reservations.gif","nav3_gogreen.gif","nav3_contact.gif","nav3_spanish.gif","nav3_home.gif");

overSources = new Array("nav3_about2.gif","nav3_services2.gif","nav3_fleet2.gif","nav3_promotions2.gif","nav3_quote2.gif","nav3_reservations2.gif","nav3_gogreen2.gif","nav3_contact2.gif","nav3_spanish2.gif","nav3_home2.gif");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();
subInfo[9] = new Array();
subInfo[10] = new Array();




//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo[1][1] = new Array("History","http://www.atlanticlimo-ga.com/history.html",target="_parent");
subInfo[1][2] = new Array("Fleet","http://www.atlanticlimo-ga.com/fleet.html",target="_parent");
subInfo[1][3] = new Array("Chauffeurs","http://www.atlanticlimo-ga.com/chauffeurs.html",target="_parent");
subInfo[1][4] = new Array("Partners","http://www.atlanticlimo-ga.com/partners.html",target="_parent");
subInfo[1][5] = new Array("Affiliate Program","http://www.visualmediapro.com/atlanticlimo/affiliate.asp",target="_parent");
subInfo[1][6] = new Array("Employment","http://www.atlanticlimo-ga.com/employment.html",target="_parent");

subInfo[2][1] = new Array("National Services","http://www.atlanticlimo-ga.com/nationalservices.html",target="_parent");
subInfo[2][2] = new Array("Airport Services","http://www.atlanticlimo-ga.com/airportservices.html",target="_parent");
subInfo[2][3] = new Array("Wedding Services","http://www.atlanticlimo-ga.com/weddingservices.html",target="_parent");
subInfo[2][4] = new Array("Corporate/Group Transportation","http://www.atlanticlimo-ga.com/corporate.html",target="_parent");
subInfo[2][5] = new Array("Proms/Graduation","http://www.atlanticlimo-ga.com/prom_graduation.html",target="_parent");
subInfo[2][6] = new Array("Bachelor/Bachelorette Parties","http://www.atlanticlimo-ga.com/bachelorparties.html",target="_parent");
subInfo[2][7] = new Array("Nights Out on the Town","http://www.atlanticlimo-ga.com/nightontown.html",target="_parent");
subInfo[2][8] = new Array("Concerts/Sporting Events","http://www.atlanticlimo-ga.com/concerts_sports.html",target="_parent");
subInfo[2][9] = new Array("Christmas Parties/Christmas Light Tours","http://www.atlanticlimo-ga.com/christmas.html",target="_parent");
subInfo[2][10] = new Array("New Years Eve Parties","http://www.atlanticlimo-ga.com/newyears.html",target="_parent");
subInfo[2][11] = new Array("City Tours/Romantic Events","http://www.atlanticlimo-ga.com/citytours.html",target="_parent");

subInfo[3][1] = new Array("Luxury 3 Pass Sedan","http://www.atlanticlimo-ga.com/sedans.html",target="_parent");
subInfo[3][2] = new Array("Luxury Sedan - Mercedes Benz S550","http://www.atlanticlimo-ga.com/mercedes.html",target="_parent");
subInfo[3][3] = new Array("Luxury 5 Pass SUV - Escalade","http://www.atlanticlimo-ga.com/escalade.html",target="_parent");
subInfo[3][4] = new Array("Luxury 5 Pass Hybrid SUV","http://www.atlanticlimo-ga.com/hybrid_suv.html",target="_parent");
subInfo[3][5] = new Array("6 Pass Stretch Limousine","http://www.atlanticlimo-ga.com/6pass_limo.html",target="_parent");
subInfo[3][6] = new Array("10 Pass Stretch Limousine","http://www.atlanticlimo-ga.com/10pass_limo.html",target="_parent");
subInfo[3][7] = new Array("12 Pass Stretch Limousine","http://www.atlanticlimo-ga.com/12pass_limo.html",target="_parent");
subInfo[3][8] = new Array("14 Pass Excursion","http://www.atlanticlimo-ga.com/14pass_excursion.html",target="_parent");
subInfo[3][9] = new Array("18 Pass H2 Hummer","http://www.atlanticlimo-ga.com/h2_hummer.html",target="_parent");
subInfo[3][10] = new Array("24 Pass Limo Bus","http://www.atlanticlimo-ga.com/26pass_limobus.html",target="_parent");
subInfo[3][11] = new Array("13 Pass Luxury Van Terra","http://www.atlanticlimo-ga.com/13pass_vanterra.html",target="_parent");
subInfo[3][12] = new Array("10 & 14 Pass Executive Van","http://www.atlanticlimo-ga.com/van.html",target="_parent");
subInfo[3][13] = new Array("24 & 31 Pass Mini Bus","http://www.atlanticlimo-ga.com/minibus.html",target="_parent");
subInfo[3][14] = new Array("55 Pass Coach Bus","http://www.atlanticlimo-ga.com/coach_buses.html",target="_parent");
subInfo[3][15] = new Array("Classic Rolls Royce","http://www.atlanticlimo-ga.com/rolls_royce.html",target="_parent");
subInfo[3][16] = new Array("Classic Daimler Princess","http://www.atlanticlimo-ga.com/daimler.html",target="_parent");
subInfo[3][17] = new Array("Classic Mercedes-Benz 280SE","http://www.atlanticlimo-ga.com/classic_mercedes.html",target="_parent");

subInfo[4][1] = new Array("Special Offers","http://www.atlanticlimo-ga.com/special_offers.html",target="_parent");
subInfo[4][2] = new Array("Dining Package","http://www.atlanticlimo-ga.com/dining.html",target="_parent");
subInfo[4][3] = new Array("Spa Packages","http://www.atlanticlimo-ga.com/spa.html",target="_parent");
subInfo[4][4] = new Array("Night Life","http://www.atlanticlimo-ga.com/opera.html",target="_parent");

subInfo[8][1] = new Array("Contact Us","http://www.atlanticlimo-ga.com/ContactUs_add.php",target="_parent");
subInfo[8][2] = new Array("Survey / Feedback","http://www.visualmediapro.com/atlanticlimo/survey.asp",target="_parent");







//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = -9;
var ySubOffset = 25;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;');
		document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();

