function setShortMenu(menuitem){
		resetMenus();
		document.getElementById(menuitem).className = 'arrowshort';
		document.getElementById(menuitem).style.color = "#1F1F1F";
	    resizeContentArea(menuitem+'content');  	 	
		Effect.divSwap(menuitem+'content','content');
		return false;
	}

function setShortMenuToLocation(menuitem,nameref){
	
	
		setShortMenu(menuitem);
		//window.location.hash= nameref;
	
		setTimeout("moveToPageAnchor('"+nameref+"')",700);	
	}


function moveToPageAnchor(nameref){
	
	window.location = String(window.location).replace(/\#.*$/, "") + '#'+nameref;
}

/*  SCRIPTACLOUS */
Effect.divSwap = function(element,container){
    var div = document.getElementById(container);
    var nodeList = div.childNodes;
    var queue = Effect.Queues.get('menuScope');

    if(queue.toArray().length<1){
        if(Element.visible(element)==false){
            for(i=0;i<nodeList.length;i++){
                if(nodeList.item(i).nodeName=="DIV" && nodeList.item(i).id!=element){
                    if(Element.visible(nodeList.item(i))==true){
                        Effect.Fade(nodeList.item(i),{queue:{position:'end',scope:'menuScope',limit:2},duration:0.2})
                    }
                }
            }
            Effect.Appear(element,{queue:{position:'end',scope:'menuScope',limit:2},duration:0.4})
       }
   }
}



function getWidth(/* Object */ el, /* boolean */ includePadding, /* boolean */ includeBorder) {
    var width;
    el = (typeof(el) == "string") ? document.getElementById(el) : el;    

    if(window.getComputedStyle) { // FF, Safari, Opera
        var style = document.defaultView.getComputedStyle(el, null);
        if(style.getPropertyValue("display") == "none")
            return 0;
        width = parseInt(style.getPropertyValue("width"));

        if(/opera/i.test(navigator.userAgent)) {
            // opera includes the padding and border when reporting the width/height - subtract that out
            width -= parseInt(style.getPropertyValue("padding-left"));
            width -= parseInt(style.getPropertyValue("padding-right"));
            width -= parseInt(style.getPropertyValue("border-left-width"));
            width -= parseInt(style.getPropertyValue("border-right-width"));
        }

        if(includePadding) {
            width += parseInt(style.getPropertyValue("padding-left"));
            width += parseInt(style.getPropertyValue("padding-right"));
        }

        if(includeBorder) {
            width += parseInt(style.getPropertyValue("border-left-width"));
            width += parseInt(style.getPropertyValue("border-right-width"));
        }
    } else { // IE
        if(el.currentStyle["display"] == "none")
            return 0;
        var widthCSS = el.currentStyle["width"];
        var bRegex = /thin|medium|thick/; // regex for css border width keywords
        width = el.offsetWidth; // currently the width including padding + border

        if(!includeBorder) {
            var borderLeftCSS = el.currentStyle["borderLeftWidth"];
            var borderRightCSS = el.currentStyle["borderRightWidth"];
            var temp = document.createElement("DIV");
            if(!bRegex.test(borderLeftCSS)) {
                temp.style.width = borderLeftCSS;
                el.parentNode.appendChild(temp);
                width -= Math.round(temp.offsetWidth);
                el.parentNode.removeChild(temp);
            } else if(bRegex.test(borderLeftCSS)) {
                if(el.offsetWidth > el.clientWidth && el.currentStyle["borderLeftStyle"] != "none") {
                    temp.style.width = "10px";
                    temp.style.border = borderLeftCSS + " " + el.currentStyle["borderLeftStyle"] + " #000000";
                    el.parentNode.appendChild(temp);
                    width -= Math.round((temp.offsetWidth-10)/2);
                    el.parentNode.removeChild(temp);
                }
            }
            if(!bRegex.test(borderRightCSS)) {
                temp.style.width = borderRightCSS;
                el.parentNode.appendChild(temp);
                width -= Math.round(temp.offsetWidth);
                el.parentNode.removeChild(temp);
            } else if(bRegex.test(borderRightCSS)) {
                if(el.offsetWidth > el.clientWidth && el.currentStyle["borderRightStyle"] != "none") {
                    temp.style.width = "10px";
                    temp.style.border = borderRightCSS + " " + el.currentStyle["borderRightStyle"] + " #000000";
                    el.parentNode.appendChild(temp);
                    width -= Math.round((temp.offsetWidth-10)/2);
                    el.parentNode.removeChild(temp);
                }
            }
        }

        if(!includePadding) {
            var paddingLeftCSS = el.currentStyle["paddingLeft"];
            var paddingRightCSS = el.currentStyle["paddingRight"];
            var temp = document.createElement("DIV");
            temp.style.width = paddingLeftCSS;
            el.parentNode.appendChild(temp);
            width -= Math.round(temp.offsetWidth);
            temp.style.width = paddingRightCSS;
            width -= Math.round(temp.offsetWidth);
            el.parentNode.removeChild(temp);
        }
    }

    return width;
}

function getHeight(/* Object */ el, /* boolean */ includePadding, /* boolean */ includeBorder) {
    var height;
    el = (typeof(el) == "string") ? document.getElementById(el) : el;

    if(window.getComputedStyle) { // FF, Safari, Opera
    	
        var style = document.defaultView.getComputedStyle(el, null);
        
        if(style.getPropertyValue("display") == "none")
            return 0;
        height = parseInt(style.getPropertyValue("height"));

        if(/opera/i.test(navigator.userAgent)) {
            // opera includes the padding and border when reporting the width/height - subtract that out
            height -= parseInt(style.getPropertyValue("padding-top"));
            height -= parseInt(style.getPropertyValue("padding-bottom"));
            height -= parseInt(style.getPropertyValue("border-top-width"));
            height -= parseInt(style.getPropertyValue("border-bottom-width"));
        }

        if(includePadding) {
            height += parseInt(style.getPropertyValue("padding-top"));
            height += parseInt(style.getPropertyValue("padding-bottom"));
        }

        if(includeBorder) {
            height += parseInt(style.getPropertyValue("border-top-width"));
            height += parseInt(style.getPropertyValue("border-bottom-width"));
        }
    } else { // IE
        if(el.currentStyle["display"] == "none")
            return 0;
        var heightCSS = el.currentStyle["height"];
        var bRegex = /thin|medium|thick/; // regex for css border width keywords
        height = el.offsetHeight; // currently the height including padding + border

        if(!includeBorder) {
            var borderTopCSS = el.currentStyle["borderTopWidth"];
            var borderBottomCSS = el.currentStyle["borderBottomWidth"];
            var temp = document.createElement("DIV");
            if(!bRegex.test(borderTopCSS)) {
                temp.style.width = borderTopCSS;
                el.parentNode.appendChild(temp);
                height -= Math.round(temp.offsetWidth);
                el.parentNode.removeChild(temp);
            } else if(bRegex.test(borderTopCSS)) {
                if(el.offsetHeight > el.clientHeight && el.currentStyle["borderTopStyle"] != "none") {
                    temp.style.width = "10px";
                    temp.style.border = borderTopCSS + " " + el.currentStyle["borderTopStyle"] + " #000000";
                    el.parentNode.appendChild(temp);
                    height -= Math.round((temp.offsetWidth-10)/2);
                    el.parentNode.removeChild(temp);
                }
            }
            if(!bRegex.test(borderBottomCSS)) {
                temp.style.width = borderBottomCSS;
                el.parentNode.appendChild(temp);
                height -= Math.round(temp.offsetWidth);
                el.parentNode.removeChild(temp);
            } else if(bRegex.test(borderBottomCSS)) {
                if(el.offsetHeight > el.clientHeight && el.currentStyle["borderBottomStyle"] != "none") {
                    temp.style.width = "10px";
                    temp.style.border = borderBottomCSS + " " + el.currentStyle["borderBottomStyle"] + " #000000";
                    el.parentNode.appendChild(temp);
                    height -= Math.round((temp.offsetWidth-10)/2);
                    el.parentNode.removeChild(temp);
                }
            }
        }

        if(!includePadding) {
            var paddingTopCSS = el.currentStyle["paddingTop"];
            var paddingBottomCSS = el.currentStyle["paddingBottom"];
            var temp = document.createElement("DIV");
            temp.style.width = paddingTopCSS;
            el.parentNode.appendChild(temp);
            height -= Math.round(temp.offsetWidth);
            temp.style.width = paddingBottomCSS;
            height -= Math.round(temp.offsetWidth);
            el.parentNode.removeChild(temp);
        }
    }

    return height;
}

function pausecomp(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
}


function resizeContentArea(contentid){
	
		var navblock=getHeight('navblock',true,true);
		navblock = navblock+540; // Last digit is the left nav col size, set to fit small pages.
		var contentheight = getHeight(contentid,true,true);
	
		var maxheight;
		if(navblock>contentheight){
	//	alert("contentid: " + contentid + " - >more> navblock: "+navblock+ " :: contentheight:"+contentheight);   
			maxheight = navblock;
		}else{
	//		alert("contentid: "+ contentid+ "<<< navblock: "+navblock+ " :: contentheight:"+contentheight);
			maxheight = contentheight;		    
		}
		
		
		
		document.getElementById('nav').style.height=maxheight;
		document.getElementById('tdnav').style.height=maxheight;
	//	document.getElementById('content').style.height=maxheight;
		
			
  }