function validateContact (frm) {
	with (document.contactform) {
		messagetxt = "";
		
			
		if (from_name.value == "")
			messagetxt += "    Full name may not be blank\n";
		
		if (from_email.value == "")
			messagetxt += "    Email address may not be blank\n";
			
		if (phone_number.value == "")
			messagetxt += "    Phone number may not be blank\n";
			
		if (subject.selectedIndex == 0)
			messagetxt += "    Subject is not selected\n";
			
		if (message.value.length < 10)
			messagetxt += "    Your message has to be at least 10 characters long\n";
			
		if (messagetxt != ""){
			alert("Some errors occured while trying to submit your entry\n-------------------------------------------------------------------\n" + messagetxt+ "-------------------------------------------------------------------\n");
			return false;
		}
		return true;
	}
}

function validateAtLeastOneSelected (frm, msg) {
	with (frm) {
		selected = false;
		for (i=0; i<frm.elements.length; i++) {
			if (frm.elements[i].type == 'checkbox' && frm.elements[i].checked == true) {
				selected = true;
				return true;
			}
		}
		if (!selected) {
			alert(msg);
			return false;
		}
	}
}

function openwin (url, winname , options) {
	win = window.open(url, winname, (options != "" ? 'width=770, height=570, resizable=1, menubar=0, statusbar=1' : ''));
	win.focus();
}
