
function page_load() {
	
	for (var i = 0; i < load_funcs.length; i++) {
		cmd = load_funcs[i] + "()";
		setTimeout(cmd, 1);
	
	
	}
	
}


//-----------------------------------------------------------
// style scripts --------------------------------------------

function position_sep_style1() {
	var content_body = document.getElementById('content_body');
	var content_body_dots = document.getElementById('content_body_dots');
	
	content_body_dots.style.height = (content_body.offsetHeight - 130) + "px";

}

function position_sep_style2() {
	var content_body = document.getElementById('content_body');
	var content_body_dots = document.getElementById('content_body_dots');
	
	content_body_dots.style.height = (content_body.offsetHeight - 93) + "px";

}

function sidenav_height() {
	var style2_nav_div = document.getElementById('style2_nav');
	var content_body_div = document.getElementById('content_body');
	

	if ((style2_nav_div.offsetHeight + 160) > content_body_div.offsetHeight) {
		
		content_body_div.style.height = (style2_nav_div.offsetHeight + 160) + 200 + "px";
		
		content_blend_bottom_div = document.getElementById('content_blend_bottom');
		
		content_blend_bottom_div.style.top = (content_body_div.offsetHeight - 479) + "px";
		
	}
	
}

function position_sep_style1_columns() {
	var body_div = document.getElementById('body_text1');
	var sep = document.getElementById('body_text1-sep');
	
	sep.style.height = (body_div.offsetHeight - 29) + "px";

}

function position_blend() {
	content = document.getElementById('main_content');
	blend = document.getElementById('content_blend_bottom');
	
	blend.style.top = (content.offsetHeight - 479) + "px";
}

//-----------------------------------------------------------
//Form Input Behaviors

//used on search input to clear default value
//fired with onFocus - input tag - only clear default value
function clearFormInputText(thefield){
if (thefield.defaultValue==thefield.value)
	thefield.value = "";
}

//fired with onBlur - input tag - when blank
function setFormInputText(thefield){
if (thefield.value=='')
	thefield.value = thefield.defaultValue;
}

//fired with onSubmit - form tag - when defaultValue is same as value supplied
function checkSubmitFormInputText(theform,inputname){
//var inputnamed = inputname.defaultValue;
//alert(inputnamed);
if (inputname.defaultValue==inputname.value)
	inputname.value = "";
}

function validateEmail(inputname) {
alert("add email validation:  "+inputname+": value: "+inputname.value);
}

function verifyEmail(){
     var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
     if (document.enews_signup.enews_address.value.search(emailRegEx) == -1) {
          alert("Please enter a valid email address.");
          return false;
     }
//for double entry check
//     else if (document.enews_signup.enews_address.value != document.enews_signup.enews_address2.value) {
//          alert("Email addresses do not match.  Please retype them to make sure they are the same.");
//          return false;
//     }
     else {
//          alert("The email address is in the correct format and they are the same.");
          return true;
     }
}