var master_switch = true;						//easy boolean that if true will enable this happy process to continue for all generated static pages, if the popup ever has to go away set this to false and save and rest easy
var link_nav_switch = false;						//if this gets set to true via the use of the site interface we do not think about popuping
var popup_url = "http://www.wdfm.com/subscribeleave.htm";		//easy global string variable for setting the desired URL for the popup window
var popup_features = "scrollbars=yes,width=620,height=450,left=10,top=10,resizable=yes,location=yes,toolbar=yes,status=yes";	//another easy global string variable for setting the features of the popup window
var popup_max_count = 5;						//the super smooth global integer for adjusting the number of times we care to throw the popup and store that fact in the associated domain cookie
var popup_cookie_count = 0;						//pull the number of times we have popped for this client from the cookie
var popup_cookie_date = new Date();

//the name of the cookie we are setting to track the popup's history is 'subscribe_popup_history'

function link_nav_switch_flip(flip_bit){
	link_nav_switch = true;
//	if(flip_bit == 1){		//the site navigation has been used, set the flag to true
//		link_nav_switch = true;		
//	} else if(flip_bit == 0){	//for whatever reason the flag needs to be set to false, might be implemented later
//		link_nav_switch = false;
//	} else {			//watch out, we seem to have violated our simple interface and do not have the 1 or 0 
//		alert("General switch interface error, check the link bindings for link_nav_switch_flip and ensure that the param value is either a 1 or a 0");
//	}
}

function popup_unload_check(){
//	if(!link_nav_switch){
//		if(!document.cookie){ //no cookie stored set one and throw the window at them
//				popup_cookie_date.setMonth(11);
//				popup_cookie_date.setDate(31);
//				popup_cookie_date.setYear(2020);
//				SetCookie("popup_count","1",popup_cookie_date,"/");
//				window.open(popup_url,"popup_win",popup_features);		
//		} else { //cookie stored check the value and determine if we need to toss and set the adjusted count if we do
//			if(GetCookie("popup_count")){
//				popup_cookie_count = parseInt(GetCookie("popup_count"),10);
//				if(popup_cookie_count < 5){
//					popup_cookie_date.setMonth(11);
//					popup_cookie_date.setDate(31);
//					popup_cookie_date.setYear(2020);
//					SetCookie("popup_count",("" + (popup_cookie_count + 1) + ""),popup_cookie_date,"/");
//					window.open(popup_url,"popup_win",popup_features);
//				}
//			}else{
//				popup_cookie_date.setMonth(11);
//				popup_cookie_date.setDate(31);
//				popup_cookie_date.setYear(2020);
//				SetCookie("popup_count","1",popup_cookie_date,"/");
//				window.open(popup_url,"popup_win",popup_features);
//			}
//		}		
//	}	

}
