
function chkF(field,alerttxt,reject){
	with (field) {
		if (value==null||value==""||value==reject){
			alert(alerttxt);
			return false
		} else { return true }
	}
}

function chkE(field,alerttxt){
	with (field){
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
			  {alert(alerttxt);return false}
		else {return true}
	}
}

function quoteform(thisForm) {
	with (thisForm){
		if (chkF(name, "Please enter your name.", "asd")==false){
			name.focus();
			return false
		}
		
		if (chkF(phone,"Please enter your Contact Number", "asd")==false){
			phone.focus();
			return false
		}
		
		if (chkE(email,"Sorry that isn't a valid Email Address")==false){
			email.focus();
			return false
		}
		
		if (chkF(location, "Please enter a location", "asd")==false){
			location.focus();
			return false
		}
		
		if (chkF(description, "Please enter a job description", "asd")==false){
			description.focus();
			return false
		}
	}
}

function changeImg(img) {
	if(img.src.match("-over")) {
		img.src = img.src.split("-over").join("-butt");
	} else {
		img.src = img.src.split("-butt").join("-over");
	}
}

function flash(movie, width, height, alt, id) {
	document.write('<object style="border:0;padding:0;margin:0;" id="'+id+'" type="application/x-shockwave-flash" data="'+movie+'" width="'+width+'" height="'+height+'" title="'+alt+'">\n');
	document.write('<param name="movie" value="'+movie+'" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('</object>\n');
}

function newwin(lnk) {
	window.open(lnk.href, 'newwindow','toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes');
	return false;
}

