// JavaScript Document

var xmlHttp

function test()
{
alert ("Nothing is fricking working and I don't know why");	
}

function working()
{
document.getElementById("approvedthree").innerHTML="<img src='images/working.gif'/>";
}

function checkCaptcha(securitycode)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="captchacheck.php";
url=url+"?securitycode="+securitycode;

xmlHttp.onreadystatechange=CaptchaYesNo;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function CaptchaYesNo() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	if(xmlHttp.responseText == "yes")
	{
//		 document.getElementById("approved").innerHTML=xmlHttp.responseText; 
		 document.getElementById("approvedthree").innerHTML="<img src='images/check.jpg'/>";
	}
	else
	{
//		 document.getElementById("approved").innerHTML=xmlHttp.responseText;
		 document.getElementById("approvedthree").innerHTML="<img src='images/ex.jpg'/>";
	}
	 
	 
 document.getElementById("approved3").innerHTML=xmlHttp.responseText; 
 } 
}

function simplesend(To,From,Subject,Message)
{
//here is where my code actually goes

var four = document.getElementById("approved1").innerHTML;

var five = document.getElementById("approved2").innerHTML;

var six = document.getElementById("approved3").innerHTML;

//if(three == "<img src='images/check.jpg'/>")
if(six == "yes")
{
	if(four == "yes")
	{
		if(five != "no")
		{
			return true;			
		}
	}
}


return false;
}


function closesplashdiv()
{
setTimeout("reallycloseit()", 2000);
}
function reallycloseit()
{
$('splashdiv').fade();
}

//THIS IS THE STANDARD FUNCTION CALLED BY ALL THE AJAX FUNCTIONS
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function checkMailIdTheirs(mailids)
{
var arr = new Array('.com','.net','.org','.biz','.coop','.info','.museum','.name','.pro'
,'.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag','.ai','.al',
'.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw','.az','.ba','.bb',
'.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm','.bn','.bo','.br','.bs',
'.bt','.bv','.bw','.by','.bz','.ca','.cc','.cd','.cf','.cg','.ch','.ci',
'.ck','.cl','.cm','.cn','.co','.cr','.cu','.cv','.cx','.cy','.cz','.de',
'.dj','.dk','.dm','.do','.dz','.ec','.ee','.eg','.eh','.er','.es','.et',
'.fi','.fj','.fk','.fm','.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh',
'.gi','.gl','.gm','.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy',
'.hk','.hm','.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io',
'.iq','.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li','.lk',
'.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg','.mh','.mk',
'.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt','.mu','.mv','.mw',
'.mx','.my','.mz','.na','.nc','.ne','.nf','.ng','.ni','.nl','.no','.np',
'.nr','.nu','.nz','.om','.pa','.pe','.pf','.pg','.ph','.pk','.pl','.pm',
'.pn','.pr','.ps','.pt','.pw','.py','.qa','.re','.ro','.rw','.ru','.sa',
'.sb','.sc','.sd','.se','.sg','.sh','.si','.sj','.sk','.sl','.sm','.sn',
'.so','.sr','.st','.sv','.sy','.sz','.tc','.td','.tf','.tg','.th','.tj',
'.tk','.tm','.tn','.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug',
'.uk','.um','.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu',
'.ws','.wf','.ye','.yt','.yu','.za','.zm','.zw');

var mai = mailids;
var val = true;
var beforeat="";
var afterat="";
var afterat2="";

var dot=mai.lastIndexOf(".");
var con=mai.substring(dot, mai.length);
con=con.toLowerCase();
con=con.toString();

for(var i=0;i<(arr.length);i++)
{
	if(con == arr[i])
	{
		val=true;
		break;
	}
	else
	{
		val=false;
	}
}

var att=mai.lastIndexOf("@");
beforeat=mai.substring(0,att);
beforeat=beforeat.toLowerCase();
beforeat=beforeat.toString();
var asci1=beforeat.charCodeAt(0);

afterat=mai.substring(att+1, dot);
afterat=afterat.toLowerCase();
afterat=afterat.toString();

afterat2=mai.substring(att+1, mai.length);
afterat2=afterat2.toLowerCase();
afterat2=afterat2.toString();

if(beforeat=="" || afterat=="" || beforeat.length>30)
	val=false;

if(afterat2.length>64 || afterat.length<2)
	val=false;

if((afterat.charCodeAt(0))==45 || (afterat.charCodeAt(afterat.length-1))==45)
	val=false;

if(val==true)
{
	if(asci1 > 47 && asci1 < 58)
		val=false;
		
	if(asci1 < 48 || asci1 > 57)
	{
		for(var i=0; i<=beforeat.length-1; i++)
		{
			var asci2=beforeat.charCodeAt(i);
			if((asci2<=44 || asci2==47) || (asci2>=58 && asci2<=94) || (asci2==96) || (asci2>=123 && asci2<=127))
			{
				val=false;
				break;
			}
		}
		
		for(var j=0; j<=afterat.length-1; j++)
		{
			var asci3=afterat.charCodeAt(j);
			if((asci3<=44)  || (asci3==47) || (asci3>=58 && asci3<=96) || (asci3>=123 && asci3<=127))
			{
				val=false;
				break;
			}
		}	
	}
}

if(val==false)
{
	document.getElementById("approvedone").innerHTML="<img src='images/ex.jpg'/> enter a valid email address";
document.getElementById("approved1").innerHTML="no"; 	
	return false;
}
else
{
	document.getElementById("approvedone").innerHTML="<img src='images/check.jpg'/>"
document.getElementById("approved1").innerHTML="yes"; 
return true;
}
}


