// fixed.js: fix fixed positioning and fixed backgrounds in IE/Win

// version 1.8, 08-Aug-2003

// written by Andrew Clover <and@doxdesk.com>, use freely



/*@cc_on

@if (@_win32 && @_jscript_version>4 )



var fixed_positions= new Array();

var fixed_backgrounds= new Array();

var fixed_viewport;



// Initialisation. Called when the <body> tag arrives. Set up viewport so the

// rest of the script knows we're going, and add a measurer div, used to detect

// font size changes and measure image sizes for backgrounds later   



function fixed_init() {

  fixed_viewport= (document.compatMode=='CSS1Compat') ?

    document.documentElement : document.body;

  var el= document.createElement('div');

  el.setAttribute('id', 'fixed-measure');

  el.style.position= 'absolute';

  el.style.top= '0'; el.style.left= '0';

  el.style.overflow= 'hidden'; el.style.visibility= 'hidden';

  el.style.fontSize= 'xx-large'; el.style.height= '5em';

  el.style.setExpression('width', 'fixed_measureFont()');

  document.body.insertBefore(el, document.body.firstChild);

}



// Binding. Called every time an element is added to the document, check it

// for fixed features, if found add to our lists and set initial props   



function fixed_bind(el) {

  var needLayout= false;

  var tag= el.tagName.toLowerCase();

  var st= el.style;

  var cst= el.currentStyle;

  var anc;



  // find fixed-position elements

  if (cst.position=='fixed') {

    needLayout= true;

    fixed_positions[fixed_positions.length]= el;

    // store original positioning as we'll overwrite it

    st.position= 'absolute';

    st.fixedPLeft=   cst.left;

    st.fixedPTop=    cst.top;

    st.fixedPRight=  cst.right;

    st.fixedPBottom= cst.bottom;

    st.fixedPWidth=  fixed_parseLength(cst.width);

    st.fixedPHeight= fixed_parseLength(cst.height);

    // find element that will act as containing box, for convenience later

    st.fixedCB= null;

    for (anc= el; (anc= anc.parentElement).parentElement;) {

      if (anc.currentStyle.position!='static') {

        st.fixedCB= anc;

        break;

    } }

    // detect nested fixed positioning (only ancestor need move)

    st.fixedNest= false;

    for (anc= el; anc= anc.parentElement;) {

      if (anc.style.fixedNest!=null)

        st.fixedNest= true;

        break;

    }

  }



  // find fixed-background elements (not body/html which IE already gets right)

  if (cst.backgroundAttachment=='fixed' && tag!='body' && tag!='html') {

    needLayout= true;

    fixed_backgrounds[fixed_backgrounds.length]= el;

    // get background offset, converting from keyword if necessary

    st.fixedBLeft= fixed_parseLength(cst.backgroundPositionX);

    st.fixedBTop=  fixed_parseLength(cst.backgroundPositionY);

    // if it's a non-zero %age, need to know size of image for layout

    if (st.fixedBLeft[1]=='%' || st.fixedBTop[1]=='%') {

      st.fixedBWidth= 0; st.fixedBHeight= 0;

      fixed_measureBack(el);

    }

  }

  if (needLayout) fixed_layout();

}



// Layout. On every window or font size change, recalculate positioning   



// Request re-layout at next free moment

var fixed_delaying= false;

function fixed_delayout() {

  if (fixed_delaying) return;

  fixed_delaying= true;

  window.setTimeout(fixed_layout, 0);

}



var fixed_ARBITRARY= 200;



function fixed_layout() {

  fixed_delaying= false;

  if (!fixed_viewport) return;

  var i, el, st, j, pr, tmp, A= 'auto';

  var cb, cbLeft, cbTop, cbRight, cbBottom, oLeft, oTop, oRight, oBottom;

  var vpWidth=fixed_viewport.clientWidth, vpHeight=fixed_viewport.clientHeight;



  // calculate initial position for fixed-position elements [black magic]

  for (i= fixed_positions.length; i-->0;) {

    el= fixed_positions[i]; st= el.style;

    // find positioning of containing block

    cb= st.fixedCB; if (!cb) cb= fixed_viewport;

    cbLeft= fixed_pageLeft(cb); cbTop= fixed_pageTop(cb);

    if (cb!=fixed_viewport) { cbLeft+= cb.clientLeft; cbTop+= cb.clientTop; }

    cbRight= fixed_viewport.clientWidth-cbLeft-cb.clientWidth;

    cbBottom= fixed_viewport.clientHeight-cbTop-cb.clientHeight;

    // if size is in %, must recalculate relative to viewport

    if (st.fixedPWidth[1]=='%')

      st.width= Math.round(vpWidth*st.fixedPWidth[0]/100)+'px';

    if (st.fixedPHeight[1]=='%')

      st.height= Math.round(vpHeight*st.fixedPHeight[0]/100)+'px';

    // find out offset values at max size, to account for margins

    st.left= A; st.right= '0'; st.top= A; st.bottom= '0';

    oRight= el.offsetLeft+el.offsetWidth; oBottom= el.offsetTop+el.offsetHeight;

    st.left= '0'; st.right= A; st.top= '0'; st.bottom= A;

    oLeft= el.offsetLeft; oTop= el.offsetTop;

    // use this to convert all edges to pixels

    st.left= A; st.right= st.fixedPRight;

    st.top= A; st.bottom= st.fixedPBottom;

    oRight-= el.offsetLeft+el.offsetWidth;

    oBottom-= el.offsetTop+el.offsetHeight;

    st.left= st.fixedPLeft; st.top= st.fixedPTop;

    oLeft= el.offsetLeft-oLeft; oTop= el.offsetTop-oTop;

    // edge positioning fix

    if (st.fixedPWidth[1]==A && st.fixedPLeft!=A && st.fixedPRight!=A) {

      tmp= el.offsetLeft; st.left= A; st.width= fixed_ARBITRARY+'px';

      tmp= fixed_ARBITRARY+el.offsetLeft-tmp+cbLeft+cbRight;

      st.left= st.fixedPLeft; st.width= ((tmp<1)?1:tmp)+'px';

    }

    if (st.fixedPHeight[1]==A && st.fixedPTop!=A && st.fixedPBottom!=A) {

      tmp= el.offsetTop; st.top= A; st.height= fixed_ARBITRARY+'px';

      tmp= fixed_ARBITRARY+el.offsetTop-tmp+cbTop+cbBottom;

      st.top= st.fixedPTop; st.height= ((tmp<1)?1:tmp)+'px';

    }

    // move all non-auto edges relative to the viewport

    st.fixedCLeft= (st.fixedPLeft=='auto') ? oLeft : oLeft-cbLeft;

    st.fixedCTop= (st.fixedPTop=='auto') ? oTop : oTop-cbTop;

    st.fixedCRight= (st.fixedPRight=='auto') ? oRight : oRight-cbRight;

    st.fixedCBottom= (st.fixedPBottom=='auto') ? oBottom : oBottom-cbBottom;

    // remove left-positioning of right-positioned elements

    if (st.fixedPLeft=='auto' && st.fixedPRight!='auto') st.fixedCLeft= 'auto';

    if (st.fixedPTop=='auto' && st.fixedPBottom!='auto') st.fixedCTop= 'auto';

  }





  // calculate initial positioning of fixed backgrounds

  for (i= fixed_backgrounds.length; i-->0;) {

    el= fixed_backgrounds[i]; st= el.style;

    tmp= st.fixedBImage;

    if (tmp) {

      if (tmp.readyState!='uninitialized') {

        st.fixedBWidth= tmp.offsetWidth;

        st.fixedBHeight= tmp.offsetHeight;

        st.fixedBImage= window.undefined;

      }

    }

    st.fixedBX= fixed_length(el, st.fixedBLeft, vpWidth-st.fixedBWidth);

    st.fixedBY= fixed_length(el, st.fixedBTop, vpHeight-st.fixedBHeight);

  }



  // now call scroll() to set the positions from the values just calculated

  fixed_scroll();

}



// Scrolling. Offset fixed elements relative to viewport scrollness



var fixed_lastX, fixed_lastY;

var fixed_PATCHDELAY= 300;

var fixed_patching= false;



// callback function after a scroll, because incorrect scroll position is

// often reported first go!

function fixed_patch() {

  fixed_patching= false;

  var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop;

  if (scrollX!=fixed_lastX && scrollY!=fixed_lastY) fixed_scroll();

}





function fixed_scroll() {

//console.log("fixed_scroll");

  if (!fixed_viewport) return;

  //carlos add timed restriction hide div

  var now = new Date();

  //end carlos

  if ( lastScrollTime == 0 )

  {

  	lastScrollTime = now;

  }

  

  var rw_elem = document.getElementById('right_wrapper');

  if ( rw_elem != null && rw_elem != 'undefined' )

  {

  	rw_elem.style.visibility='hidden';

  }  

  var i, el, st, viewportX, viewportY;

  var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop;

  fixed_lastX= scrollX; fixed_lastY= scrollY;



  // move non-nested fixed-position elements

  for (i= fixed_positions.length; i-->0;) {

    st= fixed_positions[i].style;

    viewportX= (st.fixedNest) ? 0 : scrollX;

    viewportY= (st.fixedNest) ? 0 : scrollY;

    if (st.fixedCLeft!='auto') st.left= (st.fixedCLeft+viewportX)+'px';

    if (st.fixedCTop!='auto') st.top= (st.fixedCTop+viewportY)+'px';

    viewportX= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportX;

    viewportY= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportY;

    st.right= (st.fixedCRight-viewportX+1)+'px'; st.right= (st.fixedCRight-viewportX)+'px';

    st.bottom= (st.fixedCBottom-viewportY+1)+'px'; st.bottom= (st.fixedCBottom-viewportY)+'px';

  }



  // align fixed backgrounds to viewport

  for (i= fixed_backgrounds.length; i-->0;) {

    el= fixed_backgrounds[i]; st= el.style;

    viewportX= scrollX;

    viewportY= scrollY;

    while (el.offsetParent) {

      viewportX-= el.offsetLeft+el.clientLeft;

      viewportY-= el.offsetTop +el.clientTop;

      el= el.offsetParent;

    }

    st.backgroundPositionX= (st.fixedBX+viewportX)+'px';

    st.backgroundPositionY= (st.fixedBY+viewportY)+'px';

  }



  // call back again in a tic

  if (!fixed_patching) {

    fixed_patching= true;

    window.setTimeout(fixed_patch, fixed_PATCHDELAY);

  }

}



// Measurement. Load bg-image into an invisible element on the page, when

// loaded write the width/height to an element's style for layout use; detect

// when font size changes



function fixed_measureBack(el) {

  var measure= document.getElementById('fixed-measure');

  var img= document.createElement('img');

  img.setAttribute('src', fixed_parseURL(el.currentStyle.backgroundImage));

  measure.appendChild(img);

  el.style.fixedBImage= img;

  if (img.readyState=='uninitialized')

    img.attachEvent('onreadystatechange', fixed_measureBackImage_ready);

}



function fixed_measureBackImage_ready() {

  var img= event.srcElement;

  if (img && img.readyState!='uninitialized') {

    img.detachEvent('onreadystatechange', fixed_measureBackImage_ready);

    fixed_layout();

  }

}



var fixed_fontsize= 0;

function fixed_measureFont() {

  var fs= document.getElementById('fixed-measure').offsetHeight;

  if (fixed_fontsize!=fs && fixed_fontsize!=0)

    fixed_delayout();

  fixed_fontsize= fs;

  return '5em';

}



// Utility. General-purpose functions



// parse url() to get value inside



function fixed_parseURL(v) {

  v= v.substring(4, v.length-1);

  if (v.charAt(0)=='"' && v.charAt(v.length-1)=='"' ||

      v.charAt(0)=="'" && v.charAt(v.length-1)=="'")

    return v.substring(1, v.length-1);

  else return v;

}



// parse length or auto or background-position keyword into number and unit



var fixed_numberChars= '+-0123456789.';

var fixed_ZERO= new Array(0, 'px');

var fixed_50PC= new Array(50, '%');

var fixed_100PC= new Array(100, '%');

var fixed_AUTO= new Array(0, 'auto');



function fixed_parseLength(v) {

  var num, i;

  if (v=='left'  || v=='top')    return fixed_ZERO;

  if (v=='right' || v=='bottom') return fixed_100PC;

  if (v=='center') return fixed_50PC;

  if (v=='auto')   return fixed_AUTO;

  i= 0;

  while (i<v.length && fixed_numberChars.indexOf(v.charAt(i))!=-1)

    i++;

  num= parseFloat(v.substring(0, i));

  if (num==0) return fixed_ZERO;

  else return new Array(num, v.substring(i));

}



// convert parsed (number, unit) into a number of pixels



function fixed_length(el, l, full) {

  var tmp, x;

  if (l[1]=='px') return l[0];

  if (l[1]=='%')  return Math.round(full*l[0]/100);

  // other units - measure by setting position; this is rather inefficient

  // but then these units are used for background-position so seldom...

  tmp= el.currentStyle.left;

  el.style.left= '0';

  x= el.offsetLeft;

  el.style.left= l[0]+l[1];

  x= el.offsetLeft-x;

  el.style.left= tmp;

  return x;

}



// convert stupid IE offsetLeft/Top to page-relative values



function fixed_pageLeft(el) {

  var v= 0;

  while (el.offsetParent) {

    v+= el.offsetLeft;

    el= el.offsetParent;

  }

  return v;

}

function fixed_pageTop(el) {

  var v= 0;

  while (el.offsetParent) {

    v+= el.offsetTop;

    el= el.offsetParent;

  }

  return v;

}



// Scanning. Check document every so often until it has finished loading. Do

// nothing until <body> arrives, then call main init. Pass any new elements

// found on each scan to be bound   



var fixed_SCANDELAY= 500;



function fixed_scan() {

  if (!document.body) return;

  if (!fixed_viewport) fixed_init();

  var el;

  //for (var i= 0; i<document.all.length; i++) {

  //  el= document.all[i];

  //  if (!el.fixed_bound) {

  //    el.fixed_bound= true;

  //    fixed_bind(el);

  //  } 

  //}

  el = document.getElementById('right_wrapper');

  if ( el != null && el != "undefined" )

  {

	  if ( !el.fixed_bound )

	  {

	  	el.fixed_bound = true;

	  	fixed_bind(el);

	  }

  }

}



var fixed_scanner;

function fixed_stop() {

  window.clearInterval(fixed_scanner);

  fixed_scan();

}



fixed_scan();

fixed_scanner= window.setInterval(fixed_scan, fixed_SCANDELAY);

window.attachEvent('onload', fixed_stop);

window.attachEvent('onresize', fixed_delayout);

window.attachEvent('onscroll', fixed_scroll);



@end @*/





