<!-- Begin
var isNetscape = navigator.appName=="Netscape";
// Global variables
var xMousePos = 0; // Horizontal position of the mouse on the screen
var yMousePos = 0; // Vertical position of the mouse on the screen
var xMousePosMax = 2000; // Width of the page
var yMousePosMax = 1000; // Height of the page

// Global object to hold drag information.
var dragObj = new Object();
dragObj.zIndex = 0;

function getRefToDiv(divID) {
	if( document.layers ) { return document.layers[divID+'C'].document.layers[divID]; };
	if( document.getElementById ) {return document.getElementById(divID); };
	if( document.all ) { return document.all[divID]; };
	if( document[divID+'C'] ) { return document[divID+'C'].document[divID]; };
	return false;
}

function getkey(e) {
	if (window.event)
	   return window.event.keyCode;
	else if (e)
	   return e.which;
	else
	   return null;
}

function tonum (num) { return (parseFloat(num.toString().replace(/\$|\,/g,''))); };
function tonum1 (num) { return (parseFloat('0'+num.toString().replace(/\D/g, '')));  };

function formatCurrency(num,quant) {
	num = tonum(num) * tonum(quant);
	if (isNaN(num)) num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if (cents < 10)	cents = "0" + cents;
	for (i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num + '.' + cents);
}

function checkMail(xmail) {
	filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(xmail)) return true;
	else return false;
}

function shohyde(id) {
	var tdiv = getRefToDiv(id); 
	if (tdiv.style.visibility == "visible") {tdiv.style.visibility = "hidden";}
	else {tdiv.style.visibility = "visible";}
}

function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

function showballoon (txt) {
 var balloonid = getRefToDiv('InfoBalloon');
 captureMousePosition();
 balloonid.innerHTML = txt;
 balloonid.style.left = xMousePos-40;
 balloonid.style.top = yMousePos-50;
 balloonid.style.visibility="visible"; 
}

function hideballoon (txt) {
 var balloonid = getRefToDiv('InfoBalloon');
 balloonid.style.visibility="hidden";
}

function copyit(theField) {
  var tempval=eval("document."+theField);
  tempval.focus();
  tempval.select();
  therange=tempval.createTextRange();
  therange.execCommand("Copy");
}

function getwinmax() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  xMousePosMax = myWidth;
  yMousePosMax = myHeight;
}

getwinmax();

