<!--
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

function showDate(){
	var now = new Date(); // Retrieve date
	var tmp = months[now.getMonth()] + " "; // Retrieve the month
	tmp += now.getDate(); // Retrieve the day of the month
	tmp += ", ";
	tmp += now.getFullYear(); // Retrieve the year
	return tmp;
	}
//-->

   function Popupwin(PopUp){

window.open(PopUp,"newwindow","width=510,height=372,left=100,top=200,toolbar=0,menubar=0,resizable=1,location=0,personalbar=0,scrollbars=1,status=1");}

function sendmail(x) {
   x.href="mailto:?subject=" + document.title + "&body=" +window.location;
   return true;
}

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_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];}
}



var browser = 3;
	if (document.all) browser = 1;	
	if (document.all && document.getElmentById) browser = 3;	

function GetObj(id)
{
	switch(browser)
	{
		case 0:
		case 1:
			return document.all[id];
		break;
		case 2:
			return document[id];
		break;
		case 3:
			return document.getElementById(id);
		break;
	}
}




function ParentGetObj(id)
{
	switch(browser)
	{
		case 0:
		case 1:
			return window.opener.document.all[id];
		break;
		case 2:
			return window.opener.document[id];
		break;
		case 3:
			return window.opener.document.getElementById(id);
		break;
	}
}








function MenuOpen(obj)
{
	obj.style.display = (obj.style.display == "none") ? "" : "none";
}

















function $$(id)
{
	return document.getElementById(id);
}

var defaultGNav = null;

function SetupContent()
{
    if ($$("contentCenter") && $$("mainContent"))
    {
        if ($$("contentCenter").clientHeight > $$("mainContent").clientHeight) {
            var height = ($$("contentCenter").clientHeight - $$("mainContent").offsetTop) - 25;
            $$("mainContent").style.height = height + "px";
        }
    }
}


function SetupGnav()
{
	var gnav = $$("gnav");
	var nodes = gnav.getElementsByTagName("li");
	var gnavDrop = $$("gnavDrop");
	id = document.body.id;
	if (id) id = id.replace("body", "gnav"); else id = "";

	for (var i=0;i<nodes.length;i++)
	{
		var node = nodes[i];
		if (node.id)
		{
			node.getElementsByTagName("a")[0].innerHTML = "<nobr>" + node.getElementsByTagName("a")[0].innerHTML + "</nobr>";
			node.getElementsByTagName("a")[0].title = "";

			node.onmouseover = function()
			{
				if (gnavDrop.last) gnavDrop.last.getElementsByTagName("a")[0].className = "";

				this.getElementsByTagName("a")[0].className = "selected";
				if (this.getElementsByTagName("ul").length > 0)
				{
					gnavDrop.innerHTML = "<ul>" + this.getElementsByTagName("ul")[0].innerHTML + "</ul>";
					gnavDrop.getElementsByTagName("ul")[0].className = this.id;
				}
				gnavDrop.style.display = "block";
				gnavDrop.last = this;
				document.title = '';
				gnavDrop.flag = true;

			}
			node.onmouseout = function()
			{
				gnavDrop.flag = false;
				setTimeout("$$('gnavDrop').close();", 500);
			}

			if (id == node.id)
			{
				defaultGNav = nodes[i];
			}
		}
	}
	gnavDrop.onmouseover = function()
	{
		gnavDrop.flag = true;
	}
	gnavDrop.onmouseout = function()
	{
		gnavDrop.flag = false;
		setTimeout("$$('gnavDrop').close();", 500);
	}
	gnavDrop.close = function()
	{
		if (gnavDrop.flag) return;
		if (gnavDrop.last) gnavDrop.last.getElementsByTagName("a")[0].className = "";
		gnavDrop.last = null;
		gnavDrop.innerHTML = "";
		gnavDrop.style.display = "none";
		gnavDrop.className = "";

		if (defaultGNav) defaultGNav.onmouseover();

	}

	if (defaultGNav) defaultGNav.onmouseover();

	SetDateString("todayLongDate");
}


function SetDateString(id)
{
	var node = $$(id);
	if (node)
	{
    var now = new Date();
    var days = new Array(
      'Sunday','Monday','Tuesday',
      'Wednesday','Thursday','Friday','Saturday');
    var months = new Array(
      'January','February','March','April','May',
      'June','July','August','September','October',
      'November','December');
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

    function fourdigits(number)	{
      return (number < 1000) ? number + 1900 : number;}

    var today =  months[now.getMonth()] + " " +
       date + ", " +
       (fourdigits(now.getYear()));


		node.innerHTML = "&nbsp;&nbsp;" + today;
	}
}




/*--------------------------------------------------------------------------*/
/*  Cookie Functions */
/*--------------------------------------------------------------------------*/
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function SimpleSetCookie(key, value)
{
	var expdate = new Date ();
	FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
	expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000));
		SetCookie(key, value, expdate);		
	return true;
}
function SimpleGetCookie(key)
{
	return GetCookie(key);
}
















function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}











function wopen(url, name, w, h)
{
w += 32;
h += 96;
 var win = window.open(url,
  name, 
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=yes, resizable=yes');
 win.resizeTo(w, h);
 win.focus();
}



function highlight(obj)
{
	obj.focus();
	obj.select();
}














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 null;
}

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)
  	setActiveStyleSheet(title);
}*/

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
if (title)
	setActiveStyleSheet(title);


function $$(id)
{
	return document.getElementById(id);
}





$(document).ready(function() {

	try
	{
		$("label.infield").inFieldLabels(); 
	} catch (e) { }
});

