/*
	Copyright © 1996-2000 Gorp.com, Inc. All rights reserved. 
	You may not use this (or any part of this) code 
	without written permission from Gorp.com
*/

	var regCookie; 
	var gorpCookie;
	var now = new Date();
	var tomorrow = new Date(now.getTime() + 1000 * 60 * 60 * 24 * 30);  //it's actualy one month :)
	var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
	var domain = ".gorp.com";
	var path = "/";

	function regPrompt(){
		gorpCookie = getCookie("User");
		regCookie = getCookie("pgcount") - 0;
		
		if (!gorpCookie){
			if(!regCookie){
				setCookie('pgcount', 1, tomorrow, domain, path);
			}
			else if(regCookie >= 0 && regCookie < 2){
				setCookie('pgcount', regCookie + 1, tomorrow, domain, path);
			}
			else if(regCookie > 0 && regCookie == 2){
				var wnd;
				if (sBrand == 'aol'){
					wnd = window.open('http://gorptools.gorp.com/gorpapps/registration/exit_popup_aol.asp?brand=aol', 'popup','resizable=yes,location=no,width=315,height=300');
				}
				else if (sBrand == 'americaonline'){
					wnd = window.open('http://gorptools.gorp.com/gorpapps/registration/exit_popup_aol.asp?brand=americaonline', 'popup','resizable=yes,location=no,width=315,height=300');
				}
				else if (sBrand == 'netscape'){
					wnd = window.open('http://gorptools.gorp.com/gorpapps/registration/exit_popup_aol.asp?brand=netscape', 'popup','resizable=yes,location=no,width=315,height=300');
				}
				else if (sBrand == 'compuserve'){
					wnd = window.open('http://gorptools.gorp.com/gorpapps/registration/exit_popup_aol.asp?brand=compuserve', 'popup','resizable=yes,location=no,width=315,height=300');
				}
				else{
					wnd = window.open('http://gorptools.gorp.com/gorpapps/registration/exit_popup.htm', 'popup','resizable=yes,width=314,height=250');
				}				
				wnd.focus();
				setCookie('pgcount', '-1', tomorrow, domain, path);
			}
			else{
				//popup was shown already
			}
		}
	}

	function regPrompt2() {
		regCookie = getCookie("pgcount") - 0;
		
		if(regCookie != "111"){
			var wnd;
			wnd = window.open('http://gorptools.gorp.com/gorpapps/registration/exit_popup.htm', 'popup','resizable=yes,width=500,height=326');
			wnd.blur();
			window.focus();
			setCookieForSession('pgcount', "111", domain, path);
		}
	}

function resetCookies(){
	setCookie('pgcount', '', yesterday, domain, path);
	setCookie('User', '', yesterday, domain, path);
	//alert('cookies were reset');
}

	function regPrompt3() {
		regCookie = getCookie("pgcount") - 0;
		
		if(regCookie != "111"){
			var wnd;
			wnd = window.open('http://gorp.com/gorp/popup/iceland/iceland_popunder.htm', 'popup','resizable=yes,width=718,height=323');
			wnd.blur();
			window.focus();
			setCookieForSession('pgcount', "111", domain, path);
		}
	}

