/* Popup */
function PopUpWindow(theUrl, winName, width, height) {
	window.open(theUrl, winName, "toolbar=no, directories=no, status=no, scrollbars=no, resizable=no, menubar=no, width=" + width + ", height=" + height);
}

/*Show hide */
function getRef(obj) {
  if(typeof obj == "string") {obj= document.getElementById(obj);}
  else if (typeof obj == "object") {obj = obj;}

  return obj;
}

function setStyle(obj, style, value) {
  getRef(obj).style[style]= value;
}

function getStyle(obj, style) {
  return getRef(obj).style[style];
}


function hide(elem) {
	Test(getRef(elem));
	if (getStyle(elem, 'visibility') == "hidden") {
		setStyle(elem,'display','inline');
		setStyle(elem,'visibility','visible');
	}

	else {
		setStyle(elem,'display','none');
		setStyle(elem,'visibility','hidden');
	}
}


/*Loop to close others*/ 

function Test(elem) {
var ps = window.document.getElementsByTagName("P");
	for(var i=0; i < ps.length; i++) {
		if(ps[i].id.substring(0,4) == "def_") {
			if(elem.id != ps[i].id) {
				if ( ps[i].style.display=="inline" ) {
					ps[i].style.display="none";
					ps[i].style.visibility="hidden";
				}
			}
		}
     }
}
