

function dynObj(id,x,y,w,h) {
	this.el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (!this.el) return null;
	this.doc = (document.layers)? this.el.document: this.el;
	this.css = (this.el.style)? this.el.style: this.el;
	var px = (document.layers||window.opera)? "": "px";
	this.x = x || 0;	if (x) this.css.left = this.x+px;
	this.y = y || 0;	if (y) this.css.top = this.y+px;
	this.width = w? w: (this.el.offsetWidth)? this.el.offsetWidth: (this.css.clip.width)? this.css.clip.width: 0;
	this.height = h? h: (this.el.offsetHeight)? this.el.offsetHeight: (this.css.clip.height)? this.css.clip.height: 0;
	// if w/h passed, set style width/height
	if (w){ (document.layers)? this.css.clip.width=w+px: this.css.width=w+px;}
	if (h){ (document.layers)? this.css.clip.height=h+px: this.css.height=h+px;}
	this.obj = id + "dynObj"; 	eval(this.obj + "=this");
}

function dw_show() { this.css.visibility = "visible"; }
function dw_hide() { this.css.visibility = "hidden"; }

function dw_shiftTo(x,y) {
	if (x!=null) this.x=x; if (y!=null) this.y=y;	
	// rounded below (this.x/y can hold decimals)
	if (this.css.moveTo) { 
		this.css.moveTo(Math.round(this.x),Math.round(this.y)); 
	} else { 
		this.css.left=Math.round(this.x)+"px"; 
		this.css.top=Math.round(this.y)+"px"; 
	}
}

function dw_shiftBy(x,y) {
	this.shiftTo(this.x+x,this.y+y);
}

function dw_writeLyr(cntnt) {
	if (typeof this.doc.innerHTML!="undefined") {
      this.doc.innerHTML = cntnt;
  } else if (document.layers) {
			this.doc.write(cntnt);
			this.doc.close();
  }
}

function dw_setBgClr(bg) {
	if (document.layers) this.doc.bgColor=bg;
	else this.css.backgroundColor=bg;
}

// assign methods 
dynObj.prototype.show = dw_show;
dynObj.prototype.hide = dw_hide;
dynObj.prototype.shiftTo = dw_shiftTo;
dynObj.prototype.shiftBy = dw_shiftBy;
dynObj.prototype.writeLyr = dw_writeLyr;
dynObj.prototype.setBgClr=dw_setBgClr;


// get reference to nested layer for ns4
// from dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}





var scrTimer = 20; // interval between calls to scroll onmouseover

function stopScroll(num) {
  if (pgLoaded && wndo[num]) {
  	clearTimeout(wndo[num].scrTmId);
  	wndo[num].scrTmId = 0;
  }
}

function getElemRefs(id) {	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;	if (el) el.css = (el.style)? el.style: el;	return el;}

function loadScrLyr(num,lyr,id,updownyn) {

	//zipur@t2.net ADDED
  	// setup up/down arrows
	        var lyrxx = getElemRefs('ctrls');
  	if (updownyn == 1){
	// show up down
	MM_swapImage('tipup','','graphics/up.gif',1);
	MM_swapImage('tipdown','','graphics/down.gif',1);
	MM_swapImage('tippup','','graphics/pageup.gif',1);
	MM_swapImage('tippdown','','graphics/pagedown.gif',1);
	MM_swapImage('closetip','','graphics/close_tip.gif',1);
	lyrxx.css.visibility = "visible";
  	}
	else if (updownyn == 2){
		//close tip
		MM_swapImage('tipup','','graphics/blank.gif',1);
		MM_swapImage('tipdown','','graphics/blank.gif',1);
		MM_swapImage('tippup','','graphics/blank.gif',1);
		MM_swapImage('tippdown','','graphics/blank.gif',1);
		MM_swapImage('closetip','','graphics/blank.gif',1);


		lyrxx.css.visibility = "hidden";
	}
  	else{
	// hide up down
	MM_swapImage('tipup','','graphics/blank.gif',1);
	MM_swapImage('tipdown','','graphics/blank.gif',1);
	MM_swapImage('tippup','','graphics/blank.gif',1);
	MM_swapImage('tippdown','','graphics/blank.gif',1);
	MM_swapImage('closetip','','graphics/close_tip.gif',1);

	lyrxx.css.visibility = "visible";
  	}
  
	if (!pgLoaded) return; // avoid not loaded errors
	if (typeof wndo[num].cnt != "undefined") wndo[num].cnt.hide();
  wndo[num].scrTmId = 0;
	wndo[num].cnt = new dynObj(lyr);
  // mainly for ns6+/mozilla when scrolling horizontally
  if (id && document.getElementById) 
    wndo[num].cnt.width = document.getElementById(id).offsetWidth;
	wndo[num].cnt.show();
	wndo[num].cnt.shiftTo(0,0);	// restore top/left to 0 
	wndo[num].maxX = wndo[num].cnt.width - wndo[num].width;
	wndo[num].maxY = wndo[num].cnt.height - wndo[num].height
} 

