var starray = new Array();
var actid = null;

function Show(id) {
	
	if ( document.getElementById(id) != null ) {
		if (  document.getElementById(id).className != 'almenuon' ) {
			if ( actid != null ) {
				document.getElementById(actid).className='almenuoff';
			}
			document.getElementById(id).className='almenuon';
			actid = id;
		}
		if ( starray[id] != null )
			window.clearTimeout(starray[id]);
	}
}

function Hide(id) {
	if ( document.getElementById(id) != null ) {
		starray[id] = window.setTimeout("realHide('" + id + "')", 500);
	}
}

function realHide(id) {
		document.getElementById(id).className='almenuoff';
}

	
function RedefineStyles(objNode, strStyle) 
{	
	
	if ( objNode == null ) 
	{
		alert("Nem létező objektumra való hivatkozás!");
	} 	
	else 
	{
		if ( objNode.className != null && objNode.className != "undefined" && objNode.className.match(/^redef/) ) 
		{	
	  		objNode.className =strStyle + "_" + objNode.className;
		}  	
		
		for ( var i = 0; i < objNode.childNodes.length; ++i ) 
		{
			RedefineStyles(objNode.childNodes[i],strStyle);
		}
	}
	
}	
	
function FindFirstSibling(objNode, strTagName) 
{	
	var sibling = objNode.previousSibling;	
	
	while ( sibling != null && sibling.tagName != strTagName ) 
	{	
		sibling = sibling.previousSibling;
	}	
	
	
	return(sibling);
}	
	
function PrintDOM(objNode)
{	
	alert(objNode.tagName);
	
	for ( var i = 0; i < objNode.childNodes.length; ++i ) 
	{	
		PrintDOM(objNode.childNodes[i]);
	}	
}	
	
function ClearText(objField)
{	
	if (objField.defaultValue == objField.value)
	{	
		objField.value = "";
	}	
}	
	
function AddCookie(strCookieName, strCookieValue, intExpires, strPath, strDomain, strSecure)
{	
	var strCookie = strCookieName + '=' + URLEncode(strCookieValue);
	
	
	if (intExpires != 0)
	{	
		intCurrent = (new Date()).getTime();
		strExpires = (new Date(intCurrent + (intExpires * 1000))).toGMTString();
		
		strCookie += ';expires=' + strExpires;
	}	
	
	if (strPath != 'null')
	{	
		strCookie += ';path=' + strPath;
	}	
	
	if (strDomain != 'null')
	{	
		strCookie += ';domain=' + strDomain;
	}	
	
	if (strSecure == 'true')
	{	
		strCookie += '; secure';
	}	
	
	document.cookie = strCookie;
}	
	