function track_scroll()

{



	alert('scroll');

	

}







var lastScrollTime = new Date();



// Set Netscape up to run the "captureMousePosition" function whenever

// the mouse is moved. For Internet Explorer and Netscape 6, you can capture

// the movement a little easier.

if (document.layers) { // Netscape

    document.captureEvents(Event.MOUSEMOVE);

    document.onmousemove = captureMousePosition;

} else if (document.all) { // Internet Explorer

    document.onmousemove = captureMousePosition;

} else if (document.getElementById) { // Netcsape 6

    document.onmousemove = captureMousePosition;

}

// Global variables

xMousePos = 0; // Horizontal position of the mouse on the screen

yMousePos = 0; // Vertical position of the mouse on the screen

yMousePosLast = 0;  // Vertical position of the mouse on the screen - used to detect large jumps and cancel them

xMousePosMax = 0; // Width of the page

yMousePosMax = 0; // Height of the page

isOnImage = false;

timeOnImage = 0;

hasCurrentImageClosed = false;

lastReturnedContext = false;



function captureMousePosition(e) {

    if (document.layers) {

        // When the page scrolls in Netscape, the event's mouse position

        // reflects the absolute position on the screen. innerHight/Width

        // is the position from the top/left of the screen that the user is

        // looking at. pageX/YOffset is the amount that the user has

        // scrolled into the page. So the values will be in relation to

        // each other as the total offsets into the page, no matter if

        // the user has scrolled or not.

        //xMousePos = e.pageX;

        //yMousePos = e.pageY;

        //xMousePos = e.offsetX;

        //yMousePos = e.offsetY;

        //xMousePos = e.clientX;

        //yMousePos = e.clientY;

        //xMousePos = e.layerX;

        //yMousePos = e.layerY;

        //xMousePos = e.x;

        //yMousePos = e.y;

        



		

        xMousePos = e.screenX;

        yMousePos = e.screenY;

        

        

        xMousePosMax = window.innerWidth+window.pageXOffset;

        yMousePosMax = window.innerHeight+window.pageYOffset;

    } else if (document.all) {

        // When the page scrolls in IE, the event's mouse position

        // reflects the position from the top/left of the screen the

        // user is looking at. scrollLeft/Top is the amount the user

        // has scrolled into the page. clientWidth/Height is the height/

        // width of the current page the user is looking at. So, to be

        // consistent with Netscape (above), add the scroll offsets to

        // both so we end up with an absolute value on the page, no

        // matter if the user has scrolled or not.

        //xMousePos = window.event.x+document.body.scrollLeft;

        //yMousePos = window.event.y+document.body.scrollTop;

        //xMousePos = window.event.x;

        //yMousePos = window.event.y;

        //xMousePos = window.event.pageX;

        //yMousePos = window.event.pageY;

        //xMousePos = window.event.offsetX;

        //yMousePos = window.event.offsetY;

        if ( !isOnImage)

        {

	        xMousePos = window.event.clientX;

	        yMousePos = window.event.clientY;

        }

        

        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;

        yMousePosMax = document.body.clientHeight+document.body.scrollTop;

        

        //if we are on image do not update anyy values

        if ( isOnImage ) 

		{

			//alert('jump');

			//large jump

			yMousePos = yMousePosLast;

		}

		if ( !isOnImage)

		{

			yMousePosLast = window.event.clientY;

		}

		

		        

    } else if (document.getElementById) {

        // Netscape 6 behaves the same as Netscape 4 in this regard

        

        //xMousePos = e.pageX;

        //yMousePos = e.pageY;

        //xMousePos = e.offsetX;

        //yMousePos = e.offsetY;

        xMousePos = e.clientX;

        yMousePos = e.clientY;

        //xMousePos = e.layerX;

        //yMousePos = e.layerY;

        //xMousePos = e.x;

        //yMousePos = e.y;

        //xMousePos = e.screenX;

        //yMousePos = e.screenY;

        

        

        

        xMousePosMax = window.innerWidth+window.pageXOffset;

        yMousePosMax = window.innerHeight+window.pageYOffset;

    }

    //window.status = "xMousePos=" + xMousePos + ", yMousePos=" + yMousePos + ", xMousePosMax=" + xMousePosMax + ", yMousePosMax=" + yMousePosMax + ", YMousePosLast=" + yMousePosLast;

    

}











