function init(){
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}
	else // Explorer Mac;
		 //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	//document.images['sizer'].height = y-140;
}

function checkForm(frm){ /* test if element will work here */
	if(!validEmail(frm)){
		return false;
	}
	switch(frm.selPreference.value){
		case "telephone" :
			if(!validTelephone(frm)){
				alert("Please supply a valid telephone number if you would like to be contacted by this method");
				return false;
			}
			break;
		case "email" :
			return true;
			break;
		default:
			return false;
			break;
	}
	return true;
}

function validEmail(frm){
	var regpat = /^(\w+)(\.\w+)?(@)(\w+)(-)?(\w+)(\.)((\w{2,6})|(\w{2,6}(\.)(\w{2,6})))$/;
	var b = regpat.test(frm.txtEmail.value);
	if(!b){
		alert("please enter a valid email address");
		frm.txtEmail.focus();
	}
	return b;
}

function validTelephone(frm){
	var str = frm.txtTelephone.value;
	str = str.replace(/\s/g, '');
	var regpat = /^(\+)?[\d\(\)]{6,}$/;
	var b = regpat.test(str);
	return b;
}

function confirmDelete(){
	var agree=confirm("Are you sure you want to delete this item?");
	if (agree)
		return true ;
	else
		return false ;
}
