function doup(btn)
{
	cn = btn.className
	switch (cn)
	{
		case 'wide':
			btn.style.cssText = "background:url('images/tab200_over.jpg');"
			break;
		case 'mediumplus':
			btn.style.cssText = "background:url('images/tab110_over.jpg');"
			break;
		case 'medium':
			btn.style.cssText = "background:url('images/tab90_over.jpg');"
			break;
		default:
			break;
	}
}
function dodown(btn)
{
	cn = btn.className
	switch (cn)
	{
		case 'wide':
			btn.style.cssText = "background:url('images/tab200.jpg');"
			break;
		case 'mediumplus':
			btn.style.cssText = "background:url('images/tab110.jpg');"
			break;
		case 'medium':
			btn.style.cssText = "background:url('images/tab90.jpg');"
			break;
		default:
			break;
	}
}
function showDets(id)
{
	over = document.getElementById('overview'+id)
	if(over)over.style.display = "none"
	dets = document.getElementById('details'+id)
	if(dets)dets.style.display = "block"
	sep = document.getElementById('sep'+id)
	if(sep)sep.style.cssText = "background:url('images/sepdets.gif');"
}
function showOver(id)
{
	over = document.getElementById('overview'+id)
	if(over)over.style.display = "block"
	dets = document.getElementById('details'+id)
	if(dets)dets.style.display = "none"
	sep = document.getElementById('sep'+id)
	if(sep)sep.style.cssText = "background:url('images/sepover.gif');"
}
function rollin(obj){
	obj.style.backgroundColor = "#940021"
	obj.style.cursor = 'pointer'
}
function rollout(obj){
	obj.style.backgroundColor = "#00529c"
}

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function go(dest){
	var cmd = "parent.location = '" + dest + "'"
	eval(cmd);
}

// Functions for menu handling
function showDiv(n,hdr,expandDirection,horAdj,verAdj){

	if(!currentDiv || currentDiv == null) return

	// Hide current div
	hideCurrentDiv(currentDiv)
	
	var xpos = 0
	var ypos = 0

	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("menu" + n + "Div")
	if(!menutoshow || menutoshow == null) return
	
	menutoshow.style.left = xpos
	menutoshow.style.top = ypos

	currentDiv = n
    
}

function hideDiv(n){
    if(!keepMenu){
		menu = document.getElementById("menu" + n + "Div")
		if(!menu || menu == null) return
        menu.style.top = -500
	}
}

function hideCurrentDiv(n){
	menu = document.getElementById("menu" + n + "Div")
	if(!menu || menu == null) return
    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);
	}
}

