function checkBrowser()
{	
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) && this.dom)?1:0;
	this.ie5=((this.ver.indexOf("MSIE 5")>-1 || this.ie5 || this.ie6) && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ie4plus=(this.ie6 || this.ie5 || this.ie4);
	this.ie5plus=(this.ie6 || this.ie5)
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
	return this;
}

bw = new checkBrowser();
			
if (!document.getElementById) 
{
document.getElementById = getObjectById;
}
			
function getObjectById(ID) 
{
	var obj;
	if (bw.dom)
		return document.getElementById(ID);
	else if (bw.ie4)
		return document.all(ID);
	else if (bw.ns4)
		return eval('document.' + ID);
}
			
function getObjectByIdParent(ID) 
{
	var obj;
	if (bw.dom)
		return parent.document.getElementById(ID);
	else if (bw.ie4)
		return parent.document.all(ID);
	else if (bw.ns4)
		return eval('parent.document.' + ID);
}

function cancelBubble(netEvent) 
{
    if (document.all) 
    {
        window.event.cancelBubble = true;
    } 
    else 
    {
        netEvent.cancelBubble = true;
    }
}

if (!document.getElementById) 
{
	document.getElementById = getObjectById;
}


function SetCookie(name, value, days) { 
     var expire = new Date (); 
     expire.setTime (expire.getTime() + (24 * 60 * 60 * 1000) * days); 
     document.cookie = name + "=" + escape(value) + "; expires=" +expire.toGMTString() +";path=/;"; //domain='.theatredelaplace.com'; 
}
function GetCookie(name) { 
     var startIndex = document.cookie.indexOf(name); 
     if (startIndex != -1) { 
          var endIndex = document.cookie.indexOf(";", startIndex); 
          if (endIndex == -1) endIndex = document.cookie.length; 
          return unescape(document.cookie.substring(startIndex+name.length+1, endIndex)); 
     } 
     else { 
          return null; 
     } 
}
function DeleteCookie(name) { 
     var expire = new Date (); 
     expire.setTime (expire.getTime() - (24 * 60 * 60 * 1000)); 
     document.cookie = name + "=; expires=" + expire.toGMTString(); 
}
function toggleVisibility(id) {
	e = document.getElementById(id);
	if (e.style.visibility == "visible") {
		e.style.display = "none";
		e.style.visibility = "hidden";
	} else {
		e.style.display = "block";
		e.style.visibility = "visible";

	}
}

function toggleFlashNews(id) {
	var e = document.getElementById(id);
  var ck = GetCookie('showflashnews');
  if(ck == "hide"){
		toggleVisibility(id)
    SetCookie('showflashnews','show','360');
  }else if (ck == "show"){
		toggleVisibility(id)
    SetCookie('showflashnews','hide','7');
  }else{
		toggleVisibility(id)
    SetCookie('showflashnews','hide','7');
  }
}
