eventArray=new Array();
myImage=new Array();

function initMenu(){/*preloads the arrow image to swap & determines browser type*/
	imageArray= new Array();
	var myDocument=document;
	i=0;
	do{
		imageArray[i]='/pics/navback_'+myDocument.getElementById('topnav').childNodes[i].id+'.gif';
		i++;
	}		
	while(myDocument.getElementById('section').childNodes[i-1]!=myDocument.getElementById('section').lastChild);
	for (i=0;i<imageArray.length;i++){
		myImage[i] = new Image();
		myImage[i].src=imageArray[i];
	}
}

function initSlide(){/*preloads the arrow image to swap & determines browser type*/
	imageArray= new Array();
	var myDocument=document;
	i=0;
	do{
		imageArray[i]='/pics/slide_'+myDocument.getElementById('section').childNodes[i].id+'.gif';
		eventArray[i]=myDocument.getElementById('section').childNodes[i];
		i++;
	}		
	while(myDocument.getElementById('section').childNodes[i-1]!=myDocument.getElementById('section').lastChild);
	for (i=0;i<imageArray.length;i++){
		myImage[i] = new Image();
		myImage[i].src=imageArray[i];
	}
}

function initEvents(){/*handles all onMouseOver & onMouseOut events on menu entry divs*/
	for(i=0; i<eventArray.length; i++){
		eventArray[i].onmouseover = function () {Slide(this)}
		eventArray[i].onmouseout = function () {Slide('section')}
	}
}



function Slide(image){
	var myDocument=document;
	if(image=='section'){
		image=myDocument.getElementById('section');
		image.src='/pics/section_myspace.gif';
		
	}
	else{
		image.src='/pics/slide_'+image.id+'.gif';
	}
		myDocument.getElementById('slide').setAttribute("src",image.src);
}