// These functions are for onmouseover scrolling
function inchDown(num,inc) {
	if (!pgLoaded||!wndo[num]) return;
	if (wndo[num].scrTmId) clearTimeout(wndo[num].scrTmId);
	var y = parseInt(wndo[num].cnt.css.top);
	if (y>-wndo[num].maxY) { 
    if ((y-inc)>(-wndo[num].maxY)) wndo[num].cnt.shiftBy(0,-inc);
		else wndo[num].cnt.shiftBy(0,-(wndo[num].maxY-Math.abs(y)));
		wndo[num].scrTmId = setTimeout("inchDown("+num+","+inc+")",scrTimer);	
	}
}

function inchUp(num,inc) {
	if (!pgLoaded||!wndo[num]) return;
	if (wndo[num].scrTmId) clearTimeout(wndo[num].scrTmId);
	var y = parseInt(wndo[num].cnt.css.top);
	if (y<0) { 
    if ((y+inc)<=0) wndo[num].cnt.shiftBy(0,inc); 
		else wndo[num].cnt.shiftBy(0,-y);
		wndo[num].scrTmId = setTimeout("inchUp("+num+","+inc+")",scrTimer);	
  }
}

function inchRight(num,inc) {
	if (!pgLoaded||!wndo[num]) return;
	if (wndo[num].scrTmId) clearTimeout(wndo[num].scrTmId);
	var x = parseInt(wndo[num].cnt.css.left);	
	if (x>-wndo[num].maxX) { 
    if ((x-inc)>(-wndo[num].maxX)) wndo[num].cnt.shiftBy(-inc,0);
		else wndo[num].cnt.shiftBy(-(wndo[num].maxX-Math.abs(x)),0);
		wndo[num].scrTmId = setTimeout("inchRight("+num+","+inc+")",scrTimer);	
	}
}

function inchLeft(num,inc) {
	if (!pgLoaded||!wndo[num]) return;
	if (wndo[num].scrTmId) clearTimeout(wndo[num].scrTmId);
	var x = parseInt(wndo[num].cnt.css.left);
	if (x<0) { 
    if ((x+inc)<=0) wndo[num].cnt.shiftBy(inc,0); 
		else wndo[num].cnt.shiftBy(-x,0); 
		wndo[num].scrTmId = setTimeout("inchLeft("+num+","+inc+")",scrTimer);	
  }
}


// These functions are for onclick scrolling
function jumpDown(num,jump) {
	if (!pgLoaded||!wndo[num]) return;
	var y = parseInt(wndo[num].cnt.css.top);
	if (y>(-wndo[num].maxY)) { 
		if ((y-jump)>(-wndo[num].maxY)) wndo[num].cnt.shiftBy(0,-jump);
		else wndo[num].cnt.shiftBy(0,-(wndo[num].maxY-Math.abs(y)));	
  }
}

