
<!-- Hide from old browsers....
// Assures visitor will only see popup window once per day,
// unless popupnow is set to true in the call

function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length)))
	return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,domain) {
	 // alert ("SetCookie called, name='" + name + "', value= '" + value + "', expires = '" + expires + "'\n");
    document.cookie = name + "=" + escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (domain) ? ";domain=.rgj.com" + domain : "");
}
        // ( (path) ? ";path=" + path : "") +

function CheckPopup(popupname,url,w,h,popupnow,scrollbars) {
    var cookieExists = Get_Cookie(popupname);
    if (!popupnow && !cookieExists) {
        var todays_date = new Date();
        var expires_date = new Date();
        expires_date.setHours(23);
        expires_date.setMinutes(59);
        expires_date.setSeconds(59);
        // Cookie goes away at Midnight

        Set_Cookie(popupname, todays_date, expires_date);
        popupnow = true;
    }
    if (popupnow) {
	PopUp(popupname,url,w,h,scrollbars);
    }
}

function PopUp(popupname,url,w,h,scrollbars) {
	window.name = "popUpParent";	
	window.open(url,popupname, "width=" + w + ",height=" + h + ",scrollbars=" + scrollbars + ",resizable");
}


// -->
