
function checkemail()	{
	var illegchar = /\<|\>|\^|\"|\'|\%|\;|\(|\)|\&|\\|\//g;
	var formstr = document.form1;
	var error = "false";
	var errmsg;
	var emailStr = formstr.Email1.value;
	var checkTLD=1;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	var ownname = formstr.Name.value;
	if	(ownname.match(illegchar))	{
		error = "true";
		msg = "Please use only letters and / or numbers for your name (no &\'s, \\, /, etc).";
		errmsg = "formstr.Name.focus()";
	}
	if	(emailStr.match(illegchar))	{
		error = "true";
		msg = "Please use only letters and / or numbers for your email address (no &\'s, \\, /, etc).";
		errmsg = "formstr.Email1.focus()";
	}
	if	(formstr.Name.value=="" || formstr.Name.value=="Enter Your Name here")	{
		error = "true";
		msg = "Please enter your name.";
		errmsg = "formstr.Name.focus()";
	}
	if ((formstr.Email1.value == "" || formstr.Email1.value == "Enter Primary Email here" || formstr.Email1.value.indexOf('@', 0) == -1) || formstr.Email1.value.indexOf('.') == -1)  {
		error = "true";
		msg = "Please enter a valid e-mail address.";
		errmsg = "formstr.Email1.focus()";
	}
	if (error=="true")	{
		alert(msg);
		eval(errmsg);
		return false;
	}	else	{
	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("This username contains invalid characters.");
			return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			return false;
	   	}
	}
	if (user.match(userPat)==null) {
		alert("The username doesn't seem to be valid.");
		return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
	  		 }
		}
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			return false;
   		}
	}
	if (len<2) {
		alert("This address is missing a hostname!");
		return false;
	}
	else	{
		return true;
	}
	}
}


function checkemail3()	{
	var illegchar = /\<|\>|\^|\"|\'|\%|\;|\(|\)|\&|\\|\//g;
	var formstr = document.feedburner;
	var error = "false";
	var errmsg;
	var emailStr = formstr.email.value;
	var checkTLD=1;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	if	(emailStr.match(illegchar))	{
		error = "true";
		msg = "Please use only letters and / or numbers for your email address (no &\'s, \\, /, etc).";
		errmsg = "formstr.email.focus()";
	}
	if ((formstr.email.value == "" || formstr.email.value == "Enter Primary Email here" || formstr.email.value.indexOf('@', 0) == -1) || formstr.email.value.indexOf('.') == -1)  {
		error = "true";
		msg = "Please enter a valid e-mail address.";
		errmsg = "formstr.email.focus()";
	}
	if (error=="true")	{
		alert(msg);
		eval(errmsg);
		return false;
	}	else	{
	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("This username contains invalid characters.");
			return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			return false;
	   	}
	}
	if (user.match(userPat)==null) {
		alert("The username doesn't seem to be valid.");
		return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
	  		 }
		}
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			return false;
   		}
	}
	if (len<2) {
		alert("This address is missing a hostname!");
		return false;
	}
	else	{
		return true;
	}
	}
}


















/*


// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );
function Get_Cookie(check_name) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}




var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 98.5 //set x offset of bar in %
var startY = 15 //set y offset of bar in px
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

var IEfadelength=1 //fade in duration for IE, in seconds
var Mozfadedegree=0.2 //fade in degree for NS6+ (number between 0 and 1. Recommended max: 0.2)

var ie=document.all
var dom=document.getElementById
var ns4=document.layers

function mozfadefx(){
if (parseFloat(objref.style.MozOpacity)<1)
objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+Mozfadedegree
else{
clearInterval(mozfadevar)
//controlledhidebox()
}
}


function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function hideform(){

	objref.style.visibility="hidden"
	if (typeof showonscrollvar!="undefined")	{
		clearInterval(showonscrollvar)
	}
	
	//links = (dom)?document.getElementById("Layer1").style : ie? document.all.Layer1 : document.Layer1
	cvr = (dom)?document.getElementById("coverPage").style : ie? document.all.coverPage : document.coverPage
	crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
	
	crossobj.visibility="hidden";
	cvr.visibility = "hidden";
	cvr.display="none";
	//links.visibility = "visible";
	//links.display="block";
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function staticbar(){
	var ie=document.all && !window.opera
	var dom=document.getElementById
	iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	objref=(dom)? document.getElementById("dropin") : document.all.dropin

	barheight=document.getElementById("dropin").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	if (objref.filters){
		objref.filters[0].duration=IEfadelength
		objref.filters[0].Apply()
		objref.filters[0].Play()
	}
	objref.style.visibility="visible"
	if (objref.style.MozOpacity){
		mozfadevar=setInterval("mozfadefx()", 90)
	}
	
	var arrayPageSize = getPageSize();
		
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"%";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	
	/*
	links = (dom)?document.getElementById("Layer1").style : ie? document.all.Layer1 : document.Layer1
	links.visibility = 'hidden';
	links.display = 'none';
	*/
	/*
	cvr = (dom)?document.getElementById("coverPage").style : ie? document.all.coverPage : document.coverPage
    cvr.visibility = 'visible';
	cvr.display="block";
	
	
	cvr.width = (arrayPageSize[0] + 'px');
	cvr.height = (arrayPageSize[1] + 'px');
	
	ftlObj = ml("dropin");
	stayTopLeft();
}



if (Get_Cookie('businessethicsblog'))	{}

else	{setTimeout("staticbar()",4000);}
//setTimeout("staticbar()",5000);

*/


