// Open window and locate at center

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);

}

// form must be names as mailform
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 (!process) {
  	alert(message);
	}
  return process;
}

