var strBaseZip = "53749";

function getCookie(NameOfCookie) {
	
	if (document.cookie.length > 0) {
	//visitor has cookies, look for ours (NameOfCookie)
	
		var begin = document.cookie.indexOf(NameOfCookie+"="); 
    	if (begin != -1) {
    	//Found the cookie, get and return its value
    		 
			begin += NameOfCookie.length+1; 
    		end = document.cookie.indexOf(";", begin);
    		if (end == -1) end = document.cookie.length;
    		return unescape(document.cookie.substring(begin, end));       
		}
		
		//Cookie not found, return null value 
		return null;
	}
	//No cookies (sad), return null value 
	return null;  
}


function setCookie (name, value, expires) {
	if (!expires) expires = new Date();
    
    document.cookie = name + "=" + escape (value) + "; expires=" + expires.toGMTString() +  "; path=/"; 
}


function insideUser(strIPString) {

	if (strIPString.indexOf("12.11.184.129") != -1) {
		return true;
	} else if (strIPString.indexOf("192.168.4") != -1) {
		return true;
	} else if (strIPString.indexOf("192.168.5") != -1) {
		return true;
	} else if (strIPString.indexOf("192.168.6") != -1) {
		return true;
	} else if (strIPString.indexOf("192.168.8") != -1) {
		return true;
	} else if (strIPString.indexOf("172.16") != -1) {
		return true;
	} else {
		return false;
	}

}    


function checkMe() {
// Empty constructor for function Pass-through


}


function checkMe_WC() {

	var objDateSeed = new Date();
	var intMilSec = objDateSeed.getMilliseconds();

	if (getCookie("inside") != "y") { //User is outside...
				
		if (getCookie("ZipCode") == null) { //We don't have their zipcode... 
			
			if (getCookie("visited") == "y" && getCookie("reg") == "n") { //They've either refused to submit, or...
	
				self.location = "http://www.bostonphoenix.com/utility/reg/zip_survey.asp"
					
			} else if (intMilSec >= 500 && intMilSec <= 550) { //This is their first time through, make choice "random"
				
				var myWin = window.open("","zippop",'width=125,height=125,resizable=no');
				myWin.location = "http://www.bostonphoenix.com/utility/reg/redirCheck.asp";
			}		
		}
	}
}




