/////////////////////////////////////////
// Image Rollovers
function imgRollover(objLink , state)
{
if (document.getElementById)
{
	var strImgSrc = objLink.getElementsByTagName("img")[0].src
    strImgSrc = strImgSrc.substring (0 , strImgSrc.lastIndexOf("_"))
    
    if (state == "on")
    {
    objLink.getElementsByTagName("img")[0].src = (strImgSrc + "_on.gif")
    }
    else
    {
    objLink.getElementsByTagName("img")[0].src = (strImgSrc + "_off.gif")
    }
}
}

/////////////////////////////////////////
// Hide/Show Content 
function collapse()
{
	document.getElementById("advertising-roles").style.display = "block"
	
}

/////////////////////////////////////////
// Hide/Show Content 
function collapsePub()
{
	document.getElementById("publications").style.display = "block"
	
}

/////////////////////////////////////////
// Form Validation 
// simple check for empty fields and valid email address
// objFrom = form
// returns (true | false)
function validateForm(objForm)
{

	if(objForm.firstname.value=="")
	{
		alert("Please enter your first name");
		objForm.firstname.focus();
		return false;
	}

	if(objForm.surname.value=="")
	{
		alert("Please enter your surname");
		objForm.surname.focus();
		return false;
	}

	if(objForm.email.value=="")
	{
		alert("Please enter your email address");
		objForm.email.focus();
		return false;
	}
	else
	{
		var strEmail = objForm.email.value
		if ( (strEmail.indexOf("@") == -1) || (strEmail.indexOf(".") == -1) )
		{
			alert ("Please enter a valid email address")
			objForm.email.focus();
			return false;
		}
	}
	
	if(objForm.view)
	{
		if(objForm.message.value=="")
		{
			alert("Please enter your views");
			objForm.message.focus();
			return false;
		}		
	}
  
}


function imageWin(loc,w,h)
{
	var showScroll = "no";
	var screenH = screen.availHeight;
	var screenW = screen.availWidth;
	if (h > screenH - 100 || w > screenW - 100) showScroll = "yes";
	imageWindow = window.open( "/nma/static/imageWin.html?loc=" + loc + "&w=" + w + "&h=" + h, "image_Window", "height=300,width=300,top=20,left=20,scrollbars=" + showScroll + ",resizable=yes,status=yes,toolbar=no,menubar=no");
	if (window.focus) {setTimeout('imageWindow.focus()',0)};
}






