


function joload()
{
var infoframeb = "id_frameb";
   document.getElementById(infoframeb).style.display="none";

}


//---------------------------------------------------------------------
// Bild/Content Fader
// Script copyright 2009 by Johanna Bindgen
//---------------------------------------------------------------------

window.onresize=rez;


var Millisec     = 20; //Timer Zeitintervall

var Max            = 100;
var Nenner         = 100;

var setgdliburl  = "setgdliburl";
var globpath     = "dummy";

var BoZielBreite     = 0;
var BoZielMarginleft = 0;
var BoZielHoehe      = 0;
var BoZielMargintop  = 0;

var Rand             =4;
var infoDivTxHoehe   =20;
var RandBild         =0;

var bild_overlay   = "bild_overlay";

//------------ abdunkeln ; count_blende()------------------------
var infoDivBl      = "infoDivBl";  //id in html
var ZaehlerBlStart = 90;  //Beginn des Zaehlers
var ZaehlerBl      = ZaehlerBlStart;
var ZaehlerBlMax   = 95;
var DeltaBl        = 5; // Schrittweite


//------------ Event Hintergrund ; Bg()------------------------
var infoDivBg      = "infoDivBg";  //id in html
var ZaehlerBgStart = 85;  //Beginn des Zaehlers
var ZaehlerBg      = ZaehlerBgStart;
var ZaehlerBgMax   = 100;
var DeltaBg        = 5; // Schrittweite

//------------ Event Content ; OverlayContent()---bild---------------------
var infoDivCo      = "infoDivCo"; //id in html
var ZaehlerCoStart = 80;  //Beginn des Zaehlers
var ZaehlerCo      = ZaehlerCoStart;
var ZaehlerCoMax   = 100;
var DeltaCo        = 10; // Schrittweite
//------------ Event Content ; OverlayContent()--text zum bild-----------------
var infoDivTx      = "infoDivTx"; //id in html
var ZaehlerTxStart = 40;  //Beginn des Zaehlers
var ZaehlerTx      = ZaehlerTxStart;
var ZaehlerTxMax   = 60;
var DeltaTx        = 10; // Schrittweite
//------------ Event Exit ; ExitOverlay()------------------------
var infoDivEx      = "infoDivEx"; //id in html
var ZaehlerExStart = 100;  //Beginn des Zaehlers
var ZaehlerEx      = ZaehlerExStart;
var ZaehlerExMax   = 90;
var DeltaEx        = 10; // Schrittweite
//------------ Nothing()------------------------
var ZaehlerNoStart = 0;  //Beginn des Zaehlers
var ZaehlerNo      = ZaehlerNoStart;
var ZaehlerNoMax   = 100;
var DeltaNo        = 2; // Schrittweite


var infospanText       = "infospanText";

var InitFensterBreite  = 0;
var InitFensterHoehe   = 0;

var FensterBreite  = 0;
var FensterHoehe   = 0;
var Zoom           = 100;
var MaxBildRand    = 80;
var bild_original_width = 0;
var bild_original_height= 0;
var Untertitel     = "dummy";

var infoDivExBreite = 200;
var infoDivExHoehe  = 20;

var infoDivTxBreite = 80;// in %
var infoDivTxHoehe  = 20;


//----------------------------------
function pic_js_display_visible(id)
{
 document.getElementById(id).style.display = 'inline'; // andernfalls noscript bereich;
}

function init()
{
}
//------------------------------
function get_screen_width()
{
  //return window.innerWidth; dat get so nich bei aaln brausern
  return  xClientWidth(); // dat is besser
}

//------------------------------
function get_screen_height()
{
  //return window.innerHeight;
  return xClientHeight();
}
//------------------------------