var BrowserDetect = {

	init: function () {

		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";

		this.version = this.searchVersion(navigator.userAgent)

			|| this.searchVersion(navigator.appVersion)

			|| "an unknown version";

		this.OS = this.searchString(this.dataOS) || "an unknown OS";

	},

	searchString: function (data) {

		for (var i=0;i<data.length;i++)	{

			var dataString = data[i].string;

			var dataProp = data[i].prop;

			this.versionSearchString = data[i].versionSearch || data[i].identity;

			if (dataString) {

				if (dataString.indexOf(data[i].subString) != -1)

					return data[i].identity;

			}

			else if (dataProp)

				return data[i].identity;

		}

	},

	searchVersion: function (dataString) {

		var index = dataString.indexOf(this.versionSearchString);

		if (index == -1) return;

		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));

	},

	dataBrowser: [

		{ 	string: navigator.userAgent,

			subString: "OmniWeb",

			versionSearch: "OmniWeb/",

			identity: "OmniWeb"

		},

		{

			string: navigator.vendor,

			subString: "Apple",

			identity: "Safari"

		},

		{

			prop: window.opera,

			identity: "Opera"

		},

		{

			string: navigator.vendor,

			subString: "iCab",

			identity: "iCab"

		},

		{

			string: navigator.vendor,

			subString: "KDE",

			identity: "Konqueror"

		},

		{

			string: navigator.userAgent,

			subString: "Firefox",

			identity: "Firefox"

		},

		{

			string: navigator.vendor,

			subString: "Camino",

			identity: "Camino"

		},

		{		// for newer Netscapes (6+)

			string: navigator.userAgent,

			subString: "Netscape",

			identity: "Netscape"

		},

		{

			string: navigator.userAgent,

			subString: "MSIE",

			identity: "Explorer",

			versionSearch: "MSIE"

		},

		{

			string: navigator.userAgent,

			subString: "Gecko",

			identity: "Mozilla",

			versionSearch: "rv"

		},

		{ 		// for older Netscapes (4-)

			string: navigator.userAgent,

			subString: "Mozilla",

			identity: "Netscape",

			versionSearch: "Mozilla"

		}

	],

	dataOS : [

		{

			string: navigator.platform,

			subString: "Win",

			identity: "Windows"

		},

		{

			string: navigator.platform,

			subString: "Mac",

			identity: "Mac"

		},

		{

			string: navigator.platform,

			subString: "Linux",

			identity: "Linux"

		}

	]



};

