

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		scroll_up_over = newImage("images/scroll_up_over.gif");
		scroll_dn_over = newImage("images/scroll_dn_over.gif");
		preloadFlag = true;
	}
}
// -->

<!--// End Preload Script -->
//

function clickIE() {
  if (document.all) {
    return false;
  }
}

function clickNS(e) {
  if (document.layers||(document.getElementById&&!document.all)) { 
    if (e.which==2||e.which==3) {
      return false;
    }
  }
}
 
if (document.layers) {
  document.captureEvents(Event.MOUSEDOWN);
//  document.onmousedown=clickNS;
} else {
  document.onmouseup=clickNS;
//  document.oncontextmenu=clickIE;
}
 
//document.oncontextmenu=new Function("return false") 



//--Flash sniff routines
//--These detect the presence of flash
//--For IE6 Mac which has no plugins array, a prompt box is displayed once
//--user's response is then stored in cookie
//--flash sniff in part by yoleroy@hotmail.com

function checkBrowser(){
	sBrowserName = navigator.appName;
	sBrowserVersion = parseInt(navigator.appVersion);
	if (sBrowserName == "Netscape" && sBrowserVersion >= 3){
		if(navigator.appVersion.indexOf("Mac") != -1){
				return false;
		}else{
				return true;
		}
	}
	else if(sBrowserName == "Microsoft Internet Explorer" && sBrowserVersion >=6){
		return false;
	}
};




var isIEpc = ((navigator.appVersion.indexOf("Win") != -1) && (navigator.userAgent.indexOf("MSIE") != -1));
var ieMac6 = ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.appVersion.indexOf("MSIE 6") != -1));
var isNS = (navigator.appName == "Netscape");

var isNS6mac = ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.appVersion.indexOf("MSIE 6") != -1));
//var isNS6mac = ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.appName == "Netscape"));

var theCookieName = "HTI_f_sniff";
var flash = "yes";


