//----------------------------------------------------------------
// IsPPC 
//----------------------------------------------------------------
function isPPC() {
	if (navigator.appVersion.indexOf("PPC") != -1) return true;
	else return false;
}

//----------------------------------------------------------------
// SetHomepage 
// Modified from script by JavaScript Source!! http://javascript.internet.com 
//----------------------------------------------------------------
function SetHomepage() {
	// If it's Internet Explorer, use automatic link
	if (document.all){
  		document.write('<a HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.consumerwebwatch.org\');">');
  		if ( SetHomepage.arguments.length == 0 ) {
			document.write('Make Consumer Reports WebWatch Your Homepage');
		} else { 
			document.write(SetHomepage.arguments[0]);
		}
		document.write('</a>');
	}

	// If it's Netscape 6, tell user to drag link onto Home button
	else if (document.getElementById) {
		document.write('<a href="http://www.consumerwebwatch.org">');
		if ( SetHomepage.arguments.length == 0 ) {
			document.write('Drag this link onto your Home button to make Consumer Reports WebWatch your Home Page.');
		} else { 
			document.write(SetHomepage.arguments[0]);
		}
		document.write('</a>');
	}

	// else do nothing
	else if ( SetHomepage.arguments.length > 0 ) {
		document.write(SetHomepage.arguments[0]);
	} else {
		document.write('&nbsp;');
	}
}

//----------------------------------------------------------------
// EmailPage() 
// Modified from script by JavaScript Source!! http://javascript.internet.com 
//----------------------------------------------------------------
function EmailPage() {
	var h;
	if ( isPPC() ) {
		h = "\?subject\=Take a look at this page I found, " + escape(document.title) + "?body=You can see this page at: " + window.location;
	} else {
		h = "\?body\=Take a look at this page I found, " + escape(document.title) + ".  You can see this page at: " + window.location;
	}
	document.write('<A CLASS="contact" HREF=\"mailto:' + h + '\" onMouseOver="window.status=\'Send an e-mail about this page\'; return true" TITLE="Send an e-mail about this page">');
	if (EmailPage.arguments.length>=1) document.write(EmailPage.arguments[0]);
	else document.write('<img name="emailthispage" src="images/email-this-page.gif" width="85" height="32" border="0" alt="Email this Page">');
	document.write('<\/A> ');
}

//----------------------------------------------------------------
// MakeArticles() 
// Create the Article Editor window.  Very mundane stuff.
//----------------------------------------------------------------
var articleWin=0;
function MakeArticles( sName ) {
	var sStyle = "";
	articleWin = window.open("",sName, sStyle);
  	articleWin.focus();
}


//----------------------------------------------------------------
// Date Stuff 
//----------------------------------------------------------------
function makeArray() {
	for (i = 0; i<makeArray.arguments.length; i++)
    	this[i + 1] = makeArray.arguments[i];
	}

// used for drop-down on the header
function gotosite() {
	oconsumer = document.search.consumers;
	website = oconsumer.options[oconsumer.selectedIndex].value
	if (website != "") window.open(website, "ConsumerReports");
}

var months = new makeArray('January','February','March',
    'April','May','June','July','August','September',
    'October','November','December');
	
var WEEKDAYS = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
	
var the_date=new Date();
var the_days=the_date.getDay();
var the_day=the_date.getDate();
var the_month=the_date.getMonth()+1;
var the_year=the_date.getYear();
if(the_year<2000) the_year+=1900;
var compiledDate= WEEKDAYS[the_days] + ", "+ months[the_month] +" "+the_day+", "+the_year;

