function WritePageNo(pp) {
		
	for (i=1;i<=totalpage;i++) {
		if (pp == i) {
			document.write ("<b> "+ i + "</b> | ");
			} else {
		document.write ("<a href='p" + i + ".htm'> "+ i + "</a> | ");
		}
	}
}

function switchLang(w) {

	// valid w is 'chi' ,'eng' ,'gb'
	
	var url = location.href;
	var ok = false;

	
	if (url.indexOf('chi') > 0 && !ok) {
		url = url.replace('chi', w);
		ok = true;
	}
	
	if (url.indexOf('eng') > 0 && !ok) {
		url = url.replace('eng', w);
		ok = true;
	}

	alert("Sorry! Chinese version is temporary not available");	
//	location.href = url;
}

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\n';
      process = false;
    }
  }

	if (document.mailform.txtname.value == '') {
		message += 'Contact Person\n';
		process = false;
	}
	
	if (document.mailform.txtmsg.value == '') {
		message += 'Message\n';
		process = false;
	}

  if (!process) {
  	alert(message);
	}
  return process;
}

function checkQuote(){
  var process = true;
  var message = 'Please provide information for the following field(s):\n\n';
  
  if (document.quoteform.txtemail.value == ''){
    message += 'Email Address\n';
    process = false;}
  else{
    var iemail = document.quoteform.txtemail.value;
    if ((iemail.indexOf('@') <= 0) || (iemail.indexOf('.') <= 0)){
      message += 'Invalid email address, please check email on email\n';
      process = false;
    }
  }

	if (document.quoteform.txtname.value == '') {
		message += 'Contact Person\n';
		process = false;
	}
	
	if (document.quoteform.txtcompany.value == '') {
		message += 'Company Name\n';
		process = false;
	}

	if (document.quoteform.txttel.value == '') {
		message += 'Telephone Number\n';
		process = false;
	}	
	if (document.quoteform.txtdesc.value == '') {
		message += 'Description\n';
		process = false;
	}

  if (!process) {
  	alert(message);
	}
  return process;
}

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 goNextpage() {
	if (Number(form1.pageno.value) == totalpage)
		location.href = "#";
	else
		location.href = "p"+String(Number(form1.pageno.value)+1)+".htm";
}

function goPrevpage() {
	if (Number(form1.pageno.value) == 1)
		location.href = "#";
	else
		location.href = "p"+String(Number(form1.pageno.value)-1)+".htm";
}