/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_rpmixmain1 = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_rpmixmain1 = new Array("button1up_rpmixmain1.png","button2up_rpmixmain1.png","button3up_rpmixmain1.png","button4up_rpmixmain1.png","button5up_rpmixmain1.png","button6up_rpmixmain1.png");

overSources_rpmixmain1 = new Array("button1over_rpmixmain1.png","button2over_rpmixmain1.png","button3over_rpmixmain1.png","button4over_rpmixmain1.png","button5over_rpmixmain1.png","button6over_rpmixmain1.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_rpmixmain1 = new Array();
subInfo_rpmixmain1[1] = new Array();
subInfo_rpmixmain1[2] = new Array();
subInfo_rpmixmain1[3] = new Array();
subInfo_rpmixmain1[4] = new Array();
subInfo_rpmixmain1[5] = new Array();
subInfo_rpmixmain1[6] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_rpmixmain1[1][1] = new Array("General Info","http://www.raggedpoint.us/Big-Sur-California/1-Information.htm","_self");
subInfo_rpmixmain1[1][2] = new Array("Milage & Drive Times","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/09-Ragged-Point-Inn-Mileage.htm","_self");
subInfo_rpmixmain1[1][3] = new Array("Ragged Point CA","http://www.raggedpoint.us/Big-Sur-California/City-Town-Village-Community-of-Ragged-Point-CA.htm","_self");
subInfo_rpmixmain1[1][4] = new Array("Views","http://www.raggedpoint.us/Big-Sur-California/3-Coastal_Views.htm","_self");
subInfo_rpmixmain1[1][5] = new Array("Hiking","http://www.raggedpoint.us/Big-Sur-California/4-Hiking_Beach.htm","_self");

subInfo_rpmixmain1[2][1] = new Array("Ragged Point Inn","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/01-Ragged-Point-Inn-Hotel.htm","_self");
subInfo_rpmixmain1[2][2] = new Array("RPI Hotel Rm #6","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/11-Ragged-Point-Inn-Luxury-Hotel-06.htm","_self");
subInfo_rpmixmain1[2][3] = new Array("RPI Hotel Rm #7","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/12-Ragged-Point-Inn-Luxury-Hotel-07.htm","_self");
subInfo_rpmixmain1[2][4] = new Array("San Simeon Hotels","http://www.san-simeon-lodging.com/","_blank");
subInfo_rpmixmain1[2][5] = new Array("Big Sur Lodging","http://www.big-sur-lodging.com/","_blank");

subInfo_rpmixmain1[3][1] = new Array("Ragged Point Inn","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/02-Ragged-Point-Inn-Dining.htm","_self");
subInfo_rpmixmain1[3][2] = new Array("San Simeon Restaurants","http://san-simeon-lodging.com/California-Central-Coast-Vacation-Guide/Hearst-Castle-Restaurants/San-Simeon-Restaurants/Directory-Restaurants-Near-Hearst-Castle-SS.html","_blank");
subInfo_rpmixmain1[3][3] = new Array("Big Sur Restaurants","http://www.big-sur-lodging.com/Big-Sur-California-Visitor-Guide/Restaurants-Cafe-Coffee/Complete-Directory-Big-Sur-Restaurants.html","_blank");

subInfo_rpmixmain1[4][1] = new Array("Ragged Point Inn","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/04-Ragged-Point-Inn-Weddings.htm","_self");
subInfo_rpmixmain1[4][2] = new Array("San Simeon","http://san-simeon-lodging.com/Hearst-Castle-area-visitor-information/Churches-Chapels-Weddings-Worship-San-Simeon-Cambria-CA.html","_blank");
subInfo_rpmixmain1[4][3] = new Array("Big Sur","http://www.big-sur-lodging.com/Big-Sur-California-Visitor-Guide/Wedding-Locations-Professionals-Resources/Big-Sur-Weddings-Information.html","_blank");

subInfo_rpmixmain1[5][1] = new Array("San Simeon","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/San-Simeon-San-Luis-Obispo-Paso-Robles-Vacation-Links.htm","_self");
subInfo_rpmixmain1[5][2] = new Array("Big Sur","http://www.raggedpoint.us/Big-Sur-California/Big-Sur-Monterey-Vacation-Links.htm","_self");
subInfo_rpmixmain1[5][3] = new Array("Hiking Camping North","http://www.big-sur-lodging.com/Big-Sur-California-Visitor-Guide/Outdoor-Activities/Picnicking-Hiking-Camping-in-Big-Sur-California.html","_blank");
subInfo_rpmixmain1[5][4] = new Array("Hiking Camping South","http://san-simeon-lodging.com/California-Central-Coast-Vacation-Guide/Outdoor-Activities/Picnicking-Hiking-Camping-Near-Hearst-Castle.html","_blank");
subInfo_rpmixmain1[5][5] = new Array("PCH Highway Map","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/08-Ragged-Point-Inn-Map.htm","_self");

subInfo_rpmixmain1[6][1] = new Array("Ragged Point #1","http://www.raggedpoint.us/ragged-point-inn-San-Simeon-CA/ImagesSlideShow/SlideShow-index.html","_self");
subInfo_rpmixmain1[6][2] = new Array("Ragged Point #2","http://www.raggedpoint.us/Ragged_Point_Gallery/index.htm","_self");
subInfo_rpmixmain1[6][3] = new Array("Hearst Castle","http://san-simeon-lodging.com/California-Central-Coast-Vacation-Guide/Hearst-Castle-Gallery-Index.htm","_blank");
subInfo_rpmixmain1[6][4] = new Array("San Simeon","http://san-simeon-lodging.com/Hearst-Castle-area-visitor-information/San-Simeon-Village-Photos/Old-San-Simeon-Village-Photo-Thumbs-Index.html","_blank");
subInfo_rpmixmain1[6][5] = new Array("Big Sur","http://www.big-sur-lodging.com/Big-Sur-California-Visitor-Guide/Pacific-Coast-Highway-Photo-Tour/Big-Sur-California-PCH-Photo-Thumbs-Index.html","_blank");
subInfo_rpmixmain1[6][6] = new Array("Pismo Beach","http://san-simeon-lodging.com/California-Central-Coast-Vacation-Guide/Pismo-Beach-CA-Photo-Gallery/Pismo-Pictures-index.html","_blank");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_rpmixmain1 = 0;
var ySubOffset_rpmixmain1 = 22;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_rpmixmain1 = false;
var delay_rpmixmain1 = 1000;
totalButtons_rpmixmain1 = upSources_rpmixmain1.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_rpmixmain1; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_rpmixmain1[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_rpmixmain1">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_rpmixmain1" class="dropmenu_rpmixmain1" ');
		document.write('onMouseOver="overSub_rpmixmain1=true;');
		document.write('setOverImg_rpmixmain1(\'' + (x+1) + '\',\'_rpmixmain1\');"');
		document.write('onMouseOut="overSub_rpmixmain1=false;');
		document.write('setTimeout(\'hideSubMenu_rpmixmain1(\\\'submenu' + (x+1) + '_rpmixmain1\\\')\',delay_rpmixmain1);');
		document.write('setOutImg_rpmixmain1(\'' + (x+1) + '\',\'_rpmixmain1\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_rpmixmain1[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_rpmixmain1[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_rpmixmain1[x+1][k+1][2] + '">');
			document.write( subInfo_rpmixmain1[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_rpmixmain1() {
	for ( x=0; x<totalButtons_rpmixmain1; x++ ) {
		buttonUp_rpmixmain1 = new Image();
		buttonUp_rpmixmain1.src = buttonFolder_rpmixmain1 + upSources_rpmixmain1[x];
		buttonOver_rpmixmain1 = new Image();
		buttonOver_rpmixmain1.src = buttonFolder_rpmixmain1 + overSources_rpmixmain1[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_rpmixmain1(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_rpmixmain1 + overSources_rpmixmain1[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_rpmixmain1(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_rpmixmain1 + upSources_rpmixmain1[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_rpmixmain1(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_rpmixmain1(id) { 
	var el = getElement_rpmixmain1(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_rpmixmain1(id) {
	var el = getElement_rpmixmain1(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_rpmixmain1(objectID,x,y) {
	var el = getElement_rpmixmain1(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_rpmixmain1(subID, buttonID) {
	hideAllSubMenus_rpmixmain1();
	butX = getRealLeft_rpmixmain1(buttonID);
	butY = getRealTop_rpmixmain1(buttonID);
	moveObjectTo_rpmixmain1(subID,butX+xSubOffset_rpmixmain1, butY+ySubOffset_rpmixmain1);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_rpmixmain1() {
	for ( x=0; x<totalButtons_rpmixmain1; x++) {
		moveObjectTo_rpmixmain1("submenu" + (x+1) + "_rpmixmain1",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_rpmixmain1(subID) {
	if ( overSub_rpmixmain1 == false ) {
		moveObjectTo_rpmixmain1(subID,-500, -500);
	}
}



//preload_rpmixmain1();