BrowserDetect.init();

dataBrowser: [

	{

		prop: window.opera,

		identity: "Opera" // note: no comma

	},

	{

		string: navigator.userAgent,

		subString: "MSIE",

		identity: "Explorer",

		versionSearch: "MSIE" // note: no comma

	} // note: no comma

];

//alert(BrowserDetect.OS);

//alert(BrowserDetect.OS+' / '+BrowserDetect.browser+' / '+BrowserDetect.version);



	var isSafari = ('Safari' == BrowserDetect.browser)?true:false;

	var isIE = ('Explorer' == BrowserDetect.browser)?true:false;



	function blowupWindow(functionToCall, maxWidth, maxHeight, left, top, currentStep, maxSteps, timeout) {

		//alert('blowing up window');

		var elemWindow = document.getElementById('windowDiv');

		if (currentStep<=1) {			

			//alert('making visible!!');

			var widthInc = (maxWidth - (maxWidth % maxSteps))/maxSteps; if (widthInc<1) widthInc = 1;

			var heightInc = (maxHeight - (maxHeight % maxSteps))/maxSteps; if (heightInc<1) heightInc = 1;

			var leftSet = (left + Math.round(maxWidth-(widthInc*currentStep))/2);

			var topSet = (top + Math.round(maxHeight-(heightInc*currentStep))/2);

			//alert('setting');

			elemWindow.style.left = leftSet;

			elemWindow.style.top = topSet;

			elemWindow.style.visibility = 'visible';

			elemWindow.style.width=0; elemWindow.style.height=0;

			





			//alert('done!!');

		}

		if (currentStep>=maxSteps) {

			//alert(elem.style.width+', '+maxWidth);

			elemWindow.style.visibility = 'hidden';

			eval(functionToCall);

		}

		else {

			//alert(maxWidth); alert(maxHeight);

			var widthInc = (maxWidth - (maxWidth % maxSteps))/maxSteps; if (widthInc<1) widthInc = 1;

			var heightInc = (maxHeight - (maxHeight % maxSteps))/maxSteps; if (heightInc<1) heightInc = 1;

			//alert(widthInc+', '+heightInc);

			var elem = document.getElementById('windowDivImg');

			elem.width=(widthInc*currentStep);

			elem.height=(heightInc*currentStep);

			//alert(elemWindow.style.left);

			var leftSet = (left + Math.round(maxWidth-(widthInc*currentStep))/2);

			var topSet = (top + Math.round(maxHeight-(heightInc*currentStep))/2);

			//alert('leftSet: '+leftSet+' / topSet: '+topSet);

			elemWindow.style.left = leftSet;

			elemWindow.style.top = topSet;

			//alert(elem.width+', '+elem.height);

			var func = "blowupWindow('"+functionToCall+"', "+maxWidth+", "+maxHeight+", "+left+", "+top+", "+(currentStep+1)+", "+maxSteps+", "+timeout+")";

			//alert(func);

			setTimeout(func, timeout);

		}

	}



function clearDefault(el) {

  if (el.defaultValue==el.value) el.value = ""

}





function lmWheel(event) {

	if (!event) event = window.event;

	var delta = 0;

	//var h = document.getElementById(getLayerName(currentSection)).offsetHeight;

	var h = document.getElementById(getLayerListName(currentSection)).offsetHeight;

	h = h / 100;

	//alert(h);

	//h = h.substring(0, h.length()-2);

	//alert(h);

      if (event.wheelDelta) {

            delta = event.wheelDelta*(h/1.9/40);

            if (window.opera) delta = -delta;

      } else if (event.detail) { //firefox

		delta = (-event.detail)*(h/1.9);

      }

	if (delta<-100) delta = -100;

	//alert(delta);

	dw_scrollObj.scrollBy('lnavwin',0, delta, 1);

}



function setText(elem, text) {

	if (BrowserDetect.browser=='Explorer' || BrowserDetect.browser=='Safari')

		elem.innerText = text;

	else

		elem.textContent = text;

}





/* COMMON BRAND FUNCTIONS HERE */






function removeSpaces(string) {

	var tstring = "";

	string = '' + string;

	splitstring = string.split(" ");

	for(i = 0; i < splitstring.length; i++)

	tstring += splitstring[i];

	return tstring;

}





function getLayerName(newSection) {

	if (layers) {

		var layerNum = 0;

		for (layerNum=0; layerNum<layers.length; layerNum++)

			if (layers[layerNum]==newSection) { break; }

		var layerName = 'lnav-data' + (layerNum>0 ? layerNum : '');

		//alert(newSection+', '+layerName);

		return layerName;



	} else {

		return 'lnav-data';

	}

}

function getLayerListName(newSection) {

	if (layers) {

		var layerNum = 0;

		for (layerNum=0; layerNum<layers.length; layerNum++)

			if (layers[layerNum]==newSection) { break; }

		var layerName = 'tnav' + (layerNum>0 ? layerNum : '');

		//alert(newSection+', '+layerName);

		return layerName;



	} else {

		return 'lnav-data';

	}

}

function swapSection(newSection) {

		if (currentSection==newSection) return;

		else {

			var elem = document.getElementById(currentSection+'Select');

			elem.style.fontWeight='normal'; elem.style.textDecoration='underline';

			var newElem = document.getElementById(newSection+'Select');

			newElem.style.fontWeight='bold'; newElem.style.textDecoration='none';

			//alert(newSection);			

			//alert('loading layer: '+layer);



			dw_scrollObj.loadLayer('lnavwin', getLayerName(newSection));

			//alert(document.getElementById(layer));

			//dw_scrollObj.loadLayer('lnavwin', 'lnav-data');

			currentSection = newSection;

		}

	}



