///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
// Opens centered pop-up window & closes when parent closes
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function openWin(url, w, h) {
	var winX = 0;
	var winY = 0;
	
	if (parseInt(navigator.appVersion) >= 4) {
	winX = (screen.availWidth - w)*.5;
	winY = (screen.availHeight - h)*.5;}
	
popupWin = window.open(url,"WinName","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=" +w + ",height=" + h + ",left=" + winX + ",top=" + winY);

function blowOut() {
	if (popupWin != null && popupWin.open) popupWin.close()}
	
	window.onunload=blowOut;
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Statusbar Message
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function statusDefault(){
window.defaultStatus = " Welcome to Electronic Motor Service Ltd. ";}
onLoad = statusDefault();



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Form Validation
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function validate_form(){
	validate = true;
	
	if (document.Form.From.value == ""){
		alert("Please fill out all required fields marked with a white asterik (*).\nCurrently the Name field is empty.");
		validate = false;
	} else if (document.Form.PhoneNumber.value == ""){
		alert("Please fill out all required fields marked with a red asterik (*).  \nCurrently the Phone Number field is empty.");
		validate = false;
	} else {
		validate = true;
		//submit_form();
	}
	return validate;										
}

						
function submit_form(){
	document.Form.submit();
	}							
	

