function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features).focus();
}
function openWin(summer)
{
window.open("makeyourown.htm","ScholasticNews","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=no,top=100,left=100,width=595,height=365");
}
function pop(path,name,features) {
	popWindow = window.open(path,name,features).focus();
}
function popWeatherMaker()
{
window.open("/activities/wwatch/sim/index.htm","ScholasticNews","width=580,height=350,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=yes").focus()
}
function processMagazines()
{
	index = document.MagazinesForm.magazine.selectedIndex;
	window.location = document.MagazinesForm.magazine[index].value ;
}
function processSubscriberMagazines()
{
	index = document.SubscriberMagazinesForm.magazine.selectedIndex;
	window.location = document.SubscriberMagazinesForm.magazine[index].value ;
}
function processMagazinesPDF()
{
	index = document.MagazinesPDF.magazine.selectedIndex;
	window.location = document.MagazinesPDF.magazine[index].value ;
}
function processSn1Sn2Vote(choice)
{
	document.vote.choice[choice].checked=true
	//document.vote.submit()
}

function makeArray() {
     for (i = 0; i<makeArray.arguments.length; i++)
          this[i + 1] = makeArray.arguments[i];
}

var months = new makeArray('January','February','March',
    'April','May','June','July','August','September',
    'October','November','December');

var date = new Date();
var d  = date.getDate();
//var day = (d < 10) ? '0' + d : d;
var day = d
var m = date.getMonth() + 1;
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

String.prototype.trim = strtrim;

function strtrim() {
	return this.replace(/^\s+/,'').replace(/\s+$/,'');
}

function writeError(text,id)
{
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		text2 = '<div class="'+id+'" id="'+id+'">' + text + '</div>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}
function isblank(svalue)
{
	svalue1 = new String(svalue);
	for(var i = 0; i < svalue1.length; i++) 
	{
		var c = svalue1.charAt(i);
		if((c != ' ') && (c != '\n') && (c!='\t')) return false;
	} 
	return true;
}
function isEmail (s)
{   if (isEmpty(s)) return false;
   
    // is s whitespace or space?
    if (isWhitespace(s) || isSpace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length; 
    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace(s)

{   var i;
	var whitespace = " \t\n\r";

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}
function isSpace(s)

{   var i;

    // Search through string's characters one by one
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't a space.
        var c = s.charAt(i);

        if (c == ' ') return true;
    }

    // All characters are spaces.
    return false;
}