function checkMailIdYours(mailids)
{
var arr = new Array('.com','.net','.org','.biz','.coop','.info','.museum','.name','.pro'
,'.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag','.ai','.al',
'.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw','.az','.ba','.bb',
'.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm','.bn','.bo','.br','.bs',
'.bt','.bv','.bw','.by','.bz','.ca','.cc','.cd','.cf','.cg','.ch','.ci',
'.ck','.cl','.cm','.cn','.co','.cr','.cu','.cv','.cx','.cy','.cz','.de',
'.dj','.dk','.dm','.do','.dz','.ec','.ee','.eg','.eh','.er','.es','.et',
'.fi','.fj','.fk','.fm','.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh',
'.gi','.gl','.gm','.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy',
'.hk','.hm','.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io',
'.iq','.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li','.lk',
'.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg','.mh','.mk',
'.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt','.mu','.mv','.mw',
'.mx','.my','.mz','.na','.nc','.ne','.nf','.ng','.ni','.nl','.no','.np',
'.nr','.nu','.nz','.om','.pa','.pe','.pf','.pg','.ph','.pk','.pl','.pm',
'.pn','.pr','.ps','.pt','.pw','.py','.qa','.re','.ro','.rw','.ru','.sa',
'.sb','.sc','.sd','.se','.sg','.sh','.si','.sj','.sk','.sl','.sm','.sn',
'.so','.sr','.st','.sv','.sy','.sz','.tc','.td','.tf','.tg','.th','.tj',
'.tk','.tm','.tn','.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug',
'.uk','.um','.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu',
'.ws','.wf','.ye','.yt','.yu','.za','.zm','.zw');

var mai = mailids;
var val = true;
var beforeat="";
var afterat="";
var afterat2="";

var dot=mai.lastIndexOf(".");
var con=mai.substring(dot, mai.length);
con=con.toLowerCase();
con=con.toString();

for(var i=0;i<(arr.length);i++)
{
	if(con == arr[i])
	{
		val=true;
		break;
	}
	else
	{
		val=false;
	}
}

var att=mai.lastIndexOf("@");
beforeat=mai.substring(0,att);
beforeat=beforeat.toLowerCase();
beforeat=beforeat.toString();
var asci1=beforeat.charCodeAt(0);

afterat=mai.substring(att+1, dot);
afterat=afterat.toLowerCase();
afterat=afterat.toString();

afterat2=mai.substring(att+1, mai.length);
afterat2=afterat2.toLowerCase();
afterat2=afterat2.toString();

if(beforeat=="" || afterat=="" || beforeat.length>30)
	val=false;

if(afterat2.length>64 || afterat.length<2)
	val=false;

if((afterat.charCodeAt(0))==45 || (afterat.charCodeAt(afterat.length-1))==45)
	val=false;

if(val==true)
{
	if(asci1 > 47 && asci1 < 58)
		val=false;
		
	if(asci1 < 48 || asci1 > 57)
	{
		for(var i=0; i<=beforeat.length-1; i++)
		{
			var asci2=beforeat.charCodeAt(i);
			if((asci2<=44 || asci2==47) || (asci2>=58 && asci2<=94) || (asci2==96) || (asci2>=123 && asci2<=127))
			{
				val=false;
				break;
			}
		}
		
		for(var j=0; j<=afterat.length-1; j++)
		{
			var asci3=afterat.charCodeAt(j);
			if((asci3<=44)  || (asci3==47) || (asci3>=58 && asci3<=96) || (asci3>=123 && asci3<=127))
			{
				val=false;
				break;
			}
		}	
	}
}

if(val==false)
{
	if(mai=="")
	{
	document.getElementById("approvedtwo").innerHTML="optional";
document.getElementById("approved2").innerHTML="yesss"; 
return false;
	}
	else
	{
	document.getElementById("approvedtwo").innerHTML="<img src='images/ex.jpg'/> enter a valid email address";
document.getElementById("approved2").innerHTML="no"; 
return false;
	}
}
else
{
	document.getElementById("approvedtwo").innerHTML="<img src='images/check.jpg'/>";
document.getElementById("approved2").innerHTML="yes"; 
return true;
}
}


