function changeImg(name)
{
	/*
		Change display image when click on the link
		@param name: name of image that will be displayed when link is clicked
	*/
	window.document.getElementById("enlargeImg").src="images/" + name;		
}

function popup(url)
{
	/*
		Pop-up a window
	*/
	var newwindow;
	newwindow=window.open(url,'name','height=800,width=670, scrollbars=yes, locationbar=false');
	if (window.focus) {newwindow.focus()}
}

function checkContactForm(formName)
{
	/*
		Check format of entered email in the input field
		@param formNam: name of the form
	*/
	valid = true;
	x = document.getElementById(formName);
	
	fullName = x.fullN.value;
	email = x.email.value;	
	content = x.message.value;
	
	emailConfirm = /^(\w|\.)+@[a-zA-Z]([a-zA-Z0-9]|\-)*(\.[a-zA-Z]([a-zA-Z0-9]|\-)*)+$/;
	
	if (fullName == '')
	{
		document.getElementById('fullN').style.border = " solid thin #FF0000 ";	
		document.getElementById('name_note').style.color = "#FF0000";
		document.getElementById('name_note').innerHTML = "Please enter your Full Name.";
		valid = false;
	}
	
	if (email == '')
	{
		document.getElementById('email').style.border = " solid thin #FF0000 ";	
		document.getElementById('email_note').style.color = "#FF0000";
		document.getElementById('email_note').innerHTML = "Please enter your Email Address.";
		valid = false;
	}
	else if(email != '' && !emailConfirm.exec(email))
	{
		document.getElementById('email').style.border = " solid thin #07784c";	
		document.getElementById('email_note').style.color = "#07784c";
		document.getElementById('email_note').innerHTML = "Email is in wrong format.";
		valid = false;		
	}
	
	if (content == '')
	{
		document.getElementById('message').style.border = " solid thin #FF0000 ";	
		document.getElementById('msg_note').style.color = "#FF0000";
		document.getElementById('msg_note').innerHTML = "Please enter your message content.";
		valid = false;
	}
	
	return valid;
}