// JavaScript Document
function MM_jumpMenu(targ,selObj,restore)
{
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function checkrequired(which) 
{
	var pass=true;
	if (document.images) 
	{
		for (i=0;i<which.length;i++) 
		{
			var tempobj=which.elements[i];
			if (tempobj.name.substring(0,8)=="required") 
			{
				if (((tempobj.type=="text"||tempobj.type=="textarea"||tempobj.type=="file")&&
				tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
				tempobj.selectedIndex==0)) 
				{
					pass=false;
					break;
				}
			}
		}
	}
	if (!pass) 
	{
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		alert("You must fill out the "+shortFieldName+" field!");
		return false;
	}
	else
	return true;
}
function setMaxLength()
{
	var x = document.getElementsByTagName('textarea');
	var counter = document.createElement('div');
	counter.className = 'counter';
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('maxlength'))
		{
			var counterClone = counter.cloneNode(true);
			counterClone.relatedElement = x[i];
			counterClone.innerHTML = 'Character Count: <span>0</span>/'+x[i].getAttribute('maxlength');
			x[i].parentNode.insertBefore(counterClone,x[i].nextSibling);
			x[i].relatedElement = counterClone.getElementsByTagName('span')[0];

			x[i].onkeyup = x[i].onchange = checkMaxLength;
			x[i].onkeyup();
		}
	}
}

function checkMaxLength()
{
	var maxLength = this.getAttribute('maxlength');
	var currentLength = this.value.length;
	if (currentLength > maxLength)
		this.relatedElement.className = 'toomuch';
	else
		this.relatedElement.className = '';
	this.relatedElement.firstChild.nodeValue = currentLength;
	// not innerHTML
}
dom = (document.getElementById) ? 1 : 0;
function activatefield(what){
if (dom){
what.style.border='3px solid #0099ff';
}
}
function deactivatefield(what){
if (dom){
what.style.border='';
}
}
function change(id, newClass) {

identity=document.getElementById(id);

identity.className=newClass;

}
function change2(id, newClass) {

identity=document.getElementById(id);

identity.className=newClass;

}
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function NewWindow2(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}