// VALIDATES THE CONTACT FORM
function validateForm(theForm) {
	
	if (!theForm.ddlSubject.value) {
		alert("Please select a subject.");
		theForm.ddlSubject.focus();
		return false;
	}
	
	if (!theForm.txtFullName.value) {
		alert("Please enter your full name.");
		theForm.txtFullName.focus();
		return false;
	}
	
	if (theForm.txtEmail.value=="")
	{   alert("Please enter your email address.");
		theForm.txtEmail.focus();
		return false;
	} 
	
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(theForm.txtEmail.value))) { 
	   alert("Please enter a valid email address.");
	   return false;
	}
	
	if (!theForm.txtPhone.value) {
		alert("Please enter your phone number.");
		theForm.txtPhone.focus();
		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'
}

//// OPENS WINDOW
function ImageW(strurl) {
	
	width = 100
	height = 20
//	strurl = 'page.htm'
	winName = 'Image'
	scrollbars = 'no'	
	
    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='+scrollbars);	

}

