/* LightBox management */

if(typeof HTMLElement!=='undefined'&&!HTMLElement.prototype.click){
    HTMLElement.prototype.click=function()
    {
        var evt = this.ownerDocument.createEvent('MouseEvents');
        evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
        this.dispatchEvent(evt);
    };
}

function showLightBox(stuff){
	document.getElementById('CB_ContentHide').style.clip='rect(105px, 3000px, 3000px, 0px)';
	document.getElementById(stuff).click();
}

var doExternal = true;

function stateLightBox(){
	quid = document.getElementById('CB_ContentHide').style.width;
	return !((quid.length === 0)  || ( (quid.lastIndexOf('0px')) === 0 ));
}

function showFromFooter(stuff){
	if (!stateLightBox()){
		showLightBox(stuff);
			/* Following line added as test to avoid reloading (and subsequent blinking of modules) */
			doExternal = false;
	}
}

function closeLightBox(){
	doExternal = false;
	CB_Close();
}

function checkCloseLightBox(){
	if (stateLightBox()){
		closeLightBox();
		CB_Init();
	}
}

function CB_ExternalFunctionCBClose(){
	if (doExternal){
	document.getElementById("flashContent").catchLink_2(); /* Dispatch a CD_Init() */
	}
	doExternal = true;
}

function CB_ExternalFunctionPageLoad(){
	alert("page loaded!");
}
/* setTimeout("showLightBox('logo');",3000);
setTimeout("closeLightBox();",7000); */

/* End of LightBox management */
