function formHandler(form){
var URL = form.site.options[form.site.selectedIndex].value;
window.location.href = URL;
}

function calculate() {
month = document.aboutyou.month.selectedIndex;
month = document.aboutyou.month.options[month].value;
day = document.aboutyou.day.selectedIndex;
day = document.aboutyou.day.options[day].value;
year = document.aboutyou.f1year.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]="Sunday";
weekday[2]="Monday";
weekday[3]="Tuesday";
weekday[4]="Wednesday";
weekday[5]="Thursday";
weekday[6]="Friday";
weekday[7]="Saturday";
if (day != date) alert("Please enter a valid date!");
else {
dayborn = weekday[theday];
dob = dayborn + ", " + month + " " + date + ", " + oyear + ".";
document.aboutyou.yourday.value = dayborn;
   }
}

function getmstone() {
var mmonth = document.aboutyou.month.value;
var mstone = "stone";
var Janstone = "Garnet";
var Febstone = "Amethyst";
var Marstone = "Aquamarine";
var Aprstone = "Diamond";
var Maystone = "Emerald";
var Junstone = "Pearl";
var Julstone = "Ruby";
var Augstone = "Peridot";
var Sepstone = "Sapphire";
var Octstone = "Opal";
var Novstone = "Topaz";
var Decstone = "Turquoise";
var Nostone = "unknown";

if (mmonth=="January")
mstone= Janstone;
else if (mmonth=="February")
mstone= Febstone;
else if (mmonth=="March")
mstone= Marstone;
else if (mmonth=="April")
mstone= Aprstone;
else if (mmonth=="May")
mstone= Maystone;
else if (mmonth=="June")
mstone= Junstone;
else if (mmonth=="July")
mstone= Julstone;
else if (mmonth=="August")
mstone= Augstone;
else if (mmonth=="September")
mstone= Sepstone;
else if (mmonth=="October")
mstone= Octstone;
else if (mmonth=="November")
mstone= Novstone;
else if (mmonth=="December")
mstone= Decstone;
else mstone= Nostone;

document.aboutyou.yourmstone.value = mstone;
}

