function getCookie(NameOfCookie)
{

if (document.cookie.length > 0)
{

begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1) // Note: != means "is not equal to"
{

begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); }
}
return null;

}




function setCookie(NameOfCookie, value, expiredays)
{

var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) +
";path=/";

}




function delCookie (NameOfCookie)
{

// The function simply checks to see if the cookie is set.
// If so, the expiration date is set to Jan. 1st 1970.

if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}


var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
if (getCookie("browser") == null)  { setCookie("browser",InternetExplorer);  };

function BgImg (id, imageURL) {
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all)
    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' 
: 'url(' + imageURL + ')';
  else if (document.getElementById)
    document.getElementById(id).style.backgroundImage = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ')';
}

function toggle_vis(id) {
var evv = document.getElementById(id);
if(evv.style.display == "")
evv.style.display = 'block';
if(evv.style.display == 'none')
evv.style.display = 'block';
else
evv.style.display = 'none';
}

function doMenu(menuname){
// MC trigger
window.document.CodacorSplash.TGotoLabel("ctrl",' + labelname + ');
window.document.CodacorSplash.TPlay("ctrl",' + labelname + ');

}