
//<![CDATA[

document.write("<img src='assets/loading_trans2.gif' style='display:none;' />");

function tabs(a){
	if(document.getElementById){
		var aa=0;
		if(a){ aa = document.getElementById(a).style.display; }
		document.getElementById('header_left').style.display = "none";
		// document.getElementById('header_left2').style.display = "none";
		document.getElementById('header_right').style.display = "none";
		// document.getElementById('header_right2').style.display = "none";
		if(a && aa=="block"){ document.getElementById(a).style.display = "none"; }
		if(a && aa=="none"){ document.getElementById(a).style.display = "block"; }
	}
}

function newWindow(href,width,height){
if(!width){ width=500; }
if(!height){ height=600; }
window.open(href, 'AshtonCourtPopup', 'width='+width+',height='+height+',alwaysRaised=yes,location=no,toobar=no,menubar=no,status=no,scrollbars=yes,resizable=yes');
}

var error_light = "#FFEAE5";
var error_dark = "#FF6606";
var okey_light = "#efefef";
var okey_dark = "#aaaaaa";

var first_validation_error = err_it = 0;

function validateForm(){
if(!arguments.length){ return true; }
if(document.getElementById){
     var alerttxt = "";
     var return_alert = "Please complete the following fields:\n";
     for(var x=0; x<arguments.length; x++){
     if(document.getElementById(arguments[x])){
	var inObj = document.getElementById(arguments[x]);
        if (inObj.type == "text" || inObj.type == "textarea"){
	    if(inObj.value == ""){
	        if(inObj.type == "textarea") alerttxt += "- "+inObj.title+"\n\r";
	        else alerttxt += "- "+inObj.alt+"\n\r";
        	inObj.style.backgroundColor=error_light;
        	inObj.style.borderColor=error_dark;
        	inObj.style.borderWidth='1px';
		if(err_it<1){ first_validation_error=x; }
		err_it++;
	    } else {
        	inObj.style.backgroundColor=okey_light;
        	inObj.style.borderColor=okey_dark;
        	inObj.style.borderWidth='1px';
	    }
	} else if(inObj.type == "checkbox"){
            if (!inObj.checked){
		alerttxt += "- "+inObj.alt+"\n\r";
		if(err_it<1){ first_validation_error=x; }
		err_it++;
	    }
        }
    }}
    if(alerttxt != ""){
	alert(return_alert+alerttxt);
	var inObj = document.getElementById(arguments[first_validation_error]);
	inObj.focus();
	return false;
    } else { return true; }
}}

function getSelected(selectName){
if(document.getElementById(selectName)){
	var box = document.getElementById(selectName);
	return box.options[box.selectedIndex].value;
}}

function fd(pdf){
	if(confirm("Please choose 'OK' to open this document within your browser or 'Cancel' to save?")) return true;
	else document.location='/documents/?f='+pdf;
	return false;
}
//]]>