function jumpUp(num,jump) {
	if (!pgLoaded||!wndo[num]) return;
	var y = parseInt(wndo[num].cnt.css.top);
	if (y<0) { 
		if ((y+jump)<=0) wndo[num].cnt.shiftBy(0,jump); 
		else wndo[num].cnt.shiftBy(0,-y); 
	}
}

function jumpRight(num,jump) {
	if (!pgLoaded||!wndo[num]) return;
	var x = parseInt(wndo[num].cnt.css.left);
	if (x>(-wndo[num].maxX)) {
		if ((x-jump)>(-wndo[num].maxX)) wndo[num].cnt.shiftBy(-jump,0);
		else wndo[num].cnt.shiftBy(-(wndo[num].maxX-Math.abs(x)),0);	
  }
}

function jumpLeft(num,jump) {
	if (!pgLoaded||!wndo[num]) return;
	var x = parseInt(wndo[num].cnt.css.left);
	if (x<0) { 
		if ((x+jump)<=0) wndo[num].cnt.shiftBy(jump,0); 
		else wndo[num].cnt.shiftBy(-x,0); 
	}
}

// Functions for glide-scrolling onclick  
// NOTE: dw_slide.js needed for glide-scroll
function glideRight(num,dist) {
	if (!pgLoaded||!wndo[num]) return;
	var x = parseInt(wndo[num].cnt.css.left);
	if (x>(-wndo[num].maxX)) {
		if ((x-dist)>(-wndo[num].maxX)) wndo[num].cnt.slideBy(-dist,0,500);
		else wndo[num].cnt.slideBy(-(wndo[num].maxX-Math.abs(x)),0,500);	
  }
}

function glideLeft(num,dist) {
	if (!pgLoaded||!wndo[num]) return;
	var x = parseInt(wndo[num].cnt.css.left);
	if (x<0) { 
		if ((x+dist)<=0) wndo[num].cnt.slideBy(dist,0,500); 
		else wndo[num].cnt.slideBy(-x,0,500); 
	}
}

function glideDown(num,dist) {
	if (!pgLoaded||!wndo[num]) return;
	var y = parseInt(wndo[num].cnt.css.top);
	if (y>(-wndo[num].maxY)) { 
		if ((y-dist)>(-wndo[num].maxY)) wndo[num].cnt.slideBy(0,-dist,500);
		else wndo[num].cnt.slideBy(0,-(wndo[num].maxY-Math.abs(y)),500);	
  }
}

function glideUp(num,dist) {
	if (!pgLoaded||!wndo[num]) return;
	var y = parseInt(wndo[num].cnt.css.top);
	if (y<0) { 
		if ((y+dist)<=0) wndo[num].cnt.slideBy(0,dist,500); 
		else wndo[num].cnt.slideBy(0,-y,500); 
	}
}




dynObj.prototype.slideTo = function(destX,destY,slideTime,fn,container) {
	this.slideTime = slideTime||.0001; this.fn=fn||null;
	// ok to slide along one axis only
	if (destX==null) destX=this.x;
	if (destY==null) destY=this.y;
	if (isNaN(parseInt(destX))) {	// if relative to container (string)
		this.posRel(destX,destY,container);
		this.destX=this.leftPos; this.destY=this.topPos;
	} else {
		this.destX=destX; this.destY=destY;
	}
	this.distX=this.destX-this.x; this.startX=this.x;
	this.distY=this.destY-this.y; this.startY=this.y;
	this.slideStart = (new Date()).getTime();
	if (this.slideProp=="steady") this.per = 1/this.slideTime;
	else this.per = Math.PI/(2*this.slideTime);
	if (this.slideProp=="acc") {
		this.distX=-this.distX; this.distY=-this.distY;
		this.startX=this.destX; this.startY=this.destY;
	}
	this.sliding=true;
	this.doSlide();
	
}

