/************* ieBlur() **************/

function ieBlur() {
	
	window.defaultStatus="Arche Warder e.V.";
	
	if (document.images&&navigator.userAgent.indexOf("MSIE")!=-1){
		
		for (i=0;i<document.links.length;i++) {
		
			target=eval("document.links[i]")
			target.onfocus=keinRahmen
		
		} // for
	
	} // if

}

function keinRahmen(){

	obj=window.event.srcElement
	if(obj.tagName == "A"||obj.tagName=="AREA") obj.blur()

} // ieBlur


/************* flip() **************/

function flip(ziel,bild) {

	document.images[ziel].src = eval(bild +".src")

} // flip

/************* fliptext() **************/

function fliptext(text) {

	window.status = text;
	return true;

} // fliptext


/************* goIntern() **************/

function goIntern(url) {
	
	opener.location.href=url;

} // showPortrait



/************* petDaddy() **************/

function petDaddy(id) {
	
	if (id!="") {
	
		opener.location.href="tiere_pate_werde.php?id="+id;
		self.close();
	
	} // id
	
} // showPortrait


/************* getPortrait() **************/

function getPortrait() {
	
	id=document.formular["tiere"].options[document.formular["tiere"].options.selectedIndex].value;
	url="tiere_portrait.php?id="+id;
	
	if (id!="" && id!="undefined") {
	
		ansicht = window.open(url,"portrait","width=530,height=530,scrollbars=yes,toolbar=no,dependent=yes,resizable=no,top=50,left=300");
		ansicht.focus();
	
	} // if

} // getPortrait


function getPortrait2(feld) {
	
	id=document.tierform[feld].options[document.tierform[feld].options.selectedIndex].value;
	url="tiere_portrait.php?id="+id;
	
	if (id!="" && id!="undefined") {
	
		ansicht = window.open(url,"portrait","width=530,height=530,scrollbars=yes,toolbar=no,dependent=yes,resizable=no,top=50,left=300");
		ansicht.focus();
	
	} // if

} // getPortrait


/************* showPortrait() **************/

function showPortrait(id) {
	
	url=(id!=0)?"tiere_portrait.php?id="+id:"tiere_portrait.php";
	
	ansicht = window.open(url,"portrait","width=530,height=530,scrollbars=yes,toolbar=no,dependent=yes,resizable=no,top=50,left=300");
	ansicht.focus();

} // showPortrait


/************* showPicture() **************/

function showPicture(id,b,h) {
	
	lpos=(b>300)?400:600;
	
	bildansicht=window.open("tiere_bildanzeige.php?id="+id,"tierbild","width="+b+",height="+h+",scrollbars=no,toolbar=no,dependent=yes,resizable=no,top=50,left="+lpos);
	bildansicht.resizeTo(b,h);
	bildansicht.focus();

} // showPortrait

/************* getURL() **************/

function getURL(feld) {
	
	if (feld!="" && feld!="undefined") {
	
		url=document.formular[feld].options[document.formular[feld].options.selectedIndex].value;
		if (url!="" && url!="undefined") document.location.href=url;
		
	} // if feld

} // getURL


function getURL2(feld) {
	
	if (feld!="" && feld!="undefined") {
		
		url=document.tierform[feld].options[document.tierform[feld].options.selectedIndex].value;
		if (url!="" && url!="undefined") document.location.href=url;
		
	} // if feld

} // getURL

/************* rundgang() **************/

function rundgang() {

	ansicht = window.open("besucher_rundgang.html","rundgang","width=500,height=500,scrollbars=no,toolbar=no,dependent=yes,resizable=no");
	ansicht.focus();

} // tierportrait


/************* seitenanfang() **************/

function seitenanfang() {

	window.scrollTo(0,0);

} // seitenanfang 


/********** empfehlen() **********/

function empfehlen(){

	url=document.location.href;
			
	if (url!="" && url!="undefined") {
	
	buddy = window.open("empfehlung.php?url="+url,"empfehlung","width=400,height=500,menubar=no,scrollbars=no,location=no,toolbar=no,ubar=no,resizable=no,dependent=yes,top=100,left=100");
	buddy.focus();
	
	} // if

} // empfehlen


/********** antidrecksmail **********/

arrEmails=new Array();
arrEmails["info"]="101/100/46/114/101/100/114/97/119/45/101/104/99/114/97/64/111/102/110/105/58/111/116/108/105/97/109";
arrEmails["info2"]="101/100/46/114/101/100/114/97/119/45/101/104/99/114/97/64/111/102/110/105/58/111/116/108/105/97/109";
arrEmails["fandrey"]="101/100/46/114/101/100/114/97/119/45/101/104/99/114/97/64/121/101/114/100/110/97/102/58/111/116/108/105/97/109";
arrEmails["laing"]="101/100/46/114/101/100/114/97/119/45/101/104/99/114/97/64/103/110/105/97/108/58/111/116/108/105/97/109";
arrEmails["kopte"]="101/100/46/114/101/100/114/97/119/45/101/104/99/114/97/64/101/116/112/111/107/58/111/116/108/105/97/109";


function revString(text) {

	if (text!="") {
		
		wert="";
		
		arrWert=text.split("/");
			
		for (i=arrWert.length-1;i>=0;i--) wert+=String.fromCharCode(eval(arrWert[i]));
		
		return wert;
		
	} // if

} // revString


function eMail(linkID){

	if (linkID && arrEmails[linkID]!="") document.getElementById(linkID).href=revString(arrEmails[linkID]);

} // eMail


/*********** newsletter **********/

function clickmail(x) {
		
	email=document.newsform["newsletter"].value;
		
if (x) {

	if (email==document.newsform["newsletter"].defaultValue) document.newsform["newsletter"].value="";

} else {

	if (email=="") document.newsform["newsletter"].value=document.newsform["newsletter"].defaultValue;

} // else

} // function

function checkmail() {
     
    email=document.newsform["newsletter"].value;
    
	if (email==document.newsform["newsletter"].defaultValue || !isEmail(email)) return false;
	else return true;

} // function