function rez()
{


             InitFensterHoehe  = get_screen_height();
             InitFensterBreite = get_screen_width();
             //alert(InitFensterBreite);


             Zoom=get_max_zoom(bild_original_width,bild_original_height);





             Zoom=Math.min(ZoomX,ZoomY);
                            
                W=BoZielBreite*Zoom/100;
                Ml=-BoZielMarginleft*Zoom/100;

                H=BoZielHoehe*Zoom/100;
                Mt=-BoZielMargintop*Zoom/100;

                document.getElementById(infoDivBg).style.marginLeft = (Ml-Rand)+'px';
                document.getElementById(infoDivBg).style.width = (W+Rand*2)+'px';
                document.getElementById(infoDivBg).style.marginTop = (Mt-Rand)+'px';
                document.getElementById(infoDivBg).style.height = (H+Rand*2)+'px';


                document.getElementById(infoDivCo).style.marginLeft = (Ml)+'px';
                document.getElementById(infoDivCo).style.width = (W)+'px';
                document.getElementById(infoDivCo).style.marginTop = (Mt)+'px';
                document.getElementById(infoDivCo).style.height = (H)+'px';

                //document.getElementById(setgdliburl).style.marginLeft = (Ml)+'px';
                document.getElementById(setgdliburl).style.width = (W)+'px';
                //document.getElementById(setgdliburl).style.marginTop = (Mt)+'px';
                document.getElementById(setgdliburl).style.height = (H)+'px';


                //W=BoZielMarginleft*2*Zoom/100/4*3;
                Ml=-BoZielMarginleft*Zoom/100+Rand;
                //H=infoDivTxHoehe;
                Mt=-BoZielMargintop*Zoom/100+Rand;
                


                document.getElementById(infoDivTx).style.marginLeft = Ml+'px';
                //document.getElementById(infoDivTx).style.width = W+'px';
                document.getElementById(infoDivTx).style.marginTop = Mt+'px';
                //document.getElementById(infoDivTx).style.height = H+'px';

                W=infoDivExBreite;
                Ml=BoZielMarginleft*Zoom/100-infoDivExBreite-Rand;
                H=infoDivExHoehe;
                Mt=BoZielMargintop*Zoom/100+infoDivExHoehe-Rand;


                document.getElementById(infoDivEx).style.marginLeft = (Ml)+'px';
                document.getElementById(infoDivEx).style.width = (W)+'px';
                document.getElementById(infoDivEx).style.marginTop = (Mt)+'px';
                document.getElementById(infoDivEx).style.height = (H)+'px';


}




function get_max_zoom(width,height)
{
             ZoomY=100;
             if(height>(InitFensterHoehe-MaxBildRand))
             {
             ZoomY=(InitFensterHoehe-MaxBildRand)/height*100;
             }
             ZoomX=100;
             if(width>(InitFensterBreite-MaxBildRand))
             {
             ZoomX=(InitFensterBreite-MaxBildRand)/width*100;
             }


return   Math.min(ZoomX,ZoomY);
}

//------------------------------------------------------------------------
//------------------------------------------------------------------------


function init_fader(path,width,height,text)
{

 //alert("bl"+ZaehlerBl+" path="+path);
  R = ZaehlerBl/Nenner;
  Ralpha = R*100;





     	


             Untertitel=text;

             bild_original_width=width;
             bild_original_height=height;

             InitFensterHoehe  = get_screen_height();//window.innerHeight;
             InitFensterBreite = get_screen_width();//window.innerWidth;

             Zoom=get_max_zoom(bild_original_width,bild_original_height);

             height=height/100*Zoom;
             width=width/100*Zoom;




              globpath=path;
              document.getElementById(setgdliburl).src = globpath;


              BoZielBreite=width;
              BoZielMarginleft=width/2;

              BoZielHoehe=height;
              BoZielMargintop=height/2;

              document.getElementById(bild_overlay).style.display="block";
              document.getElementById(infoDivBl).style.display="block";
              document.getElementById(infoDivCo).style.display="none";
              document.getElementById(infoDivEx).style.display="none";
              document.getElementById(infoDivBg).style.display="none";
              document.getElementById(infoDivTx).style.display="none";

              document.getElementById(setgdliburl).style.width  = (BoZielBreite)+'px';
              document.getElementById(setgdliburl).style.height = (BoZielHoehe)+'px';


              document.getElementById(setgdliburl).src = globpath;//alert(globpath);






	

         //bg();
         count_blende();




}

