function $(v){return(document.getElementById(v))}function getEventSrc(e){return window.event?window.event.srcElement:e.target}function CancelEvent(e){if((typeof(e)=="undefined")&&(typeof(window.event)!="undefined")){e=window.event}if(typeof(window.event)!="undefined"){e.cancelBubble=true;}else{e.stopPropagation();}}function AjaxCreate(){try{return new XMLHttpRequest()}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}return false}function AjaxExecute(url,data,funct){var xhr=AjaxCreate();xhr.onreadystatechange=function(){if((xhr.readyState==4)&&(xhr.status==200)){funct(xhr.responseText)}};xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xhr.send(data)}function AjaxDummy(data){}function ltrim(s){return s.replace(/^\s*/,"")}function rtrim(s){return s.replace(/\s*$/,"")}function trim(s){return rtrim(ltrim(s))}function setFavorite(iURL,iTitle){if(navigator.appVersion.indexOf("Mac",0)>0){alert("This function is not available on Macintosh.\n\nUse instead the key combination \"Apple-D\".");return}if((navigator.appName.indexOf("Microsoft",0)>=0)&&(parseInt(navigator.appVersion)>=4)){window.external.AddFavorite(iURL,iTitle)}else{alert("This function is only available on Internet Explorer.\n\nFor Netscape, you can use instead the key combination \"Control-D\".");}}function __Query(iQueryId,iPath){window.location.href="http://"+window.location.hostname+iPath+"/"+$("__query_"+iQueryId).value;return false;}





function showHelp_(iShow, iHide_1, iHide_2, iHide_3)
	{
	$("help-content-"+iShow  ).style.display = "block";
	$("help-content-"+iHide_1).style.display = "none" ;
	$("help-content-"+iHide_2).style.display = "none" ;
	$("help-content-"+iHide_3).style.display = "none" ;
	}



function showHelp(iShow)
	{
	if (iShow == -1)
		{
		$("help").style.display="none";
		}
	  else
		{
		if (iShow==0)	showHelp_(0, 1, 2, 3);
		if (iShow==1)	showHelp_(1, 0, 2, 3);
		if (iShow==2)	showHelp_(2, 0, 1, 3);
		if (iShow==3)	showHelp_(3, 0, 1, 2);

		$("help").style.display="block";
		}

	return false
	}




function showLanguageWindow(iShow)
	{
	$("language-window").style.display = (iShow?"block":"none");
	return false;
	}


var language_Timer=null;

function language_ShowList	()	{ $("language-list").style.display="block";  clearTimeout (language_Timer); }
function language_HideList	()	{ $("language-list").style.display="none" ;}

function language_StartTimer()	{ language_Timer = setTimeout ("language_HideList()",500);	}
function language_ResetTimer()	{ clearTimeout (language_Timer);							}



function select_file()
	{
	$("file_arrow").src  ="/img/arr.gif";
	$("code_arrow").src  ="/img/arr_dis.gif";
	$("source"	  ).value="file";
	}

function select_code()
	{
	$("file_arrow").src  ="/img/arr_dis.gif";
	$("code_arrow").src  ="/img/arr.gif";
	$("source"	  ).value="code";
	}




function selectNode (node)
	{
	var selection, range, doc, win;

	if ((doc = node.ownerDocument)
	 && (win = doc.defaultView)
	 && typeof win.getSelection != 'undefined'
	 && typeof doc.createRange  != 'undefined'
	 && (selection = window.getSelection())
	 && typeof selection.removeAllRanges != 'undefined')
		{
		range = doc.createRange	 ();
		range.selectNode		 (node);
		selection.removeAllRanges();
		selection.addRange		 (range);
		}

   else if (document.body
   		 && typeof document.body.createTextRange != 'undefined'
		 && (range = document.body.createTextRange()))
	   		{
    		 range.moveToElementText(node);
		     range.select();
			}
	}





