	function echeck(str) {
	
			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   //alert("Invalid E-mail ID")
			   return false
			}
	
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   //alert("Invalid E-mail ID")
			   return false
			}
	
			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				//alert("Invalid E-mail ID")
				return false
			}
	
			 if (str.indexOf(at,(lat+1))!=-1){
				//alert("Invalid E-mail ID")
				return false
			 }
	
			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				//alert("Invalid E-mail ID")
				return false
			 }
	
			 if (str.indexOf(dot,(lat+2))==-1){
				//alert("Invalid E-mail ID")
				return false
			 }
			
			 if (str.indexOf(" ")!=-1){
				//alert("Invalid E-mail ID")
				return false
			 }
	
			 return true					
		}
	

	function resetDisplay(formObject){
		if(formObject.value == ""){
			formObject.className = "inputText";
		}
	}
	
	function showError(formObject,errorText){
			formObject.className = "inputText error";
			help_id = formObject.id + "_help";
			helpCell = document.getElementById(help_id);
			helpCell.innerHTML = errorText;
	}
	
	function cancelError(formObject){
			formObject.className = "inputText";
			help_id = formObject.id + "_help";
			helpCell = document.getElementById(help_id);
			helpCell.innerHTML = "";
	}
	
	function checkForm(theForm){
		var isValid = true;
	
		if(theForm.surname.value == ""){
		
			showError(theForm.surname,"Please enter a surname");
			isValid = false;
		}else{
			cancelError(theForm.surname)	
		}
		
		if(theForm.firstName.value == ""){
			showError(theForm.firstName,"Please enter a first name");
			isValid = false;
		}else{
			cancelError(theForm.firstName)	
		}
		
		
		if(theForm.company.value == ""){		
			showError(theForm.company,"Please enter a company / school");
			isValid = false;
		}else{
			cancelError(theForm.company)	
		}
		
		if(theForm.email.value == ""){		
			showError(theForm.email,"Please enter an email");
			isValid = false;
		}else{
			cancelError(theForm.email)	
		}
		
		if (echeck(theForm.email.value)==false){
			showError(theForm.email,"Please enter a correct email address");
			isValid = false;
		}else{
			cancelError(theForm.email)	
		}
		
		if(theForm.state.value == ""){		
			showError(theForm.state,"Please enter a state you wish to attend");
			isValid = false;
		}else{
			cancelError(theForm.state)	
		}
		

			//cancelError(theForm.company);
		if(!isValid){
			return false;
		}
	}

	function setFooter(margin){
		//var footerObj = document.getElementById("footer");
		//footerObj.style.top = margin;
	}
	
	function openWin( windowURL, windowName, height, width) {
		var left = parseInt((screen.availWidth/2)-(width/2));
		var top = parseInt((screen.availHeight/2)-(height/2));
		var newWindow = new Object();
		var winFeatures = 'width='+width + ',height=' + height + ',left=' + left + ',top=' + top + ',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1'; 
		newWindow = window.open( windowURL, windowName, winFeatures ); 
			if (window.focus) {newWindow.focus()};
	}
	
	function activateFlash(oArgs) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + oArgs.codebase + '" width="' + oArgs.width + '" height="' + oArgs.height + '" id="' + oArgs.id + '" align="' + oArgs.align + '">\n');
	    document.write('<param name="FlashVars" value="' + oArgs.flashvars + '" />\n');
	    document.write('<param name="allowScriptAccess" value="' + oArgs.allowscriptaccess + '" />\n');
	    document.write('<param name="movie" value="' + oArgs.movie + '" />\n');
	    document.write('<param name="quality" value="high" />\n');
	    document.write('<param name="loop" value="' + oArgs.loop + '" />\n');
	    document.write('<param name="menu" value="' + oArgs.menu + '" />\n');
	    document.write('<param name="scale" value="' + oArgs.scale + '" />\n');
	    document.write('<param name="bgcolor" value="' + oArgs.bgcolor + '" />\n');
	    document.write('<param name="wmode" value="' + oArgs.wmode + '" />\n');
	    document.write('<embed src="' + oArgs.movie + '" loop="' + oArgs.loop + '" menu="' + oArgs.menu + '" scale="' + oArgs.scale + '" quality="high" bgcolor="' + oArgs.bgcolor + '" width="' + oArgs.width + '" height="' + oArgs.height + '" name="' + oArgs.id + '" align="' + oArgs.align + '" allowScriptAccess="' + oArgs.allowscriptaccess + '" type="application/x-shockwave-flash" pluginspage="' + oArgs.pluginspage + '" flashvars="' + oArgs.flashvars + '" wmode="' + oArgs.wmode + '" />\n');
	    document.write('</object>\n');
	}