Popup Script Works but causes errors on some pages


Y

Yonih

Hey Everyone,

Need some help. I have a popup that I have integrated into my website
that was working great however when I go to certain pages within my
site I get a IE error. "This web site cannot be loaded" or something
like that when I press ok it sends me to Website cannot be displayed
screen. This only happens on a couple of the web pages and was
wondering if someone can see why from my script.
Please let me know if anyone sees any mistakes that may cause this.
Thank you
Yoni Hirsch

<!-- Start Coupon Popup -->
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0" onLoad="onlyOnce();setFocus();"><center><div
align="center"><font size="1" style="font-size:11px"
face="arial,helvetica"><center><div align="center">


<script language="javascript" src="http://www.goldspeed.com/lib/zahav/
coupondropdown.js"></script>
<!-- Start Date Integration -->
<Script type="text/javaScript">

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

<!-- End Date Integration -->

<!-- Start onlyOnce Cookie -->

// the already existing code
function initpopup() {
window.open(initpopup())
}

// the new code
function onlyOnce() {
if (document.cookie.indexOf("hasSeen=true") == -1) {
var later = new Date();
later.setFullYear(later.getFullYear()+10);
document.cookie = 'hasSeen=true;path=/;';
// call the old function
initpopup();
}
}
</script>
<!-- End onlyOnce Cookie -->

<!-- Start Text Box -->
<style>#close {cursor:pointer;background-color: #cccccc; border: 1px
#656565 solid; position: absolute; padding: 0px 6px 2px 6px; top:
-1px; right: -1px; margin-right: 0px;} #close a {color: #333333; text-
decoration:none;}</style>
<div id="open" style="display:none;background-
color:#FFFFFF;position: absolute; top: 0px; right: 4px; color:
#656565; border-bottom: 1px solid #656565; border-left: 1px solid
#656565; border-right: 1px solid #656565; font-weight: bold;
background-color: #ffffff; padding: 0px 4px 2px 4px;">
<div id="close" onClick="return popupclose()"><font color="#000000"
size="-2">CLOSE</font></div>

<div class="t11"><font color="#FF0000" size="2" face="Arial">Special
Sale Today<br>
Use Coupon Code: GSAVE10 <br>
and Take 10% Off Your Order</font><font color="#FF0000" size="3"
face="Arial"><br>
<font size="1">*This Coupon Expires at Midnight Tonight -
<Script type="text/javaScript"> document.write(today);</script>
</font> </font><br>
<input class="t11" onclick="coupon();" type="button" value="Add
Coupon To My Cart"></div></div>
<!-- End Text Box -->

<!-- Begin Popup Script -->
<script language="javascript">
var dsDiv = document.getElementById("open");

function initpopup(){
if (getCookie('custompopup') == "null" || getCookie('custompopup') !
= "1"){
dsDiv.style.display = "block";
start = dsDiv.offsetHeight;
dsDiv.style.top = 0-start;
scrollpopup(0,1);}
}
function coupon(item){
window.open("http://store.yahoo.com/cgi-bin/clink?zahav+gdDQKW
+index.html+GSAVE10","_self");
window.open('couponadded.html', 'couponadded',
'status=no,scrollbars=no,resizable=no,width=215,height=10,top=0,left=0')
popupclose();
open("http://www.goldspeed.com","_self");
}


var searchtimer;
var start = 0;
function scrollpopup(start,inc){
if(parseInt(dsDiv.style.top) < start){
dsDiv.style.top = parseInt(dsDiv.style.top)+inc;
searchtimer = window.setTimeout ("scrollpopup("+start+","+inc+");",
10);}
else{
clearTimeout(searchtimer);}
}

function popupclose(){
scrollpopup(start,-1);
createCookie('custompopup',1,'120');
}
</script>
<!-- End Popup Script -->
<!-- End Coupon Popup -->
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top