function toggleDate() // 1 visible, 0 hidden
{

	var eventDate = document.getElementById('eventDate');
	if(eventDate.value=="May 15, 2008 - 6:30 pm - 8:30 pm")
		iState=1;
	else
	    iState=0;

	if(iState)
		document.getElementById('location').value="TBD";
	else
		document.getElementById('location').value="Ritz Carlton4375 Admiralty Way,Marina del Rey, CA 90292";
}

function markVisited() {
	//document.getElementById('ppState').value="1";
	document.ppform.submit();
}
function toggleBox() // 1 visible, 0 hidden
{
    if(document.getElementById('howhear')== null)
	    return;
	var howhear = document.getElementById('howhear');
	if(howhear.value=="Other") {
		showLayer(123);
	}	
	else {
		hideLayer(123);
	}
}


//-->
function hideLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "hidden";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "hidden";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "hidden";
}
}

function showLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "visible";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "visible";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "visible";
}

}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function sendRequest() {
	var valid = new Validation('sendform',{useTitles:true});
	if(!valid.validate() )
		return;
	
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';

	
	var form = $('sendform');

	new Ajax.Request("wealth_academy_registration.php", {
			   method: 'post',
			   postBody: Form.serialize(form),
			   onComplete: showResponse
		});
}	

function sendRequestContact() {
	var valid = new Validation('sendform',{useTitles:true});
	if(!valid.validate() )
		return;
	
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';

	
	var form = $('sendform');

	new Ajax.Request("contact.php", {
			   method: 'post',
			   postBody: Form.serialize(form),
			   onComplete: showResponse
		});
}	

function sendRequestPartner() {
	var valid = new Validation('sendform',{useTitles:true});
	if(!valid.validate() )
		return;
	
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';

	
	var form = $('sendform');

	new Ajax.Request("partner_with_ecrews.php", {
			   method: 'post',
			   postBody: Form.serialize(form),
			   onComplete: showResponse
		});
}	

function sendRequestCareers() {

	var valid = new Validation('sendform',{useTitles:true});
	if(!valid.validate() )
		return;
	
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';

	
	var form = $('sendform');

	new Ajax.Request("careers.php", {
			   method: 'post',
			   postBody: Form.serialize(form),
			   onComplete: showResponse
		});
}	


function showResponse(req)
{

	$('errors').innerHTML=  req.responseText;

	var loader = document.getElementById('loadBar');
	var success = document.getElementById('emailSuccess');
 
	loader.style.display = "none";
	success.style.display = "block";
	   
}


function sendRequestCrossover() {

	var valid = new Validation('sendform',{useTitles:true});
	if(!valid.validate() )
		return;
	
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';

	
	var form = $('sendform');

	new Ajax.Request("thecrossover.php", {
			   method: 'post',
			   postBody: Form.serialize(form),
			   onComplete: showResponse
		});
}	

function sendRequestSeminar() {

	var valid = new Validation('sendform',{useTitles:true});
	if(!valid.validate() )
		return;
	
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';

	
	var form = $('sendform');

	new Ajax.Request("seminar2010.php", {
			   method: 'post',
			   postBody: Form.serialize(form),
			   onComplete: showResponse
		});
}	

