
///////////////////////////////////////////////
/// POPUP DIV SCRIPT
///////////////////////////////////////////////
var smokeEnabled = false;

function hideFlash()
{


 try {
   if(document.getElementById("flashbanner"))
      throw "blah";
}
catch(er)
 {

	var flashbanner = document.getElementById("flashbanner");
        flashbanner.style.display = "none";

	var flashreplace = document.getElementById("flashreplace");
        flashreplace.style.display = "block";

} 







}



function showFlash()
{


 try {
   if(document.getElementById("flashbanner"))
      throw "blah";
}
catch(er)
 {
       var flashreplace = document.getElementById("flashreplace");
        flashreplace.style.display = "none";


	var flashbanner = document.getElementById("flashbanner");
        flashbanner.style.display = "block";

       blah = flashbanner.innerHTML;




        // fix für FIREFOX objecthandling (flash in diesem fall)
        flashbanner.innerHTML = blah;
}
    
	
}







function showPopup(url,boxtitle,frameclass) {

document.body.style.overflow='hidden';

if (smokeEnabled) return;
	

	var smokeImg = document.createElement("img");
	smokeImg.src =  "fileadmin/templates/images/halbtrans.png";
	smokeImg.id = "smokeImg";
	smokeImg.style.width = (document.body.clientWidth + 1000 )  + "px";
	smokeImg.style.height = (document.body.clientHeight + 1000) + "px";
        smokeImg.className = "popUpBackground";


hideFlash();
showMsgBox(url,boxtitle,frameclass);
	var bodyelement = document.getElementsByTagName("body")[0];
	bodyelement.appendChild(smokeImg);



	smokeEnabled = true;
}



function showMsgBox(url,boxtitle,frameclass)
{

//	var msgbox1 = document.getElementById("msgbox1");
//        msgbox1.className = "showmsgbox";

	var msgbox = document.createElement("div");
	msgbox.id = "msgbox";
        msgbox.className = "showmsgbox";
	msgbox.style.width = (document.body.clientWidth )  + "px";
	msgbox.style.height = (document.body.clientHeight ) + "px";



      var boxiframe = "<iframe src='"+url+"'  title='"+boxtitle+"' id='subpage' scrolling='auto' name='subpage'  FRAMEBORDER='0' style='border:none' class='"+frameclass+"'></iframe>";


       msgbox.innerHTML ="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center><table cellspacing=0 border=0 cellpadding=0 class='msgbox''><tr><td align=left  class='msgbox_top'><div class='msgbox_title'>"+boxtitle+"</div></td><td align =right class='msgbox_top'><a href='#' onClick='hideMsgBox();' onMouseOver=\"document.getElementById('boxcloseimg').src='fileadmin/templates/images/popupclose_act.gif';\" onMouseOut=\"document.getElementById('boxcloseimg').src='fileadmin/templates/images/popupclose.gif';\"><img id='boxcloseimg' border=0 src='fileadmin/templates/images/popupclose.gif'></a></td></tr><tr><td colspan=2 class='msgbox_content'>"+boxiframe+"</td></tr></table></td></tr></table>";



        var bodyelement = document.getElementsByTagName("body")[0];
	bodyelement.appendChild(msgbox);
}




function hideMsgBox()
{
 if (!smokeEnabled) return;
	
var bodyelement = document.getElementsByTagName("body")[0];

 // destroy box

 mbox = document.getElementById("msgbox");
 mbox.style.visibility = "hidden";
 mbox.style.display = "none";
 bodyelement.removeChild(mbox);


 //destroy smoke


 smokeimg = document.getElementById("smokeImg");
 smokeimg.style.visibility = "hidden";
 smokeimg.style.display = "none";
 bodyelement.removeChild(smokeimg);

document.body.style.overflow='auto';
	

 // restore flash
 showFlash();
 smokeEnabled = false;

}



