var browserName = navigator.appName;
var browserUserAgent = navigator.userAgent;
//var browserTyp = "veraltet";
var browserTyp = "aktuell"; 

// if ((browserUserAgent.indexOf("Firefox") != -1) || (browserUserAgent.indexOf("Netscape") != -1) || (browserUserAgent.indexOf("SeaMonkey") != -1) || (browserUserAgent.indexOf("MSIE 7.0") != -1))
if (browserUserAgent.indexOf("MSIE 6.0") != -1)
{
	browserTyp = "veraltet";
}


function euro()
{
	if(document.all){return "€";}else{return "Eur";}
}


function cv2name(a)
{
	var a=a.toLowerCase();

	if (a.indexOf("ä") != -1){a=a.substr(0,a.indexOf("ä")) + "ae" + a.substr(a.indexOf("ä")+6);}
	if (a.indexOf("ö") != -1){a=a.substr(0,a.indexOf("ö")) + "oe" + a.substr(a.indexOf("ö")+6);}
	if (a.indexOf("ü") != -1){a=a.substr(0,a.indexOf("ü")) + "ue" + a.substr(a.indexOf("ü")+6);}
	if (a.indexOf("Ä") != -1){a=a.substr(0,a.indexOf("Ä")) + "ae" + a.substr(a.indexOf("Ä")+6);}
	if (a.indexOf("Ö") != -1){a=a.substr(0,a.indexOf("Ö")) + "oe" + a.substr(a.indexOf("Ö")+6);}
	if (a.indexOf("Ü") != -1){a=a.substr(0,a.indexOf("Ü")) + "ue" + a.substr(a.indexOf("Ü")+6);}
//	if (a.indexOf("ä") != -1){a=a.substr(0,a.indexOf("ä")) + "ae" + a.substr(a.indexOf("ä")+1);}
//	if (a.indexOf("ö") != -1){a=a.substr(0,a.indexOf("ö")) + "oe" + a.substr(a.indexOf("ö")+1);}
//	if (a.indexOf("ü") != -1){a=a.substr(0,a.indexOf("ü")) + "ue" + a.substr(a.indexOf("ü")+1);}
	
	return a;
}


function timerCheck(version)
{				
	var TopPos_a;  
    var NavHoehe=document.body.offsetHeight;
    var TopPos_a_scroll=document.body.scrollTop;
    var TopPos_b;
	var TopPos_c;
    
    TopPos_a = document.all.anzeige.offsetTop;
    parentObj=anzeige.offsetParent;
    while(parentObj != null) {TopPos_a+=parentObj.offsetTop;parentObj=parentObj.offsetParent}
                          
    TopPos_b=TopPos_a-TopPos_a_scroll;
	TopPos_c=TopPos_a-TopPos_b
    
    if (version == "2")
    {
	    if ((TopPos_a_scroll = TopPos_c) && (TopPos_a_scroll >= 0))
	    {
	        document.all.anzeige.className="box2"; 
	    }
	    else
	    {
	        document.all.anzeige.className="boxfest2";  
	    }
    }
}
 								  
 
function drucken(welche_box)
{

	y = "<html><head><title>"
	y = y + document.title+"</title><link href='/ra-micro/css/standard.css' rel='stylesheet' type='text/css'></head><body>"
	y = y + "<p style='margin-left:10pt'><br><a class='news' class='blau9' href='javascript:window.close()'>Fenster schließen</a>     ";
	y = y + "<a class='news' href='javascript:window.print();'><img src='/ra-micro/images/drucker.gif' border='0' width='20' height='12' alt='Drucken'>Drucken</a></p><p>&nbsp;</p>";
	y = y + "<div style='margin-left:10pt;margin-right:10pt'";
	y = y + document.getElementById('druck').innerHTML;
	y = y + "</div>";
	y = y + "<p>&nbsp;</p><p style='margin-left:10pt'><a class='news' href='javascript:window.close()'>Fenster schließen</a>     ";
	y = y + "<a class='news' href='javascript:window.print();'><img src='/ra-micro/images/drucker.gif' border='0' width='20' height='12' alt='Drucken'>Drucken</a></p></p></body></html>";

	box = new Array();
	box["Druckversion"] = new Array();
	box["Druckversion"]["URL"] = '';
	box["Druckversion"]["Fenstername"] = 'Druckversion';
	box["Druckversion"]["Fenstereigenschaften"] = 'height=650,width=800,resizable=no,scrollbars=yes';
	box["Druckversion"]["Inhalt"] = y;
	
	var Fenster = window.open(box['Druckversion']["URL"],box['Druckversion'] ["Fenstername"],box['Druckversion']["Fenstereigenschaften"]);
	
	with (Fenster.document)
	{
		open();
		if (box['Druckversion']["Inhalt"]) write(box['Druckversion']["Inhalt"]);
		close();
	}							  
}


function suchmaskeanzeigen(suchmaske)
{
	document.getElementById(suchmaske).style.visibility='visible';
	document.eing_suche.sucheingabe.focus();	
}


function suchmaskeweg(suchmaske)
{
	document.getElementById(suchmaske).style.visibility='hidden';
}


function EMailpruefung(s)
{
	var a = false;
	var res = false;
	if(typeof(RegExp) == 'function')
	{
  		var b = new RegExp('abc');
  		if(b.test('abc') == true){a = true;}
  	}
 	if(a == true)
 	{
  		reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)(\\@)([a-zA-Z0-9\\-\\.]+)(\\.)([a-zA-Z]{2,4})$');
 		res = (reg.test(s));
	}
 	else
 	{
  		res = (s.search('@') >= 1 && s.lastIndexOf('.') > s.search('@') && s.lastIndexOf('.') >= s.length-5)
 	}
 	return(res);
}


