
//ML 15.04.2008
//Da es kein globales Sytel gibt haben wir diesen Weg gewählt um die Flahfilme in den nicht Barrierefreien Auftritt im CMS sichtbar zu machen
document.writeln("<style>");
document.writeln(".flvplayer{visibility:visible;width: 80px;height:80px;background-image: url('/shared/flv/flvplayer.gif');background-repeat: no-repeat;background-position: center center;border:1px gray solid;}");
document.writeln("embed {display: none;}");
document.writeln("embed.flvplayer{display: block;}");
document.writeln("</style>");
  
var std_param = "resizable=1,status=1,scrollbars=1,toolbar=0,location=0,directories=0,menubar=1"
var xwidth = 700;
var ywidth= 500;
var param = std_param + ", width="+xwidth+",height="+ywidth
  

/*
'-------------------------------------------------------------------------------------------
'	Weiterleitung zur Auswertung der Schlagwoerter
'	Variablen: 
'		intId : modul_id
'		intNumArg : Anzahl der uebergebenen Argumente
'-------------------------------------------------------------------------------------------
*/
function callInstadr() { 
		//wenn ein argument übergeben wird
      if (arguments.length>=1) {
			// id auf alle Fälle holen
         var intId = arguments[0];
			intId=intId.toString();
	      var string ="modul_id="+intId.replace(/([. .])/ig,"%20");
			//Werden mehr als ein Argument übergeben, dann 
			if (arguments.length>1) {
				for(var i = 1 ; i < arguments.length;i++) {
					inString=arguments[i];
					inString=inString.toString();
					//ist mehr als ein formular vorhanden, dann benutze formular adr_form ansonsten das vorhandene
					if(document.forms.length >1)
						{formular=document.forms['adr_form'];}
					else
						{formular=document.forms[0];}
						
					if ("" + formular != "undefined") {
						var form_field_pos = -1;   //Position der ausgewählten Select-Box (falls mehrere zur Auswahl)
						hilfsArray = arguments[i].split("@");
						if (hilfsArray.length > 1) {
							form_field_pos = parseInt(hilfsArray[1]-1); //nur bei mehreren select-Feldern
						}
						
 						//  wenn ein Adress-Abfrage Formular vorhanden
						form_field = eval("formular."+hilfsArray[0]);
						if (""+form_field!="undefined") {
							//existiert das Feld überhaupt
							if (""+form_field.length=="undefined") {
								//feld ist ein einfaches Input-Feld (oder ein Radio mit nur 1 Auswahlmöglichkeit)
								if (""+form_field.value != "undefined") {
									// nur wenn das Feld auch einen Wert enthält
									var form_value = form_field.value;
									if (form_value != "") {
										// argumente als Querystring zusammensetzen
										//string+= "&" + arguments[i] + "=" + form_value.replace(/([. .])/ig,"%20");
										string+= "&" + arguments[i] + "=" + escape(form_value);
										
									}
									//###Achtung, falls Radio mit 1 Auswahlmöglichkeit, wird Wert gesetzt, auch wenn man nicht draufklickt
								}
							} else {// radio, 1 select-feld oder mehrere select-felder
								if (""+form_field.type != "undefined") {// ==============> 1 Select-feld
									//###vielleicht vorher checken, ob form_field.value ex., d.h. ob überhaupt etwas ausgewählt wurde
									
									string+= "&" + hilfsArray[0] + "=" + form_field.options[form_field.selectedIndex].value.replace(/([. .])/ig,"%20");
									
								} else {//radio oder mehrere select-felder
									if (""+form_field[0].type == "radio") {// ==============> Radio (mit Auswahlmöglichkeit)
										for (var j=0; j<form_field.length;j++) {
											if (form_field[j].checked == true) 	{
												string+= "&" + arguments[i] + "=" + form_field[j].value.replace(/([. .])/ig,"%20");
											}
										}
									} else {//=========================> mehrere Select-felder
										//es wurde ein bestimmtes select-Feld ausgewählt, dessen Position nun in form_field_pos steht
										//###falls hier form_field_pos nicht > -1 ist oder NaN ist, gabs wohl'n Fehler ==> abfangen
										string+= "&" + hilfsArray[0] + "=" + form_field[form_field_pos].options[form_field[form_field_pos].selectedIndex].value.replace(/([. .])/ig,"%20");
									}
								
								}
								
								//var form_value = form_field.value;
							}
						}
					} else {
						// wenn kein Formular, dann annehmen, das die Parameter mit Wert übergeben werden
						if (arguments[i].indexOf("=") > 0) {
							string+="&" + arguments[i].replace(/([. .])/ig,"%20");
						}
					}
				}
			}
			url = "/aspe_shared/az/a-z_qrylogic2inst.asp?"+string;
			//alert(url);		//#####kommt weg
      	//if (arguments.length>i) 
			//	url+=arguments[i];
     		msg=open(url,"DisplayWindow", param);
     		msg.focus();
		}
	}
   
   