//------------------------------------------------------------------------
//------------------------------------------------------------------------


function count_blende()
{
 //alert(" path="+path);
 //alert("bl"+ZaehlerBl+" path="+path);
  R = ZaehlerBl/Nenner;
  Ralpha = R*100;



     if (ZaehlerBl <= ZaehlerBlMax) {

     	 aktivBl = setTimeout("count_blende()", Millisec);
           if (ZaehlerBl==ZaehlerBlStart)
             {









             }
               document.getElementById(infoDivBl).style.opacity = R;
               document.getElementById(infoDivBl).style.MozOpacity = R;
               document.getElementById(infoDivBl).style.KhtmlOpacity = R;
               document.getElementById(infoDivBl).style.filter = 'alpha(opacity=' + Ralpha + ')';



         ZaehlerBl += DeltaBl;
    } else {


	 clearTimeout(aktivBl);
	

         bg();
    }




}

//----------------------------------------------------

function bg()
{


  R = ZaehlerBg/Nenner;
  Ralpha = R*100;



     if (ZaehlerBg <= ZaehlerBgMax) {

     	 aktivBg = setTimeout("bg()", Millisec);


           if (ZaehlerBg==ZaehlerBgStart)
             {
                //alert("bg");
                document.getElementById(infoDivBg).style.display="block";
                document.getElementById(infoDivCo).style.display="none";
             }

                W=Math.min(BoZielBreite,(BoZielBreite/Max)*Ralpha);
                Ml=Math.max(-BoZielMarginleft,-(BoZielMarginleft/Max)*Ralpha);
  
                H=Math.min(BoZielHoehe,(BoZielHoehe/Max)*Ralpha);
                Mt=Math.max(-BoZielMargintop,-(BoZielMargintop/Max)*Ralpha);


                //document.getElementById(infoDivBg).style.opacity = (R);
                //document.getElementById(infoDivBg).style.MozOpacity = (R);
                //document.getElementById(infoDivBg).style.KhtmlOpacity = (R);
                //document.getElementById(infoDivBg).style.filter = 'alpha(opacity=' + Ralpha + ')';


                document.getElementById(infoDivBg).style.marginLeft = (Ml-Rand)+'px';
                document.getElementById(infoDivBg).style.width = (W+Rand*2)+'px';

                document.getElementById(infoDivBg).style.marginTop = (Mt-Rand)+'px';
                document.getElementById(infoDivBg).style.height = (H+Rand*2)+'px';






         ZaehlerBg += DeltaBg;
    } else {

         
	 clearTimeout(aktivBg);
         ZaehlerBg=ZaehlerBgStart;
         overlay_content();
    }




}

//----------------------------------------------------
function overlay_content()
{

  R =ZaehlerCo/Nenner;
  Ralpha = R*100;




    if (ZaehlerCo <= ZaehlerCoMax) {

     	 aktivCo = setTimeout("overlay_content()", Millisec);
     	
          if (ZaehlerCo == ZaehlerCoStart)
              {
              //alert("co");
              document.getElementById(infoDivCo).style.display="block";
              document.getElementById(setgdliburl).style.display="block";
              //document.getElementById(setgdliburl).src = globpath;
              document.getElementById(setgdliburl).style.width  = BoZielBreite+'px';
	      document.getElementById(setgdliburl).style.height = BoZielHoehe+'px';
	
                W=BoZielBreite;
                Ml=-BoZielMarginleft;
                H=BoZielHoehe;
                Mt=-BoZielMargintop;
                
                document.getElementById(infoDivCo).style.marginLeft = Ml+'px';
                document.getElementById(infoDivCo).style.width = W+'px';
                document.getElementById(infoDivCo).style.marginTop = Mt+'px';
                document.getElementById(infoDivCo).style.height = H+'px';

              }


              document.getElementById(infoDivCo).style.opacity = (R);
              document.getElementById(infoDivCo).style.MozOpacity = (R);
              document.getElementById(infoDivCo).style.KhtmlOpacity = (R);
              document.getElementById(infoDivCo).style.filter = 'alpha(opacity=' + Ralpha + ')';
              
          ZaehlerCo += DeltaCo;
    } else {

	 clearTimeout(aktivCo);

	 overlay_content_text();


    }


}