function getpet () {

        var toyear = 1997;
        var birthyear = document.aboutyou.f1year.value;
        var birthpet="Ox"

        x = (toyear - birthyear) % 12
        if ((x == 1) || (x == -11)) {
            birthpet="Mouse"      }
            else  {
             if (x == 0)             {
             birthpet="Ox"           }
             else  {
              if ((x == 11) || (x == -1)) {
              birthpet="Tiger"          }
              else  {
               if ((x == 10) || (x == -2)) {
               birthpet="Rabbit"         }
               else  {
                if ((x == 9) || (x == -3))  {
                birthpet="Dragon"         }
                else  {
                 if ((x == 8) || (x == -4))  { 
                 birthpet="Snake"          }
                 else  {
                  if ((x == 7) || (x == -5))  { 
                  birthpet="Horse"          }
                  else  {
                   if ((x == 6) || (x == -6))  { 
                   birthpet="Sheep"          }
                   else  {
                    if ((x == 5) || (x == -7))  {  
                    birthpet="Monkey"         }
                    else  {
                     if ((x == 4) || (x == -8))  {
                     birthpet="Chicken"        }
                     else  {
                      if ((x == 3) || (x == -9))  {
                      birthpet="Dog"            }
                      else  {
                       if ((x == 2) || (x == -10))  {
                       birthpet="Pig"             }  
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
        document.aboutyou.youranimal.value = birthpet;

}

function dog (aboutyou) {
aboutyou.dogyears.value = aboutyou.f1age.value/7;
}

function cat (aboutyou) {
aboutyou.catyears.value = aboutyou.f1age.value/5;
}

function computer (aboutyou) {
aboutyou.computeryears.value = aboutyou.f1age.value/20;
}

function gpig (aboutyou) {
aboutyou.gpigyears.value = aboutyou.f1age.value/14;
}

function kauri (aboutyou) {
aboutyou.kauriyears.value = aboutyou.f1age.value*30;
}

function fly (aboutyou) {
aboutyou.flyyears.value = aboutyou.f1age.value/5000;
}

function turtle (aboutyou) {
aboutyou.turtleyears.value = aboutyou.f1age.value/1.25;
}

function elephant (aboutyou) {
aboutyou.elephantyears.value = aboutyou.f1age.value/1.5;
}

var moona = 1;
var mercurya = .241;
var venusa = .615;
var marsa = 1.88;
var jupitera = 11.9;
var saturna = 29.5;
var uranusa = 84;
var neptunea = 164.8;
var plutoa = 248.5;
var moonw = .16666;
var mercuryw = .381;
var venusw = .9032;
var marsw = .3799;
var jupiterw = 2.643;
var saturnw = 1.159;
var uranusw = .91;
var neptunew = 1.19;
var plutow = .6;

function points(x) {
	x = Math.floor(x*100)/100;
	return(x);
}

function compute(obj) {
	obj.moonage.value = points((obj.f1age.value))
	obj.mercuryage.value = points((obj.f1age.value / mercurya))
	obj.venusage.value = points((obj.f1age.value / venusa))
	obj.marsage.value = points((obj.f1age.value / marsa))
	obj.jupiterage.value = points((obj.f1age.value / jupitera))
	obj.saturnage.value = points((obj.f1age.value / saturna))
	obj.uranusage.value = points((obj.f1age.value / uranusa))
	obj.neptuneage.value = points((obj.f1age.value / neptunea))
	obj.plutoage.value = points((obj.f1age.value / plutoa))
	obj.moonweight.value = points((obj.f1weight.value * moonw))
	obj.mercuryweight.value = points((obj.f1weight.value * mercuryw))
	obj.venusweight.value = points((obj.f1weight.value * venusw))
	obj.marsweight.value = points((obj.f1weight.value * marsw))
	obj.jupiterweight.value = points((obj.f1weight.value * jupiterw))
	obj.saturnweight.value = points((obj.f1weight.value * saturnw))
	obj.uranusweight.value = points((obj.f1weight.value * uranusw))
	obj.neptuneweight.value = points((obj.f1weight.value * neptunew))
	obj.plutoweight.value = points((obj.f1weight.value * plutow))
}

function getsign () {
        var year = document.aboutyou.f1year.value;
        var wholedate = month + " " + day + ", " + year;
        var today = new Date();
        var psj=0;      

        var birth = new Date(wholedate);
        birth.setYear(today.getYear()); 
        var astrosign="Capricorn"

        var birthsecs = birth.getTime()

        astro = new Date("January 20,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Aquarius"

        astro = new Date("February 19,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Pisces"
        
        var astro = new Date("March 21,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Aries"

        astro = new Date("April 20,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Taurus"

        astro = new Date("May 21,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Gemini"

        astro = new Date("June 22,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Cancer"

        astro = new Date("July 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Leo"

        astro = new Date("August 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Virgo"

        astro = new Date("September 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Libra"

        astro = new Date("October 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Scorpius"

        astro = new Date("November 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Sagittarius"

        astro = new Date("December 22,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) astrosign="Capricorn"


        document.aboutyou.astro.value = astrosign;

}
function getzstone () {
        var year = document.aboutyou.f1year.value;
        var wholedate = month + " " + day + ", " + year;
        var today = new Date();
        var psj=0;      

        var birth = new Date(wholedate);
        birth.setYear(today.getYear()); 
        var zstone="Ruby"

        var birthsecs = birth.getTime()

        astro = new Date("January 20,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Garnet"

        astro = new Date("February 19,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Amethyst"
        
        var astro = new Date("March 21,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Bloodstone"

        astro = new Date("April 20,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Sapphire"

        astro = new Date("May 21,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Agate"

        astro = new Date("June 22,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Emerald"

        astro = new Date("July 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Onyx"

        astro = new Date("August 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Carnelian"

        astro = new Date("September 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Peridot"

        astro = new Date("October 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Beryl"

        astro = new Date("November 23,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Topaz"

        astro = new Date("December 22,1997");
        astro.setYear(today.getYear());
        if (birthsecs > astro.getTime()) zstone="Ruby"


        document.aboutyou.yourzstone.value = zstone;

}

// Einstein calculation
function burnup()
{
var kilos=document.aboutyou.f1weight.value
var light=300000000
var joulespercalorie=4.18
with (Math) {
        lightsquared = light*light
        joules = kilos*lightsquared
        calories = joules/joulespercalorie
}
document.aboutyou.joules.value=joules
document.aboutyou.calories.value=calories
}
