function changeContent(id,shtml) {
   if (document.getElementById || document.all) {
      var el = document.getElementById? document.getElementById(id): document.all[id];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
   }
}

function toggleLayer(whichLayer,stater) {
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if (stater == 'show') {
		vis.display = 'block';
	} else {
		vis.display = 'none';
	}
	//if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	//	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	//vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function changeClass(Elem, myClass) {
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	elem.className = myClass;
}

function menu_goto( menuform ) {
	var selecteditem = menuform.newurl.selectedIndex ;
	var newesturl = menuform.newurl.options[ selecteditem ].value ;
	if (newesturl.length != 0) {
		menuform.newurl.options[0].selected=true;
		location.href = newesturl ;
	}
}

// Start tooltips code --------------------------------------------------------------
var offsetx = 12;
var offsety =  8;
var tiplocker;
function newelement(newid) { 
    if(document.createElement)
    { 
        var el = document.createElement('div'); 
        el.id = newid;     
        with(el.style)
        { 
            display = 'none';
            position = 'absolute';
        } 
        el.innerHTML = '&nbsp;'; 
        document.body.appendChild(el); 
    } 
} 
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all); 
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
	var lixlpixel_tooltip = document.getElementById(tiplocker);
	if (tiplocker == 'calinsideroll') {
		offsetx = -215;
	}
	lixlpixel_tooltip.style.left = (cursor.x+offsetx) + 'px';
    lixlpixel_tooltip.style.top = (cursor.y+offsety) + 'px';
    //return cursor;
}
function tooltip(tip,tiploc) {
	tiplocker = tiploc;
    if(!document.getElementById(tiploc)) newelement(tiploc);
    var lixlpixel_tooltip = document.getElementById(tiploc);
    lixlpixel_tooltip.innerHTML = tip;
    lixlpixel_tooltip.style.display = 'block';
    document.onmousemove = getPosition;
}
function exit(tiploc) {
    document.getElementById(tiploc).style.display = 'none';
}
// End tooltips code ----------------------------------------------------------------

// functions for experimental menu
var navHover = function() {
	if (document.all&&document.getElementById) {
		var lis = document.getElementById("navmenu").getElementsByTagName("LI");
		for (var i=0; i<lis.length; i++) {
			lis[i].onmouseover=function() {
				this.className+=" iehover";
			}
			lis[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" iehover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);
function changeRemote(id,newtext){
	document.getElementById(id).innerHTML=newtext;
}
// end experimental nav functions

// Start div scroller code ----------------------------------------------------------
// gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.
// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)
// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll('div_scroll1', 'scroll_box');

function TextScroll(scrollname, div_name, up_name, down_name) {
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 10;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;
	{
        if (document.getElementById) {
            var div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            var div_up_obj = document.getElementById(this.up_name);
            var div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
                div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
				div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
				div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
				div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
            }
        }
    }
	this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }
	this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }
	this.scrollDown = function() {
        if (this.div_obj) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
        }
    }
	this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}
// end div scroller code ------------------------------------------------------------

function doMail(theLink, key){

    //Get the HREF tag. This includes the anti-spam 'key'
    var before = theLink.getAttribute('href');

    //If the anti-spam key is not found in the link, exit the function without doing anything
    //If the link is clicked more than once, this prevents the Javascript from throwing an error
    if(before.indexOf(key) == -1) return false;

    //Our new variable "addy" is a combination of the text that
    //comes BEFORE the key [0] and AFTER the key [1]
    var addy = before.split(key)[0] + before.split(key)[1];

    //Substitute the original link with the new link ("addy")
    theLink.href = addy;
	return true;
}

function clearMe(formfield){
	if (formfield.defaultValue==formfield.value)
	formfield.value = "";
 }