dynObj.prototype.slideBy = function(dx,dy,slideTime,fn,container) {
	var destX=this.x+dx; var destY=this.y+dy;
	
	this.slideTo(destX,destY,slideTime,fn,container);
}

dynObj.prototype.doSlide = function() {
	if (!this.sliding) return;	// slide can be interrupted
	var elapsed = (new Date()).getTime()-this.slideStart;
	if (elapsed<this.slideTime) {
		if (this.slideProp=="dec") {
			var x = Math.round((this.distX)*Math.sin(this.per*elapsed)+this.startX);
			var y = Math.round((this.distY)*Math.sin(this.per*elapsed)+this.startY);
		} else if (this.slideProp=="acc") {
			var x = Math.round((this.distX)*Math.cos(this.per*elapsed)+this.startX);
			var y = Math.round((this.distY)*Math.cos(this.per*elapsed)+this.startY);
		} else {
			var x = Math.round((this.distX)*(this.per*elapsed)+this.startX);
			var y = Math.round((this.distY)*(this.per*elapsed)+this.startY);
		}
		this.shiftTo(x,y);
		this.onSlide();
		setTimeout(this.obj+".doSlide()",35);
	} else {	// if time's up
		this.shiftTo(this.destX,this.destY);
		this.onSlide();
		this.sliding=false;
		this.onSlideEnd();
		if (this.fn) eval(this.fn);
	}

}

// do you want your slides to be steady, accelerate or decelerate?
dynObj.prototype.slideProp="dec";	// can be "steady", "acc", or "dec"

dynObj.prototype.onSlide=function() {}
dynObj.prototype.onSlideEnd=function() {}

/*
		dw_util.js
		utility functions (and 1 method for dynObj)
		version date: August 2002
		
		functions for getting window dimensions and scroll amount
		from http://13thparallel.com/?issue=2002.06&title=viewport
				
		This code is from Dynamic Web Coding 
    www.dyn-web.com 
    See Terms of Use at http://www.dyn-web.com/bus/terms.html
    Permission granted to use this code 
    as long as this entire notice is included.		
*/

// center in container (window or outer layer)
// NOTE: uses this.width/height properties of dynObj
// so make sure those have been obtained/set appropriately
// for type of content!!!!
dynObj.prototype.centerIn = function(outer) {
	var outWd, outHt, inWd, inHt, x, y;
	if (eval(outer)==window) {
		outWd=getWinWidth();
		outHt=getWinHeight();
	} else {
		outWd=outer.width;
		outHt=outer.height;
	}
	inWd=this.width;
	inHt=this.height;
	x=Math.round((outWd-inWd)/2);
	y=Math.round((outHt-inHt)/2);
	this.shiftTo(x,y);
}

// gets rendered height/width 
// for ns4, pass reference to layer. 
// for others, pass reference to layer or
// id of html element containing content (depends...)
function getWidth(obj,id) {
	var wd=0;
	if (document.getElementById||document.all) {
		var elem;
		if (id)	elem = (document.getElementById)? document.getElementById(id): document.all[id];
		else elem = obj;
		if (elem.offsetWidth) wd = elem.offsetWidth;
  } else if (obj.document) wd = obj.document.width;	// ns4
	return wd;
}

function getHeight(obj,id) {
	var ht=0;
	if (document.getElementById||document.all) {
    var elem;
		if (id)	elem = (document.getElementById)? document.getElementById(id): document.all[id];
		else elem = obj;
		if (elem.offsetHeight) ht = elem.offsetHeight;
  } else if (obj.document) ht = obj.document.height;	// ns4
	return ht;
}

// credit to http://www.13thparallel.com for the following 4 functions
// see http://13thparallel.com/?issue=2002.06&title=viewport
// returns width of window
function getWinWidth() {
	var winWd = 0;
	if (document.documentElement && document.documentElement.clientWidth) 
		winWd = document.documentElement.clientWidth;
	else if (document.body && document.body.clientWidth) 
		winWd = document.body.clientWidth;
	else if (document.body && document.body.offsetWidth) 
		winWd = document.body.offsetWidth; // ns6
	else if (window.innerWidth) winWd = window.innerWidth-18;
	return winWd;
}

