//Change popupUrl1 and popupUrl2 to test different popups
var popupUrl1 = "http://hop.clickbank.net/?75023/fsbohelp";
var popupUrl2 = "http://clickbank.com/marketplace/?r=75023&c=family.realestate&s=1&i=10&t=ClickBank_Marketplace";

/*
For sale by owner help
http://hop.clickbank.net/?75023/fsbohelp

Target MLS
http://www.targetmls.com/cgi-bin/click2.cgi?id=scottrty

Mortgage tips
http://hop.clickbank.net/?75023/mortgages

Robert Allen-Mutliple streams of income
http://hop.clickbank.net/?75023/wealthguy
*/

//pop up function

var exit=false;

/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
/*
 * Popup code generated by PopUpMaster Pro from 
 * http://popupmaster.com
 * Copyright (c)2003, Steve Shaw, takanomi.com
 */

var popWin=null;
var cookie="MyRealEstateBusiness.com";

function openPopup(mypage,myname,w,h,scroll,pos) {
	if(exit) {
		//if (getcookie(cookie)=="") {
			if(pos=="random")
				{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
			if(pos=="center")
				{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
			else if((pos!="center" && pos!="random") || pos==null)
				{LeftPosition=0;TopPosition=20;}
			settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
			
			popWin=window.open(mypage,myname,settings);
			
			self.focus();
		//	setcookie();
		//}
	}
}

function getcookie(cookieName) {
	var id = cookieName + "=";
	var cookievalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(id);
		if (offset != -1) {
			cookievalue = "x";
		}
	}
	return cookievalue;
}

function setcookie () {
	var today = new Date();
	//var expdate = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000);
	var expdate = new Date(today.getTime() + 1 * 1 * 60 * 60 * 1000);
	document.cookie = cookie
		+ "="
		+ escape ("done") + ";expires=" + expdate.toGMTString();
}

function popup()
{
	if (getcookie(cookie)=="") {
		openPopup(popupUrl1, '', 800, 600, 'yes', 'center');
		openPopup(popupUrl2, '', 800, 600, 'yes', 'center');
		setcookie();
	}
}



