isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla ��� Netscape 6.*

function _height()
{
	if(isMSIE || isOpera7)
	{
		return document.body.scrollHeight;
	}
	if(isNetscape4 || isMozilla)
	{
		return document.height;
	}
	if(isOpera6 || isOpera)
	{
		return document.body.style.pixelHeight;
	}
}

function _width()
{
	if(isMSIE || isOpera7)
	{
		return document.body.scrollWidth;
	}
	if(isNetscape4 || isMozilla)
	{
		return document.width;
	}
	if(isOpera6 || isOpera)
	{
		return document.body.style.pixelWidth;
	}
}

function _frame(aID)
{
	var element='';
	if(isMSIE)
	{
		element=frames[aID].document;
	}
	else
	{
		try
		{
			element=document.getElementById(aID).contentDocument;
		}
		catch(e)
		{
			alert('Browser error!');
		}
	}
	return element;
}

var __IE__=1; // IE
if(navigator.userAgent.indexOf('Gecko') != -1){__IE__=0;} // MOZILLA

function positionWindow(width, height, event)
{
	var winWidth =screen.width
	var winHeight=screen.height
	if(event == null){
		var left= 150
		var top = 150
	}else{
		var left= event.screenX+15
		var top = event.screenY+15
	}
	if((left+width)>winWidth){left=winWidth-width-10;}
	if((top+height+100)>winHeight){top=winHeight-height-100;}
	return new Array(left,top);
}

function PopupWindow(url,width,height,event){
	var aXY=positionWindow(width, height, event);
	if(__IE__==1 && !isOpera){
		height+=40;
		window.showModalDialog(url,
			window,"dialogHeight: "+height+"px; dialogWidth: "+width+
			"px; dialogLeft: "+aXY[0]+"px; dialogTop: "+aXY[1]+
			"; edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll:no; unadorned; no");
	}else{
		window.open(url, "extreme2", "modal,width="+width+",height="+height+",left="+aXY[0]+",top="+aXY[1]+',resizable=no,status=no"')
	}
}

function show_htmltags_help()
{
	PopupWindow('/html_tags?no_main=1',450,400);
}

window.addEvent('domready', function() {
    var begun=$$('table.begun_adv#');
    if(begun.length > 0){
	begun[0].setStyles({
	    '-moz-border-radius':'12px',
	    '-webkit-border-radius':'12px',
	    'border-radius':'12px',
	    '-khtml-border-radius':'12px'
	});
    }
});