//ENTFÄLLT!!!!!   
//einzelnes schlagwort, mit möglichkeit lcv anzugeben , ansonsten wird nach area gesucht
function showInstadr() { // Aufruf: name ("Schlagwort-Text","lcv","PLZ-Bereich[optional]");
	sw=arguments[0].replace(/ /,"%20");
	if(arguments[1].length!=0)
	{
		para=arguments[1].split("$")		
	    if(para[0]=="lcv")
	 	{
		url="/asp/a-z_qry2inst_lcv.asp?sw_text="+sw+"&suchbereich="+para[1]+"&plzbereich=";
		}
	else
		{url="/asp/a-z_qry2inst.asp?sw_text="+sw+"&suchbereich="+arguments[1]+"&plzbereich=";}
  	}
	else
	 {url="/asp/a-z_qry2inst.asp?sw_text="+sw+"&suchbereich="+arguments[1]+"&plzbereich=";}
	 if (arguments.length>2) 
        url+=arguments[2];
     msg=open(encodeURI(url),"DisplayWindow", param);
     msg.focus();
   }
   
   
   //wird nirgends unter wwwroot verwendet!!!
     function showInstadr_std() { 
   		sw=arguments[0].replace(/ /,"%20");
     url="/asp/a-z_qry2inst.asp?sw_text="+sw+"&suchbereich="+arguments[1]+"&stadtteil="+arguments[2];
	
	 if (arguments.length>3) 
        url+=arguments[3];
     msg=open(encodeURI(url),"DisplayWindow", param);
     msg.focus();
   }
   
   //wird nirgends unter wwwroot verwendet!!!
      function showInstadr_okz() { 
   		sw=arguments[0].replace(/ /,"%20");
     url="/asp/a-z_qry2inst.asp?sw_text="+sw+"&suchbereich="+arguments[1]+"&"+arguments[2];
	
	 if (arguments.length>3) 
        url+=arguments[3];
     msg=open(encodeURI(url),"DisplayWindow", param);
     msg.focus();
   }
   
/* aeltere Version
function showInstadr() { // Aufruf: name ("Suchbegriff","Area","PLZ-Bereich[optional]");
    sw=arguments[0].replace(/ /,"%20");
    url="/asp/a-z_ergebnis_sw.asp?art=0&suchbegriff="+sw+"&suchbereich="+arguments[1]+"&plzbereich=";
    if (arguments.length>2) url+=arguments[2];
    msg=open(url,"DisplayWindow","resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,width=700,height=500");
    msg.focus();
}
*/

