
function val(frm){
	if(frm.email.value.indexOf('@') == -1){
		alert("Please enter an email address")
		return false
	}	
	else{
		return true
	}
}
function hideall(){
	for(var i=1;i<11;i++){
		var div = document.getElementById("a" + i)
		div.style.display = 'none'
	}
}
function showall(){
	for(var i=1;i<11;i++){
		var div = document.getElementById("a" + i)
		div.style.display = 'block'
	}
}
function showa(n){
	var div = document.getElementById("a" + n)
	if(div.style.display == 'block'){
		div.style.display = 'none'
	}
	else{
		div.style.display = 'block'
	}
}
function hand(div){
	div.style.cursor = 'pointer'
}


function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function activatearr(n){
	arr = document.getElementById('arr' + n)
	if(arr)
		if(arr.src == boff.src) arr.src = bon.src
		else arr.src = boff.src
}

function rollin(obj,ptr){
	obj.style.backgroundColor = "#91A599"
	if(ptr == 1) obj.style.cursor = 'pointer'
}
function rollout(obj){
	obj.style.backgroundColor = "#DEDBD6"
}

function getCopy(){
	return '&copy;International Glutamate Information Service 2005'
}

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; 

} 
