

function show_form(div) {
	var place =  (typeof(div)==typeof(""))?document.getElementById(div):div;
	if (place==null) return;
	place.className="editForm_active";
	var _body=window.document.body;
	pW=300;//place.offsetWidth;
	pH=200;//place.offsetHeight
	x_offset = Math.round(( _body.clientWidth - pW) / 2 );   //* 4 / 9);
	x = (isIE?_body.scrollLeft:window.scrollX) + x_offset;
	y_offset = Math.round(( _body.clientHeight - pH) / 2);   //* 4 / 9);
	y = (isIE?_body.scrollTop:window.scrollY) + y_offset;
	if (isIE) {
		place.style.pixelLeft = x;
		place.style.pixelTop = y;
	}
	else {
		place.style.left = x;
		place.style.top = y;
	}
	place.oncontextmenu=new Function("return false");
	place.style.display="block";
	showShadow();
}

function hide_Form(div) {
	var place = (typeof(div)==typeof(""))?document.getElementById(div):div;
	if (place==null) return;
	place.style.display="none";
	hideShadow();
}

function addShadow(frame) {
	if (frame == null) frame = self;
	var b = frame.document.getElementsByTagName('body')[0];
	var o=frame.document.getElementById("overlay");
	if (o == null) {
		var overlay = frame.document.createElement('iframe');
		overlay.setAttribute("scrolling", "no");
		overlay.setAttribute("id", "overlay");
		overlay.style.overflow = "hidden";
		b.appendChild(overlay);
		o=overlay;
	}
	return o;
}

function showShadow(frame) {
	if (frame == null) frame = self;
	var s = frame.document.getElementById("overlay");
	if (s == null) s=addShadow(frame);

	var _body=frame.document.body;
	var winWidth= _body.clientWidth;
	var winHeight=_body.clientHeight;
	var contentWidth=_body.scrollWidth;
	var contentHeight=_body.scrollHeight;

	var w=(contentWidth > winWidth)? contentWidth: winWidth;
	var h= (contentHeight > winHeight)? contentHeight: winHeight;

	s.style.width = isMOZ?(w-4):w;
	s.style.height =isMOZ?(h-4):h;
	s.style.display = "block";
}

function hideShadow(frame) {
	if (frame == null) frame = self;
	var s = frame.document.getElementById("overlay");
	if (s == null) return;
	s.style.display = "none";
}
