/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_new1 = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_new1 = new Array("button1up_new1.png","button2up_new1.png","button3up_new1.png","button4up_new1.png","button5up_new1.png","button6up_new1.png","button7up_new1.png","button8up_new1.png","button9up_new1.png","button10up_new1.png","button11up_new1.png","button12up_new1.png","button13up_new1.png","button14up_new1.png","button15up_new1.png","button16up_new1.png","button17up_new1.png","button18up_new1.png","button19up_new1.png","button20up_new1.png","button21up_new1.png","button22up_new1.png","button23up_new1.png");

overSources_new1 = new Array("button1over_new1.png","button2over_new1.png","button3over_new1.png","button4over_new1.png","button5over_new1.png","button6over_new1.png","button7over_new1.png","button8over_new1.png","button9over_new1.png","button10over_new1.png","button11over_new1.png","button12over_new1.png","button13over_new1.png","button14over_new1.png","button15over_new1.png","button16over_new1.png","button17over_new1.png","button18over_new1.png","button19over_new1.png","button20over_new1.png","button21over_new1.png","button22over_new1.png","button23over_new1.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_new1 = new Array();
subInfo_new1[1] = new Array();
subInfo_new1[2] = new Array();
subInfo_new1[3] = new Array();
subInfo_new1[4] = new Array();
subInfo_new1[5] = new Array();
subInfo_new1[6] = new Array();
subInfo_new1[7] = new Array();
subInfo_new1[8] = new Array();
subInfo_new1[9] = new Array();
subInfo_new1[10] = new Array();
subInfo_new1[11] = new Array();
subInfo_new1[12] = new Array();
subInfo_new1[13] = new Array();
subInfo_new1[14] = new Array();
subInfo_new1[15] = new Array();
subInfo_new1[16] = new Array();
subInfo_new1[17] = new Array();
subInfo_new1[18] = new Array();
subInfo_new1[19] = new Array();
subInfo_new1[20] = new Array();
subInfo_new1[21] = new Array();
subInfo_new1[22] = new Array();
subInfo_new1[23] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//


subInfo_new1[3][1] = new Array("Statewide","http://hoarders.org/lasw.html","");
subInfo_new1[3][2] = new Array("San Francisco","http://hoarders.org/lasf.html","");
subInfo_new1[3][3] = new Array("San Mateo / Santa Clara County","http://hoarders.org/lasmsc.html","");

subInfo_new1[4][1] = new Array("General/Statewide","http://hoarders.org/mhg.html","");
subInfo_new1[4][2] = new Array("San Francisco","http://hoarders.org/mhsf.html","");
subInfo_new1[4][3] = new Array("San Mateo","http://hoarders.org/mhsm.html","");

subInfo_new1[5][1] = new Array("General","http://hoarders.org/sgg.html","");
subInfo_new1[5][2] = new Array("San Francisco/Daly City","http://hoarders.org/sgsfdc.html","");
subInfo_new1[5][3] = new Array("Palo Alto/Santa Clara","http://hoarders.org/sgpasc.html","");
subInfo_new1[5][4] = new Array("Berkeley/Pleasanton/Walnut Creek","http://hoarders.org/sgbpwc.html","");
subInfo_new1[5][5] = new Array("On Line Support Groups","http://hoarders.org/sgolsp.html","");

subInfo_new1[6][1] = new Array("Professional Organizers","http://hoarders.org/hahpo.html","");
subInfo_new1[6][2] = new Array("In Home Care","http://hoarders.org/hahihc.html","");
subInfo_new1[6][3] = new Array("Clean-up","http://hoarders.org/hahcu.html","");

subInfo_new1[7][1] = new Array("Bay Area Donation and Pick up Services","http://hoarders.org/drsbad.html","");

subInfo_new1[8][1] = new Array("San Francisco","http://hoarders.org/drsrsf.html","");
subInfo_new1[8][2] = new Array("San Mateo/Santa Clara","http://hoarders.org/drsrsm.html","");
subInfo_new1[8][3] = new Array("Marin","http://hoarders.org/drsrm.html","");
subInfo_new1[8][4] = new Array("Contra Costa","http://hoarders.org/drsrcc.html","");

















//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_new1 = 127;
var ySubOffset_new1 = 6;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_new1 = false;
var delay_new1 = 1000;
totalButtons_new1 = upSources_new1.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_new1; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_new1[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_new1">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_new1" class="dropmenu_new1" ');
		document.write('onMouseOver="overSub_new1=true;');
		document.write('setOverImg_new1(\'' + (x+1) + '\',\'_new1\');"');
		document.write('onMouseOut="overSub_new1=false;');
		document.write('setTimeout(\'hideSubMenu_new1(\\\'submenu' + (x+1) + '_new1\\\')\',delay_new1);');
		document.write('setOutImg_new1(\'' + (x+1) + '\',\'_new1\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_new1[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_new1[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_new1[x+1][k+1][2] + '">');
			document.write( subInfo_new1[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_new1() {
	for ( x=0; x<totalButtons_new1; x++ ) {
		buttonUp_new1 = new Image();
		buttonUp_new1.src = buttonFolder_new1 + upSources_new1[x];
		buttonOver_new1 = new Image();
		buttonOver_new1.src = buttonFolder_new1 + overSources_new1[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_new1(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_new1 + overSources_new1[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_new1(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_new1 + upSources_new1[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_new1(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_new1(id) { 
	var el = getElement_new1(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_new1(id) {
	var el = getElement_new1(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_new1(objectID,x,y) {
	var el = getElement_new1(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_new1(subID, buttonID) {
	hideAllSubMenus_new1();
	butX = getRealLeft_new1(buttonID);
	butY = getRealTop_new1(buttonID);
	moveObjectTo_new1(subID,butX+xSubOffset_new1, butY+ySubOffset_new1);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_new1() {
	for ( x=0; x<totalButtons_new1; x++) {
		moveObjectTo_new1("submenu" + (x+1) + "_new1",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_new1(subID) {
	if ( overSub_new1 == false ) {
		moveObjectTo_new1(subID,-500, -500);
	}
}



//preload_new1();

