
	function input_focus(inp,def) {
		if(inp.value == def) {
	                inp.value = "";
	                inp.focus();
	        }
	}
						
	var win = null;	
        function OpenWindow(url,h,w) {
                if((win != null) && (!win.closed)) {
                        win.close();
                }
                aa = "toolbar=no,location=no,directories=no,status=no,menubar=no,";
                aa = aa + "scrollbars=yes,resizable=yes,height="+h+",width="+w;
                win = window.open(url,'imgshow',aa);
        }

	function show_theme() {
		var div = document.getElementById('theme');
		
		if(div.style.display == "") {
			div.style.display = "none";
		} else {
			div.style.display = "";
		}
	}

	function gotourl(sel) {
		theurl = sel.options[sel.selectedIndex].value;
	        window.location.href = theurl;
	}

	function collapse(idnr) {
		var div    = document.getElementById("box"+idnr);

		if(div == null) {
		       return;
		}

		if(div.style.display == "none") {
			div.style.display = "";
		} else {
			div.style.display = "none";
		}
	}

function redraw( oElem )
{
	// case 294500, 293076: We need to explicitly instruct IE to redraw
	if (oElem && oElem.style)
	{
		oElem.style.display = "none";
		oElem.style.display = "";
	}
}

function safeFocus( oElem )
{
	try { oElem.focus(); } catch(e) {};
}

function giveFocus ()
{
	if (document.all) // IE only
	   {
	   var el = TabManager.getCurrentSEventEl();
	   if (null != el)
	{
		safeFocus(el);
	}
	}
}
											

function adjustRows (textarea) 
{
	bUserTyped = true;
	if (textarea.bRowLock) return;
	var nRowsOrig = textarea.rows;
	
	if (document.all && !window.opera) // IE only
	{ 
		var bGrew = false;
		while ((textarea.scrollHeight > textarea.clientHeight) && (textarea.rows < 30))
		{
			textarea.rows += 3;
			bGrew = true;
		}
		if ( bGrew )
		{
			textarea.scrollTop = 0;
			redraw(textarea); // case 294500, 293076
			safeFocus(textarea);
		}
		
	}
	else
	{
		var rgLines = textarea.value.split('\n');
		var nRows = 1;
		for ( var i=0; i<rgLines.length; i++ )
		{
			if ( rgLines[i].length > 80 )
				nRows += Math.ceil(rgLines[i].length/80);
		}
		nRows += rgLines.length;
		if ( nRows > 8 )
			textarea.rows = Math.min(nRows, 30);
	}
	
	if (textarea.fxnResize && textarea.rows != nRowsOrig)
	{
		textarea.fxnResize.call();
	}
}



