function showLehrerForm(f,iddd,divname)
{
	
	$.dimScreen(200, 0.5);
	
	//div = window.document.getElementById('event_nfo');
		
	div = top.document.createElement('div');
	div.setAttribute('id','evt_nfo'+iddd);
	
	top.document.body.appendChild(div);
	offY = 5+(f*153);
	if(div != null) {
	

	
	 var template = "<table cellspacing='0' cellpadding='5' border='0' style='border: solid 1px #336699;'>";
  	template += "<tr>\n";
  	template += "<td align='right' colspan='2' valign='top'>";
    template += "<a onClick=\"hideLehrerForm("+iddd+")\" style=\"cursor:pointer;\">Schlie&szlig;en</a>\n";
    template += "</td></tr>\n";
    template += "<tr><td align='left'>\n";
    //alert(divname);
    if (document.getElementById(divname))
    template += document.getElementById(divname).innerHTML;
    template += "</td></tr>\n";
        
  	template += "</table>";
	

	
	
		div.innerHTML = template;
		
		
		div.style.position = 'absolute';
		div.style.padding = '5px';

	var win_width =$(window).width();
    var scrollToLeft=$(window).scrollLeft();
    var win_height =$(window).height();
    var scrollToBottom=$(window).scrollTop();

		div.style.left = win_width/2-100+scrollToLeft+'px';
		div.style.top = win_height/2-100+scrollToBottom+'px';
		div.style.visibility = 'visible';
	  //div.style.width= '400px';
 	  //div.style.height='400px';
		div.style.zIndex= '12500'; 
		//div.style.border= '2px solid #336699';
		div.style.backgroundColor = '#FFFFFF';
	}	
	
}
/*
function getBodyWidth()
{
 if (navigator.appName=="Netscape") {
  return  document.documentElement.clientWidth;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  return  document.body.clientWidth;
 
 }

}
function getBodyHeight()
{

 if (navigator.appName=="Netscape") {
  return  document.documentElement.clientHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  return  document.body.clientHeight;
 
 }

}
function getXoffset()
{
 if (navigator.appName=="Netscape") {
  return  window.pageXOffset ;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  return  document.body.scrollLeft ;
 
 }

}
function getYoffset()
{
 if (navigator.appName=="Netscape") {
  return  window.pageYOffset ;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  return  document.body.scrollTop ;
 
 }

}


function buildLehrerForm(iddd,divname) 
{
 var template = "<table cellspacing='0' cellpadding='5' border='0' style='border: solid 1px #336699;'>";
  	template += "<tr>\n";
  	template += "<td align='right' colspan='2' valign='top'>";
    template += "<a onClick=\"hideLehrerForm("+iddd+")\" style=\"cursor:pointer;\">Schlie&szlig;en</a>\n";
    template += "</td></tr>\n";
    template += "<tr><td align='left'>\n";
    //alert(divname);
    if (document.getElementById(divname))
    template += document.getElementById(divname).innerHTML;
    template += "</td></tr>\n";
        
  	template += "</table>";
	
	return template;
	
}

*/
function hideLehrerForm(iddd)
{
//alert(iddd);

	//div = window.document.getElementById('event_nfo'+lid);
	div = document.getElementById('evt_nfo'+iddd);
	if(div != null) {
		//div.style.visibility = 'hidden';
		top.document.body.removeChild(div);
		div = null;
	}
	div = document.getElementById('evt_nfo_notiz_'+iddd);
	if(div != null) {
		//div.style.visibility = 'hidden';
		top.document.body.removeChild(div);
		div = null;
	}
	div = document.getElementById('maske'+iddd);
	if(div != null) {
		//div.style.visibility = 'hidden';
		top.document.body.removeChild(div);
		div = null;
	}
	div = document.getElementById('maske2'+iddd);
	if(div != null) {
		//div.style.visibility = 'hidden';
		top.document.body.removeChild(div);
		div = null;
	}
	
	top.$.dimScreenStop();
	

	
	
}


