/*
     *  Umfang:
     *      - Zeit die Sosi-Druckversion an
     *
     *  1.1.0       2009-01-21  Ulrich Santo
     *				- popup_veranstaltung_anmeldung_bk für den Bundeskongress eingefuegt!
     *  1.0.0       2008-07-14  Ulrich Santo
     *				- letzte Version ohne Historie
     *              - Popup für Trägerförderung eingefügt
     *
     * @package 	bpbCMS
     * @subpackage 	cms-php
     * @copyright 	Glamus GmbH
     * @author      Ulrich Santo
*/

function bt(strBildHTML, strBildNeuURL) {
  if (parseInt(navigator.appVersion)>2) {
	objHTML = (document.images ? document.images : document.all);
	objHTML[strBildHTML].src = strBildNeuURL;
  }
}

function all_search_top_submit(){
   document.top_suche.submit();
}

function btu(strBildHTML,nr) {
  if (parseInt(navigator.appVersion)>2) {
	objHTML = (document.images ? document.images : document.all);
	zw=objHTML[strBildHTML].src.replace(/\d\.gif/,nr+".gif");
        //alert(zw);
	objHTML[strBildHTML].src=zw;
  }
}

function BilderVorladen() {
	//bei Seitenstart aufrufen
	//argumente sind die Mouseoverbilder als String
	var intZaehler;
	var objBild = new Image();
	for (intZaehler = 0; intZaehler < arguments.length; intZaehler++) {
		objBild.src = arguments[intZaehler];
	}
}


    function popup_artikel_versenden(guid,param){
      //alert(guid);
      if (param!=undefined){
      	 av=open("/popup/popup_artikel_versenden.html?guid="+guid+param,"Versenden","width=470,height=500,resizable=yes,scrollbars=yes,dependent=no");
      } else {
      	 av=open("/popup/popup_artikel_versenden.html?guid="+guid,"Versenden","width=470,height=500,resizable=yes,scrollbars=yes,dependent=no");
      }
      av.focus();
    }

    function popup_veranstaltung_programm(guid){
      //alert(guid);
      vp=open("/popup/popup_veranstaltung_programm.html?guid="+guid,"Programm","width=470,height=500,resizable=yes,scrollbars=yes,dependent=no");
      vp.focus();
    }

    function popup_veranstaltung_anmeldung(guid){
      //alert(guid);
      vp=open("/popup/popup_veranstaltung_anmeldung.html?guid="+guid,"Programm","width=470,height=700,resizable=yes,scrollbars=yes,dependent=no");
      vp.focus();
    }

    function popup_veranstaltung_anmeldung_bk(guid){
      //alert(guid);
      vp=open("/popup/popup_veranstaltung_anmeldung_bk.html?guid="+guid,"AnmeldungBundeskongress","width=470,height=700,resizable=yes,scrollbars=yes,dependent=no");
      vp.focus();
    }

    function popup_quellentext(guid){
      //alert(guid);
      qt=open("/popup/popup_quellentext.html?guid="+guid,"Quellentext","width=470,height=500,resizable=yes,scrollbars=yes,dependent=no");
      qt.focus();
    }

    function popup_druckversion(guid,param){
      //alert(guid);
      if (param!=undefined){
	      dv=open("/popup/popup_druckversion.html?guid="+guid+param,"Drucken","width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
	  } else {
	      dv=open("/popup/popup_druckversion.html?guid="+guid,"Drucken","width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
	  }
      dv.focus();
    }

    function popup_druckversion_local(guid,param,path){
      //alert(guid);
      if (path==undefined){
      	path = "";
      }
      if (param!=undefined){
	      dv=open(path+"popup_druckversion_"+guid+".html","Drucken","width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
	  } else {
	      dv=open(path+"popup_druckversion_"+guid+".html","Drucken","width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
	  }
      dv.focus();
    }
        
    function popup_druckversion_sosi(guid,param){
      /*
      	  Wegen den Pfaden muss das Popup der Druckversion für Sosi unter root liegen!
      */
      dv=open("/popup/popup_druckversion_sosi.html?guid="+guid+param,"Drucken","width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
      dv.focus();
    }
    
    function popup_druckversion_methoden(guid,mid){
      //alert(guid);
      dv=open("/popup/popup_druckversion.html?guid="+guid+"&mid="+mid,"Drucken","width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
      dv.focus();
    }

    function popup_fussnote(guid,id){ // &id="+id+"
      win=open("/popup/popup_fussnote.html?guid="+guid+"#"+id,"Fussnoten","width=330,height=400,resizable=yes,scrollbars=yes,dependent=no");
      win.focus();
    }

    function popup_fussnote_local(guid,id,path){
      //alert(guid);
      if (path==undefined){
      	path = "";
      }
      dv=open(path+"popup_fussnote_"+guid+".html#"+id,"Fussnoten","width=330,height=400,resizable=yes,scrollbars=yes,dependent=no");
      dv.focus();
    }
    
    function popup_lemmata(guid){
      win=open("/popup/popup_lemmata.html?guid="+guid,"Lemmata","width=470,height=500,resizable=yes,scrollbars=yes,dependent=no");
      win.focus();
    }

    function popup_parteiengeschichte(lurl){
		win=open(lurl,"parteiengeschichte","width=470,height=500,resizable=yes,scrollbars=yes,dependent=no");
		win.focus();
    }


        var RealMode=0;
        var RealPlayer5=0;
        var RealPlayer4=0;
        var RealPlayerG2=0;

	function global_check_for_realplayer(){
	
		if (navigator.userAgent.indexOf("MSIE")< 0 ){
			numPlugins = navigator.plugins.length;
			for (i = 0; i < numPlugins; i++){
				plugin = navigator.plugins[i];
				if (plugin.name.substring(0,10)=="RealPlayer"){
					RealMode=1;
				}
			}
		}
			
		if ( RealPlayerG2 || RealPlayer5 || RealPlayer4 ) {
			// IE RealPlayer vorhanden!
			
		}else if ( RealMode ){
			// NS RealPlayer vorhanden!
			
		}else {
			alert("Sie benötigen den Realplayer zum Anschauen der Filme!\nSie können den Realplayer unter http://germany.real.com/player/win/ kostenlos downloaden.");
		}
	}

	function popup_galerie(guid,linkespalte){
		if (linkespalte==1){
			f2=window.open('/popup/popup_galerie.html?guid='+guid+'&linkespalte='+linkespalte,'bpb_galerie','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=651,height=442,print=yes,left=2,top=2');
		} else {
			f2=window.open('/popup/popup_galerie.html?guid='+guid+'&linkespalte='+linkespalte,'bpb_galerie','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=651,height=442,print=yes,left=2,top=2');
		}
		if (parseInt(navigator.appVersion)>2) {
			f2.focus();
		};
		return false;
	}

	function popup_galerie_local(guid,linkespalte){
		if (linkespalte==1){
			f2=window.open('popup_galerie_'+guid+'_lsp'+linkespalte+'.html','bpb_galerie','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=651,height=442,print=yes,left=2,top=2');
		} else {
			f2=window.open('popup_galerie_'+guid+'_lsp'+linkespalte+'.html','bpb_galerie','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=651,height=442,print=yes,left=2,top=2');
		}
		if (parseInt(navigator.appVersion)>2) {
			f2.focus();
		};
		return false;
	}

	function popup_karte(guid,linkespalte){
		if (linkespalte==1){
			f2=window.open('/popup/popup_karte.html?guid='+guid+'&linkespalte='+linkespalte,'galerie','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=590,height=460,print=yes,left=2,top=2');
		} else {
			f2=window.open('/popup/popup_karte.html?guid='+guid+'&linkespalte='+linkespalte,'galerie','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=590,height=460,print=yes,left=2,top=2');
		}
		if (parseInt(navigator.appVersion)>2) {
			f2.focus();
		};
		return false;
	}

	function popup_audio(guid,linkespalte){
		if (linkespalte==1){
			f2=window.open('/popup/popup_audio.html?guid='+guid+'&linkespalte='+linkespalte,'audio','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=530,height=337,print=yes,left=2,top=2');
		} else {
			f2=window.open('/popup/popup_audio.html?guid='+guid+'&linkespalte='+linkespalte,'audio','scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,width=530,height=337,print=yes,left=2,top=2');
		}
		if (parseInt(navigator.appVersion)>2) {
			f2.focus();
		};
		return false;
	}

    function popup_video(guid,html_url,dx,dy,target,stage,scrollbars,text){
    	//einstellungen 	= 1;
    	//text			= 1;
    	//alert(dx);
    	stage			= 'settings';
    	win_settings	= 'scrollbars='+scrollbars+',toolbar=0,titlebar=0,status=0,resizable=1,width='+dx+',height='+dy+',left=10,top=10';
	    f2=window.open(html_url+'?guid='+guid+'&text='+text,target,win_settings);
	    if (parseInt(navigator.appVersion)>2) {
	    	f2.focus();
	    }
   	}

    function popup_video_local(guid,html_url,dx,dy,target,stage,scrollbars,text){
    	//einstellungen 	= 1;
    	//text			= 1;
    	//alert(dx);
    	stage			= 'settings';
    	win_settings	= 'scrollbars='+scrollbars+',toolbar=0,titlebar=0,status=0,resizable=1,width='+dx+',height='+dy+',left=10,top=10';
	    f2=window.open('popup_video_'+guid+'_txt'+text+'.html',target,win_settings);
	    if (parseInt(navigator.appVersion)>2) {
	    	f2.focus();
	    }
   	}
	   	
	function popup_bild(guid,realdx,realdy){
		//alert(realdx);
		//alert(realdy);
		scroll_y=scroll_x=0;
		old_dx = realdx;
		old_dy = realdy;
		
		if (realdx>1000){
			realdx=1000;
			scroll_x=1;
			//realdy = parseInt(realdy*(realdx/old_dx));
			
		}
		if (realdy>800){
			realdy=800;
			scroll_y=1;
			//realdx = parseInt(realdx*(realdy/old_dy));
		}
		/*if (scroll_y){
			realdx+=19;
		}		
		if (scroll_x){
			realdy+=19;
		}*/		
		if ((scroll_y!=0)||(scroll_x!=0)){        
			win=open("/popup/popup_bild.html?guid="+guid+"&x="+old_dx+"&y="+old_dy,guid,"width="+(realdx+34)+",height="+(realdy+34)+",resizable=yes,scrollbars=yes,dependent=no");
		} else {		
			win=open("/popup/popup_bild.html?guid="+guid+"&x="+realdx+"&y="+realdy,guid,"width="+(realdx+14)+",height="+(realdy+14)+",resizable=no,scrollbars=no,dependent=no");
		}
		win.focus();
	}

    function popup_pdf(mid, pdf_name) {
      pdf = open("/popup/popup_pdf.html?pdf_id="+mid+"&pdf_name="+pdf_name, "PDF", "width=520,height=500,resizable=yes,scrollbars=yes,dependent=no");
      pdf.focus();

      return false;
    }


    function popup_sosi_lexikon(l_id) {
      l_entry = open("/sosi/popup/lexikon.php?id="+l_id, "Lexikon", "width=460,height=300,resizable=yes,scrollbars=yes,dependent=no");
      l_entry.focus();

      return false;
    }

    function popup_sosi_wtest(guid) {
      wtest = open("/sosi/popup/popupwtest.php?guid="+guid, "WissensTest", "width=600,height=500,resizable=yes,scrollbars=yes,dependent=no");
      wtest.focus();

      return false;
    }

    function popup_sosi_fallbsp(guid) {
      fallbsp = open("/sosi/popup/popupfallbsp2.php?guid="+guid, "Fallbeispiel", "width=700,height=580,resizable=yes,scrollbars=yes,dependent=no");
      fallbsp.focus();

      return false;
    }

    function popup_sosi_popup(guid) {
      popup = open("/sosi/popup/popup.php?guid="+guid, "SosiPopup", "width=600,height=360,resizable=yes,scrollbars=yes,dependent=no");
      popup.focus();

      return false;
    }

    function popup_sosi_images(theURL) {
        ImagePopup = open(theURL, "SosiImagePopup", "width=800,height=600,resizable=no,scrollbars=yes,dependent=no");
        ImagePopup.focus();

      return false;
    }

function MM_openBrWindow(theURL,winName,features) { //v2.0
  	win = window.open(theURL,winName,features);
  	win.focus();
}

    function praxisboerse_popup_kommentar(guid){
      //alert(guid);
      dv=open("/popup/popup_praxisboerse/popup_praxisboerse_kommentar.html?prax_id="+guid,"PraxisboerseKommentare","width=460,height=560,resizable=yes,scrollbars=yes,dependent=no");
      dv.focus();
    }
    
    
   	function popup_praxisboerse(bild,dx,dy){
		dy += 23;
		dx += 18;
		opt = "width="+dx+",height="+dy+",resizable=yes,scrollbars=no,dependent=no";
		win=open(bild,"praxisboersebild",opt);
		win.focus();
	}

    function popup_bild_local(guid,realdx,realdy){
      scroll_y=scroll_x=0;

      /*if (realdx>640){
        realdx=640;
        scroll_x=1;
        realdy+=19;
      }
      if (realdy>600){
        realdy=600;
        scroll_y=1;
        realdx+=19;
      }*/

      if ((scroll_y!=0)||(scroll_x!=0)){        
        win=open("popup_bild_"+guid+"_"+realdx+"_"+realdy+".html",guid,"width="+(realdx+12)+",height="+(realdy+12)+",resizable=yes,scrollbars=yes,dependent=no");
      } else {

        win=open("popup_bild_"+guid+"_"+realdx+"_"+realdy+".html",guid,"width="+(realdx+12)+",height="+(realdy+12)+",resizable=no,scrollbars=no,dependent=no");
      }
      win.focus();
    }


    function popup_artikel_traegerfoerderung(id){
      //alert(guid);
  	  av=open("/popup/popup_traegerfoerderung/popup_traegerkontakt.html?id="+id,"Traegerfoerderung","width=470,height=600,resizable=yes,scrollbars=yes,dependent=no");
      av.focus();
    }

