I have been using a script by mike new that generates a popunder to a random site.
I wanted to change the dimensions of the new window for each site so I tried to incorporate a script from webmonkey.
And of course I can't get it to work. Any suggestions?
Here is the reulting script:
<script>
//PopUnder Power
//Credit notice must stay intact for use.
//Paste this entire javascript between the <head> & </head> tags of your page,
// Visit <!-- m --><a class="postlink" href="http://www.mikenew.net">http://www.mikenew.net</a><!-- m --> for more scripts.
// by Mike New, with special thanks to Jeff Phillips of classadrivers.com
var num = MD_random(0, 2)
// Begin. Specify URLs to randomly select from and pop-under. Edit & add freely.
var popunder=new Array()
popunder[0]="http://www.net-families.com/sponsorpages/sponsor0.htm"
popunder[1]="http://www.net-families.com/sponsorpages/sponsor1.htm"
popunder[2]="http://www.net-families.com/sponsorpages/sponsor2.htm";
// Specify the width and height of new popunder window (in pixels).
var width=new array()
width[0] = '250'
width[1] = '300'
width[2] = '468';
var height=new array()
height[0] = '250'
height[1] = '250'
height[2] = '60';
var p = 'scrollbars=no,resizable=no,toolbar=no,' + //these are obvious variables. set "yes" or "no".
'menubar=no,status=no,location=no,left=85,top=20,height=' + //yes/no, & the screen location
height[num] + ',width=' + width[num];
// Load new PopUnder only once per browser session? (0=no, 1=yes)
// Putting 0 will cause the Popunder to load every time page is loaded
// Specifying 1 will cause it to load only once per session
var one_time=1
// That's it! Don't edit the code below unless you're really good. //
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if the cookie exists
offset += search.length
end = document.cookie.indexOf(";", offset); // set the index of beginning value
if (end == -1) // set the index of the end of cookie value
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadornot(){
if (get_cookie('popunder')==''){
load_pop_power()
document.cookie="popunder=yes"
}
}
function load_pop_power(){
win2=window.open(popunder[num],"bw",p)
win2.blur()
window.focus()
}
if (one_time==0)
load_pop_power()
else
loadornot()
/*
MD_random()
This function returns a random integer between two numbers.
Source: Webmonkey Code Library
(<!-- m --><a class="postlink" href="http://www.hotwired.com/webmonkey/javascript/code_library/">http://www.hotwired.com/webmonkey/javas ... e_library/</a><!-- m -->)
Author: Michael Daines
Author Email: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
Usage: MD_random(number1, number2) returns a random integer between the values specified.
*/
function MD_random(r1, r2) {
if (r2 > r1) return (Math.round(Math.random()*(r2-r1))+r1);
else return (Math.round(Math.random()*(r1-r2))+r2);
}
</script>
I wanted to change the dimensions of the new window for each site so I tried to incorporate a script from webmonkey.
And of course I can't get it to work. Any suggestions?
Here is the reulting script:
<script>
//PopUnder Power
//Credit notice must stay intact for use.
//Paste this entire javascript between the <head> & </head> tags of your page,
// Visit <!-- m --><a class="postlink" href="http://www.mikenew.net">http://www.mikenew.net</a><!-- m --> for more scripts.
// by Mike New, with special thanks to Jeff Phillips of classadrivers.com
var num = MD_random(0, 2)
// Begin. Specify URLs to randomly select from and pop-under. Edit & add freely.
var popunder=new Array()
popunder[0]="http://www.net-families.com/sponsorpages/sponsor0.htm"
popunder[1]="http://www.net-families.com/sponsorpages/sponsor1.htm"
popunder[2]="http://www.net-families.com/sponsorpages/sponsor2.htm";
// Specify the width and height of new popunder window (in pixels).
var width=new array()
width[0] = '250'
width[1] = '300'
width[2] = '468';
var height=new array()
height[0] = '250'
height[1] = '250'
height[2] = '60';
var p = 'scrollbars=no,resizable=no,toolbar=no,' + //these are obvious variables. set "yes" or "no".
'menubar=no,status=no,location=no,left=85,top=20,height=' + //yes/no, & the screen location
height[num] + ',width=' + width[num];
// Load new PopUnder only once per browser session? (0=no, 1=yes)
// Putting 0 will cause the Popunder to load every time page is loaded
// Specifying 1 will cause it to load only once per session
var one_time=1
// That's it! Don't edit the code below unless you're really good. //
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if the cookie exists
offset += search.length
end = document.cookie.indexOf(";", offset); // set the index of beginning value
if (end == -1) // set the index of the end of cookie value
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadornot(){
if (get_cookie('popunder')==''){
load_pop_power()
document.cookie="popunder=yes"
}
}
function load_pop_power(){
win2=window.open(popunder[num],"bw",p)
win2.blur()
window.focus()
}
if (one_time==0)
load_pop_power()
else
loadornot()
/*
MD_random()
This function returns a random integer between two numbers.
Source: Webmonkey Code Library
(<!-- m --><a class="postlink" href="http://www.hotwired.com/webmonkey/javascript/code_library/">http://www.hotwired.com/webmonkey/javas ... e_library/</a><!-- m -->)
Author: Michael Daines
Author Email: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
Usage: MD_random(number1, number2) returns a random integer between the values specified.
*/
function MD_random(r1, r2) {
if (r2 > r1) return (Math.round(Math.random()*(r2-r1))+r1);
else return (Math.round(Math.random()*(r1-r2))+r2);
}
</script>