function submittheform()
{
	formsz = document.getElementById('Searchform');
	formsz.submit();
	return true;
}

function showemailbox()
{
	document.getElementById('emailbox').style.display = (document.getElementById('emailbox').style.display == "block")?"none":"block";
}

function printpage() { window.print(); } 

function showhidediv(divone,divtwo){

if( divtwo == null ){
	divone = document.getElementById(divone);
	divone.style.display = ( divone.style.display == "none" )? "block" : "none" ;
}else{
	
	document.getElementById(divone).style.display = "block";
	document.getElementById(divtwo).style.display = "none";
	
}


}

function hidediv(divone,divtwo){

document.getElementById(divone).style.display = "none";
document.getElementById(divtwo).style.display = "none";

}

var MONTHLY;

function rewrite(div,newvalue,oldvalue){
	
	var that_ = newvalue;
	var this_ = new RegExp(oldvalue, 'gi');

document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace(this_, that_);

	if( newvalue == MONTHLY ){
		document.getElementById('eft').disabled = true;
		if( document.getElementById('debitorder').checked == false ){
			document.getElementById('creditcard').checked = true;	
			showhidediv('creditcarddiv','debitorderdiv');
		}
	}else{
		document.getElementById('eft').disabled = false;	
	}
	
}



	
	function startRequest(inputs,webaddress,section,interactwith){
		
		var divs = new Array();
		
		var errordiv_1 = '<div class="error"><img src="'+webaddress+'/images/icons/error.gif" border="0" />';
		var errordiv_2 = '</div><div class="userborder"></div>';
		
		
		divs[0] = [['errordiv',errordiv_1+"Please complete both fields to log in."+errordiv_2],['errordiv',errordiv_1+"the username or password you've entered is incorrect"+errordiv_2],['user_signup',""]];
		divs[1] = [['errordiv',errordiv_1+"Please complete all fields to create an account."+errordiv_2],['errordiv',errordiv_1+"the username or email you've entered is already in use"+errordiv_2],['errordiv',errordiv_1+"Your account could not be created."+errordiv_2],['user_signup',""]];
		
			inputs = inputs.split(':');
			
			for( var x=0; x<inputs.length; x++ ){
				
				//alert(inputs[x]);
				inputs[x] = inputs[x]+"="+document.getElementById(inputs[x]).value;
				
			}
		
			inputs = inputs.join(':');
			//alert(inputs);
			
			
			try{
				// Opera, Firefox, Safari
				check = new XMLHttpRequest();
			} catch (e){
				// IE
				try{
					check = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
					try{
						check = new ActiveXObject("Microsoft.XMLHTTP");
					} catch (e){
						// Something went wrong
						alert("Well, something is wrong with your browser, or it doesn't support AJAX.");
						return false;
					}
				}
			}
			
			
			check.onreadystatechange = function(){
				if(check.readyState == 4){
				
					var requestReturn = check.responseText;
					var x = parseInt(requestReturn);
					var y = parseInt(interactwith);
					var z = divs[y].length-1;
					//alert(requestReturn);
					//alert(x);
					if( isNaN(x) ){
						
						document.getElementById(divs[y][z][0]).innerHTML = divs[y][z][1];
						
						var fillinputs = requestReturn.split('_[[[:]]]_');
						for( var i=0; i<fillinputs.length; i++ ){
							var fill = fillinputs[i].split('_[[[=]]]_');
							if( document.getElementById(fill[0]) ){
								document.getElementById(fill[0]).value = fill[1];
							}
						}
						document.getElementById('formsubmitbutton').disabled = false;
						document.getElementById('MyGBNfooterlinks').style.display = "block";
												
					}else{
						document.getElementById(divs[y][x][0]).innerHTML = divs[y][x][1];
					}
				}
			}
			
			check.open("GET", webaddress+"/ajax/"+section+"/"+inputs+"/", true);
			check.send(null);	
			/**/
	}

