// Eddie Traversa
// http://www.dhtmlnirvana.com/ 

// sniff for browser 

	ie	= (document.all && !window.opera);
	dom 	= (document.getElementById && !window.opera);
	opera 	= (window.opera);

// this will dynamically create an iframe 
// needs to be called at the onload event and target the id value of the layer we want to appear on top of active content
// it will track the layers position automatically and size and position the iframe automatically to fit the layer

function activecontentHider(id) {
	if (ie) {
		el = document.getElementById(id);
		ifrm = document.createElement("IFRAME");
		ifrm.setAttribute("id", "dummyFRM");
		ifrm.setAttribute("src", "#");
		ifrm.setAttribute("scroll", "no");
		ifrm.setAttribute("frameborder", "0");
		ifrm.style.setAttribute("position", "absolute");
		ifrm.style.setAttribute("visibility", "hidden");
		// better for IE5.5 to use old filter...
		ifrm.style.filter='Alpha(opacity=0)';
		ifrm.style.width = el.offsetWidth + "px";
		ifrm.style.height = el.offsetHeight + "px";
		ifrm.style.left = el.offsetLeft + "px";
		ifrm.style.top = el.offsetTop + "px";
		ifrm.style.zIndex = el.style.zIndex-1;
		document.body.appendChild(ifrm);
 }
}

// this hides elements 
// for opera we resize the flash movie back to original size
// arguments for the loadflash() function are id of layer, url of flash movie, width and height. 

function hideDiv(id){
if (ie) {
	document.getElementById(id).style.visibility = "hidden";
	ifrm.style.visibility = "hidden";
 }
else if (dom) {
	document.getElementById(id).style.visibility="hidden";
 }
 else if (opera) {
	document.getElementById(id).style.visibility="hidden";
	loadFlash('flashLYR','matrix.swf',500,300);
 }
}

// this shows elements 
// for opera we resize the flash movie to a smaller size so as to allow the layer to show. 
// arguments for the loadflash() function are id of layer, url of flash movie, width and height. 

function showDiv(id){
if (ie) {
	document.getElementById(id).style.visibility="visible";
	ifrm.style.visibility = "visible";
}
else if (dom) {
	document.getElementById(id).style.visibility="visible";
}
else if (opera) {
	document.getElementById(id).style.visibility="visible";
	loadFlash('flashLYR','matrix.swf',500,161);
 }
}

// dynamically write in a flash movie to replace the one in the document body.  
// you should keep a normal object / embed tag in the document body in case javascript is turned off.  

function loadFlash(id,theurl,width,height) {
	document.getElementById(id).innerHTML ='<embed src="'+ theurl + '" width="'+ width + '" height="'+ height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit" /><\/embed>';
}