// Added by Rick M 1/24/08

// Prevent Exit
var PreventExitPop = false;

// Seen First Page?
var saw = readCookie("subbed")
if (saw == 1) { document.location.href = 'http://www.creapprentice.com/offer/'; }

// Form Check * Rick M 02/06/08 *
function checkForm(myForm)
{
	// First Name
	if (myForm.Name.value == ""){
	alert("Please enter your Name to continue."); return (false); }
	
	// Email		
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.Email.value)){}
	else { alert("Please enter a valid E-mail Address to continue."); return (false); }
	
	var PreventExitPop = true;
	var leaving = false;
	createCookie('subbed', '1', 365);
	return true;
}

// Unload
function unl()
{
	var r = readCookie("saw")
	var em = form1.from.value
	if (r == 1) { return true; }
	if (em != '') { createCookie("subbed", "1", 365); return true; } 
 	createCookie("saw", "1", 365)

	var page = "<html><head><meta http-equiv=Content-Type content='text/html; charset=iso-8859-1'><title>Billion Dollar Secret to Commercial Real Estate Profits<\/title><meta http-equiv=Content-Language content=en-us><style type='text/css'><!--.Normal {	font-family: Verdana;}--><\/style><\/head><body bgcolor=#FFFFFF link=blue class='Normal' lang=EN-US><div align=center>  <table width=660 border=1 cellpadding=15 cellspacing=0 bordercolor='#000000'>    <tr>      <td class='Normal'> This <u>special free report won't be available for          much longer<\/u>...        <blockquote>          <h4 >            <div align='center'>              <p><font color='#CC0000'>Work from Home!<br>                <br>                Make Money as a Professional <br>                Commercial Real Estate Property Scout <\/font><\/p>            <\/div>              <p>An exciting opportunity for the average person to earn an extraordinary                income finding commercial real estate property for our private                investor group to purchase. <br>                <br>                No experience required. Train at home to earn more money than                most doctors, lawyers and CEOs... <\/p>          <\/h4>          <ul>            <li><font size='2' face='Arial, Helvetica, sans-serif'>Without using <b><u>ANY<\/u><\/b> of                your own money, credit or capital&#8230;<br>              <\/font><\/li>            <li><font size='2' face='Arial, Helvetica, sans-serif'>Working just                minutes a day from your home, no matter where you live and with                no travel required<br>              <\/font><\/li>            <li><font size='2' face='Arial, Helvetica, sans-serif'>Without taking                ANY risk&#8230;<br>              <\/font><\/li>            <li><font size='2' face='Arial, Helvetica, sans-serif'>Without becoming                a real estate agent, landlord, property manager or mortgage broker&#8230;<br>              <\/font><\/li>            <li><font size='2' face='Arial, Helvetica, sans-serif'>With no selling,                no experience, no expertise and no license required&#8230;<br>              <\/font><\/li>            <li><font size='2' face='Arial, Helvetica, sans-serif'>And without                doing crazy &#8220;No Money Down&#8221; deals, rehabbing ugly                houses, buying complex tax liens or &#8220;flipping&#8221; properties--in                fact, <u>without buying or selling any real estate at all<\/u>.<\/font><\/li>          <\/ul>        <\/blockquote>        <h3 align='center'><a href='http://www.creapprentice.com/offer/'>Click            here to learn more<\/a><\/h3>      <\/td>    <\/tr>  <\/table><\/div><\/body><\/html>"
	document.write(page)
	
	var leave = confirm('Are you sure you want to navigate away from this page?\n\n\n------------\n\nYou\'re leaving us without signing up, so here\'s a last chance special offer for you.\n\nThis offer will only be shown once.\n\nTo see this offer please click on the CANCEL button\n\n------------\n\nClick OK to continue or CANCEL to stay on the current page.\n\n')
}

// Set Cookies
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}

	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

// Read Cookies
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

// Exit
function ExitPop() {
	if(PreventExitPop == false)	{
//	if(PreventExitPop == true)	{
		PreventExitPop=true;
		MainBody.style.display='none';
		ExitDiv.style.display='block';
		alert ("Wait! We have a very special offer for you! Please hit 'Cancel' on the next window to remain on this page...");
//		return "I bet we know why you want to navigate away from this page...\n\n**************************************************************\nPLEASE WAIT! Before you go!\n\nYou see, we surveyed people just like you that also left our page and\ndiscovered most either did not believe the opportunity was for real OR \nthey thought no one could make any money in real estate in today's market.\n\nWell, we'd like to PROVE IT TO YOU right now by mailing you a full day\nreal estate seminar on 4 CDs absolutely FREE. No strings or gimmicks!\n\nJust click on the CANCEL button to stay on the current page and\ntake advantage of our FREE offer!\n\n***************************************************************"
		return "PLEASE WAIT! Before you go!\n\nWe have surveyed people just like you who also left our page \nand discovered most either did not believe the opportunity was \nfor real OR they thought no one could make any money in \ntoday's real estate market.\n\nWell, we'd like to PROVE IT TO YOU right now by mailing \nyou a full day real estate seminar on FOUR CDs absolutely \nFREE. No strings attached or gimmicks!\n\nPress OK to decline and leave our FREE Offer, or press \nCancel to take advantage of our FREE Offer.  In other words, \nDO NOT PRESS OK UNLESS YOU ARE SURE YOU DO \nNOT WANT THE FREE CD OFFER!";
	}
}