// Used to Preload Images
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Used to Create a New Window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Redirects to New URL
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// Displays Date
function RunDate()
{
calendar = new Date();
 day = calendar.getDay();
 month = calendar.getMonth();
 date = calendar.getDate();
 year = calendar.getYear();
 if (year < 1000)
 year+=1900
 cent = parseInt(year/100);
 g = year % 19;
 k = parseInt((cent - 17)/25);
 i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
 i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
 j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
 l = i - j;
 emonth = 3 + parseInt((l + 40)/44);
 edate = l + 28 - 31*parseInt((emonth/4));
 emonth--;
 var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
 var monthname = 
 new Array ("January","February","March","April","May","June","July","August","September","October","November","December" );
 document.write("");
 document.write(dayname[day] + ", ");
 document.write(monthname[month] + " ");
 if (date< 10) document.write("0" + date + ", ");
         else document.write(date + ", ");
 document.write(year + "    ");
 // Easter
 if ((month == emonth) && (date == edate)) document.write(" ~ Happy Easter   ");
 // January
 if ((month == 0) && (date == 1)) document.write(" ~ Happy New Year!");
 if ((month == 0) && (day == 1) && (date > 14) && (date< 22)) document.write(" ~ Martin Luther King's Birthday");
 if ((month == 0) && (date == 30)) document.write(" ~ Super Bowl Sunday XLIII");
 // February
 if ((month == 1) && (date == 2)) document.write(" ~ Groundhog Day");
 if ((month == 1) && (date== 12)) document.write(" ~ Lincoln's Birthday");
 if((month == 1) && (date == 14)) document.write(" ~ Happy Valentine's Day");
 if ((month == 1) && (date == 22)) document.write(" ~ Washington's Birthday");
 if ((month == 1) && (date == 29)) document.write(" ~ Leap Day");
 // March
 if ((month == 2) && (date == 1)) document.write(" ~ Safe Ride Home, 1 Year Anniversary");
 if ((month == 2) && (date == 17)) document.write(" ~ Happy St. Patrick's Day");
 // April
 if ((month == 3) && (date == 1)) document.write(" ~ April Fools' Day");
 if ((month == 3) && (date == 15) && (day != 0)) document.write(" ~ Income Tax Day (USA),   ");
 if ((month == 3) && (date == 16) && (day == 1)) document.write(" ~ Income Tax Day (USA) ");
 if ((month == 3) && (date == 22)) document.write(" ~ Earth Day");
 if ((month == 3) && (day == 0) && (date > 0) && (date< 8)) document.write(" ~ Daylight Savings Time Begins");
 // May
 if ((month == 4) && (date == 5)) document.write(" ~ Cinco de Mayo (Mexico)");
 if ((month == 4) && (day == 0) && (date > 7) && (date< 16)) document.write(" ~ Happy Mother's Day");
 if ((month == 4) && (day == 1) && (date > 24)) document.write(" ~ Memorial Day - We Remember");
 // June
 if ((month == 5) && (date == 6)) document.write(" ~ D-Day (USA)");
 if ((month == 5) && (date == 14)) document.write(" ~ FlagDay (USA)");
 if ((month == 5) && (day == 0) && (date > 15) && (date< 24)) document.write(" ~ Happy Father's Day");
 // July
 if ((month == 6) && (date == 4)) document.write(" ~ Happy Independence Day!");
 // August
 if ((month == 7) && (date == 22)) document.write(" ~ (Safe Ride Home Launches New Website)");
 // September
 if ((month == 8) && (day== 1)&& (date > 0) && (date< 8)) document.write(" ~ Labor Day (USA)");
 // October
 if ((month == 9) && (day == 1) && (date > 7) && (date< 16)) document.write(" ~ Columbus Day (USA)");
 if ((month == 9) && (day == 0) && (date > 24) && (date< 31)) document.write(" ~ Daylight Savings Time Ends");
 if ((month == 9) && (date == 31)) document.write(" ~ Happy Halloween");
 // November
 if ((month == 10) && (date == 11)) document.write(" ~ Veteran's Day (USA)");
 if ((month == 10) && (day == 4) && (date > 23) && (date< 30)) document.write(" ~ Happy Thanksgiving (USA)");
 if ((month == 10) && (date == 30) && (day == 4)) document.write(" ~ Happy Thanksgiving (USA)");
 // December
 if ((month == 11) && (date == 10)) document.write(" ~ Human Rights Day");
 if ((month == 11) && (date == 24)) document.write(" ~ Christmas Eve");
 if ((month == 11) && (date == 25)) document.write(" ~ Merry Christmas!");
 if ((month == 11) && (date == 26)) document.write(" ~ Boxing Day");
 if ((month == 11) && (date == 31)) document.write(" ~ New Year's Eve - Please Don't Drink and Drive.");
 document.write("&nbsp; ");
}

// Displays News Ticker
function Runinfoticker()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="720" height="24" title="SafeRideHomeNC.com">\n');
    document.write('<param name="movie" value="swf/infoticker.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<embed src="swf/infoticker.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="720" height="24">\n');
	document.write('</embed>\n');
    document.write('</object>\n');
}