

function setCookie (cookieName, cookieValue, expires, path, domain, secure) {

	document.cookie =

		escape(cookieName) + '=' + escape(cookieValue)

		+ (expires ? '; expires=' + expires.toGMTString() : '')

		+ (path ? '; path=' + path : '')

		+ (domain ? '; domain=' + domain : '')

		+ (secure ? '; secure' : '');

};



// [Cookie] Gets a value from a cookie

function getCookie (cookieName) {

	var cookieValue = '';

	var posName = document.cookie.indexOf(escape(cookieName) + '=');

	if (posName != -1) {

		var posValue = posName + (escape(cookieName) + '=').length;

		var endPos = document.cookie.indexOf(';', posValue);

		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));

		else cookieValue = unescape(document.cookie.substring(posValue));

	}

	return (cookieValue);

};

function popupWindow(url,width,height,toolbar,location,status,menubar,scrollbars)
{
	var options = 'toolbar='+toolbar+',location='+location+',status='+status+',menubar='+menubar+',scrollbars='+scrollbars+',resizable=yes';
	if(width > 0 && height > 0)
	{
		var centered;
		x = (screen.availWidth - width) / 2;
		y = (screen.availHeight - height) / 2;
		centered ='width=' + width + ',height=' + height + ',left=' + x + ',top=' + y + ',' + options;
	}else
	{
		centered = options;
	}	
	var popup = window.open(url, '_blank', centered);
    if (!popup.opener) popup.opener = self;
	popup.focus();
}

 function clearCookie () {

	var now = new Date();

	var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
	for(i=1;i<=4;i++ ) {
	setCookie('submenu'+i, 'cookieValue', yesterday);
	}

	};

	 function closeMenu()
	  {
        pomtr = document.getElementsByTagName ("div");
        for (var i=0; i < pomtr.length; i++)
		{
        	if (pomtr[i].className == "menupodon")
       			pomtr[i].className = "menupod";
		}
	  }
	  
	  function closeMenu(what)
	  {
        pomtr = document.getElementsByTagName ("div");
        for (var i=0; i < pomtr.length; i++)
		{
        	if (pomtr[i].className == "menupodon")
       			pomtr[i].className = "menupod";
		}
	  }
