//JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use //Win Type: Pop Under | Session Only //Specify URLs to randomly select from and popup/popunder: //To display a single URL, just remove all but the first entry below: var popurls=new Array() //popurls[0]="http://www.eldercarelink.com/community.htm?source=ecldir"; popurls[0]="http://blog.eldercarelink.com/?source=ecldir"; function openpopup(popurl){ w=800 h=600 var p = "toolbar,location,status,scrollbars,menubar,resizable"; if (window.screen) { w = window.screen.availWidth; h = window.screen.availHeight; p = p + ",height="+h+", width="+w+",top=0,left=0"; }else{ p = p + ',fullscreen'; } var winpops=window.open(popurl,"",p) winpops.blur() window.focus() } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadornot(){ if (get_cookie('ghpopup')==''){ openpopup(popurls[Math.floor(Math.random()*(popurls.length))]) document.cookie="ghpopup=yes" } } var myrules = { '.popunder' : function(element){ element.onclick = function(){ loadornot(); } } }; Behaviour.register(myrules);