window.onload=SET_SCREENRES_CSS;function SET_SCREENRES_CSS(){	var pageWrapper=document.getElementById('pageWrapper');	if (document.getElementById('post-wrapper')) var postWrapper=document.getElementById('post-wrapper');	if (document.getElementById('blogpost-wrapper')) var blogpostWrapper=document.getElementById('blogpost-wrapper');	if (document.getElementById('homepost-wrapper')) var homepostWrapper=document.getElementById('homepost-wrapper');		//alert("Adjusting CSS Page Widths");	if (screen.width>=1024) {		if(pageWrapper) pageWrapper.style.width = '1250px';		if(postWrapper) postWrapper.style.width = '800px';		if(blogpostWrapper) blogpostWrapper.style.width = '850px';		if(homepostWrapper) homepostWrapper.style.width = '720px';		//alert(pageWrapper.style.width);	}		}function FORM_FUNCTIONS(the_form){	return (VALIDATE_FORM(the_form));}//Start of form validation functionsfunction VALIDATE_FORM(the_form){	if (CHECK_REQUIRED(the_form) && EMAIL(the_form.email) && CHECK_ACCEPT_CONTRACT(the_form)){		return true;	} else {    	return false;	}}function TEST_REQUIRED_FIELDS_EXIST(required_field, array_no){		if(!required_field)	alert("Required Field number: "+i+" does not exist.");}function GET_REQUIRED_ARRAY(the_form){	var separator=",";//The separator used to seperate the different values in the hidden required field	required_array=the_form.required.value.split(separator);//populates the required_array by splitting(exploding) the value of the hidden required field	for(i=0;i<required_array.length;i++){		required_array[i]=eval("document."+the_form.name+"."+required_array[i]);		//alert("document."+the_form.name+"."+required_array[i]);		//TEST_REQUIRED_FIELDS_EXIST(required_array[i], i);//Used this function to test if the fields in the hidden required field exist in the form, if they do not exist they will create errors when the form is processed on the server	}	return(required_array);}function CHECK_ACCEPT_CONTRACT(the_form){	//alert(the_form.AcceptContract.value);	if (the_form.AcceptContract.checked == 1){		return true;	}else{		alert ("You must accept the contract terms to sign up for the 30 day demo");		the_form.AcceptContract.focus();		return false;	}}function CHECK_REQUIRED(the_form){var required = new Array (the_form.first_name,the_form.last_name,the_form.email);var alerts = new Array ("your First Name","your Last Name","your Email Address");var field;//the position of the required field in the form array which is used to place the focus onto the field for the user to complete //if (required length != alerts.length){alert("Number of alerts not equal to number of required fields");}	for (var i=0;i<required.length;i++){//loops through each of the fields in the the required array		//alert (i);		//alert (required[i]);		//alert (required[i].value);		if(required[i]){			var value = required[i].value;			if (NOT_EMPTY_BLANK(value)){//Checks if the value of each of the required fields is empty  				if (i==(required.length-1)) {//If it reaches the end of the array and all the fields are filled the function returns true					return true;				}			} else {				alert ("Please enter " + alerts[i]);				required[i].focus();				return false;			}						}else{			//alert("Required form element: "+i+" does not exist");			if (i==(required.length-1)) {//If it reaches the end of the array and all the fields are filled the function returns true				return true;			}		}				}}function EMAIL(email_field){	var str = email_field.value;	var email_name = email_field.name.replace(/_+/g," ");//Replaces underscores in the field name with spaces	if (NOT_EMPTY_BLANK(str)){//Checks if the value of each of the required fields is empty		if (str.indexOf('@')==-1 || str.indexOf('.')==-1 || str.length<5){//checks if the character '@' and '.' are in the address in the email field and that the number of letters is greater than 5			alert ("This email address is not in the correct format. Please re-enter your "+email_name);			email_field.focus();			return false;		} else {			return true;		}	} else {		alert ("Please enter your "+email_name);		email_field.focus();		return false;	}	}function NOT_EMPTY_BLANK(str) {	if (str.length != 0){		for (i = 0; i < str.length; i++) {			if (str.charAt(i) != " "){					return true;			}		}	}	else{		return false;	}}
