// JavaScript Document
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
  rnd.seed = (rnd.seed*9301+49297) % 233280;
  return rnd.seed/(233280.0);
}

function rand(number) {
  return Math.ceil(rnd()*number);
}

function PopUp(url,w,h,sb,rs,st,tb,mb,ti,lc)
{
  lft = (screen.availWidth -w)/2;
  t = (screen.availHeight -h)/2;
  p = "scrollbars=" + sb + ",resizable=" + rs + ",status=" + st + ",toolbar=" + tb + ",menubar=" + mb + ",titlebar=" + ti + ",location=" + lc + ",top=" + t + ",left=" +lft + ",width=" + w + ",height=" + h;
  window.open(url, rand(101)-1, p);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

var maxChars = 1000;
function charsleft(fieldName)
{
	theInputBox = document.getElementById(fieldName);
	theCountBox = document.getElementById('charsLeft');
	var currentChars = theInputBox.value.length;
	theCountBox.value = Math.max((maxChars - currentChars),0);
	if(currentChars > maxChars)
		theInputBox.value = theInputBox.value.substring(0,maxChars);
}








