///////////////////////////////////////////

function popWinChangeBodyClass() {
//change the class of the body element if the window is a popup

var windowName = window.name;
var bodyElement = document.getElementsByTagName("body");

	if(windowName == "popupWin") {	
		bodyElement[0].setAttribute("class", "popupWin");
		//alertSize();
		//alert(bodyElement[0].getAttribute("class"));
	}

}

////////////////////////////////////////////

var a_newWindow = '';

function winPopUp(strURL,strType,strHeight,strWidth) {
var strOptions="";
if (strType=="slideshow") strOptions="height="+strHeight+",width="+strWidth+"top=150,left=70,scrollbars=no, status=no, resizable=yes";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,scrollbars,resizable,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
a_newWindow = window.open(strURL, 'popupWin', strOptions);
if (window.focus) {a_newWindow.focus()}
}

////////////////////////////////////////////

function selectBoxJumpTo(selectBox) {

location.href = selectBox.value;

}

////////////////////////////////////////////

function hide(targetId) {
if (document.getElementById) {
	target = document.getElementById(targetId);

	target.style.display = "none";
	}
}

////////////////////////////////////////////

function show(targetId) {
if (document.getElementById) {
	target = document.getElementById(targetId);

	target.style.display = "block";

	// hack to fix safari's redraw bug 
        if (self.screenTop && self.screenY){
            window.resizeTo(self.outerWidth + 1, self.outerHeight);    
            window.resizeTo(self.outerWidth - 1, self.outerHeight);                
        }
	}
}

////////////////////////////////////////////

///////////////////////////////////////

function swap(targetId) {
if (document.getElementById) {
	target = document.getElementById(targetId);
		if (target.style.display == "none") {
			target.style.display = "block";
			} else {
			target.style.display = "none"
			}
		}
}

////////////////////////////////////////////

function show_inline(targetId) {
if (document.getElementById) {
	target = document.getElementById(targetId);
		if (target.style.display == "none") {
			target.style.display = "inline";
			} else {
			target.style.display = "none"
			}
		}
}

////////////////////////////////////////////

function doubleswap(targetId,targetId2) {
if (document.getElementById) {
	target = document.getElementById(targetId);
		if (target.style.display == "none") {
			target.style.display = "block";
			} else {
			target.style.display = "none"
			}

		target2 = document.getElementById(targetId2);

		if (target2.style.display == "none") {
			target2.style.display = "block";
			} else {
			target2.style.display = "none"
			}
		}
}