function openWindow(page, framename, win_width, win_height,lockscroll)
{
	var w,h, para,sc;
	var absw, absh;
	
	w = screen.width;
	h = screen.height
	
	absw = (w-win_width) /2;
	
	if (win_height > 0) {
		absh = (h-win_height) / 2;	
	} else{
		absh = (h-(h * 0.7)) /2;
		}
		
	if (lockscroll == 1) { sc = "no" } else { sc = "YES" }
	
	para = "top="+absh+", left="+absw+ ",width="+win_width+", height="+win_height+", toolbar=no, menubar=no, location=no, scrollbars="+sc+", directories=no";
	
	window.open(page, framename, para);

}

function doSwitchLang(w) {

	// valid w is 'gb' ,'en' ,'b5'
	

	
	var url = location.href;
	var ok = false;

	
	if (url.indexOf('/gb') > 0 && !ok) {
		url = url.replace('/gb', '/'+w);
		ok = true;
	}
	
	if (url.indexOf('/en') > 0 && !ok) {
		url = url.replace('/en', '/'+w);
		ok = true;
	}
	
	if (url.indexOf('/b5') > 0 && !ok) {
		url = url.replace('/b5', '/'+w);
		ok = true;
	}

//	alert("Sorry! Chinese version is temporary not available");	
	location.href = url;
}


function showpix(imgname) {
	window.open("/en/gallery/fullsize.htm?"+imgname+"+","popup");
}

function showpixgb(imgname) {
	window.open("/gb/gallery/fullsize.htm?"+imgname+"+","popup");
}


function checkform(){
		
  var process = true;
  var message = 'Please provide information for the following field(s):\n\n';
  
  if (document.mailform.txtemail.value == ''){
    message += 'Email Address\n';
    process = false;}
  else{
    var iemail = document.mailform.txtemail.value;
    if ((iemail.indexOf('@') <= 0) || (iemail.indexOf('.') <= 0)){
      message += 'Invalid email address, please check email on email address\n';
      process = false;
    }
  }
  
  if (document.mailform.txtemailc.value == ''){
    message += 'Email Address\n';
    process = false;}
  else{
    var iemail = document.mailform.txtemailc.value;
    if ((iemail.indexOf('@') <= 0) || (iemail.indexOf('.') <= 0)){
      message += 'Invalid email address, please check email on verified email address\n';
      process = false;
    }
  }
  
  if (document.mailform.txtemail.value != document.mailform.txtemailc.value) {
      message += 'Email address does not match with verified email address\n';
      process = false;
  }

	if (document.mailform.txtfname.value == '') {
		message += 'First Name\n';
		process = false;
	}
	
	if (document.mailform.txtlname.value == '') {
		message += 'Last Name\n';
		process = false;
	}
		
	if (document.mailform.txttel3.value == '') {
		message += 'Telelphone\n';
		process = false;
	}

	
	if (document.mailform.txtmsg.value == '') {
		message += 'Message\n';
		process = false;
	}

  if (!process) {
  	alert(message);
	}
  return process;
}