// JavaScript Document
function hiddenDiv(divname) {
    


    origHTML = "";

	if (document.getElementById(divname)) {
		var element = document.getElementById(divname);
		var origHTML = element.innerHTML;
		var origWidth = element.style.width;
		var origHeight = element.style.height;
		
		if (origWidth != "") {
		   alert(origWidth);
		   origWidth = "width:" + origWidth + ";"; 
		}
		else {
		   origWidth = "width:80%;";
		}
		if (origHeight != "") {
		   alert(origHeight);
		   origHeight = "height:" + origHeight + ";"; 
		}
		else {
		   origHeight = "width:80%;";
		}
		element.parentNode.removeChild(element); //remove original div
		
	}
	

	document.write('<div name="' + divname + '" id="' + divname + '" style="display: none;width: 101%;height: 101%;position: fixed;top: -1px;left: -1px;background: url(imgs/grey.png);z-index:1000;">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">');
	document.write('<tr>');
	document.write('<td width="100%" height="100%" align="center" valign="middle">');
	document.write('	<div id="' + divname + '_container" style="background-color:#FFFFFF;' + origWidth + origHeight + '">');
	document.write('		<div style="text-align:right"><a href="javascript:void(0)" onclick="hideDiv(\'' + divname + '\')"><img border="0" src="imgs/closelabel.gif"></a></div>');
	document.write('		<div name="' + divname + '_content" id="' + divname + '_content" style="overflow:auto; background-color:#FFFFFF;">' + origHTML + '</div>');
	document.write('	</div>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</div>');
	
	
}

function hideDiv(div) {
	document.getElementById(div).style.display='none';
}

function showDiv(div) {
	
    var root= document.compatMode=='BackCompat'? document.body : document.documentElement; 
    var isVerticalScrollbar= root.scrollHeight>root.clientHeight; 
	var isHorizontalScrollbar= root.scrollWidth>root.clientWidth; 
	

	document.getElementById(div + "_content").style.maxHeight = (root.clientHeight - 100) + "px";
	document.getElementById(div + "_content").style.maxWidth = (root.clientWidth - 200) + "px";
	document.getElementById(div + "_content").style.overflow = "auto";

	document.getElementById(div).style.display='block';
	
}

function showHideDiv(div) {
	document.getElementById(div).style.display=(document.getElementById(div).style.display=='block')?'none':'block';
}
