function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

// Functions for menu handling
function showDiv(hdr,expandDirection,horAdj,verAdj){
	
	var xpos = 0
	var ypos = 0
	
	document.images.btnNews.src = b1.src

	switch (expandDirection) { 
		case 'below': 
			xpos = getX(hdr); 
			ypos = getY(hdr) + hdr.offsetHeight; 
			break; 
		case 'right': 
			xpos = getX(hdr) + hdr.offsetWidth - 1; 
			ypos = getY(hdr) - 1; 
			break; 
		default: 
			xpos = getX(hdr) + hdr.offsetWidth; 
			ypos = getY(hdr); 
			break; 
	} 

	xpos += horAdj; 
	ypos += verAdj; 

	menutoshow = document.getElementById("newsdiv")
	if(menutoshow){
		menutoshow.style.left = xpos + "px"
		menutoshow.style.top = ypos + "px"
	}
    
}

function hideDiv(){
    if(!keepMenu){
		menu = document.getElementById("newsdiv")
		if(menu) menu.style.top = -500
		document.images.btnNews.src = b2.src
	}
}

function hideCurrentDiv(n){
	menu = document.getElementById("newsdiv")
	if(menu) menu.style.top = -500
}



// Calculates the absolute page x coordinate of any element 
function getX(element) { 

	var x = 0; 

	do { 

		if (element.style.position == 'absolute') { 

			return x + element.offsetLeft; 

		} 

		else { 

			x += element.offsetLeft; 

			if (element.offsetParent) 

				if (element.offsetParent.tagName == 'TABLE') 

					if (parseInt(element.offsetParent.border) > 0) { 

						x += 1; 

					} 
		} 

	} while ((element = element.offsetParent)); 

	return x; 

} 

// Calculates the absolute page y coordinate of any element 
function getY(element) { 

	var y = 0; 

	do { 

		if (element.style.position == 'absolute') { 

			return y + element.offsetTop; 

		} 

		else { 

			y += element.offsetTop; 

			if (element.offsetParent) 

				if (element.offsetParent.tagName == 'TABLE') 

					if (parseInt(element.offsetParent.border) > 0) { 

						y += 1; 

					} 

		} 

	} while ((element = element.offsetParent)); 

	return y; 

} 



// functions to handle form submission
function send(){
	Form1.action = "SendEmail.asp"
	Form1.submit()
}

function login(){
	Form1.action = "Login.asp"
	Form1.submit()
}

function destination(oList){
    var pid = oList.options[oList.selectedIndex].value
	if(pid != "0"){
		var cmd = "parent.location = 'index.aspx?pid=" + pid + "'"
		eval(cmd);
	}
}


