function openWindow(src,name) {
    msgWindow=open(src,name,'resizable=yes,width=640,height=600,scrollbars=yes');
    if (msgWindow.opener == null) msgWindow.opener = self;
}

function newPreviewImageWindow(imagesrc) {
	image = new Image();
	image.src = imagesrc;
	var width = image.width + 50;
	var height = image.height + 50;
	if ( width == 50 || height == 50 ) {
		width = 300;
		height = 300;
	}
    msgWindow=open(imagesrc,'preview','resizable=yes,width='+width+',height='+height+',scrollbars=yes');
    if (msgWindow.opener == null) msgWindow.opener = self;
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.visibility = document.layers ? (iState ? "show" : "hide") :
   (iState ? "visible" : "hidden");
}

function showHideAdmin(state)
{
	toggleBox("adminhorbar", state);
	toggleBox("adminminimized",(state?0:1));
}