window.onload = checkHeight;
window.onresize = checkHeight;

function checkHeight() {
    var elem = document.getElementById("content");
    document.getElementById("bg_content").style.height = elem.clientHeight+"px";
    document.getElementById("bg_content2").style.background = "";
}


// Get base url
url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend); 

function ajax(url) {
        // Does URL begin with http?
        if (url.substring(0, 4) != 'http') {
                url = base_url + url+"&sid="+Math.random();
        }

		//alert(url);

        // Create new JS element
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        // Append JS element (therefore executing the 'AJAX' call)
        document.body.appendChild (jsel);
}

function show(name1,name2)
{
	document.getElementById(name1).style.display = "none";
	document.getElementById(name2).style.display = "block";
    checkHeight();
}
function show2(name)
{
	var s = document.getElementById(name).style;
	if (s.display == "none") {s.display = "block";}
		else {s.display = "none";}
    checkHeight();
}
