Raven
11-13-2003, 11:11 AM
This script will calculate the day of someones birth, but instead of a window popping up with text, I would like to have specified images that corrospond with each day of the week pop up instead. In the red area is where is tells what text to popup with. I have tried several things here to try to make it see an image instead such as <img src="http.your.gif"> but I get scrip error or "http:your.gif" but it simply writes http:your.gif on the screen. This below is the <head> part of the script, I am pretty sure this is the one I want to change but if you need to see the <body> part please e-mail me raven@ecdollz.com and I will send it to you.
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function calculate() {
month = document.form.month.selectedIndex;
month = document.form.month.options[month].value;
day = document.form.day.selectedIndex;
day = document.form.day.options[day].value;
year = document.form.year.value;
var oyear=year
var dob = " "+ year +", "+month + ", "+day;
var thenx = new Date(dob);
var year=thenx.getYear();
if (year<100) year="19" + thenx.getYear();
else year=thenx.getYear();
if (year > 1969) wyear=year;
else {
if (oyear<1900) {
if (oyear>1800) {
wrelyear= (eval(oyear)-1801)%(28);
wyear = wrelyear+1981;
}
else wyear = 1970
}
else
if (oyear>1900) {wrelyear= (eval(oyear)-1901)%(28);
wyear= wrelyear+1985
}
else
if (oyear==1900) {wyear= 1990;
}
}
var dob = " "+ wyear +", "+month + ", "+day;
var thenx = new Date(dob);
var theday = thenx.getDay()+1;
var date=thenx.getDate();
var weekday = new Array(6);
weekday[1]="But A Child That's Born On The Sabbath Day Is Bonny And Blithe, And Good And Gay";
weekday[2]="Monday's Child is Fair of Face";
weekday[3]="Tuesday's Child Is Full Of Grace";
weekday[4]="Wednesday's Child Is Full Of Woe";
weekday[5]="Thursday's Child Has Far To Go";
weekday[6]="Friday's Child Is Loving And Giving";
weekday[7]="Saturday's Child Works Hard For A Living";
if (day != date) alert("Sorry! That appears to be an invalid date!"+day+" ..."+date+"::"+oyear+"..."+year+" "+dob+"=="+wyear+".-.-"+thenx+" "+day+" "+month);
else {
dayborn = weekday[theday];
dob = dayborn ;
alert(" " + dob);
}
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function calculate() {
month = document.form.month.selectedIndex;
month = document.form.month.options[month].value;
day = document.form.day.selectedIndex;
day = document.form.day.options[day].value;
year = document.form.year.value;
var oyear=year
var dob = " "+ year +", "+month + ", "+day;
var thenx = new Date(dob);
var year=thenx.getYear();
if (year<100) year="19" + thenx.getYear();
else year=thenx.getYear();
if (year > 1969) wyear=year;
else {
if (oyear<1900) {
if (oyear>1800) {
wrelyear= (eval(oyear)-1801)%(28);
wyear = wrelyear+1981;
}
else wyear = 1970
}
else
if (oyear>1900) {wrelyear= (eval(oyear)-1901)%(28);
wyear= wrelyear+1985
}
else
if (oyear==1900) {wyear= 1990;
}
}
var dob = " "+ wyear +", "+month + ", "+day;
var thenx = new Date(dob);
var theday = thenx.getDay()+1;
var date=thenx.getDate();
var weekday = new Array(6);
weekday[1]="But A Child That's Born On The Sabbath Day Is Bonny And Blithe, And Good And Gay";
weekday[2]="Monday's Child is Fair of Face";
weekday[3]="Tuesday's Child Is Full Of Grace";
weekday[4]="Wednesday's Child Is Full Of Woe";
weekday[5]="Thursday's Child Has Far To Go";
weekday[6]="Friday's Child Is Loving And Giving";
weekday[7]="Saturday's Child Works Hard For A Living";
if (day != date) alert("Sorry! That appears to be an invalid date!"+day+" ..."+date+"::"+oyear+"..."+year+" "+dob+"=="+wyear+".-.-"+thenx+" "+day+" "+month);
else {
dayborn = weekday[theday];
dob = dayborn ;
alert(" " + dob);
}
}
// End -->
</script>