	//**********SHARED FUNCTIONS***************
var menuType;
var fixedClipHeight =121;
var heightOfItems;
var centerX;
var centerY;
//Dynamically line up a layer with a reference image
function P7_Snap() { //v2.62 by PVII
  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
  for (k=0; k<(args.length-3); k+=4)
   if ((g=MM_findObj(args[k]))!=null) {
    el=eval(MM_findObj(args[k+1]));
    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
    if(document.getElementById) {
     d="document.getElementsByName('"+args[k]+"')[0]";
     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
    }else if(document.all) {d=da;} 
    if (document.all || document.getElementById) {
     while (tx==1) {p+=".offsetParent";
      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
      }else{tx=0;}}
     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
      x=document.body.scrollLeft + event.clientX + bx;
      y=document.body.scrollTop + event.clientY;}}
   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
   if(el) {e=(document.layers)?el:el.style;
   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
	centerX=xx;
	centerY=yy;
}

//Test if menu will scroll in 91px clip region
function isScrolling(objID) {
	if(loaded){
		gScroll=eval('gScroll'+ objID);
		scrollVal=(gScroll.scrollHeight>clipHeightArray[objID])?1:0;
	}
	return scrollVal;
}
function scrollingHeight(objID) {
	if(loaded){
		gScroll=eval('gScroll'+ objID);
		scrollVal=gScroll.scrollHeight
	}
	return scrollVal;
}

//Change the Z Index so that the correct layers can be clicked
function ChangeZindex(layerName1, layerIndex, layerName2){
	if(document.layers){
		if(layerName2){document.layers[layerName1].document.layers[layerName2].zIndex=layerIndex;}
		else{document.layers[layerName1].zIndex=layerIndex;}}
	if(document.getElementById){document.getElementById(layerName1).style.zIndex=layerIndex;}
	if(document.all){document.all[layerName1].style.zIndex=layerIndex;}
	return;
}

function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
var speed=24;

var loop, timer

function makeObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
//alert("obj: " + obj + " scrollHeight= " + this.scrollHeight)
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.clipWidth=bw.ns4?this.css.document.width:this.el.offsetWidth
this.up=goUp;this.down=goDown;
this.moveIt=moveIt; this.x; this.y;
this.obj = obj + "Object"
this.name = obj
this.id=this.name.substring(this.name.length-1,this.name.length)
eval(this.obj + "=this")
return this
}

function moveIt(x,y){
this.x=x;
this.y=y;
this.css.left=this.x+"px"
this.css.top=this.y+"px"
}

function goDown(move){
var newMove=0;
if(this.y>-this.scrollHeight+clipHeightArray[this.id]){
	var newMove=0;
	if (this.y +(-1*(-this.scrollHeight+clipHeightArray[this.id])) < 4 ) {move=this.y +(-1*(-this.scrollHeight+clipHeightArray[this.id]))}
	this.moveIt(0,this.y-move)
	
	if (this.y +(-1*(-this.scrollHeight+clipHeightArray[this.id])) < 4 ) {newMove=(-this.scrollHeight+clipHeightArray[this.id] + -this.y)*-1}
	else {newMove=move}
	if(loop) setTimeout(this.obj+".down("+newMove+")",speed)}
}

function goUp(move){
var newMove=0
if(this.y<0){
	if (this.y > -4 ) {move=this.y;}
	this.moveIt(0,this.y-move)
	if (this.y > -4 ) {newMove=this.y}
	else {newMove=move}
	if(loop) setTimeout(this.obj+".up("+newMove+")",speed)}
}

function scroll(speed,menu,height){
	fixedClipHeight = height
	heightOfItems=scrollingHeight(menu);

	if(loaded){
		loop=true;
		gScroll=eval('gScroll'+ menu);
		if(speed>0) gScroll.down(speed)
		else gScroll.up(speed)
	}
}

function noScroll(){
	loop=false
	if(timer) clearTimeout(timer)
}

var loaded;

//Netscape 4.7 refresh on browser resize
MM_reloadPage(true);