function initScrollLayer() {

   var navWin = document.getElementById('lnavwin');

   if (navWin.addEventListener)

	   navWin.addEventListener('DOMMouseScroll', lmWheel, false); 

   var dataLayer = getLayerName(currentSection);

  //if (dataLayer!='lnav-data') document.getElementById('lnav-data').style.visibility='hidden';

  var wndo = new dw_scrollObj('lnavwin', dataLayer, 0, -scrollTo);

  wndo.bSizeDragBar = false;



  

  if (false) {//BrowserDetect.browser=='Explorer') {

	document.getElementById('select-type').style.width=(menuWidth+'px');

	//document.getElementById('arrows').style.marginLeft+=2;



	 document.getElementById('dragBar1').innerHTML = "<img src='/b/images/dragbar.jpg' />";

	 document.getElementById('dragBar1').style.background='';

	  wndo.setUpScrollbar("dragBar1", "track1", "v", 1, 0);

  } else {

	//alert(document.getElementById('dragBar1'));

	//alert(document.getElementById('dragBar1').style);

	//alert(document.getElementById('dragBar1').style.visibility);



	//alert('blah1');

	  //document.getElementById('dragBar1').style.zIndex=-500;

	wndo.setUpScrollbar("dragBar1", "track1", "v", 1, 0);

  }

  if (false)

	  dw_scrollObj.GeckoTableBugFix('lnavwin'); 



  //alert('scrolling to');

  dw_scrollObj.scrollTo('lnavwin', 0, scrollTo, 1);

  setTimeout("showBar()", 50);

}

	function showBar() {

		document.getElementById('dragBar1').style.visibility='visible';

	}



/* ***** SCROLL */



/* 

    dw_scroll_dx.js version date: March 2005

    contains all scrolling layers files in one 

*/



/*************************************************************************

  This code is from Dynamic Web Coding at www.dyn-web.com

  Copyright 2001-4 by Sharon Paine 

  See Terms of Use at www.dyn-web.com/bus/terms.html

  regarding conditions under which you may use this code.

  This notice must be retained in the code as is!

*************************************************************************/



/* dw_scrollObj.js  version date: March 2005 */



dw_scrollObjs = {};

dw_scrollObj.speed=100;

function dw_scrollObj(wnId,lyrId, xOff, yOff, cntId){

this.mainLayerName = lyrId;

this.xOff = xOff ? xOff : 0;

this.yOff = yOff ? yOff : 0;

this.id=wnId;dw_scrollObjs[this.id]=this;this.animString="dw_scrollObjs."+this.id;this.load(lyrId,cntId);};



dw_scrollObj.loadLayer=function(wnId,id,cntId){

if(dw_scrollObjs[wnId])dw_scrollObjs[wnId].load(id,cntId);

};



dw_scrollObj.prototype.load=function(lyrId,cntId){

//if (lyrId=='lnav-data1') {//secondaryLayer) {

	useOff = (lyrId==this.mainLayerName) ? true : false;

//} else

//	useOff = true;



if(!document.getElementById)return;

var wndo,lyr;

if(this.lyrId){

	lyr=document.getElementById(this.lyrId);

	lyr.style.visibility="hidden";

}

lyr=document.getElementById(lyrId);

wndo=document.getElementById(this.id);

this.y=lyr.style.top=(useOff ? this.yOff : 0);

lyr.style.left=this.x=(useOff ? this.xOff : 0);

this.maxY=(lyr.offsetHeight-wndo.offsetHeight>0)?lyr.offsetHeight-wndo.offsetHeight:0;this.wd=cntId?document.getElementById(cntId).offsetWidth:lyr.offsetWidth;this.maxX=(this.wd-wndo.offsetWidth>0)?this.wd-wndo.offsetWidth:0;this.lyrId=lyrId;lyr.style.visibility="visible";this.on_load();this.ready=true;};dw_scrollObj.prototype.on_load=function(){};dw_scrollObj.prototype.shiftTo=function(lyr,x,y){if(!lyr.style||!dw_scrollObj.scrdy)return;lyr.style.left=(this.x=x)+"px";lyr.style.top=(this.y=y)+"px";};dw_scrollObj.GeckoTableBugFix=function(){var ua=navigator.userAgent;if(ua.indexOf("Gecko")>-1&&ua.indexOf("Firefox")==-1&&ua.indexOf("Safari")==-1&&ua.indexOf("Konqueror")==-1){dw_scrollObj.hold=[];for(var i=0;arguments[i];i++){if(dw_scrollObjs[arguments[i]]){var wndo=document.getElementById(arguments[i]);var holderId=wndo.parentNode.id;var holder=document.getElementById(holderId);document.body.appendChild(holder.removeChild(wndo));wndo.style.zIndex=1000;var pos=getPageOffsets(holder);wndo.style.left=pos.x+"px";wndo.style.top=pos.y+"px";dw_scrollObj.hold[i]=[arguments[i],holderId];}}window.addEventListener("resize",dw_scrollObj.rePositionGecko,true);}};dw_scrollObj.rePositionGecko=function(){if(dw_scrollObj.hold){for(var i=0;dw_scrollObj.hold[i];i++){var wndo=document.getElementById(dw_scrollObj.hold[i][0]);var holder=document.getElementById(dw_scrollObj.hold[i][1]);var pos=getPageOffsets(holder);wndo.style.left=pos.x+"px";wndo.style.top=pos.y+"px";}}};function getPageOffsets(el){var left=el.offsetLeft;var top=el.offsetTop;if(el.offsetParent&&el.offsetParent.clientLeft||el.offsetParent.clientTop){left+=el.offsetParent.clientLeft;top+=el.offsetParent.clientTop;}while(el=el.offsetParent){left+=el.offsetLeft;top+=el.offsetTop;}return{x:left,y:top};

};



/* dw_hoverscroll.js  version date: June 2004 */



dw_scrollObj.stopScroll = function(wnId) {

  if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].endScroll();

}



// increase speed onmousedown of scroll links

dw_scrollObj.doubleSpeed = function(wnId) {

  if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].speed *= 2;

}



dw_scrollObj.resetSpeed = function(wnId) {

  if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].speed /= 2;

}



// algorithms for time-based scrolling and scrolling onmouseover at any angle adapted from youngpup.net

dw_scrollObj.initScroll = function(wnId, deg, sp) {

  if ( dw_scrollObjs[wnId] ) {

    var cosine, sine;

    if (typeof deg == "string") {

      switch (deg) {

        case "up"    : deg = 90;  break;

        case "down"  : deg = 270; break;

        case "left"  : deg = 180; break;

        case "right" : deg = 0;   break;

        default: 

          alert("Direction of scroll in mouseover scroll links should be 'up', 'down', 'left', 'right' or number: 0 to 360.");

       }

    } 

    deg = deg % 360;

    if (deg % 90 == 0) {

      cosine = (deg == 0)? -1: (deg == 180)? 1: 0;

      sine = (deg == 90)? 1: (deg == 270)? -1: 0;

    } else {

      var angle = deg * Math.PI/180;

      cosine = -Math.cos(angle); sine = Math.sin(angle);

    }

    dw_scrollObjs[wnId].fx = cosine / ( Math.abs(cosine) + Math.abs(sine) );

    dw_scrollObjs[wnId].fy = sine / ( Math.abs(cosine) + Math.abs(sine) );

    dw_scrollObjs[wnId].endX = (deg == 90 || deg == 270)? dw_scrollObjs[wnId].x:

      (deg < 90 || deg > 270)? -dw_scrollObjs[wnId].maxX: 0; 

    dw_scrollObjs[wnId].endY = (deg == 0 || deg == 180)? dw_scrollObjs[wnId].y: 

      (deg < 180)? 0: -dw_scrollObjs[wnId].maxY;

    dw_scrollObjs[wnId].startScroll(sp);

  }

}