function getcookieval(offset)
{
	var endstr = document.cookie.indexOf(";",offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

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)
{
	var argv = setcookie.arguments;
	var argc = setcookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+((expires==null)?"":(";expires="+expires.togmtstring()))+((path==null) ? "":(";path="+path))+((domain==null)?"":(";domain="+domain))+((secure==true)?";secure" : "");
}

function deletecookie(name)
{
	var exp=new Date();
	exp.settime (exp.gettime()-1);
	var cval=getcookie(name);
	document.cookie = name+"="+cval+"; expires="+exp.togmtstring();
}

function question()
{
if (confirm("If you have Macromedia Flash 7.0 click 'OK'"))
	{
	return "yes";
	}
else
	{
	return "no";
	}
}


function nsHasFlash(){

     if  (navigator.plugins["Shockwave Flash"]){
 //    alert("nsHasFlash=yes");
        	return "yes"
     } else {
 //    alert("nsHasFlash=no");
		return "no"
		 }

}

function detectflash(){
	if (isIEpc){
		return ieHasFlash();
	}
	else if (isNS || ieMac6)  {
		return nsHasFlash();
	}
	else {
		return question();

	}
}
if (isIEpc){
	document.writeln("<SCR"+"IPT LANGUAGE=VBScript>");
	document.writeln("function ieHasFlash");
	document.writeln("on error resume next");
	document.writeln("var GotFlash");
	document.writeln("GotFlash = IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.7\"))");
	document.writeln("If GotFlash = True Then");
	document.writeln("ieHasFlash= \"yes\"");
	document.writeln("else");
	document.writeln("ieHasFlash = \"no\"");
	document.writeln("End If");
	document.writeln("end function");
	document.writeln("</SC"+"RIPT>");
}

function hasFlash() {
	//--this function returns true or false
	//--depending on whether the user's browser
	//--supports flash. Note if IE 6 Mac, a prompt
	//--box will be displayed asking the user.
	//--supported platforms:
	//--   NS6-PC/MAC,NS6-PC/MAC,IE6-PC/MAC,IE6-PC/MAC
	//--
	if (getcookie(theCookieName)==null) {
		//----start a testin---
		var theResponse = detectflash();
		setcookie(theCookieName,theResponse,null,'/');
	}
	flash = getcookie(theCookieName);
	if (flash=="yes") {
		return true;
	} else {
		return false;
	}
}


//-- END Flash sniff routines
//--FORM STUFF 
function checkEmail(the_email) {
  var the_at = the_email.indexOf("@");
  var the_dot = the_email.lastIndexOf(".");
  var a_space = the_email.indexOf(" ");
  if ( (the_at != -1) &&
       (the_at != 0) &&
       (the_dot != -1) &&
       (the_dot > the_at + 1) &&
       (the_dot < the_email.length) &&
       (a_space == -1) ) {
    return false;
  } else {
    return true;
  }
}

function formatPhone(p){
    if (p.length==7) return p.substring(0,3) + "-" + p.substring(3,7);
    if (p.length==10) return "(" + p.substring(0,3) + ") " + p.substring(3,6) + "-" + p.substring(6,10);
  return p;
}
//---END FORM STUFF


//-- NAV STUFF

	//  function navGo(pg){
	//  	window.location=pg;
	//  }
	  function navPop(pop, pg){
	  	window.location=pg;
	  	openAWindow( pop, "pdfs", 650, 450, 1, 1);
	  }
	  function navHover(item){
	  	// other supported styles
	  
	  		// myElement.style.fontSize = "24px";
	  
	  		// myElement.style.fontFamily = "Verdana, Arial, Courier New";
	  
	  		// myElement.style.textDecoration = "underline";
	  
	  		// myElement.style.fontWeight = "normal";
	  
	  		// myElement.style.visibility=="hidden";
	  
	  
	  
	  		if((document.getElementById)&& (document.getElementById(item)!=null)) {
	  
	  	  		// Get a reference to the element
	  
	  			var myElement = document.getElementById(item);
	  
	  
	  
	  			// Check the element's style object and background property are available
	  
	  		 	if ((myElement.style)) {
	  		 	//alert(myElement.style.backgroundColor);
	  
	      			// Check the value of the property #FFF4E4
	   					// change style to new color
	  
	  					document.getElementById(item).style.color = "#F6C06F";
				//document.getElementById(item).style.backgroundColor = "#7C98AE";

	  				
	  
	    			}else {
	  
	  				// This CSS property is not assigned or is not supported
	  
	  				return;
	  
	    			}
	  
	  		}else {
	  
	  		  return;
	  
	  		}
	  
	  	}
	  	
	function navOutGray(item){


	if((document.getElementById)&& (document.getElementById(item)!=null)) {

		// Get a reference to the element

		var myElement = document.getElementById(item);

		if ((myElement.style)) {
				//document.getElementById(item).style.color = "#FF9966";
				document.getElementById(item).style.color = "#d8d8d8";
				//document.getElementById(item).style.backgroundColor = "";
		}else {

			// This CSS property is not assigned or is not supported

			return;

		}

	}else {

	  return;

	}

	}	
	  	
	  	
	  	

	  function navOut(item){


		if((document.getElementById)&& (document.getElementById(item)!=null)) {

			// Get a reference to the element

			var myElement = document.getElementById(item);

			if ((myElement.style)) {
					document.getElementById(item).style.color = "#ffffff";
				//document.getElementById(item).style.backgroundColor = "";


			}else {

				// This CSS property is not assigned or is not supported

				return;

			}

		}else {

		  return;

		}

	}
//-- END NAV STUFF
	  function openAWindow( pageToLoad, winName, width, height, resizeable, scroll) {
	  	  	var popWin;
	  
	  	  	/* Opens a new window on the users desktop.
	  	  		Arguments:
	  	  		 pageToLoad - The URL of a page to load in the browser window.
	  	  						  This can be a relative URL or fully qualified.
	  	  		 winName - 	 Name of the new window.
	  	  		 width - 	 The horizontal size of the new window.
	  	  		 height - 	 The vertical size of the new window.
	  	  		 center -     toggle centering on 4.0 browsers.
	  	  						  1=centered window 0=no centering
	  
	  	  		 Values in the "args" section below can all be toggled in the
	  	  		 same fashion as the center toggle.  Just modify the appropriate
	  	  		 value in the args section to be either 0 or 1.
	  
	  	  	*/
	  
	  	  		 xposition=0; yposition=0;
	  	  		 if ((parseInt(navigator.appVersion) >= 4 ) && (1==1)){
	  	  			  xposition = (screen.width - width) / 2;
	  	  			  yposition = (screen.height - height) / 2;
	  	  		 }
	  	  		 args = "width=" + width + ","
	  	  		 + "height=" + height + ","
	  	  		 + "location=0,"
	  	  		 + "menubar=0,"
	  	  		 + "resizable=" + resizeable + ","
	  	  		 + "scrollbars=" + scroll + ","
	  	  		 + "status=0,"
	  	  		 + "titlebar=1,"
	  	  		 + "toolbar=0,"
	  	  		 + "hotkeys=0,"
	  	  		 + "screenx=" + xposition + ","  //NN Only
	  	  		 + "screeny=" + yposition + ","  //NN Only
	  	  		 + "left=" + xposition + ","     //IE Only
	  	  		 + "top=" + yposition;           //IE Only
	  
	  	  		 popWin=window.open( pageToLoad,winName,args );
	  	  		 popWin.focus();
	  
	  	  	}
	  
	  
	  

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}