function stopRKey(evt) 
	{
  	var evt = (evt) ? evt : ((event) ? event : null);
  	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  	if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
	}

	document.onkeypress = stopRKey;
	
function splashdiv(id)
{
	switch(id)
	{
	case 1:
	$('splashdiv').update('To provide the most secure, easy to use, reliable anonymous email/messaging service in the world. And we do it every time an eNote is sent from our page. No other company provides free, ease of use, no advertising, no sign up, type service. So try us today. <br/> <br/> <br/>	eNote.com <br/><br/><br/><a href="#" onclick=$("splashdiv").fade()><strong>(X) close</strong></a>');
	$('splashdiv').morph('height:200px;');
	$('splashdiv').appear({duration: '1'});
	
	break;
	
	case 2:
	$('splashdiv').update('To provide the most secure, easy to use, reliable anonymous mail/messaging service in the world.   eNote takes pride in its state of the art design and software, making Your eNotes anonymous even to us.  We guarantee that every eNote you receive is a legitimate, personal message. <br><br> Spam Policy: Here at eNote we do our best to see that not a single spam or soliciting/advertising type email gets through.  You can be assured that when you receive an eNote, it was written by a specific person, who intended it specifically for you. <br><br> No other company provides free, ease of use, no advertising, and no sign up, type service.  So try us today.<br /><br />eNote.com<br/><br/><br/><a href="#" onclick=$("splashdiv").fade()><strong>(X) close</strong></a>');
	$('splashdiv').morph('height:350px;');
	$('splashdiv').appear({duration: '1'});
	break;
	
	case 3:

        document.getElementById('txtTheirEmail').value = "contactus@enote.com";
$('txtTheirEmail').activate();

//$('splashdiv').update('contactus@enote.com<br /><br />Marketing@enote.com	<br /><br />Corporate@enote.com<br/><br/><br/><a href="#" onclick=$("splashdiv").fade()><strong>(X) close</strong></a>');
	//$('splashdiv').morph('height:230px;');
	//$('splashdiv').appear({duration: '1'});
	break;
	
	case 4:
	$('splashdiv').update('Legal NOTICE: ENOTE retains the right to block, stop, and/or the option to remove any messages sent via ENOTE that are found to be; threatening, harassing or of a criminal and illegal nature.  ENOTE is not responsible for the integrity, content, or accuracy of the messages sent.  ENOTE complies with all federal/local laws and regulations, and allows full transparency to any and all federal/local government entities upon request.<br/><br/> Services: ENOTE cannot guarantee the acceptance, delivery or receivable nature of any and all messages sent via eNote.com. Delivery of all messages and services provided by eNote.com are dependent on the recipients receiving medium of work/business/home/and or local regulations, over which  ENOTE has no control. Clients/users of eNote.com are held fully responsible for the content, nature, accuracy of mailing address and/or electronic address, and phone numbers provided to eNote.com by the client/user.  ENOTE does not guarantee the delivery of any and all content sent through its page.  ENOTE does not endorse or support any/and all content provided by users, and ENOTE cannot be held liable for the content withheld within any messages or attached documents sent via eNote.com.<br/><br/><br/><a href="#" onclick=$("splashdiv").fade()><strong>(X) close</strong></a>');
	$('splashdiv').morph('height:400px;');
	$('splashdiv').appear({duration: '1'});
	break;
	
	case 5:
	$('splashdiv').update('Your email address is required if you would like the recipient to be able to reply to your eNote. Your email address will remain 100% anonymous. Additionally, your email address will never be sold or used for solicitation purposes.<br/><br/><br/><a href="#" onclick=$("splashdiv").fade()><strong>(X) close</strong></a>');
	$('splashdiv').morph('height:230px;');
	$('splashdiv').appear({duration: '1'});
	break;	
	
	default:
	break;		
	}
	
	
	
	
}