function showInstadr_offenbach() { // Aufruf: name ("Suchbegriff","Area","PLZ-Bereich[optional]");
    sw=arguments[0].replace(/ /,"%20");
    url="/asp/a-z_ergebnis_sw_offenbach.asp?art=0&suchbegriff="+sw+"&suchbereich="+arguments[1]+"&plzbereich=";
    alert(url)
	if (arguments.length>2) url+=arguments[2];
    msg=open(encodeURI(url),"DisplayWindow", param);
    msg.focus();
}
function showInstadr_aus_ort_suche() { // Aufruf: name ("Suchbegriff","Area","Ortsname[optional]");
    sw=arguments[0].replace(/ /,"%20");
	url="/asp/a-z_qry2inst.asp?sw_text="+sw+"&suchbereich="+arguments[1]+"&ortsbereich=";

	if (arguments.length>2) url+=arguments[2];
    msg=open(encodeURI(url),"DisplayWindow", param);
    msg.focus();
}
/*function showInstadr_swlogik_old() { // Aufruf: name ("Schlagwort-Text","Schlagwort-Logik","Area","PLZ-Bereich[optional]");
     sw=arguments[0].replace(/ /,"%20");
     url="/asp/a-z_qrylogic2inst.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+arguments[2]+"&plzbereich=";
    
	 if (arguments.length>3) 
        url+=arguments[3];
     msg=open(url,"DisplayWindow", param);
     msg.focus();
   }*/
   
   function showInstadr_swlogik() { // Aufruf: name ("Schlagwort-Text","Schlagwort-Logik","lcv","PLZ-Bereich[optional]");
	 sw=arguments[0].replace(/([. .])/ig,"%20");
	 //falls das 2.argument gesetzt ist, dann bearbeite es, nsonsten gehe nach der area!
	if (arguments[2].length != 0)
	 {
	 	para=arguments[2].split("$");
	 	if(para[0]=="lcv")
	 	{ 
		url="/asp/a-z_qrylogic2inst_lcv.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+para[1]+"&plzbereich=";
		}
		else
		{ 
	 url="/asp/a-z_qrylogic2inst.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+arguments[2]+"&plzbereich=";
	 }
	 }
	 else
	 { 
	 url="/asp/a-z_qrylogic2inst.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+arguments[2]+"&plzbereich=";
	
	 }

	 if (arguments.length>4) 
        url+=arguments[4];
     msg=open(encodeURI(url),"DisplayWindow", param);
     msg.focus();
   }
	
	
	function showInstadr_swlogik_sw() { // Aufruf: name ("Schlagwort-Text","Schlagwort-Logik","lcv","PLZ-Bereich[optional]");
	 sw=arguments[0].replace(/([. .])/ig,"%20");
	 //falls das 2.argument gesetzt ist, dann bearbeite es, nsonsten gehe nach der area!
	if (arguments[2].length != 0)
	 {
	 	para=arguments[2].split("$");
	 	if(para[0]=="lcv")
	 	{ 
		url="/asp/a-z_qrylogic2inst_lcv.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+para[1];
		}
		else
		{ 
	 url="/asp/a-z_qrylogic2inst.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+arguments[2];
	 }
	 }
	 else
	 { 
	 url="/asp/a-z_qrylogic2inst.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+arguments[2];
	
	 }

	 if (arguments.length>4) 
        url+=arguments[4];
     msg=open(encodeURI(url),"DisplayWindow", param);
     msg.focus();
   }

function showInstadr_aus_ort_swlogik() { // Aufruf: name ("Schlagwort-Text","Schlagwort-Logik","Area","Ortsname[optional]");
    sw=arguments[0].replace(/ /,"%20");
    url="/asp/a-z_qrylogic2inst.asp?sw_text="+sw+"&sw_logik="+arguments[1]+"&suchbereich="+arguments[2]+"&ortsbereich=";
	if (arguments.length>3) 
       url+=arguments[3];
    msg=open(encodeURI(url),"DisplayWindow", param);
    msg.focus();


}



function showOrtadr() { // Aufruf: name ("Suchbegriff","Area","PLZ-Bereich[optional]");
    ort=arguments[0].replace(/ /,"%20");
    url="/asp/dicverf/a-z_ergebnis_ort.asp?art=0&ort="+ort+"&suchbereich="+arguments[1]+"&plzbereich=";
    if (arguments.length>2) url+=arguments[2];
    msg=open(encodeURI(url),"DisplayWindow", param);
    msg.focus();
}

