
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
  	}
	var arrayPageSizeWithScroll = yWithScroll;
	// alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	// if user is unfortunate enough to be using IE6, do this...
	var IE7 = (navigator.appVersion.indexOf("MSIE 7.")==-1) ? false : true;
	if(IE7==true){

		var arrayPageSizeWithScroll = document.getElementById("mainContainerinner").scrollHeight;
		// alert ("ie exception..." +  document.getElementById("mainContainerinner").scrollHeight);
	}
		
	return arrayPageSizeWithScroll;
}
function init(){
	
	// alert ("woo " + getPageSizeWithScroll());
	

	// alert (newHeight);
	
	
	if (window.XMLHttpRequest) {
		// IE 7, mozilla, safari, opera 9
		var IE7 = (navigator.appVersion.indexOf("MSIE 7.")==-1) ? false : true;
		//alert (IE7);
		if(IE7==true){
			//IE7 fix for background-height
			var newHeight = getPageSizeWithScroll()+"px";
			// alert ("new height is " + newHeight);
			document.getElementById("body").style.height=newHeight;
			document.getElementById("mainContainer").style.height=newHeight;
			document.getElementById("mainContainerinner").style.height=newHeight;
			
		}else{
			// fix background height in mozilla, safari, opera 9
			var newHeight = getPageSizeWithScroll()+"px";
			document.getElementById("body").style.height=newHeight;
			document.getElementById("mainContainer").style.height=newHeight;
			document.getElementById("mainContainerinner").style.height=newHeight;
		}
	} else {
		// IE6 bizarely doesn't need a fix for background height!
		
	}
}


//validate reg form
function CheckRegForm() {
	// The fields are checked for blanks
	if (document.pform.name.value   == "" ||
	    document.pform.email.value  == "" ) {
	    	alert( "You haven't completed the form.\nPlease ensure that all boxes are filled in.");
		}
		
	// check for valid email address
	else if (document.pform.email.value.length <= 6 ||
      		 document.pform.email.value.indexOf ('@', 0) == -1 ||
      		 document.pform.email.value.indexOf ('.', 0) == -1){
				 alert("Sorry, " + document.pform.email.value + " is not a valid Email Address.");  
			 }
  	else { 
 		document.pform.submit()
	}
}