dom = (document.getElementById) ? true : false;
ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
ns4 = (document.layers && !dom) ? true : false;
ie4 = (document.all && !dom) ? true : false;
nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;
mac = (navigator.userAgent.indexOf("mac")>-1) ? true: false;
isOpera = (navigator.userAgent.indexOf("Opera")!=-1);
isKonqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);

var origWidth, origHeight;

if (ns4)
{
 origWidth = window.innerWidth;
 origHeight = window.innerHeight;
}

//window.onresize = reDo;

var glideLyr, glidecss, glideStart, glideAmp, intId;

var flag = 1;
var winWd;
var winHt;

var qLayer = 0;

function submitIt(page)
{
 myObj = document.myForm;
 myObj.strPage.value = page;
 myObj.strLastPage.value = "N/A";
 myObj.submit();
}

function PopUp(page,height,width,top,left)
{
 window.open(page,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
}

function handleShowHide(linkLyr,headLyr)
{
 init(linkLyr);
 if (qLayer == 0)
  show(glidecss);
 else
  hide(glidecss);

 init(headLyr);
 if (qLayer == 0)
  show(glidecss);
 else
  hide(glidecss);

 if (qLayer == 0)
  qLayer = 1;
 else
  qLayer = 0;
}

function show(lyr)
{
 lyr.visibility = "visible";
}

function hide(lyr)
{
 lyr.visibility = "hidden";
}
////////////////////////////////

// handles selections layer
function initLinks(linkLyr, headLyr)
{
 init(linkLyr);
 if (winWd < 978)
 {
  fn_shiftTo(glidecss, 510, 23);
  hide(glidecss);
 }
 else
 {
  fn_shiftTo(glidecss, 810, 23);
  show(glidecss);
  qLayer = 1;
 }

 glidecss.height = winHt-23;

 init(headLyr);
 if (winWd < 978)
 {
  fn_shiftTo(glidecss, 510, 0);
  hide(glidecss);
 }
 else
 {
  fn_shiftTo(glidecss, 810, 0);
  show(glidecss);
  qLayer = 1;
 }
}

function reDo()
{
 if (window.innerWidth != origWidth || window.innerHeight != origHeight)
  window.location.reload();
 else
  window.location.reload();
}

function init(lyr)
{
 glideLyr = (ns4)? document.layers[lyr] : (ie4)? document.all[lyr] : (ie5||ns5)? document.getElementById(lyr): null;
 glidecss = (ns4)? document.layers[lyr]: (ie4)? document.all[lyr].style: (ie5||ns5)? document.getElementById(lyr).style: null;
 glideLyrWd = (ns4)? glidecss.clip.width: (glidecss.width)? parseInt(glidecss.width): glideLyr.offsetWidth;
 winWd=(ie4||ie5)? document.body.clientWidth: window.innerWidth;
 winHt=(ie4||ie5)? document.body.clientHeight: window.innerHeight;
}

function fn_shiftTo(lyr,x,y)
{
 if (ns4)
  lyr.moveTo(x,y);
 else
 {
  lyr.left=x+"px";
  lyr.top=y+"px";
 }
}

function ShowSection(lyr)
{
 lyr = "section" + lyr;
 init(lyr);
 show(glidecss);
}

function HideSection(lyr)
{
 lyr = "section" + lyr;
 init(lyr);
 hide(glidecss);
}

function tabNext(obj, objLength, objNext) {
	if ((document.getElementById(obj).value).length == objLength)
		if (document.getElementById(objNext))
			setFocus(objNext);
}

function setFocus(obj) {
	document.getElementById(obj).focus();
	document.getElementById(obj).select();
}

function show(obj) {
	document.getElementById(obj).style.visibility = "visible";
}

function hide(obj) {
	document.getElementById(obj).style.visibility = "hidden";
}


///////////////////////////////////////////////

