function checkBrowser() {
if (window != top) top.location.href = location.href;    // Breaks browser out of frames


	// Check browser for screen resolution and if Java console is enabled
var msg = "                              MU Help & Info";
var msg1 = "", msg2 = "";
var alert1 = false, alert2 = false;
var bestwidth = 800, bestheight = 600;
if (screen.width != bestwidth || screen.height != bestheight) {
	msg1 = "\rThis Web site looks best when viewed at a screen resolution         ";
	msg1 += "\rof 800x600.  Your resolution is " + screen.width + "x" + screen.height + ".  To best view our";
	msg1 += "\rsite, if possible please change your resolution.\r";
	msg += msg1;
	alert1 = true;
}
if (!navigator.javaEnabled()) {
	msg2 = "\rWe make extensive use of Javascripts and your Java console";
	msg2 += "\ris NOT enabled.  Please change the settings in your browser's      ";
	msg2 += "\rTools or Edit menu under Internet Options or Preferences. You\r";
	msg2 += "will then need to Refresh/Reload the Web page.\r";
	msg += msg2;
	alert2 = true;
}
	msg += "                                  Thank you!";
if (alert1 || alert2) {
	alert(msg);
}
}

var rotateMsg = true;		// Initiate status bar message
function MsgStatus(x, y) {
var firstMsg = setGreeting() + status1;
var secondMsg = status2;
if(rotateMsg) {
window.status = '';
window.defaultStatus = firstMsg;
}
if(!rotateMsg) {
window.status = '';
window.defaultStatus = secondMsg;
}
setTimeout("MsgStatus();rotateMsg=!rotateMsg", 5000);
}


function GetDay(intDay) {		// Todays date, 1 of 3
	var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday",
                         "Thursday", "Friday", "Saturday")
	return DayArray[intDay]
}
function GetMonth(intMonth){	// 2 of 3
	var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December")
	return MonthArray[intMonth]
}
function getToday() {		// 3 of 3
	var Stamp = new Date();
	var Hours, Mins, Time;
	Hours = Stamp.getHours();
	if (Hours >= 12) {
		Time = " p.m.";
	}
	else {
		Time = " a.m.";
	}
	if (Hours > 12) {
		Hours -= 12;
	}
	if (Hours == 0) {
		Hours = 12;
	}
	Mins = Stamp.getMinutes();
	if (Mins < 10) {
		Mins = "0" + Mins;
	}
	var todayTime = Hours + ":" + Mins + Time;
	var today = new Date();
	var year = today.getYear()
	if(year<1000) year+=1900
	var todayStr = "<font face='verdana, arial' size='1'>&nbsp;";
	todayStr += GetDay(today.getDay()) + ", ";
	todayStr += GetMonth(today.getMonth()) + " " + today.getDate();
	todayStr += ", " + year + ", " + todayTime;
	todayStr += "<\/font>";
	return todayStr
}

	// Calculates morning, afternoon or evening
function setGreeting() {
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour > 17) display = "Evening"; // after 6 pm
else if (thehour >11) display = "Afternoon"; // after 12 noon
else display = "Morning";
var greeting = ("   Good " + display + "! ");
return greeting;
}

	// How long in business
function HowLongSince(startmonth, startdate, startyear) {
sdate=startdate;
smonth=startmonth-1;
syear=startyear;
var DaysInMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
today = new Date();
var thisyear = today.getFullYear();
var thismonth = today.getMonth();
var thisdate = today.getDate();
mstart = new Date(syear,(smonth==12?1:smonth+1),1);
days1 = (mstart - new Date(syear,smonth,sdate))/(24*60*60*1000)-1;
mend = new Date(thisyear,thismonth,1);
days2 = (new Date(thisyear,thismonth,thisdate) - mend)/(24*60*60*1000)+1;
dayst = days1 + days2;
if (dayst >= DaysInMonth[smonth])  {
AddOneMonth = 1;
dayst -= DaysInMonth[smonth];
}
else AddOneMonth = 0;
dayst = parseInt(dayst);
ydiff1 = thisyear-mstart.getFullYear();
mdiff1 = thismonth-mstart.getMonth()+AddOneMonth;
if (mdiff1 >11) { mdiff1=0; ydiff1++; }
if (mdiff1 < 0) { mdiff1 = mdiff1 + 12; ydiff1--; }
temp = "<font size='1' face='verdana, arial'>In business Online ";
temp += (ydiff1==0?"":(ydiff1==1?ydiff1+" year and ":ydiff1 + " years, "));
temp += (mdiff1==0?"0 months, ":(mdiff1==1?mdiff1+" month, ":mdiff1+" months, "));
temp += (dayst==0?"0 days":(dayst==1 ? " 1 day" : dayst + " days" )) + ".&nbsp;<\/font>";
return temp;
}

function doColor(item, color, bg) {	// mouseover color changer, IE only
item.style.color = color; 	// changes text color
item.style.backgroundColor = bg; // changes background
}
function undoColor(item) {
item.style.color = ""; 		// sets color back to default
item.style.backgroundColor = ""; // sets background to default
}

function browserInfo() {	// Opens new window with a table of browser settings
window.open("browserinfo.htm","","toolbar=no,menubar=no,scrollbars=no,location=no,resizeable=no,height=395,width=375,left=200,top=130");
}

function snapShot() {		// Opens a new window for product snapshot
window.open("snapshot.htm","","toolbar=no,menubar=no,scrollbars=no,location=no,resizeable=no,height=230,width=310,left=228,top=230");
}

	// Opens a new window centered on page
function NewWindow(mypage, pgname, w, h, scroll) {
self.name = "main";
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
win = window.open(mypage, "remote", winprops);
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function printIt() {		// Prints Order Form/Price List
	if (confirm("\r                                  MU HELP AND INFO\r\rThis print-out consists of 2 pages.  If you would like to distribute our\rform to other groups feel free to make copies or do multiple printings.\rThe document is printer friendly (no extraneous text and/or graphics).\r\rTo continue click OK, to scroll through (preview) the document\rchoose Cancel.  Prices can be found at the top of each order section            \r(aluminum and bronze), shipping charges and discount information at\rthe top of page two.\r\rIf you Cancel, then decide later to print, use your Browser's Print\rbutton.  Or click the Reload button in Netscape, Refresh in\rInternet Explorer.  When done, to return from whence you came use\ryour browser's Back button.\r\r")) {
		window.print();
		window.close();
	}
}
function formHandler(page)
{
var URL = page.site.options[page.site.selectedIndex].value;
window.location.href = URL;
}

function addToFavorites() {			// Add Web site to Favorites list
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
var url="http://www.medallionsunlimited.com/index.shtml";
var title="Sobriety Medallions at UNBEATABLE PRICES";
window.external.AddFavorite(url,title);
}
else {
var msg = "We are unable to bookmark this page for you.\rPlease use the method prescribed for your browser.    ";
if(navigator.appName == "Netscape") msg = "  Sorry, Netscape doesn't support this method.\rTo bookmark a page in Netscape use CTRL-D.        ";
alert(msg);
}
}
