setHeight = function() {
    var container = document.getElementById("container");
    var content = document.getElementById("content");
    var regionContainer = YAHOO.util.Dom.getRegion("container");
    var regionContent = YAHOO.util.Dom.getRegion("content");
    var minHeight = 700
    
        if(regionContent.bottom < minHeight)
        YAHOO.util.Dom.setStyle(container,"height",minHeight+"px");
    else
        YAHOO.util.Dom.setStyle(container,"height",regionContent.bottom+"px");
    
    /*
    if((regionContainer.bottom - regionContainer.top) < (regionContent.bottom - regionContent.top)) {
	    YAHOO.util.Dom.setStyle(container,"height","640px");
    }
    */
}

initReplaceImages = function() {
    if(document.getElementById("flashImages")) {
	    var root = document.getElementById("flashImages");
	    var imagesToReplace = root.getElementsByTagName("IMG");
	    for(var i=imagesToReplace.length-1; i >= 0; i--) {
		    replaceImage(imagesToReplace[i]);
	    }
    }
}

replaceImage = function(img) {
    var imgSrc = img.src;
    var imgWidth = 230;
    var imgHeight = 180;
    var imgBorderColor = "0xFFFFFF";
    var imgBorderWidth = 6;
    var imgShadow = true;
    var imgRotate = -4;

    var imgRoot = img.parentNode;
    var flashContainer= document.createElement("SPAN");
	
    var flashElement = document.createElement("EMBED");
    flashElement.setAttribute("type","application/x-shockwave-flash");
    flashElement.setAttribute("src","/includes/swf/default.swf");
    flashElement.setAttribute("name","replacedImage");
    flashElement.setAttribute("width",imgWidth);
    flashElement.setAttribute("height",imgHeight);
    flashElement.setAttribute("wmode","transparent");
    flashElement.setAttribute("flashvars","src=" + imgSrc + "&border=" + imgBorderColor + "&borderwidth=" + imgBorderWidth + "&shadow=" + imgShadow + "&rotate=" + imgRotate);

    YAHOO.util.Dom.addClass(flashContainer,"flashImage");
    flashContainer.appendChild(flashElement);
    imgRoot.replaceChild(flashContainer,img);
}


sfHover = function() {
    var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
	    sfEls[i].onmouseover=function() {
		    this.className+=" over";
	    }
	    sfEls[i].onmouseout=function() {
		    this.className=this.className.replace(new RegExp("over\\b"), "");
	    }
    }
}

showElement = function(id) {
    YAHOO.util.Dom.setStyle([id], 'display', 'block');
}

hideElement = function(id) {
    YAHOO.util.Dom.setStyle([id], 'display', 'none');
}

YAHOO.util.Event.addListener(window,"load",setHeight);
YAHOO.util.Event.addListener(window,"load",initReplaceImages);
YAHOO.util.Event.addListener(window,"load",sfHover);