// returns height of window
function getWinHeight() {
	var winHt = 0;
	if (window.innerHeight) winHt = window.innerHeight-18;
	else if (document.documentElement && document.documentElement.clientHeight) 
		winHt = document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight) 
		winHt = document.body.clientHeight;
	return winHt;
}	

// returns amount of vertical scroll
function getScrollY() {
	var scroll_y = 0;
	if (document.documentElement && document.documentElement.scrollTop)
		scroll_y = document.documentElement.scrollTop;
	else if (document.body && document.body.scrollTop) 
		scroll_y = document.body.scrollTop; 
	else if (window.pageYOffset)
		scroll_y = window.pageYOffset;
	else if (window.scrollY)
		scroll_y = window.scrollY;
	return scroll_y;
}

// returns amount of horizontal scroll
function getScrollX() {
	var scroll_x = 0;
	if (document.documentElement && document.documentElement.scrollLeft)
		scroll_x = document.documentElement.scrollLeft;
	else if (document.body && document.body.scrollLeft) 
		scroll_x = document.body.scrollLeft; 
	else if (window.pageXOffset)
		scroll_x = window.pageXOffset;
	else if (window.scrollX)
		scroll_x = window.scrollX;
	return scroll_x;
}


 
statObj.ar = new Array();
function statObj(id,x,y,w,h,d) {
	this.dur=d||1000; this.xOff=x; 
	if (y>=0) this.yOff=y;	
	else { 
		this.relBtm = y;
		this.yOff = y = getWinHeight() + y;
	}
	this.bobj = dynObj;
	this.bobj(id,x,y,w,h);
  statObj.ar[statObj.ar.length] = this;
  this.show();
}
statObj.prototype = new dynObj;
statObj.prototype.checkStatLyr=checkStatLyr;
statObj.prototype.glideInit=statGlideInit; 
statObj.prototype.glide=statGlide;
statObj.prototype.onGlideInit=function(){}

// adapted from ypChaser
// Aaron Boodman's updated chaser from www.youngpup.net
window.setInterval("statObj.timer()",20);
statObj.timer = function() {
  for (var i=0; i<statObj.ar.length; i++) {
    curObj = statObj.ar[i];
    if (curObj) curObj.checkStatLyr();
  }
}

// monitors scrolling and position of statLyr
function checkStatLyr() {
	var yScroll = getScrollY();
	this.curTop = parseInt(this.css.top);
	this.newDestY = yScroll + this.yOff;
	if (this.newDestY!=this.curTop) {
		if (this.newDestY!=this.destY) {
			this.destY = this.newDestY;
			this.glideInit();
			this.onGlideInit();
		} 
		this.glide();
	}
}

