function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=600,height=400,left = 100,top = 50');");
}

function Validate(theForm) {
	if( !CheckEmptyField(theForm.recipientName,"Please fill in your name!") ) return false;
	if( !CheckEmptyField(theForm.recipientEmail,"Please fill in your email!") ) return false;
    return true;
} 

function CheckEmptyField(theField, theMessage ) {
	if	(theField.value=="") {
		alert(theMessage);
		return false;
	} 
	else {
		return true;
	}
}

function checkFields() {
	missinginfo = "";
	if (document.form.position.value == "") {
		missinginfo += "\n     -  Position";
	}
	if (document.form.description.value == "") {
		missinginfo += "\n     -  Description";
	}
	if (document.form.salary.value == "") {
		missinginfo += "\n     -  Salary";
	}
	if (missinginfo != "") {
		missinginfo = "Please fill in the Empty Fields:\n" + missinginfo + "\n" ;
		alert(missinginfo);
		return false;
	}
	else return true;
}


var it=0

function initialize(){
	mytext=typing.innerText
	var myheight=typing.offsetHeight
	typing.innerText=''
	document.all.typing.style.height=myheight
	document.all.typing.style.visibility="visible"
	typeit()
}

function typeit(){
	typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
	if (it<mytext.length-1){
		it++
		setTimeout("typeit()",100)
	}
	else{
		return
	}
	if (document.all){
		document.body.onload=initialize
	}
}

function checkCountry() {
	if(document.regform.country.value != "United Kingdom"){
		document.regform.sublocation.disabled=true;
		document.regform.sublocation='';
	}
	else{
		document.regform.sublocation.disabled=false;	
	}
	//document.regform.submit();
}

function clearField(field, text){
	if (field.value == text){
		field.value = "";
	}

}