// VALIDATES THE CONTACT FORM

// MAIL FORM
function validateForm(theForm) {
	if (!theForm.FirstName.value) {
		alert("You must enter your First Name.");
		theForm.FirstName.focus();
		return false;
	}
	if (!theForm.Surname.value) {
		alert("You must enter your Surname Name.");
		theForm.Surname.focus();
		return false;
	}
	if (theForm.Email.value=="")
	{   alert("Please enter your Email Address before continuing.");
		theForm.Email.focus();
		return false;
	} 
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(theForm.Email.value))) { 
       alert("Please enter a valid email address.");
	   return false;
	}
		return true;
	}



// QuickForm FORM
function validateForm(QuickForm) {
	if (!QuickForm.Name.value) {
		alert("You must enter your Full Name.");
		QuickForm.Name.focus();
		return false;
	}
	if (QuickForm.Email.value=="")
	{   alert("Please enter your Email Address before continuing.");
		QuickForm.Email.focus();
		return false;
	} 
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(QuickForm.Email.value))) { 
       alert("Please enter a valid email address.");
	   return false;
	}
		return true;
	}


// OPENS THE WINDOW TO THE UPPER LEFT HAND SIDE TO THE SCREEN
function openWindow(width,height,strurl,winName,scrollb) {
    x = (640 - width)/2, y = (480 - height)/10;

    if (screen) {
        y = (screen.availHeight - height)/10;
        x = (screen.availWidth - width)/10;
    }
    
    if (screen.availWidth > 1800) { 
	x = ((screen.availWidth/2) - width)/10; 
    } 
	window.open(strurl,winName,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',scrollbars='+scrollb);
}

// OPENS THE WINDOW IN THE CENTER OF THE SCREEN
function openWindowM(width,height,strurl,winName,scrollb) {
    x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
    
    if (screen.availWidth > 1920) { 
	x = ((screen.availWidth/2) - width)/2; 
    } 
	window.open(strurl,winName,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',scrollbars='+scrollb);
}

// FLIP ITEM
function FlipItem(name) {
	if (document.getElementById(name).className == 'show')
		document.getElementById(name).className = 'hide'
	else
		document.getElementById(name).className = 'show'
}
