<!--

/* style switcher */

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title)
				a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled)
			return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return 'default';
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ')
			c = c.substring(1,c.length);
    
		if (c.indexOf(nameEQ) == 0)
			return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
	if(title == 'null' || title == null)
		title = "default";
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
if(title == 'null' || title == null)
	title = "default";
setActiveStyleSheet(title);


  function GetMonth(intMonth){
    var MonthArray = new Array("Jan", "Feb", "Mar",
                               "April", "May", "June",
                               "July", "Aug", "Sept",
                               "Oct", "Nov", "Dec") 
    return MonthArray[intMonth] 	  	 
	}
  
	function getDateStr(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
  }

/* end style switcher */

  function GetMonth(intMonth){
    var MonthArray = new Array("Jan", "Feb", "March",
                               "April", "May", "June",
                               "July", "Aug", "Sept",
                               "Oct", "Nov", "Dec") 
    return MonthArray[intMonth] 	  	 
	}
  
	function getDateStr(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
  }
  
 	/*  Quick links Functions */ 

			function MM_jumpMenu(targ,selObj,restore){ //v3.0
			  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
			  if (restore) selObj.selectedIndex=0;
			}
			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]+"'");
			}

 /***********************************/
				
/* font sizer */
			
var tags = new Array('p','ul','li');
var pixelArray =  new Array('15', '16', '17', '18', '19', '20', '21','23');
var emArray =  new Array('14', '15', '17', '19', '20', '22');
var initSize = 1;	

function fontSizer(inc,unit) {

	
	if (!document.getElementById) 
		return;
	var size = initSize;
		size += inc;
	if (size < 0 ) {
		size = 0;
}
	if (size > 6 ) {
		size = 6;
}
		initSize = size;


		getBody = document.getElementsByTagName('body')[0];
	for (i = 0 ; i < tags.length ; i++ ) {
		getallTags = getBody.getElementsByTagName(tags[i]);
	for (k = 0 ; k < getallTags.length ; k++) 
		getallTags[k].style.fontSize = (unit=='em') ? pixelArray[size]+unit: emArray[size]+unit;
	}
}


/* Swardlick - UMS Campaign Tracking - April 25 2006 */

function uvlog( what ) {
	(new Image()).src =
		 'http://enroll.maine.edu/uv/?' + Math.random() +
		 '&who=' 	+ escape( uvgetc( 'eid' ) ) +
		 '&which='	+ escape( uvgetc( 'cid' ) ) +
		 '&what='	+ escape( what ) +
		 '&where='	+ escape( window.location );

	return true;
	}

function uvgetc( n ) {
	var nameString = n + '=';
	var cookieDefs = document.cookie.split( ';' );
	for( var ii = 0; ii < cookieDefs.length; ii++ ) {
		var c = cookieDefs[ ii ];
		var jj = 0;

		while( c.charAt( jj ) == ' ' ) { jj++; }
		
		if( c.indexOf( nameString ) == jj ) {
			return c.substring( jj + nameString.length, c.length );
			}
		}
	return null;
	}

function uvsetc( n, v ) {
	document.cookie = n + '=' + v + '; path=/';
	}

uvlog( 'view' );




function getPrint(print_area)

{

//Creating new page

var pp = window.open("", "PreviewWindow", 'width=550,height=650') 

//Adding HTML opening tag with <HEAD> � </HEAD> portion

pp.document.writeln('<HTML><HEAD><title>Printer Friendly Version</title>')

pp.document.writeln('<LINK href="http://www.maine.edu/css/print.css" type="text/css" rel="stylesheet" media="print">')

pp.document.writeln('<base target="_blank"></HEAD>')

//Adding Body Tag

pp.document.writeln('<body>');

//Adding form Tag

pp.document.writeln('<form method="post">');

//Creating two buttons Print and Close within a HTML table

pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');

pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');

pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');

pp.document.writeln('<INPUT ID="CLOSE" type="button" value="Close" onclick="window.close();">');

pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');

//Writing print area of the calling page

pp.document.writeln(document.getElementById(print_area).innerHTML);

//Ending Tag of </form>, </body> and </HTML>

pp.document.writeln('</form></body></HTML>');

} 



//-->
