Click to See Complete Forum and Search --> : Need Some Help


Hyperion
07-31-2003, 07:51 PM
can someone please explain to me what the following does?:


<html>
<script language ="javascript" type = "text/javascript">
var popunder="http://www.diave.com"
var once_per_session=1
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('popunder')==''){
loadpopunder()
document.cookie="popunder=yes"
}
}

function loadpopunder(){
win2=window.open(popunder)
win2.blur()
window.focus()
}

if (once_per_session==0)
loadpopunder()
else
loadornot()


window.location ="http://www.geocities.com"+"/asdf";


//This padding is to make the file size larger than 512 bytes so explorer
//never shows its 404 error pretty page, thus blocking the redirect to diave
//how's that for thoughtful on microsoft's part
//This padding is to make the file size larger than 512 bytes so explorer
//never shows its 404 error pretty page, thus blocking the redirect to diave
//how's that for thoughtful on microsoft's part
//This padding is to make the file size larger than 512 bytes so explorer
//never shows its 404 error pretty page, thus blocking the redirect to diave
//how's that for thoughtful on microsoft's part

</script>
</html>

Bungholio
07-31-2003, 11:38 PM
pretty sure it simply checks a cookie and decides wether to display a Pop-Under or not, if you want details, post in the javascript forum instead

...good luck