function RecoverShow(){
	fncValue("UserName","");
	fncValue("Password","");
	fncDisplay("TableLogin","none");
	fncDisplay("TableRecover","block");
	fncFocus("RecoverEmail",250);
}
function RecoverCancel(){
	fncValue("RecoverEmail","");
	fncDisplay("TableLogin","block");
	fncDisplay("TableRecover","none");
	fncFocus("UserName",250);
}
function Recover(i){
	var email = fncGetValue("RecoverEmail");
	if(i == 1) fncDoAjax("_scripts/asp/ajax.asp?function=recover&mail="+email,"RecoverResult()");
	if(i == 2) fncDoAjax("../_scripts/asp/ajax.asp?function=recover&mail="+email,"RecoverResult()");
}
function RecoverResult(){
	if(AjaxData == "1") alert("Your account password has been recovered and emailed to you.");
	if(AjaxData == "0") alert("Your account password could not be found. Please contact callcenter@robere.com for more information.");
	RecoverCancel();
}
function Flash(i){
	switch(i){
	case 1:
		var flashObjStr = 	""+
							"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='280' height='250' title='Robere &amp; Associates Introduction'>"+
							"<param name='movie' value='_flash/movie.swf'>"+
							"<param name='PLAY' value='false'>"+
							"<param name='BGCOLOR' value='#5f503d'>"+
							"<param name='LOOP' value='false'>"+
							"<embed src='_flash/movie.swf' width='280' height='250' loop='false' wmode='transparent' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' bgcolor='#5f503d' play='false'></embed>"+
							"</object>"
		break;
	case 2:
		//var flashObjStr = "<object type=application/x-shockwave-flash width='280' height='250' loop=false><PARAM NAME='Movie' value='../thaimovie.swf'></object>"
		var flashObjStr = 	""+
							"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='280' height='250' title='Robere &amp; Associates Introduction'>"+
							"<param name='movie' value='_flash/thaimovie.swf'>"+
							"<param name='PLAY' value='false'>"+
							"<param name='BGCOLOR' value='#5f503d'>"+
							"<param name='LOOP' value='false'>"+
							"<embed src='_flash/thaimovie.swf' width='280' height='250' loop='false' wmode='transparent' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' bgcolor='#5f503d' play='false'></embed>"+
							"</object>"
		break;
	}
	document.getElementById('FlashDisplay').innerHTML = flashObjStr;
	//alert(document.getElementById('FlashDisplay').innerHTML);
}
function SubmitCourseRegistration(id){
	 if(!fncValidateTextAllowed("AttendDates","Date(s) To Attend",0,0,"")) return;
	 if(!fncValidateTextAllowed("Company","Company Name",0,0,"")) return;
	 if(!fncValidateTextAllowed("Address","Address",0,0,"")) return;
	 if(!fncValidateTextAllowed("Telephone","Telephone",0,0,"")) return;
	 if(!fncValidateTextAllowed("Fax","Fax",0,0,"")) return;
	 if(!fncValidateTextAllowed("Contact","Contact Name",0,0,"")) return;
	 if(!fncValidateEmail("Email","Email",0)) return;
	 if(!fncValidateTextAllowed("Name1","Participant 1",0,0,"")) return;
	 fncPostTo("_engines/schedule.register.asp");
}

function SubmitProfile(){
	if(!fncValidateEmail("UserName","Email/User Name",0)){return;}
	if (fncGetValue("Password1") != fncGetValue("OriginalPassword") || fncGetValue("Password2") != fncGetValue("OriginalPassword")){
		if(!fncValidateTextAllowed("Password1","Password",0,6,"")){return;}
		if(fncGetValue("Password1") != fncGetValue("Password2")){
			alert("Password information is invalid. Your original password has been restored. To change your password, please type a password and password confirmation."); 
			fncValue("Password1",fncGetValue("OriginalPassword"));
			fncValue("Password2",fncGetValue("OriginalPassword"));
			fncFocus("Password1",250);
			return;
		}
	}
	if(!fncValidateTextAllowed("FName","First Name",0,2,"")){return;}
	if(!fncValidateTextAllowed("LName","Last Name",0,2,"")){return;}
	if(!fncValidateTextAllowed("Position","Work Position",0,4,"")){return;}
	if(!fncValidateTextAllowed("Company","Company Name",0,6,"")){return;}
	if(!fncValidateTextAllowed("Address","Address",0,10,"")){return;}
	if(!fncValidateTextAllowed("City","City",0,3,"")){return;}
	if(!fncValidateTextAllowed("State","State",1,2,"")){return;}
	if(!fncValidateTextAllowed("Country","Country",0,2,"")){return;}
	if(!fncValidateTextAllowed("PostalCode","Postal Code",0,3,"")){return;}
	if(!fncValidateTextAllowed("W_Telephone","Telephone",0,7,"1234567890()+. ")){return;}

	fncPostTo("_engines/profile.php");
}

function Register(){
	if(!fncValidateTextAllowed("FName","First Name",0,2,"")){return;}
	if(!fncValidateTextAllowed("LName","Last Name",0,2,"")){return;}
	if(!fncValidateTextAllowed("Position","Work Position",0,4,"")){return;}
	if(!fncValidateTextAllowed("Telephone","Telephone",0,0,"")) return;
	if(!fncValidateTextAllowed("Mobile","Mobile Phone",1,0,"")) return;
	if(!fncValidateEmail("Email","Email/User Name",0)){return;}
	if(!fncValidateTextAllowed("Password1","Password",0,6,"")){return;}	
	if(fncGetValue("Password1") != fncGetValue("Password2")){
		alert("Your password confirmation is invalid. Please try again."); 
		fncValue("Password1","");
		fncValue("Password2","");
		fncFocus("Password1",250);
		return;
	}
	if(!fncValidateTextAllowed("Company","Company Name",0,6,"")){return;}
	if(!fncValidateTextAllowed("Address","Address",0,10,"")){return;}
	if(!fncValidateTextAllowed("City","City",0,3,"")){return;}
	if(!fncValidateTextAllowed("State","State",1,2,"")){return;}
	if(!fncValidateTextAllowed("Country","Country",0,2,"")){return;}
	if(!fncValidateTextAllowed("PostalCode","Postal Code",0,3,"")){return;}
	if(!fncValidateTextAllowed("W_Telephone","Telephone",0,7,"1234567890()+. ")){return;}
	fncPostTo("_engines/register.asp");
}
