// JavaScript Document
function valid_form(thisone){
	var pass = true;
	if(document.getElementById('first_name').value == '') {
		pass = false;
		document.getElementById('fn_label').className="input_label_emph";
	}
	else {
		document.getElementById('fn_label').className="input_label";
	}
	if(document.getElementById('last_name').value == '') {
		pass = false;
		document.getElementById('ln_label').className="input_label_emph";
	}
	else {
		document.getElementById('ln_label').className="input_label";
	}
	if(document.getElementById('city').value == '') {
		pass = false;
		document.getElementById('city_label').className="input_label_emph";
	}
	else {
		document.getElementById('city_label').className="input_label";
	}
	if(document.getElementById('state').value == '') {
		pass = false;
		document.getElementById('state_label').className="input_label_emph";
	}
	else {
		document.getElementById('state_label').className="input_label";
	}
	if(document.getElementById('email').value == '') {
		pass = false;
		document.getElementById('email_label').className="input_label_emph";
	}
	else {
		document.getElementById('email_label').className="input_label";
	}
	if(document.getElementById('phone').value == '') {
		pass = false;
		document.getElementById('phone_label').className="input_label_emph";
	}
	else {
		document.getElementById('phone_label').className="input_label";
	}
	if(pass == false) {
		alert('Please fill out all fields marked in red!');
		return false;
	}
	else {
		return true;
	}
}

function proc_form(thisone){

	var xmlhttp=false; //Clear our fetching variable
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
	} catch (e) {
		try {
		xmlhttp = new
		ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}

	var file = 'proc_form.php?first_name=' + document.ebook_form.first_name.value.replace('&', 'and') + '&last_name=' + document.ebook_form.last_name.value.replace('&', 'and') + '&phone=' + document.ebook_form.phone.value.replace('&', 'and') + '&email=' + document.ebook_form.email.value.replace('&', 'and') + '&city=' + document.ebook_form.city.value.replace('&', 'and') + '&state=' + document.ebook_form.state.value.replace('&', 'and');
	
	xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
			var content = xmlhttp.responseText; //The content data which has been retrieved ***
			if( content ){ //Make sure there is something in the content variable
				document.getElementById('full_con_right_col').innerHTML = content;
			//Change the inner content of your div to the newly retrieved content ****
			}
		}
	}
	xmlhttp.send(null) //Nullify the XMLHttpRequest
	return;	
}

function nm_pass_bg(action) {
	if(action=='blur' && document.getElementById('nm_pass').value=='') {
		document.getElementById('nm_pass').style.backgroundImage="url(images/nm_pass_bg.gif)";
	}
	else if(action=='focus') {
		document.getElementById('nm_pass').style.backgroundImage="none";
	}
}