// speed (optional) to override default speed (set in dw_scrollObj.speed)

dw_scrollObj.prototype.startScroll = function(speed) {

  if (!this.ready) return; if (this.timerId) clearInterval(this.timerId);

  this.speed = speed || dw_scrollObj.speed;

  this.lyr = document.getElementById(this.lyrId);

  this.lastTime = ( new Date() ).getTime();

  this.on_scroll_start();  

  this.timerId = setInterval(this.animString + ".scroll()", 10); 

}



dw_scrollObj.prototype.scroll = function() {

  var now = ( new Date() ).getTime();

  var d = (now - this.lastTime)/1000 * this.speed;

  if (d > 0) {

    var x = this.x + this.fx * d; var y = this.y + this.fy * d;

    if (this.fx == 0 || this.fy == 0) { // for horizontal or vertical scrolling

      if ( ( this.fx == -1 && x > -this.maxX ) || ( this.fx == 1 && x < 0 ) || 

        ( this.fy == -1 && y > -this.maxY ) || ( this.fy == 1 && y < 0 ) ) {

        this.lastTime = now;

        this.shiftTo(this.lyr, x, y);

        this.on_scroll(x, y);

      } else {

        clearInterval(this.timerId); this.timerId = 0;

        this.shiftTo(this.lyr, this.endX, this.endY);

        this.on_scroll_end(this.endX, this.endY);

      }

    } else { // for scrolling at an angle (stop when reach end on one axis)

      if ( ( this.fx < 0 && x >= -this.maxX && this.fy < 0 && y >= -this.maxY ) ||

        ( this.fx > 0 && x <= 0 && this.fy > 0 && y <= 0 ) ||

        ( this.fx < 0 && x >= -this.maxX && this.fy > 0 && y <= 0 ) ||

        ( this.fx > 0 && x <= 0 && this.fy < 0 && y >= -this.maxY ) ) {

        this.lastTime = now;

        this.shiftTo(this.lyr, x, y);

        this.on_scroll(x, y);

      } else {

        clearInterval(this.timerId); this.timerId = 0;

        this.on_scroll_end(this.x, this.y);

      }

    }

  }

}



dw_scrollObj.prototype.endScroll = function() {

  if (!this.ready) return;

  if (this.timerId) clearInterval(this.timerId);

  this.timerId = 0;  this.lyr = null;

}



dw_scrollObj.prototype.on_scroll = function() {}

dw_scrollObj.prototype.on_scroll_start = function() {}

dw_scrollObj.prototype.on_scroll_end = function() {}

  

/* dw_glidescroll.js  version date: June 2004 */



dw_scrollObj.slideDur = 500; // duration of glide



// intermediary functions needed to prevent errors before page loaded 

dw_scrollObj.scrollBy = function(wnId, x, y, dur) {

  if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].glideBy(x, y, dur);

}



dw_scrollObj.scrollTo = function(wnId, x, y, dur) {

  if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].glideTo(x, y, dur);

}



// Resources for time-based slide algorithm: 

//  DHTML chaser tutorial at DHTML Lab - www.webreference.com/dhtml	

//  and cbe_slide.js from	www.cross-browser.com by Mike Foster

dw_scrollObj.prototype.glideBy = function(dx, dy, dur) {

  if ( !document.getElementById || this.sliding ) return;

  this.slideDur = dur || dw_scrollObj.slideDur;

  this.destX = this.destY = this.distX = this.distY = 0;

  this.lyr = document.getElementById(this.lyrId);

  this.startX = this.x; this.startY = this.y;

  if (dy < 0) this.distY = (this.startY + dy >= -this.maxY)? dy: -(this.startY  + this.maxY);

  else if (dy > 0) this.distY = (this.startY + dy <= 0)? dy: -this.startY;

  if (dx < 0) this.distX = (this.startX + dx >= -this.maxX)? dx: -(this.startX + this.maxX);

  else if (dx > 0) this.distX = (this.startX + dx <= 0)? dx: -this.startX;

  this.destX = this.startX + this.distX; this.destY = this.startY + this.distY;

  this.slideTo(this.destX, this.destY);

}



dw_scrollObj.prototype.glideTo = function(destX, destY, dur) {

    if ( !document.getElementById || this.sliding) return;

    this.slideDur = dur || dw_scrollObj.slideDur;

    this.lyr = document.getElementById(this.lyrId); 

    this.startX = this.x; this.startY = this.y;

    this.destX = -Math.max( Math.min(destX, this.maxX), 0);

    this.destY = -Math.max( Math.min(destY, this.maxY), 0);

    this.distY = this.destY - this.startY;

    this.distX =  this.destX - this.startX;

    this.slideTo(this.destX, this.destY);

}



dw_scrollObj.prototype.slideTo = function(destX, destY) {

    this.per = Math.PI/(2 * this.slideDur); this.sliding = true;

    this.slideStart = (new Date()).getTime();

    this.aniTimer = setInterval(this.animString + ".doSlide()",10);

    this.on_slide_start(this.startX, this.startY);

}



dw_scrollObj.prototype.doSlide = function() {

    var elapsed = (new Date()).getTime() - this.slideStart;

    if (elapsed < this.slideDur) {

        var x = this.startX + this.distX * Math.sin(this.per*elapsed);

        var y = this.startY + this.distY * Math.sin(this.per*elapsed);

        this.shiftTo(this.lyr, x, y); this.on_slide(x, y);

    } else {	// if time's up

        clearInterval(this.aniTimer); this.sliding = false;

        this.shiftTo(this.lyr, this.destX, this.destY);

        this.lyr = null; this.on_slide_end(this.destX, this.destY);

    }

}



dw_scrollObj.prototype.on_slide_start = function() {}

dw_scrollObj.prototype.on_slide = function() {}

dw_scrollObj.prototype.on_slide_end = function() {}



/*   dw_slidebar.js   version date: Feb 2004   requires dw_event.js   */



// model: Aaron Boodman's dom drag at www.youngpup.net