function bspruefen(downloadlink)
{
	var downloadlink=downloadlink;
	var platform=navigator.userAgent;

	if ((platform.indexOf("Windows NT 5.1") == -1) && (platform.indexOf("Win NT 5.1") == -1) && (platform.indexOf("Windows NT 5.0") == -1) && (platform.indexOf("Win NT 5.0") == -1))
	{
		alert("Bei dem Betriebssystem dieses PC handelt es sich weder um Windows XP noch Windows 2000. Das Programm, das Sie downloaden wollen, kann auf diesem PC nicht installiert werden.");
	}
	
	document.location.href=downloadlink;
}


var box=0;

function fenster(wo, hoehe, breite, scroll, wie)
{
	if(box){if(!box.closed){box.close();}}
	if(hoehe==0 || hoehe == null){hoehe = 145;}
	if(breite == 0 || breite == null){breite = 395;}
	
	var ie = true;
	if(document.layers){ie = false;}
	
	var scrollen = "no";
	if(scroll == null){var scroll = false;}
	if(scroll){scrollen = "yes";}
	var anpassen;
	(ie)?anpassen="resizeable=":anpassen="resizable=";
	(scroll)?anpassen+="yes":anpassen+="no";
	
	if(wie == null){var wie = 0;}
	var hoch=parseInt(screen.height/2-(hoehe/2))+1;
	if(hoch < 0){hoch = 1;}
	
	var x = 150;
	var y = 150;
	
	if(wie == 1)
	{
	   x = parseInt(screen.width/2-(breite/2));
	   y = hoch;
	}
	
	box=open(wo,"ramicro","left="+x+",top="+y+",alwaysRaised=yes,menubar=no,toolbar=no,location=no,status=no,"+anpassen+",scrollbars="+scrollen+",width="+breite+",height="+hoehe, false);
	
	//box.document.location.href=wo;
	//box.location.href=wo;
	
	box.focus();
}

function blinker(Element,Zeit) 
{
	if(document.getElementById(Element).style.visibility != "hidden") 
	{
		document.getElementById(Element).style.visibility = "hidden";
	} 
	else 
	{
		document.getElementById(Element).style.visibility = "visible";
	}

	window.setTimeout("blinker('" + Element + "'," + Zeit + ")", Zeit);
}

function kopieren(ZuKopieren)
{
    if(document.all)
    {
	    document.getElementById("nichtzusehen").value=ZuKopieren;
	    var rng=document.getElementById("nichtzusehen").createTextRange();
//	    rng.select();
//	    document.execCommand("Copy");
		window.clipboardData.setData("Text",rng.text);
	 }
}

function windowOpen(DATEI,VOLLBILD)
{
	var monitorHoehe = screen.availHeight-5;
	var monitorBreite = screen.availWidth-5;
	
	if(VOLLBILD == 1)
	{
		window.open(DATEI,'muster','location=no, scrollbars=yes,sizeable=yes,left=0,top=0,height='+monitorHoehe+',width='+monitorBreite);
	}
	else
	{
		window.open(DATEI,'muster','location=no,scrollbars=yes,resizable=yes,left='+((monitorBreite/2)-400)+',top='+((monitorHoehe/2)-325)+',height=768,width=1024');
	}
}

function diashow(zaehler, anzahl, PFAD, BILD){
	if(zaehler == 0){
		zaehler = Math.round((Math.random()*(anzahl-1))+1);
	}
	document.getElementById(BILD).src = PFAD+zaehler+".jpg";
	document.getElementById(BILD).title = "Bild "+zaehler+" von "+anzahl;
	window.status = "Diashow: Bild "+zaehler+" von "+anzahl;
	if(zaehler < anzahl){
		zaehler = zaehler + 1;
		}
	else{
		zaehler = 1;
		}
	setTimeout("diashow("+zaehler+", "+anzahl+", '"+PFAD+"', '"+BILD+"')", 5000);
	}

function newserweitern()
{
	document.getElementById('newsdiv').height = "700px";
	document.getElementById('newskasten').height = "600px";
	document.getElementById('newsaufklappen').style.visibility="hidden";
	document.getElementById('newsaufklappen').style.display="none";
	document.getElementById('newszuklappen').style.visibility="visible";
	document.getElementById('newszuklappen').style.display="inline";
}	

function newsverkleinern()
{
	document.getElementById('newsdiv').height = "214px";
	document.getElementById('newskasten').height = "224px";
	document.getElementById('newsaufklappen').style.visibility="visible";
	document.getElementById('newsaufklappen').style.display="inline";
	document.getElementById('newszuklappen').style.visibility="hidden";
	document.getElementById('newszuklappen').style.display="none";
}	

// Film-Links/Grafiken
		function MM_preloadImages() { //v3.0
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}
		
		function MM_swapImgRestore() { //v3.0
		  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
		}
		
		function MM_findObj(n, d) { //v4.01
		  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		  if(!x && d.getElementById) x=d.getElementById(n); return x;
		}
		
		function MM_swapImage() { //v3.0
		  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
		}

function newwindow(URL,NAME,BREITE,HOEHE,TOP,LEFT)
//Diese Funktion (openwindow) öffnet ein separates Fenster.
{
if (isNaN(TOP+0) == true){
	TOP = (screen.height/2)-(HOEHE/2)
	}
if (isNaN(LEFT+0) == true){
	LEFT = (screen.width/2)-(BREITE/2)
	}
var neuesfenster = window.open(URL,NAME,"menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=yes,width=" + BREITE + ",height=" + HOEHE + ",left=" + LEFT + ",top=" + TOP);
neuesfenster.focus();
}