function Browser() {
  var ua, s, i;
  this.isIE    = false;
  this.isNS    = false;
  this.version = null;
  ua = navigator.userAgent;
  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.
  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

function mindiv(d3) {
	var d2 = getRefToDiv(d3);
	d2.style.maxheight = d2.style.height;
	d2.style.overflow = "hidden";
	d2.style.height = "24px";
}

function maxdiv(d3) {
	var d2 = getRefToDiv(d3);
	d2.style.overflow = "visible";
	d2.style.height = d2.style.maxheight;	
}

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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

MM_preloadImages();

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_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 backColor = new Array(); // don't change this
backColor[0] = '#FF0000';
backColor[1] = '#00FF00';
backColor[2] = '#0000FF';
backColor[3] = '#FFFFFF';

function changeBG(whichColor){
	document.bgColor = whichColor;
	//xml request - send color pref to session id database
}

function sho(fromid,toid) {
	var fromdiv = getRefToDiv(fromid);
	var todiv = getRefToDiv(toid);
	todiv.innerHTML = fromdiv.innerHTML;
	todiv.style.visibility = "visible";
}

function shosiz(fromid,toid,w,h) {
	var fromdiv = getRefToDiv(fromid);
	var todiv = getRefToDiv(toid);
	todiv.innerHTML = fromdiv.innerHTML;
	todiv.style.width = w + "px";
	todiv.style.height = h + "px";
	todiv.style.visibility = "visible";
}

function getwinx() {
	if (navigator.appName == "Netscape") return window.innerWidth;
	else return document.body.clientWidth;
}

function getwiny() {
	if (navigator.appName == "Netscape") return window.innerHeight;
	else return document.body.clientHeight;
}

function shoxy(fromid,toid) {
	var windowwidth = getwinx();
	var windowheight = getwiny();
	var x, y;
   if (browser.isIE) {
		x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
		y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	}
	if (browser.isNS) {
		x = event.clientX + window.scrollX;
		y = event.clientY + window.scrollY;
	}
  
	var fromdiv = getRefToDiv(fromid);
	var todiv = getRefToDiv(toid);
	todiv.innerHTML = fromdiv.innerHTML;
	window.status = "x=" + x + ",y=" + y;
	var halfx = (windowwidth/2);
	if (Math.abs(x-halfx) < 117) {x=227;}
	else {if (x<halfx) {x=0;} else x=451;
	}
	if (y < 277) {y=102;}
	else {if (y>437) {y=313;} else y=210;
	}
	
	todiv.style.left = x + "px";
	todiv.style.top = y + "px";
	todiv.style.visibility = "visible";
}

function hyd(id) {
	var tdiv = getRefToDiv(id);
	tdiv.style.visibility = "hidden";
}

var slideinaction = { showAni: 1000, //animate speed
	msgb4: "", qnxt: 0,
	hideAni: 750, pauseani: 2000, timer:null, timer2:null, point:null,init:function(ID)
{
el=document.getElementById(ID);
this.showMult=el.offsetWidth/this.showAni/this.showAni;
this.hideMult=el.offsetWidth/this.hideAni/this.hideAni;
el.style.visibility="visible";
}
,showit:function(msg,e,ID)
{
	if (this.timer2) { // check if already have one out
		this.qnxt = 1;
	}
	if (msg != this.msgb4) {
		this.msgb4 = msg;
		if(this.timer2) // new - av - 11-26-07
			{clearTimeout(this.timer2); // new - av - 11-26-07
			this.timer2=0; // new - av - 11-26-07
		} // new - av - 11-26-07
		if(this.timer)
			{clearTimeout(this.timer);
			this.timer=0;
		}
		this.point=document.getElementById(ID);
		this.stuffid = document.getElementById(msg);
		this.movTo(0,528);
		this.writeTip();
		this.w=this.point.offsetWidth;
		this.h=this.point.offsetHeight;
		this.startTime=(new Date()).getTime();
		this.timer=setInterval("slideinaction.rollOut()",10);
	} // end if new msg txt div
}
,rollOut:function()
{var elapsed=(new Date()).getTime()-this.startTime;
if(elapsed<this.showAni)
{var cv=this.w-Math.round(Math.pow(this.showAni-elapsed,2)*this.showMult);
this.movTo(0,528-cv);
}
else
{this.movTo(0,0);
clearInterval(this.timer);
this.timer=0;
}
}
,pauseit:function()
{
	if(this.timer2)
		{clearTimeout(this.timer2);
		this.timer2=0;
	}
}
,hydit:function()
{
	if(this.timer2)
		{clearTimeout(this.timer2);
		this.timer2=0;
	}
	this.timer2 = setTimeout("slideinaction.slideout()",this.pauseani);  // new - av - 11-26-07
}
,slideout:function(){
	 this.msgb4 = "";
if(this.timer2) // new - av - 11-26-07
{clearTimeout(this.timer2); // new - av - 11-26-07
this.timer2=0; // new - av - 11-26-07
} // new - av - 11-26-07
	if(this.timer)
{clearTimeout(this.timer);
this.timer=0;
}
this.startTime=(new Date()).getTime();
this.timer=setInterval("slideinaction.rollUp()",10);
}
,rollUp:function()
{var elapsed=(new Date()).getTime()-this.startTime;
if(elapsed<this.hideAni)
{var cv=Math.round(Math.pow(this.hideAni-elapsed,2)*this.hideMult);
this.movTo(0,528-cv);
}
else
{this.movTo(0,528);
clearInterval(this.timer);
this.timer=0;
this.point=null;
}
}
,writeTip:function()
{if(this.point&&typeof this.point.innerHTML!="undefined")this.point.innerHTML=this.stuffid.innerHTML;}
,movTo:function(top,lft)
{if(this.point&&this.point.style){this.point.style.top=top+"px";this.point.style.left=lft+"px";}}
};

// End -->