var clipTop = 0;
var clipWidth = 145;
var clipBottom = 485;
var topper = 72;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;

function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('example');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;		
	//	x.style.clip.top = 72;
	//	x.style.clip.left = 0;
	//	x.style.clip.right = 145;
	//	x.style.clip.bottom = 485;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;

	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		//x.style.clip = 'rect(46 145 485 0)'
		x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
	}
}
function getpos(nid)
{
//ob=eval("document.all.);
var ob = document.getElementById("nav"+nid);
   var thisTop = (document.all)? ob.offsetTop :
     document.defaultView.getComputedStyle(ob, "").getPropertyValue("top");
   alert(thisTop);
   if (thisTop > 485){
   var po = 485-thisTop;
   alert (po);
   //init_reset(po);
   //scrollayer('example',po,100);
   urlnow=document.location;
   alert (urlnow);
  // urlnew=eval(urlnow+"&navPos="+po)
   window.location=urlnow+"&navPos="+po;
   //document.location.reload();
   
   };

}
function init_reset(pos)
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('example');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;		
		x.style.clip.top = ((0 - pos)+ 72);
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = (((0 - pos)+ 72)+485);
	//	x.style.clip.top = clipTop;
	//	x.style.clip.left = 0;
	//	x.style.clip.right = clipWidth;
	//	x.style.clip.bottom = clipBottom;
		// topper =x.style.top;

	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		//x.style.clip = 'rect(46 145 485 0)'
		x.style.clip = 'rect('+((0 - pos)+ 72)+' '+clipWidth+' '+(((0 - pos)+ 72)+485)+' 0)';
		clipTop= ((0 - pos)+ 72);
		clipBottom= (((0 - pos)+ 72)+485);
		topper = pos;
		
	}
}

function XXXXinit_reset(pos)
{	if (!DHTML) return;
	clipTop =(0 - pos)+ 72;
	clipBottom = 72 + clipBottom;
	topper = pos;
	thelayer = new getObj('element');
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper;
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper;
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
}
function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper;
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function stopscroll()
{
	if (time) clearTimeout(time);
}

function getPos(layername)
{

	thelayer = new getObj(layername);
	//alert (thelayer.style.top);
	getPos= thelayer.style.top;
	
}
function navgo (layername, a, b, c, d, e, f, item)
{
	thelayer = new getObj(layername);
	if (b==0) {
		document.navVar.navPos.value ="";
	}else{
		document.navVar.navPos.value = thelayer.style.top ;
	}
	document.navVar.navID.value = item ;
	document.navVar.a.value = a;
	document.navVar.b.value = b;
	document.navVar.c.value = c;
	document.navVar.d.value = d;
	document.navVar.e.value = e;
	document.navVar.f.value = f;	
	navVar.submit();
}