//----------------------------------------------------
function overlay_content_text()
{
    // Untertitel=='Undefined' ||
  if (Untertitel=='')
  {

  exit_button();
  }
  else
  {

    R =ZaehlerTx/Nenner;
    Ralpha = R*100;




    if (ZaehlerTx <= ZaehlerTxMax) {

     	 aktivTx = setTimeout("overlay_content_text()", Millisec);
     	
          if (ZaehlerTx == ZaehlerTxStart)
              {



                //W=BoZielMarginleft*2/4*3;;
                Ml=-BoZielMarginleft+Rand;
                //H=infoDivTxHoehe;
                Mt=-BoZielMargintop+Rand;
                

                document.getElementById(infoDivTx).style.marginLeft = Ml+'px';
                //document.getElementById(infoDivTx).style.width = W+'px';
                document.getElementById(infoDivTx).style.marginTop = Mt+'px';
                //document.getElementById(infoDivTx).style.height = H+'px';

              }


          ZaehlerTx += DeltaTx;
    } else {
         document.getElementById(infoDivTx).style.display="block";
         document.getElementById(infospanText).innerHTML= Untertitel;
         //document.all.infospanText.innerHTML = Untertitel;
         clearTimeout(aktivTx);
         exit_button();
    }
 }

}

function exit_button()
{


                document.getElementById(infoDivEx).style.display="block";

                W=infoDivExBreite;
                Ml=BoZielMarginleft-infoDivExBreite-Rand;
                H=infoDivExHoehe;
                Mt=BoZielMargintop+infoDivExHoehe-Rand;

                document.getElementById(infoDivEx).style.marginLeft = (Ml)+'px';
                document.getElementById(infoDivEx).style.width = (W)+'px';
                document.getElementById(infoDivEx).style.marginTop = (Mt)+'px';
                document.getElementById(infoDivEx).style.height = (H)+'px';


}



function nothing()
{

    if (ZaehlerNo <= ZaehlerNoMax) {

     	 aktivNo = setTimeout("nothing()", Millisec);
         ZaehlerNo += DeltaNo;
    } else {

	 clearTimeout(aktivNo);
	 alert(ZaehlerNo);
         ZaehlerNo=ZaehlerNoStart;
    }



}


function exit_overlay()
{
  R = ZaehlerEx/Nenner;
  Ralpha = R*100;




  if (ZaehlerEx >= ZaehlerExMax) {
         //opacity(infoDivBl,R);
         //opacity(infoDivBg,R);
         opacity(infoDivCo,R);
         //opacity(infoDivBg,R);

     ZaehlerEx += -DeltaEx;
     	 aktivEx = setTimeout("exit_overlay()", Millisec);
    } else {
          clearTimeout(aktivEx);
	
              document.getElementById(infoDivBl).style.display="none";
              document.getElementById(infoDivBg).style.display="none";
              document.getElementById(infoDivCo).style.display="none";
              document.getElementById(infoDivEx).style.display="none";
              document.getElementById(infoDivTx).style.display="none";
              document.getElementById(infospanText).innerHTML="a";
              //document.all.infospanText.innerHTML = "asdf asdf";
              document.getElementById(setgdliburl).src = "xxx.jpg";
              ZaehlerBl      = ZaehlerBlStart;
              ZaehlerBg      = ZaehlerBgStart;
              ZaehlerCo      = ZaehlerCoStart;
              ZaehlerEx      = ZaehlerExStart;
              ZaehlerTx      = ZaehlerTxStart;
    }





}


function opacity(id,R)
{
    Ralpha = R*100;
    document.getElementById(id).style.opacity = (R);
    document.getElementById(id).style.MozOpacity = (R);
    document.getElementById(id).style.KhtmlOpacity = (R);
    document.getElementById(id).style.filter = 'alpha(opacity=' + Ralpha + ')';
    
    



}
//-------------------------------------------------------------------



