function hideTree(id)
{
	mImg = document.getElementById('img' + id);
	mSec = document.getElementById('s' + id)
	if(mSec.style.display=='none'){
		mSec.style.display='';
		mImg.className="open";
	} else {
		mSec.style.display='none';
		mImg.className="closed";
	}
}

function hideMe(id)
{
	mImg = eval("document.img" + id);
	if(document.getElementById(id).style.display=='none'){
		document.getElementById(id).style.display='';
		mImg.src="{/literal}{$srIm}{literal}_-.gif";
	} else {
		document.getElementById(id).style.display='none';
		mImg.src="{/literal}{$srIm}{literal}_+.gif";
	}
}

function hideBox(id)
{
	mImg = eval("document.img" + id);
	if(document.getElementById(id).style.display=='none'){
		document.getElementById(id).style.display='';
		mImg.src="{/literal}{$srIm}{literal}_min.gif";
	} else {
		document.getElementById(id).style.display='none';
		mImg.src="{/literal}{$srIm}{literal}_max.gif";
	}
}

function closeBox(id)
{
	document.getElementById(id).style.display='none';
}

function execute($text, $url)
{
	window.status='';
	if(!confirm($text))return;
	this.window.location=$url;
}

function executeForm($text)
{
   return confirm($text);
}

function maskKeyPress(objEvent)
{
	var iKeyCode;
	if (window.event) iKeyCode = window.event.keyCode;
	else if (objEvent) iKeyCode = objEvent.which;
	if(iKeyCode==34 || iKeyCode==37 || iKeyCode==39 || iKeyCode==8 || iKeyCode==46)return false;
	return true;
}

function maskKeyPressNumer(objEvent)
{
	var iKeyCode;
	if (window.event) iKeyCode = window.event.keyCode;
	else if (objEvent) iKeyCode = objEvent.which;
	if((iKeyCode>=48 && iKeyCode<=57) || iKeyCode==8 || iKeyCode==13 || iKeyCode==32 || iKeyCode==0)return true;
	return false;
}

function maskKeyPressFloat(objEvent)
{
	var iKeyCode;
	if (window.event) iKeyCode = window.event.keyCode;
	else if (objEvent) iKeyCode = objEvent.which;
	if((iKeyCode>=48 && iKeyCode<=57) || iKeyCode==8 || iKeyCode==13 || iKeyCode==32 || iKeyCode==46 || iKeyCode==0 || iKeyCode==44)return true;
	return false;
}

function maskKeyPressAlfaNumer(objEvent)
{
	var iKeyCode;
	
	if (window.event) iKeyCode = window.event.keyCode;
	else if (objEvent) iKeyCode = objEvent.which;
	/*alert(iKeyCode);*/
	if((iKeyCode>=48 && iKeyCode<=57) || (iKeyCode>=65 && iKeyCode<=90) || (iKeyCode>=97 && iKeyCode<=122) || iKeyCode==8 || iKeyCode==13 || iKeyCode==32 || iKeyCode==0 || iKeyCode==45 || iKeyCode==46){
		return true;
	}
	return false;
}

function maskKeyPressEmail(objEvent)
{
	var iKeyCode;
	
	if (window.event) iKeyCode = window.event.keyCode;
	else if (objEvent) iKeyCode = objEvent.which;
	if((iKeyCode>=48 && iKeyCode<=57) || (iKeyCode>=65 && iKeyCode<=90) || (iKeyCode>=97 && iKeyCode<=122) || iKeyCode==8 || iKeyCode==13 || iKeyCode==32 || iKeyCode==64 || iKeyCode==46 || iKeyCode==45 || iKeyCode==95 || iKeyCode==0)return true;
	return false;
}

function pause(numberMillis){
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while(true){
		now = new Date();
		if (now.getTime() > exitTime)return;
	}
}

function infoOn(event, text){
	mobj = document.getElementById('info');
	mobj2 = document.getElementById('iText');
	pause(200);
	if(mobj.style.display=='none'){
		mobj.style.display='';
		mobj2.innerHTML = text;
		mobj.style.left=event.clientX;
		mobj.style.top=event.clientY-30;
	} else {
		mobj.style.display='none';
		mobj2.innerHTML = '';
	}
}

function infoOff(){
	mobj = document.getElementById('info');
	mobj2 = document.getElementById('iText');
	pause(500);
	mobj.style.display='none';
	mobj2.innerHTML = '';
}

function end(){
	w = window.open("clear.php", '', 'width=0, height=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no');
}