var mydate = new Date();
var myday = mydate.getDate();
var mymonth = mydate.getMonth();
var n = 0;
var sponsors = new Array(
"<a class=sponsor href='http://www.dell.com'><img src='/2007/sponsors/dell.gif' alt='DELL' border=0><br>DELL</a><BR><BR>",
"<a class=sponsor href='http://ca.com'><img src='/2007/sponsors/ca.gif' alt='Computer Associates' border=0><br>Computer Associates</a><BR><BR>",
"<a class=sponsor href='http://www.winston-school.org'><img src='/2007/sponsors/winston.gif' alt='The Winston School' border=0><br>The Winston School</a><BR><BR>",
"<a class=sponsor href='http://www.ge.com'><img src='/2007/sponsors/ge_black.jpg' width='120' border=0 alt='GE Asset Intelligence'><br>GE Asset Intelligence</a><BR><BR>",
"<a class=sponsor href='http://www.texasmotorspeedway.com'><img src='/2007/sponsors/tms.gif' border='0' width='111' alt='Texas Motor Speedway'><br>Texas Motor Speedway</a><BR><BR>",
"<a class=sponsor href=''>Lightner Sams Foundation</a><BR><BR>",
"<a class=sponsor href='http://www.tcu.edu'><img src='/2007/sponsors/tcu.gif' border='0' width='125' alt='TCU Information Services'><br>TCU Information Services</a><BR><BR>",
"<a class=sponsor href='http://www.txses.org/'><img src='/2007/sponsors/tses.gif' border='0' width='125' alt='Texas Solar Energy Society'><br>Texas Solar Energy Society</a><BR><BR>",
"<a class=sponsor href='http://www.seco.cpa.state.tx.us/'><img src='/2007/sponsors/seco.gif' border='0' width='125' alt='Texas State Energy Conservation Office'><br>Texas State Energy Conservation Office</a><BR><BR>",
"<a class=sponsor href='http://www.wdtinc.com'><img src='/2007/sponsors/wdt.gif' border='0' width='111' alt='Weather Decisions Teachnologies'><br>Weather Decisions Teachnologies</a><BR><BR>",
"<a class=sponsor href='http://www.ryder.com'><img src='/2007/sponsors/ryder.gif' border='0' width='111' alt='Ryder Trucks'><br>Ryder Trucks</a><BR><BR>",
"<a class=sponsor href='http://www.precisionsolarcontrols.com'><img src='/2007/sponsors/psc.gif' border='0' width='111' alt='Precision Solar Controls'><br>Precision Solar Controls</a><BR><BR>",
"<a class=sponsor href='http://www.wyndham.com/hotels/DFWND/main.wnt'>Wyndham Dallas North</a><BR><BR>",
"<a class=sponsor href='http://www.orbitonecommunications.com/'><img src='/2007/sponsors/orbitone.gif' width='111' border='0' alt='Orbit One Communications'><br>Orbit One Communications</a><BR><BR>",
"<a class=sponsor href='http://www.able2products.com/'><img src='/2007/sponsors/able2products.gif' width='125' border='0' alt='Able2Products'><br>Able 2 Products</a><BR><BR>"
);
if ( myday == 1 || myday == 10 || myday == 19 || myday == 28 ){ n = 4; }
else
{
if ( myday == 2 || myday == 11 || myday == 20 || myday == 29 ){ n = 7; }
else
{
if ( myday == 3 || myday == 12 || myday == 21 || myday == 30 ){ n = 10; }
else
{
if ( myday == 4 || myday == 13 || myday == 22 || myday == 31 ){ n = 12; }
else
{
if ( myday == 5 || myday == 14 || myday == 23 ){ n = 5; }
else
{
if ( myday == 6 || myday == 15 || myday == 24 ){ n = 8; }
else
{
if ( myday == 7 || myday == 16 || myday == 25 ){ n = 11; }
else
{
if ( myday == 8 || myday == 17 || myday == 26 ){ n = 6; }
else
{
if ( myday == 9 || myday == 18 || myday == 27 ){ n = 9; }			 
}}}}}}}}

var AddSponsors = sponsors[ 0 ] +  sponsors[ 1 ] +  sponsors[ 2 ]  + sponsors[ 3 ]  + sponsors[ n ]  + sponsors[ n + 1 ]  + sponsors[ n + 2 ];

var FIND = 'hidden';
var WAKE = 'visible';
var ie = false;

var dayStr
if ( myday <= 8 ) {
   dayStr = "day1" }
else {
if (myday == 9) {
   dayStr = "day2" }
else {
if (myday == 10) {
   dayStr = "day3" }
else {
if (myday == 11) {
   dayStr = "day4" }
else {
if (myday == 12) {
   dayStr = "rest" }
else {
if (myday == 13) {
   dayStr = "day5" }
else {
if (myday == 14) {
   dayStr = "day6" }
else {
if (myday == 15) {
   dayStr = "day7" }
else {
if (myday >= 16) {
   dayStr = "day8" }
}}}}}}}}

if ( navigator.appName != 'Netscape')
{
 var ie = true;
}

var baseURL;
var infoURL;
var tcuURL;

if ( window.location.href.indexOf("192.168") > 0 )
{
 baseURL = "http://192.168.1.101/challenge/";
 infoURL = "http://192.168.1.101/stats/";
 tcuURL  = "http://192.168.1.101/2007/";
}
else {
if ( window.location.href.indexOf("localhost") > 0 )
{
 baseURL = "http://localhost/challenge/";
 infoURL = "http://localhost/stats/";
 tcuURL  = "http://localhost/2007/";
}
else
{
 baseURL = "http://www.winstonsolar.org/challenge/";
 infoURL = "http://www.wscinfo.org/stats/";
 tcuURL  = "/2007/";
}}