function showForm(iddd)
{
	//bildschirm abdunkeln
	
	top.$.dimScreen(200, 0.5);
	
	
	//div = window.document.getElementById('event_nfo');
		
	div = top.document.createElement('div');
	div.setAttribute('id','evt_nfo'+iddd);
	
	top.document.body.appendChild(div);
	if(div != null) 
	{
	
	template = "<table cellspacing='0' cellpadding='5' border='0' style='border: solid 1px #336699;'>";
  	template += "<tr>\n";
  	template += "<td align='right' colspan='2' valign='top'>";
    template += "<a onClick=\"hideLehrerForm('"+iddd+"')\" style=\"cursor:pointer;\">Schlie&szlig;en</a>\n";
    template += "</td></tr>\n";
    template += "<tr><td align='left' id=\"injectpoint"+iddd+"\">\n";
    //alert(divname);
    template += "<image src=\"../forum/gfx/ajax-loader.gif\" ><br>";
    template += "</td></tr>\n";
        
  	template += "</table>";
  	
  	
	var win_width =$(window).width();
    var scrollToLeft=$(window).scrollLeft();
    var win_height =$(window).height();
    var scrollToBottom=$(window).scrollTop();


		div.innerHTML = template ;
		div.style.position = 'absolute';
		div.style.padding = '5px';
		//-400
		//-300
		var sx = win_width/2-400+scrollToLeft;
		var sy = win_height/2-300+scrollToBottom;
		sx = (sx > 0) ? sx : 0;
		sy = (sy > 0) ? sy : 0;
		div.style.left = sx+'px';
		div.style.top = sy+'px';
		div.style.visibility = 'visible';
	  //div.style.width= '400px';
 	  //div.style.height='400px';
		div.style.zIndex= '12500'; 
		//div.style.border= '2px solid #336699';
		div.style.backgroundColor = '#FFFFFF';
	}
	
	
	//blur_div = top.document.createElement('div');
	//blur_div.setAttribute('id','maske'+iddd);
	
	//top.document.body.appendChild(blur_div);
	
	
}

function showForm2(iddd,title)
{
  //if (typeof width == "undefined")
  	{
		  width = 600;
	  }
  	//if (typeof height == "undefined")
	  {
		  height = 320;
	  }
  	if (typeof title == "undefined")
	  {
  		title = "";
	  }
  
	  {
		  //alert('showForm2');
		  //top.setCallBack('huhu');
		  //top.allllllert('showForm2_2');
		  
		  top_form_wnd = top.$.openModalWindow( {
						"iframe": false
						, content: "<div id=\"injectpoint"+iddd+"\"></div>"
						, "width":width
						, "height":height
						, cov:true
						, id : iddd
						, "title" : title
						, wndCtrl:[ {
							tooltip:"Schlie&szlig;en"
								, icon:"http://www.zen-reiki.de/scripts/reiki/Forum/gfx/hb_deletesm.gif"
								, click:"CLOSE"
						}]
				});
			 /**/
	  }
}
function showOverlay(iddd,cntt,width, height,iframe)
{
	  if (typeof width == "undefined") {
		  width = 450;
	  }
	  if (typeof height == "undefined") {
		  height = 450;
	  }
	  if (typeof iframe == "undefined") {
		  iframe = true;
	  }

	  if ( iframe == "url") {
		 // alert(cntt);
		  iframe = true;
				 var OMW = top.$.openModalWindow( {
						"iframe": iframe
						, contentURL: cntt
						, "width":width
						, "height":height
						, id: "overlay_"+iddd
						, wndCtrl:[ {
							tooltip:"Schlie&szlig;en"
								, icon:"http://www.zen-reiki.de/scripts/reiki/Forum/gfx/hb_deletesm.gif"
								, click:"CLOSE"
						}]
				});
				 /*alert(OMW.content.get(0).setCallBack('huhu'));*/
				/*document.'overlay_'+iddd.setCallBack('huhu');*/;
				 /**/
	  }
	  else
	  {
				 top.$.openModalWindow( {
						"iframe": iframe
						, content: cntt
						, "width":width
						, "height":height
						, id: "overlay_"+iddd
						, wndCtrl:[ {
							tooltip:"Schlie&szlig;en"
								, icon:"http://www.zen-reiki.de/scripts/reiki/Forum/gfx/hb_deletesm.gif"
								, click:"CLOSE"
						}]
				});
	  }
}

function targetOverlay (formular,target)
{
	if (formular)
	{
	    parameter = new Array();
		   for (var i=0;i<formular.length;i++)
	      {
	        parameter[parameter.length]=formular.elements[i];
	      }
		  $.post(target,parameter,function(returned_krams)
					{
			  			//alert (returned_krams);
			  			showOverlay("",returned_krams,860,700,true);
					}
			);
	
	}
}