function oeffne_fenster(w1,w2,w3,w4,w5,w6,w7,w8)
	   {
	   fenster = window.open(w1,w2,w3,w4,w5,w6,w7,w8)
	   fenster.focus();
           //fenster=openWindow(url,w,h,tb,stb,l,mb,sb,rs,x,y)
           }
	   
function FensterExtern (Adresse) {
  MeinFenster = window.open(Adresse, "Zweitfenster", "width=300,height=400,left=100,top=200");
  MeinFenster.focus();
}	
	   
function openWindow(url,w,h,tb,stb,l,mb,sb,rs,x,y){
var t=(document.layers)? ',screenX='+x+',screenY='+y: ',left='+x+',top='+y;
 //A LITTLE CROSS-BROWSER CODE FOR WINDOW POSITIONING
tb=(tb)?'yes':'no';
stb=(stb)?'yes':'no';
l=(l)?'yes':'no';
mb=(mb)?'yes':'no';
sb=(sb)?'yes':'no';
rs=(rs)?'yes':'no';
var x=window.open(url, 'newWin'+new Date().getTime(), 'scrollbars='+sb+',width='+w+',height='+h+',toolbar='+tb+',status='+stb+',menubar='+mb+',links='+l+',resizable='+rs+t);
x.focus();
}

function SetFramea()
{
  //var infoframea = "id_framea";
  //document.getElementById(infoframea).style.width="80%";

}

function SetTextareaName(zeile) {
  //alert("zeile=" + zeile);
  window.textareaname = zeile;
    if(typeof window.lasttextareaname != 'undefined')
    {
      zold=window.lasttextareaname;
      window.document.forms['formular'].elements['angabe['+zold+']'].style.backgroundColor="#ffffff";


    }
    
  window.document.forms['formular'].elements['angabe['+zeile+']'].style.backgroundColor="#C4FFC4";
  window.document.forms['formular'].elements['angabe['+zeile+']'].style.backgroundImage="none";

  window.lasttextareaname = zeile;

}

function ClearBackgroundInput(name) {
  window.document.forms['suche_unter_menue'].elements['post_suchwort_private'].style.backgroundColor="#fff";
  window.document.forms['suche_unter_menue'].elements['post_suchwort_private'].style.backgroundImage="none";
  window.document.forms['suche_unter_menue'].elements['post_suchwort_private'].value="";
}	



function show_hide_block(pointer) {

var infoDiv = "show_hide_block_" + pointer;
	if(document.getElementById(infoDiv).style.display=="block") {
		document.getElementById(infoDiv).style.display="none";
	} else {
		
                document.getElementById(infoDiv).style.display="block";

	}
	window.focus();
}

function hover_block(pointer) {

var infoDiv = "show_hide_block_" + pointer;
                document.getElementById(infoDiv).style.display="block";
	window.focus();
}

function weg_block(pointer) {
var infoDiv = "show_hide_block_" + pointer;
 document.getElementById(infoDiv).style.display="none";
	window.focus();
}

function xxblockhin(pointer) {
var infoDiv = "show_hide_block_" + pointer;
 document.getElementById(infoDiv).style.display="inline";

	window.focus();
}

function hover_helpframe() {

var infoframea = "id_framea";
var infoframeb = "id_frameb";
        //if(document.getElementById(infoframeb).style.width=="0px")
        if(document.getElementById(infoframeb).style.display=="none")
           {
           document.getElementById(infoframea).style.width="75%";
           //document.getElementById(infoframeb).style.width="300px";
           document.getElementById(infoframeb).style.display="block";
           }
           else
           {
           document.getElementById(infoframea).style.width="100%";
           //document.getElementById(infoframeb).style.width="0px";
           document.getElementById(infoframeb).style.display="none";
	   }
                //window.focus();
}

function brille(wert) {
var brillerahmen = "id_brille";

           document.getElementById(brillerahmen).style.fontSize = wert+'em';
           //document.getElementById(brillerahmen).style.backgroundColor = '#ff0000';

}