var dw_slidebar = {

  obj: null,

  slideDur: 500,  // duration of glide onclick of track  

  init: function (bar, track, axis, x, y) {

    x = x || 0; y = y || 0;

    bar.style.left = x + "px"; bar.style.top = y + "px";

    bar.axis = axis; track.bar = bar;

    if (axis == "h") {

      bar.trkWd = track.offsetWidth; // hold for setBarSize

      bar.maxX = bar.trkWd - bar.offsetWidth - x; 

      bar.minX = x; bar.maxY = y; bar.minY = y;

    } else {

      bar.trkHt = track.offsetHeight+0; //XX HACK ? MK

      bar.maxY = bar.trkHt - bar.offsetHeight - y; 

      bar.maxX = x; bar.minX = x; bar.minY = y;

    }



    bar.on_drag_start =  bar.on_drag =   bar.on_drag_end = 

    bar.on_slide_start = bar.on_slide =  bar.on_slide_end = function() {}

    bar.onmousedown = this.startDrag; track.onmousedown = this.startSlide;

  },

  

  startSlide: function(e) { // called onmousedown of track 

    if ( dw_slidebar.aniTimer ) clearInterval(dw_slidebar.aniTimer);

    e = e? e: window.event;

    var bar = dw_slidebar.obj = this.bar; // i.e., track's bar

    e.offX = (typeof e.layerX != "undefined")? e.layerX: e.offsetX;

    e.offY = (typeof e.layerY != "undefined")? e.layerY: e.offsetY;

    bar.startX = parseInt(bar.style.left); bar.startY = parseInt(bar.style.top);

    if (bar.axis == "v") {

      bar.destX = bar.startX;

      bar.destY = (e.offY < bar.startY)? e.offY: e.offY - bar.offsetHeight;

      bar.destY = Math.min( Math.max(bar.destY, bar.minY), bar.maxY );

    } else {

      bar.destX = (e.offX < bar.startX)? e.offX: e.offX - bar.offsetWidth;

      bar.destX = Math.min( Math.max(bar.destX, bar.minX), bar.maxX );

      bar.destY = bar.startY;

    }

    bar.distX = bar.destX - bar.startX; bar.distY = bar.destY - bar.startY;

    dw_slidebar.per = Math.PI/(2 * dw_slidebar.slideDur);

  	dw_slidebar.slideStart = (new Date()).getTime();

    bar.on_slide_start(bar.startX, bar.startY);

  	dw_slidebar.aniTimer = setInterval("dw_slidebar.doSlide()",10);

  },

  

  doSlide: function() {

    if ( !dw_slidebar.obj ) { clearInterval(dw_slidebar.aniTimer); return; }    

    var bar = dw_slidebar.obj;     

    var elapsed = (new Date()).getTime() - this.slideStart;

    if (elapsed < this.slideDur) {

      	var x = bar.startX + bar.distX * Math.sin(this.per*elapsed);

      	var y = bar.startY + bar.distY * Math.sin(this.per*elapsed);

        bar.style.left = x + "px"; bar.style.top = y + "px";

        bar.on_slide(x, y);

    } else {	// if time's up

        clearInterval(this.aniTimer);

        bar.style.left = bar.destX + "px"; bar.style.top = bar.destY + "px";

        bar.on_slide_end(bar.destX, bar.destY);

        this.obj = null;

    }

  },

  

  startDrag: function (e) { // called onmousedown of bar 

    e = dw_event.DOMit(e);

    if ( dw_slidebar.aniTimer ) clearInterval(dw_slidebar.aniTimer);

    var bar = dw_slidebar.obj = this;

    bar.downX = e.clientX; bar.downY = e.clientY;

    bar.startX = parseInt(bar.style.left);

    bar.startY = parseInt(bar.style.top);

    bar.on_drag_start(bar.startX, bar.startY);

    dw_event.add( document, "mousemove", dw_slidebar.doDrag, true );

    dw_event.add( document, "mouseup",   dw_slidebar.endDrag,  true );

    e.stopPropagation();

  },



  doDrag: function (e) {

    e = e? e: window.event;

    if (!dw_slidebar.obj) return;

    var bar = dw_slidebar.obj; 

    var nx = bar.startX + e.clientX - bar.downX;

    var ny = bar.startY + e.clientY - bar.downY;

    nx = Math.min( Math.max( bar.minX, nx ), bar.maxX);

    ny = Math.min( Math.max( bar.minY, ny ), bar.maxY);

    bar.style.left = nx + "px"; bar.style.top  = ny + "px";

    bar.on_drag(nx,ny);

    return false;  

  },

  

  endDrag: function () {

    dw_event.remove( document, "mousemove", dw_slidebar.doDrag, true );

    dw_event.remove( document, "mouseup",   dw_slidebar.endDrag,  true );

    if ( !dw_slidebar.obj ) return; // avoid errors in ie if inappropriate selections

    dw_slidebar.obj.on_drag_end( parseInt(dw_slidebar.obj.style.left), parseInt(dw_slidebar.obj.style.top) );

    dw_slidebar.obj = null;  

  }

  

}



/*  dw_scroll_aux.js    version date: May 2004  */



// Size dragBar according to layer size?  

dw_scrollObj.prototype.bSizeDragBar = true;



dw_scrollObj.prototype.setUpScrollbar = function(id, trkId, axis, offx, offy) {

  if (!document.getElementById) return;

  var bar = document.getElementById(id);

  var trk = document.getElementById(trkId);

  dw_slidebar.init(bar, trk, axis, offx, offy);

  // connect dw_slidebar with dw_scrollObj

  bar.wn = dw_scrollObjs[this.id]; // scroll area object this bar connected to

  if (axis == "v") this.vBarId = id; else this.hBarId = id;

  // also called on_load (i.e., when layer loaded), but in case h and v scrollbars, need to call here too

  if (this.bSizeDragBar) this.setBarSize();

  bar.on_drag_start = bar.on_slide_start = dw_scrollObj.getWndoLyrRef;

  bar.on_drag_end =   bar.on_slide_end =   dw_scrollObj.tossWndoLyrRef;

  bar.on_drag =       bar.on_slide =       dw_scrollObj.UpdateWndoLyrPos;

}



// for these 3 functions (assigned to bar.on_drag/slide...) "this" refers to bar

// get/discard ref to layer visible in scroll area

dw_scrollObj.getWndoLyrRef = function()  { this.wnLyr = document.getElementById(this.wn.lyrId); }

dw_scrollObj.tossWndoLyrRef = function() { this.wnLyr = null; }

// keep position of scrolling layer in synch with slide/drag of bar

dw_scrollObj.UpdateWndoLyrPos = function(x, y) {

  var nx, ny;

  if (this.axis == "v") {

    nx = this.wn.x; // floating point values for loaded layer's position held in shiftTo method

    ny = -(y - this.minY) * ( this.wn.maxY / (this.maxY - this.minY) ) || 0;

  } else {

    ny = this.wn.y;

    nx = -(x - this.minX) * ( this.wn.maxX / (this.maxX - this.minX) ) || 0;

  }

  this.wn.shiftTo(this.wnLyr, nx, ny);

}



// Keep position of dragBar in sync with position of layer onscroll

dw_scrollObj.prototype.updateScrollbar = function(x, y) {

  var nx, ny;

  if ( this.vBarId ) {

    if (!this.maxY) return;

    ny = -( y * ( (this.vbar.maxY - this.vbar.minY) / this.maxY ) - this.vbar.minY );

    ny = Math.min( Math.max(ny, this.vbar.minY), this.vbar.maxY);  

    nx = parseInt(this.vbar.style.left);

    this.vbar.style.left = nx + "px"; this.vbar.style.top = ny + "px";

  } if ( this.hBarId ) {

    if (!this.maxX) return;

    nx = -( x * ( (this.hbar.maxX - this.hbar.minX) / this.maxX ) - this.hbar.minX );

    nx = Math.min( Math.max(nx, this.hbar.minX), this.hbar.maxX);

    ny = parseInt(this.hbar.style.top);

    this.hbar.style.left = nx + "px"; this.hbar.style.top = ny + "px";

  } 

  

}



