T
Tjerk
Hello all,
I have the script below to change an image depending on the date upto
january it worked fine but then it just stopped working does anybody have an
idea how I can make it work again or why it doesn't work?
Thanks in advance
Tjerk
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Beginning of JavaScript -
today=new Date(); //determines the current date
start=new Date("October 8, 2003"); //date you want your image to start
displaying
end=new Date("November 7, 2003"); //date you want your image to stop
displaying
start1=new Date("November 7, 2003"); //date you want your image to start
displaying
end1=new Date("December 6, 2003"); //date you want your image to stop
displaying
start2=new Date("December 6, 2003"); //date you want your image to start
displaying
end2=new Date("December 20, 2003"); //date you want your image to stop
displaying
start3=new Date("December 20, 2003"); //date you want your image to start
displaying
end3=new Date("January 18, 2004"); //date you want your image to stop
displaying
start4=new Date("January 18, 2004"); //date you want your image to start
displaying
end4=new Date("Febuary 4, 2003"); //date you want your image to stop
displaying
start5=new Date("Febuary 4, 2003"); //date you want your image to start
displaying
end5=new Date("Febuary 14, 2004"); //date you want your image to stop
displaying
start6=new Date("Febuary 25, 2004"); //date you want your image to start
displaying
end6=new Date("March 18, 2004"); //date you want your image to stop
displaying
start7=new Date("March 18, 2004"); //date you want your image to start
displaying
end7=new Date("April 11, 2004"); //date you want your image to stop
displaying
start8=new Date("April 11, 2004"); //date you want your image to start
displaying
end8=new Date("April 22, 2004"); //date you want your image to stop
displaying
start9=new Date("April 22, 2004"); //date you want your image to start
displaying
end9=new Date("May 5, 2004"); //date you want your image to stop displaying
start10=new Date("May 5, 2004"); //date you want your image to start
displaying
end10=new Date("June 4, 2004"); //date you want your image to stop
displaying
start11=new Date("June 4, 2004"); //date you want your image to start
displaying
end11=new Date("June 11, 2004"); //date you want your image to stop
displaying
/*if the current date is between the start and end dates that you set,
then your special image is displayed. Otherwise your default image is
displayed. Be sure to include width and height tags for NN2*/
if ((today.getTime()>=start.getTime()) &&
(today.getTime()<=end.getTime())){
document.write("<IMG SRC='Images/waar/india.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start1.getTime()) &&
(today.getTime()<=end1.getTime())){
document.write("<IMG SRC='Images/waar/thailand.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start2.getTime()) &&
(today.getTime()<=end2.getTime())){
document.write("<IMG SRC='Images/waar/laos.gif' WIDTH='137' HEIGHT='103'>");
}
if ((today.getTime()>=start3.getTime()) &&
(today.getTime()<=end3.getTime())){
document.write("<IMG SRC='Images/waar/vietnam.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start4.getTime()) &&
(today.getTime()<=end4.getTime())){
document.write("<IMG SRC='Images/waar/cambodja.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start5.getTime()) &&
(today.getTime()<=end5.getTime())){
document.write("<IMG SRC='Images/waar/thailand.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start6.getTime()) &&
(today.getTime()<=end6.getTime())){
document.write("<IMG SRC='Images/waar/mexico.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start7.getTime()) &&
(today.getTime()<=end7.getTime())){
document.write("<IMG SRC='Images/waar/guatemala.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start8.getTime()) &&
(today.getTime()<=end8.getTime())){
document.write("<IMG SRC='Images/waar/honduras.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start9.getTime()) &&
(today.getTime()<=end9.getTime())){
document.write("<IMG SRC='Images/waar/nicaragua.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start10.getTime()) &&
(today.getTime()<=end10.getTime())){
document.write("<IMG SRC='Images/waar/costarica.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start11.getTime()) &&
(today.getTime()<=end11.getTime())){
document.write("<IMG SRC='Images/waar/usa.gif' WIDTH='137' HEIGHT='103'>");
}
else{
document.write("<IMG SRC='Images/waar/nederland.gif' WIDTH='137'
HEIGHT='103'>");
}
// - End of JavaScript - -->
</SCRIPT>
I have the script below to change an image depending on the date upto
january it worked fine but then it just stopped working does anybody have an
idea how I can make it work again or why it doesn't work?
Thanks in advance
Tjerk
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Beginning of JavaScript -
today=new Date(); //determines the current date
start=new Date("October 8, 2003"); //date you want your image to start
displaying
end=new Date("November 7, 2003"); //date you want your image to stop
displaying
start1=new Date("November 7, 2003"); //date you want your image to start
displaying
end1=new Date("December 6, 2003"); //date you want your image to stop
displaying
start2=new Date("December 6, 2003"); //date you want your image to start
displaying
end2=new Date("December 20, 2003"); //date you want your image to stop
displaying
start3=new Date("December 20, 2003"); //date you want your image to start
displaying
end3=new Date("January 18, 2004"); //date you want your image to stop
displaying
start4=new Date("January 18, 2004"); //date you want your image to start
displaying
end4=new Date("Febuary 4, 2003"); //date you want your image to stop
displaying
start5=new Date("Febuary 4, 2003"); //date you want your image to start
displaying
end5=new Date("Febuary 14, 2004"); //date you want your image to stop
displaying
start6=new Date("Febuary 25, 2004"); //date you want your image to start
displaying
end6=new Date("March 18, 2004"); //date you want your image to stop
displaying
start7=new Date("March 18, 2004"); //date you want your image to start
displaying
end7=new Date("April 11, 2004"); //date you want your image to stop
displaying
start8=new Date("April 11, 2004"); //date you want your image to start
displaying
end8=new Date("April 22, 2004"); //date you want your image to stop
displaying
start9=new Date("April 22, 2004"); //date you want your image to start
displaying
end9=new Date("May 5, 2004"); //date you want your image to stop displaying
start10=new Date("May 5, 2004"); //date you want your image to start
displaying
end10=new Date("June 4, 2004"); //date you want your image to stop
displaying
start11=new Date("June 4, 2004"); //date you want your image to start
displaying
end11=new Date("June 11, 2004"); //date you want your image to stop
displaying
/*if the current date is between the start and end dates that you set,
then your special image is displayed. Otherwise your default image is
displayed. Be sure to include width and height tags for NN2*/
if ((today.getTime()>=start.getTime()) &&
(today.getTime()<=end.getTime())){
document.write("<IMG SRC='Images/waar/india.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start1.getTime()) &&
(today.getTime()<=end1.getTime())){
document.write("<IMG SRC='Images/waar/thailand.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start2.getTime()) &&
(today.getTime()<=end2.getTime())){
document.write("<IMG SRC='Images/waar/laos.gif' WIDTH='137' HEIGHT='103'>");
}
if ((today.getTime()>=start3.getTime()) &&
(today.getTime()<=end3.getTime())){
document.write("<IMG SRC='Images/waar/vietnam.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start4.getTime()) &&
(today.getTime()<=end4.getTime())){
document.write("<IMG SRC='Images/waar/cambodja.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start5.getTime()) &&
(today.getTime()<=end5.getTime())){
document.write("<IMG SRC='Images/waar/thailand.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start6.getTime()) &&
(today.getTime()<=end6.getTime())){
document.write("<IMG SRC='Images/waar/mexico.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start7.getTime()) &&
(today.getTime()<=end7.getTime())){
document.write("<IMG SRC='Images/waar/guatemala.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start8.getTime()) &&
(today.getTime()<=end8.getTime())){
document.write("<IMG SRC='Images/waar/honduras.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start9.getTime()) &&
(today.getTime()<=end9.getTime())){
document.write("<IMG SRC='Images/waar/nicaragua.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start10.getTime()) &&
(today.getTime()<=end10.getTime())){
document.write("<IMG SRC='Images/waar/costarica.gif' WIDTH='137'
HEIGHT='103'>");
}
if ((today.getTime()>=start11.getTime()) &&
(today.getTime()<=end11.getTime())){
document.write("<IMG SRC='Images/waar/usa.gif' WIDTH='137' HEIGHT='103'>");
}
else{
document.write("<IMG SRC='Images/waar/nederland.gif' WIDTH='137'
HEIGHT='103'>");
}
// - End of JavaScript - -->
</SCRIPT>