var NS4, IE4;
    NS4 = (document.layers);
    IE4 = (document.all);
var msg = null;

function loadWin() {        // Aufruf: loadWin ( URL [, breite [,höhe] ]  )
    var url = spendenRedirect( arguments[0] );
    var typ;
    var xwidth = 650;
    var ywidth = 400;
    if (arguments.length>0) {
        xwidth = arguments[1]
    }
    if (arguments.length>1) {
        ywidth = arguments[2]
    }
    params=std_param + ",width="+xwidth+",height="+ywidth
    if (msg != null) {
        if (!msg.closed) {
            msg.location.replace(encodeURI(url));
            msg.focus();
        } else {
            msg = window.open(encodeURI(url),"msg",params);
            msg.focus();
        }
    } else {
        msg = window.open(encodeURI(url),"msg",params);
        msg.focus();
    }
}

function spendenRedirect(url) {
  var ret = url.replace(/https:\/\/www.caritas.de\/aspe_shared\/spenden\/spenden.asp/, "/aspe_shared/spenden/spenden_redirect.asp");
  return ret
}

function newwin(page,breite,hoehe,scroll)
{
params="resizable=1,status=0,scrollbars="+scroll+",toolbar=0,location=0,directories=0,menubar=0,width="+breite+",height="+hoehe+"";
msg=open(encodeURI(page),"Caritas",params);
if (navigator.appName =="Netscape" && navigator.appVersion.substring(0,1)>=3)
{msg.focus()}
}


/* *****
 *
 *   http://www.accessify.com/tools-and-wizards/pop-up-window-generator.asp
 *   Use the tool below to quickly generate links to pop-up windows that are
 *   both accessible and XHTML compliant.
 *   For background information on this tool, read the Perfect Pop-Up article
 *   on this site: http://www.accessify.com/tutorials/the-perfect-pop-up.asp .
 *
 *  Usage: <a href="www.caritas.de" target="popUpWin" onclick="popUpWin(this.href,'standard',700,500);return false;">Link text goes here</a>
 ******** */
var newWindow = null;
function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	closeWin();
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}

	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	if (type == "cvulm_beratung") tools="resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+"";
  if (type == "dicvaug_beratung") tools="resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+"";
	
	newWindow = window.open(encodeURI(url), 'newWin', tools);
	newWindow.focus();
}

/*******************************************
 *
 *
 *
 *******************************************/
 
/*
script language="javascript">if(typeof(sethomedicvber)=="function")sethomedicvber();</script
*/ 
function sethome(url){
  document.write(startseite(url, 'startseite_caritas.gif'));
}
function sethomecarinet(){
  document.write(startseite('http://www.carinet.de', 'startseite_carinet.gif'));
}
function sethomedicvber(){
  document.write(startseite('http://www.caritas-berlin.de', 'startseite_dicvber.gif'));
}
function startseite(url, img){
  var ausgabe = "";
  if (navigator.userAgent.indexOf("Opera") == -1) {
    if (navigator.appName.indexOf("Explorer") != -1){
      ausgabe = '<a href="#" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\''+url+'\');return false;"><img src="/shared/images/'+img+'" border="0" vspace="5"></a>';
    } else if (navigator.userAgent.indexOf("compatible") == -1) {
      //ausgabe = '<a href="javascript:nf430(\'/static/startseite/anleitung.html\');"><img src="/static/startseite/nav_startseite_120x30.gif" width="120" height="30" border="0" vspace="5"><\/a>';
    }
    return ausgabe;}
}

//-------------------------------------------------------------------
//  Popup Caritas in Deutschland
//------------------------------------------------------------------- 
function depopup()
{
params="resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,width=430,height=330";
msg=open("/shared_data/caritas_data/pulltop.htm","Chat",params);
if (navigator.appName =="Netscape" && navigator.appVersion.substring(0,1)>=3)
{msg.focus()}
}
//------------------------------------------------------------------- 
//------------------------------------------------------------------- 
