function valid_contact(){
var empty_name_msg = "Please enter your name.";
var email_error_msg = "Please enter your valid email address. (e.g. yourname@company.com)";
var empty_phone_msg = "Please enter your valid contact number. (e.g. 60379816229, 79816229, 0123901063)";
var namebox = document.order.name;
var namebox_value = document.order.name.value;
var mailbox = document.order.email;
var mailbox_value = document.order.email.value;
var phonebox = document.order.tel;
var phonebox_value = document.order.tel.value;

if(namebox_value== "")
{
	alert(empty_name_msg);
	namebox.focus();
	return false;
}
if(mailbox_value=="" || mailbox_value.search("@") == -1 || mailbox_value.search("[.*]") == -1)
{
	alert(email_error_msg);
	mailbox.focus();
	return false;
}
if(phonebox_value=="" || phonebox_value.length > 11 || phonebox_value.length < 8)
{
	alert(empty_phone_msg);
	phonebox.focus();
	return false;
}
return true;
}

function momo()
{
	if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;
}

var i=0;
function zoom(pic){
var w=330;
var h=470;
var page_title = "Alphacon Engineering Sdn. Bhd.";
var photo_root_path = "images/";
var photo_sub_path = "";
var MIME_type = ".jpg";
var close_msg = "*Double click the image to close this window.";
switch(pic)
{
	default:photo_desc="Sorry, no description for this photo.";break;
	case'enlarge_co':photo_desc=page_title;break;
	case'chart':photo_desc="",w=760,h=560;break;
	case'001':case'002':case'003':case'004':case'005':case'006':case'007':case'009':case'010':photo_desc="",photo_sub_path="cert/",w=400,h=570;break;
	case'008':photo_desc="";photo_sub_path="cert/",w=570,h=400;break;
}
enlarge = window.open("","new"+i+"","width="+w+" height="+h+" top=5 left=5");
enlarge.document.write("<html><head><title>"+page_title+"</title></head>");
enlarge.document.write("<link rel=stylesheet type=text/css href=alphacon.css><body scroll=no class=pic1>");
enlarge.document.write("<img src="+photo_root_path+photo_sub_path+pic+MIME_type+" ondblclick=window.close() alt=\""+close_msg+"\"><br>");
enlarge.document.write("<div class=info>&nbsp;"+photo_desc+"</div>");
enlarge.document.write("</body></html>");
i+=1;
}

function read(file,type){
var w=700;
var h=420;
var file_type=".asp";
var session
switch(type)
{
	default:session="current";break;
	case'previous':session="previous";break;
}
readfile = window.open(file+file_type+"?show="+session+"","newwindow","width="+w+" height="+h+" top=5 left=5 menubar");
}

function next()
{

var last_photo_msg = "This is the last photo, please select previous photo."
x=XMLPhoto.recordset
if (x.absoluteposition < x.recordcount)
{x.movenext()}
else alert(last_photo_msg);
}

function previous()
{
var first_photo_msg = "This is the first photo, please select next photo.";
x=XMLPhoto.recordset
if (x.absoluteposition > 1)
{x.moveprevious()}
else alert(first_photo_msg);
}
