﻿/********************************************************
// JavaScript Document
// Markus Hasibeder, Nov 2008
// neo:UTILS für alle Themen
********************************************************/


// JavaScript Document
function showHide(id){
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
	}
	else
	{
		document.getElementById(id).style.display = 'none';
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//  für gindoBox
function gindoBox(gbWidth, gbHeight, gbUrl, gbzindex, functionOnClose){
	var gbXpos = (document.body.clientWidth - gbWidth)/2;
	var gbYpos = (window.innerHeight - gbHeight)/2;
	var gbo = document.createElement("div");
	var gbBox = document.createElement("div");
	var gbClose = document.createElement("div");
	var gbCloseP = document.createElement("a");
	var gbCloseTxt = document.createTextNode("Fenster schließen");
	var gbBoxCont = document.createElement("div");
	var gbBoxFrame = document.createElement("iframe");
	
	idneu = "gbOverlay" + gbzindex;
	
	gbo.setAttribute("id",idneu);
	gbo.className = "gbOverlay";
	gbBox.setAttribute("id", "gindoBox");
	gbClose.className = "gbClose";
	gbCloseP.setAttribute("id", "gbCloseTxt");
	gbCloseP.setAttribute("href", "javascript:closeGindoBox("+functionOnClose+");");
	gbBoxCont.setAttribute("id", "gindoBoxCont");
	gbBoxFrame.setAttribute("id", "gindoBoxFrame");
	gbBox.style.left = gbXpos + "px";
    gbBox.style.top = gbYpos + "px";
	gbBox.style.width = gbWidth + "px";
   	gbBox.style.height = gbHeight + "px";
	gbBoxFrame.style.width = (gbWidth-6) + "px";
    gbBoxFrame.style.height = (gbHeight-26) + "px";

	gbo.style.zindex = gbzindex;

	gbClose.appendChild(gbCloseP);
	gbBox.appendChild(gbClose);
	gbBox.appendChild(gbBoxCont);
	gbBoxCont.appendChild(gbBoxFrame);
	gbo.appendChild(gbBox);
	document.body.appendChild(gbo);
	document.getElementById("gbCloseTxt").appendChild(gbCloseTxt);
	document.getElementById("gindoBoxFrame").src =gbUrl;

}

function closeGindoBox(f){
	if (typeof f == "function") { f(); }
	var gbRemoved=document.getElementById(idneu);
	document.body.removeChild(gbRemoved);
}
