function hov(loc,cls){
   if(loc.className)
      loc.className=cls;}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("home.gif","C&FServices.gif","AdultServices.gif","deafAdultChild.gif","overview.gif","ProgByCounty.gif","links.gif","employees.gif","HIPAA.gif","ContactUs4.gif","news.gif","jobs.gif","directions.gif","video.gif");

overSources = new Array("home0.gif","C&FServices0.gif","AdultServices0.gif","deafAdultChild0.gif","overview0.gif","ProgByCounty0.gif","links0.gif","employees0.gif","HIPAA0.gif","ContactUs3.gif","news0.gif","jobs0.gif","directions0.gif","video0.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()
subInfo[11] = new Array()
subInfo[12] = new Array()
subInfo[13] = new Array()
subInfo[14] = new Array()
//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

//***Children Services ***//
subInfo[2][1] = new Array("Behavioral Health Programs","behavHealth.html","");
subInfo[2][2] = new Array("Case Management (CM)","C&FCaseMgmt.html","");
subInfo[2][3] = new Array("Private Schools (MAC)","MAC.html","");
subInfo[2][4] = new Array("Therapeutic Camps (TAC)","TAC.html","");
subInfo[2][5] = new Array("After School Programs","afterSchool.html","");
//***Adult Services ***//
subInfo[3][1] = new Array("Partial Hospital Program","AdultPartial.html","");
subInfo[3][2] = new Array("Outpatient Program","AdultOutpatient.html","");
subInfo[3][3] = new Array("Case Management","AdultCaseMgmt.html","");
subInfo[3][4] = new Array("Residential Services","AdultResidential.html","");
subInfo[3][5] = new Array("Crisis Residence","Crisis.html","");
subInfo[3][6] = new Array("Long Term Structured Residence","LongTerm.html","");
subInfo[3][7] = new Array("Psychiatric Rehabilitation","PsychRehab.html","");
subInfo[3][8] = new Array("Clubhouse Programs","Clubhouse.html","");
//***Deaf Services ***//
subInfo[4][1] = new Array("Partial Hospital Program","deafPartial.html","");
subInfo[4][2] = new Array("Outpatient Program","deafOutpatient.html","");
subInfo[4][3] = new Array("Case Managment","deafICM.html","");
subInfo[4][4] = new Array("Residential Services (Adult)","deafResidential.html","");
subInfo[4][5] = new Array("Residential Treatment Facilities (Children)","deafRTF.html","");
subInfo[4][6] = new Array("Interpreter Services","deafINT.html","");
subInfo[4][7] = new Array("Outreach Services","deafOutreach.html","");

subInfo[5][1] = new Array("10 Year Report","report.html","");


subInfo[6][1] = new Array("Directions to Regional Offices","directions.html","");
subInfo[6][2] = new Array("Programs by County","programs.html","");

subInfo[6][1] = new Array("Adult Programs","adultprgs.html","");
subInfo[6][2] = new Array("Childern & Families Programs","c&fprgs.html","");
subInfo[6][3] = new Array("Deaf Services Programs","deafprgs.html","");

subInfo[8][1] = new Array("Bulletin Board/Announcements","bulletin.asp","");
subInfo[8][2] = new Array("Benefit Information","BenefitInfo.asp","");
subInfo[8][3] = new Array("Calendar","calendar/default.asp","");
subInfo[8][4] = new Array("Company Newsletter","Newsletter.asp","");
subInfo[8][5] = new Array("Directory","EmpDirectory.asp","");
subInfo[8][6] = new Array("Employee Rewards Program","http://www.selectagiftplan.com/salisbury","");
subInfo[8][7] = new Array("Ethics and Saftey","EthicsandSafety.asp","");
subInfo[8][8] = new Array("Internal Job Postings","internalJobs.asp","");
subInfo[8][9] = new Array("Photo Album","photos/photos.asp","");
subInfo[8][10] = new Array("Webmail Information","webmail.asp","");
subInfo[8][11] = new Array("Technical Support","/TechSupport/default.asp","");
subInfo[8][12] = new Array("Organzational Forms","/OrgForms/forms.asp","");
//subInfo[9][1] = new Array("Overview","Clubhouse.html","");

//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 143;
var ySubOffset = 0;



//*** 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();