//added by Preston (force scroll to move to smaller top margin while scrolling)
if(typeof(st_js)=="undefined"){stDRTL=0;stAHCM=0;// 0stAHWS=1;// 1stSMSC=1;// 1stSCSP=0;// 0stCFSP=0;// 0stBIMG=1;// 1stILOC=0;// 0stILNK=0;// 0stDF55=0;// 0stMMSZ=10;// 10nOP=nOP5=nIE=nIE4=nIE5=nNN=nNN4=nNN6=nKQ=nKQ2=nMAC=nIEM=nIEW=nDM=nVER=st_delb=st_addb=st_scd=st_ascr=0,stmozb=0;stnav();st_reg=!(nIEW&&nVER>=5.5&&nVER<6&&stDF55);st_ttb=nIE;stHAL=["left","center","right"];stVAL=["top","middle","bottom"];stREP=["no-repeat","repeat-x","repeat-y","repeat"];stBDS=["none","solid","double","dotted","dashed","groove","ridge","inset","outset"];st_gc=st_rl=st_cl=st_ct=st_cw=st_ch=st_cm=st_cp=st_ci=st_load=st_scr=0;st_ht="";st_ims=[];st_ms=[];stusrld=[];if(nNN4){stitovn=stevfn("stitov",1);stitoun=stevfn("stitou",1);stitckn=stevfn("stitck",1);stppovn=stevfn("stppov",0);stppoun=stevfn("stppou",0);}if(nIEM||nOP5)onunload=function(){for(var j=0;j<st_ms.length;++j)st_ms[j].cfrm=0;return true;}if(nDM&&!nNN4){	var s="<STYLE>\n.st_tbcss,.st_tdcss,.st_divcss,.st_ftcss{border:none;padding:0px;margin:0px}\nA.st_acss,A.st_acss:link,A.st_acss:visited,A.st_acss:active,A.st_acss:hover{background-color:transparent;font-style:normal;border:none}\n</STYLE>";	for(var j=0;j<stMMSZ;++j)		s+="<FONT ID=st_gl"+j+"></FONT>";	if(nIEW&&nVER>=5&&document.body)		document.body.insertAdjacentHTML("AfterBegin",s);	else		document.write(s);}st_js=1;}

function stgct(){
    return nIE?(nIEW&&document.compatMode=="CSS1Compat"?document.documentElement:document.body).scrollTop:pageYOffset;
}
function stnav(){var v=navigator.appVersion,a=navigator.userAgent;nMAC=v.indexOf("Mac")>=0;if((nKQ=(typeof(navigator.product)!="undefined"&&navigator.product=="Konqueror/khtml"))){nVER=parseFloat(v);nKQ2=1;stmozb=1;}else if((nOP=a.indexOf("Opera")>=0)){nVER=parseFloat(a.substring(Math.max(a.indexOf("Opera/"),a.indexOf("Opera "))+6,a.length));nOP5=nVER>=5;}else if((nIE=document.all?1:0)){nIE4=(eval(v.substring(0,1))>=4);nVER=parseFloat(a.substring(a.indexOf("MSIE ")+5,a.length));nIE5=nVER>=5&&nVER<5.5&&!nMAC;nIEM=nIE4&&nMAC;nIEW=nIE4&&!nMAC;st_ascr=nIEW&&nVER>=5;}else if((nNN4=navigator.appName.toLowerCase()=="netscape"&&v.substring(0,1)=="4")){nVER=parseFloat(v);}else if((nNN6=(document.getElementsByTagName("*")&&a.indexOf("Gecko")!=-1))){nVER=parseInt(navigator.productSub);if(a.indexOf("Netscape")>=0){st_delb=nVER<=20001108;st_addb=nVER>=20020512;}else{stmozb=nVER<20010505&&nVER>20001205;st_delb=nVER<=20010628;st_addb=nVER>=20011221&&nVER<20021016;}st_ascr=nVER>=20040804;}nNN=nNN4||nNN6;nDM=nOP5||nIE4||nNN||nKQ2;}
//end added by Preston

function statGlideInit() {
    //added by Preston (force scroll to move to smaller top margin while scrolling)
    //alert('Test: ' + this.curTop);

        var ytouse = this.destY - 130;

    
    
    
    if (ytouse < 140){
        ytouse=140;
    }
    
     //end added by Preston
    

    
	var now = new Date();
	this.a = ytouse-this.curTop;
	this.b = Math.PI/(2*this.dur);
	this.c = now.getTime();
	if (Math.abs(this.a)>winHt) {	// distance greater than window height?
		this.d = (this.a>0)? ytouse-winHt: ytouse +winHt;
		this.a = (this.a>0)? winHt : -winHt;
	} else this.d = this.curTop;
}

function statGlide() {
	var now = new Date();
	var t = now.getTime()-this.c;
	var y = Math.round(this.d+this.a*Math.sin(this.b*t));
	if ((this.a>0&&y>this.curTop)||(this.a<0&&y<this.curTop)) {
		this.shiftTo(null,y);
	}
}