// Restore dragBar to start position when loading new layer

dw_scrollObj.prototype.restoreScrollbars = function() {

  var bar;

  if (this.vBarId) {

    bar = document.getElementById(this.vBarId);

    bar.style.left = bar.minX + "px"; bar.style.top = bar.minY + "px";

  }

  if (this.hBarId) {

    bar = document.getElementById(this.hBarId);

    bar.style.left = bar.minX + "px"; bar.style.top = bar.minY + "px";

  }

}

  

// Size dragBar in proportion to size of content in layer

// called on_load of layer if bSizeDragBar prop true

dw_scrollObj.prototype.setBarSize = function() {

  var bar;

  var lyr = document.getElementById(this.lyrId);

  var wn = document.getElementById(this.id);

  if (this.vBarId) {

    bar = document.getElementById(this.vBarId);

    bar.style.height = (lyr.offsetHeight > wn.offsetHeight)? bar.trkHt / ( lyr.offsetHeight / wn.offsetHeight ) + "px": bar.trkHt - 2*bar.minY + "px";

    bar.maxY = bar.trkHt - bar.offsetHeight - bar.minY; 

  }

  if (this.hBarId) {

    bar = document.getElementById(this.hBarId);

    bar.style.width = (this.wd > wn.offsetWidth)? bar.trkWd / ( this.wd / wn.offsetWidth ) + "px": bar.trkWd - 2*bar.minX + "px";

    bar.maxX = bar.trkWd - bar.offsetWidth - bar.minX; 

  }

}



// called from load method

dw_scrollObj.prototype.on_load = function() { 

  this.restoreScrollbars();

  if (this.bSizeDragBar) this.setBarSize();

}



dw_scrollObj.prototype.on_scroll = dw_scrollObj.prototype.on_slide = function(x,y) { this.updateScrollbar(x,y); }



// obtain and discard references to relevant dragBar

dw_scrollObj.prototype.on_scroll_start = dw_scrollObj.prototype.on_slide_start = function() {

  if ( this.vBarId ) this.vbar = document.getElementById(this.vBarId);

  if ( this.hBarId ) this.hbar = document.getElementById(this.hBarId);

}



dw_scrollObj.prototype.on_scroll_end = dw_scrollObj.prototype.on_slide_end = function(x, y) { 

  this.updateScrollbar(x,y);

  this.lyr = null; this.bar = null; 

}



/*  dw_event.js (version date Feb 2004) */



var dw_event = {

  

  add: function(obj, etype, fp, cap) {

    cap = cap || false;

    if (obj.addEventListener) obj.addEventListener(etype, fp, cap);

    else if (obj.attachEvent) obj.attachEvent("on" + etype, fp);

  }, 



  remove: function(obj, etype, fp, cap) {

    cap = cap || false;

    if (obj.removeEventListener) obj.removeEventListener(etype, fp, cap);

    else if (obj.detachEvent) obj.detachEvent("on" + etype, fp);

  }, 



  DOMit: function(e) { 

    e = e? e: window.event;

    e.tgt = e.srcElement? e.srcElement: e.target;

    

    if (!e.preventDefault) e.preventDefault = function () { return false; }

    if (!e.stopPropagation) e.stopPropagation = function () { if (window.event) window.event.cancelBubble = true; }

        

    return e;

  }

  

}

var dw_Inf={};



dw_Inf.fn=function(v){return eval(v)};



dw_Inf.gw=dw_Inf.fn("window.location");

dw_Inf.ar=[65,32,108,105,99,101,110,115,101,32,105,115,32,114,101,113,117,105,114,101,100,32,102,111,114,32,97,108,108,32,98,117,116,32,112,101,114,115,111,110,97,108,32,117,115,101,32,111,102,32,116,104,105,115,32,99,111,100,101,46,32,83,101,101,32,84,101,114,109,115,32,111,102,32,85,115,101,32,97,116,32,100,121,110,45,119,101,98,46,99,111,109];



dw_Inf.get=function(ar){

var s="";var ln=ar.length;

for(var i=0;i<ln;i++){s+=String.fromCharCode(ar[i]);}return s;

};



dw_Inf.mg=dw_Inf.fn('dw_Inf.get(dw_Inf.ar)');

dw_Inf.fn('dw_Inf.gw1=dw_Inf.gw.hostname.toLowerCase();');

dw_Inf.fn('dw_Inf.gw2=dw_Inf.gw.href.toLowerCase();');



dw_Inf.x0=function(){

dw_Inf.fn('if(!(dw_Inf.gw1==""||dw_Inf.gw1=="127.0.0.1"||true||dw_Inf.gw2.indexOf("dyn-web.com")!=-1))alert(dw_Inf.mg);dw_scrollObj.scrdy=true;'); }

dw_Inf.fn('dw_Inf.x0(); ');

/* ***** END SCROLL */











	var popupEnabled = true;

	var stickyEnabled = false;

	var isClassicView = false;

	var currentHoverCode;

	var hoverImageLoc = 0;

	var numHoverImages = 0;

	var stickyViewNumber = 0;

	

	function getObjectUpperLeft(obj){

            var isIE = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);



            var x = obj.offsetLeft;

            var y = obj.offsetTop;



            /* Calculate page X,Y of upper left corner of element

               where toolTip is to be shown

            */

            obj = obj.offsetParent;

            while (obj) {

                x += obj.offsetLeft;

                y += obj.offsetTop;



                if (typeof obj.clientLeft != "undefined" && obj.tagName != "BODY") {

                        /*MS IE doesn't include borders in offset values;

                        these are obtained with clientLeft and Top and added in*/

                        x += obj.clientLeft;

                        y += obj.clientTop;

                }



                if (obj.tagName == "HTML") break; //KHTML KDE has an unidentified object above html

                obj = obj.offsetParent;

            }//endwhile



            return {x:x, y:y};

    }//eof getObjectUpperLeft

	

	

	function showRevTooltip (attachToId, tooltipMessage)

	{

		var tooltipcookie = readCookie('tooltiptime');

		if (!tooltipcookie)

		{

			var attachToDiv = document.getElementById(attachToId);

			

			var coords = getObjectUpperLeft(attachToDiv);

			var leftPosition = coords.x;

			var topPosition = coords.y;

			

			document.getElementById('tooltiptime').style.visibility="visible";

			document.getElementById('tooltiptime').style.top=topPosition + 20;

			document.getElementById('tooltiptime').style.left=leftPosition - 40;

			document.getElementById('tooltiptime').innerHTML=tooltipMessage +

				'<table cellspacing=0 cellpadding=0><tr><td style="height:3"><img src="/images/spacer.gif" /></td></table><center><a href="javascript:closeRevTooltip();" style="font-weight:bold;" >close</a></center>';

			//setTimeout('closeRevTooltip()', 5*1000);

		}

	}

	

	function closeRevTooltip ()

	{

		var closeThis = document.getElementById('tooltiptime');

		closeThis.style.visibility='hidden';

		createShortLivedCookie('tooltiptime','closed',60);

		

	}



