//  ----------------------------------------
//  POP UP
//  ----------------------------------------

var newwindow = '';

function popitup(url,url_name) {
	
if (newwindow.location && !newwindow.closed) {
	newwindow.close();
 	newwindow=window.open('','htmlname','width=1,height=1,resizable=0');
	newwindow.document.write ('<html><head><title>Gasthof Post Trens   '+url_name+'</title><SCRIPT LANGUAGE="JavaScript">');
	newwindow.document.write ('function resizer() {');
	newwindow.document.write ('windowWidth=pix.width+30;');
	newwindow.document.write ('windowHeight=pix.height+50;');
	newwindow.document.write ('windowLeft = (screen.availWidth / 2) - (windowWidth / 2);');
	newwindow.document.write ('windowTop = (screen.availHeight / 2) - (windowHeight / 2);');
	newwindow.document.write ('window.resizeTo(windowWidth,windowHeight+55);');
	newwindow.document.write ('window.moveTo(windowLeft,windowTop);}');
	newwindow.document.write ('</SCRIPT></head>');
	newwindow.document.write ('<body topmargin="0" leftmargin="0">');
	newwindow.document.write ('<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td width="100%" valign="middle" align="center" height="100%"><img id="pix" name="pix" style="border: 1 solid #FFFFFF" src="'+url+'"  onLoad="setTimeout(\'resizer()\',500)"></td></tr><td align="right"><a href="javascript:self.close();"><img border="0" src="close_d.png" width="150" height="17"></a></td>');
	newwindow.document.write ('</tr></table></body></html>');
	newwindow.focus();

} 

else { 
    	newwindow=window.open('','htmlname','width=1,height=1,resizable=0');
	newwindow.document.write ('<html><head><title>Gasthof Post Trens   '+url_name+'</title><SCRIPT LANGUAGE="JavaScript">');
	newwindow.document.write ('function resizer() {');
	newwindow.document.write ('windowWidth=pix.width+30;');
	newwindow.document.write ('windowHeight=pix.height+50;');
	newwindow.document.write ('windowLeft = (screen.availWidth / 2) - (windowWidth / 2);');
	newwindow.document.write ('windowTop = (screen.availHeight / 2) - (windowHeight / 2);');
	newwindow.document.write ('window.resizeTo(windowWidth,windowHeight+55);');
	newwindow.document.write ('window.moveTo(windowLeft,windowTop);}');
	newwindow.document.write ('</SCRIPT></head>');
	newwindow.document.write ('<body topmargin="0" leftmargin="0">');
	newwindow.document.write ('<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td width="100%" valign="middle" align="center" height="100%"><img id="pix" name="pix" style="border: 1 solid #FFFFFF" src="'+url+'"  onLoad="setTimeout(\'resizer()\',500)"></td></tr><td align="right"><a href="javascript:self.close();"><img border="0" src="close_d.png" width="150" height="17"></a></td>');
	newwindow.document.write ('</tr></table></body></html>');
	newwindow.focus();
	
}
}

function tidy() {
if (newwindow.location && !newwindow.closed) { 
   newwindow.close(); } 
}

//  ----------------------------------------
//  Send Page
//  ----------------------------------------

function sendpage()
{
mail_str = "mailto:?subject=Seminario Maggiore di Bressanone";
mail_str += "&body=Buon giorno,%0A%0AConsgilio questo sito molto interessante:%0A"+location.href;
mail_str += "%0A%0ASeminario Maggiore di Bolzano/Bressanone%0Adella Diocesi di Bolzano/Bressanone - Alto Adige%0A%0A%0Ahttp://www.seminario-bressanone.it";
location.href = mail_str;
}

//  ----------------------------------------
//  Form Checker
//  ----------------------------------------

ceerrormess=new Array();
ceerrormess[0]="ACHTUNG: Dieses Feld ist ein Pflichtfeld!";				
ceerrormess[1]="ACHTUNG: Bitte eine gültige Email-Adresse eingeben!";			
ceerrormess[2]="ACHTUNG: Bitte lesen Sie unsere AGBs durch!";

function fehlermeldung(fehlerid){
	alert(ceerrormess[fehlerid]);
}
function checkeingabe(dasformular){
	var dieform=document.getElementsByName(dasformular);
	//alert(dieform[0].length);
	for (i=0; i<dieform[0].length; i++){
		var dasfelement=dieform[0][i];
		if (dasfelement.attributes.inputrequired){
			var inpreq=dasfelement.attributes.inputrequired.value.toLowerCase();
			if (dasfelement.attributes.derorigstyleborder) {
				dasfelement.style.border=dasfelement.attributes.derorigstyleborder.value;
			}
			if (inpreq=="true" || inpreq=="1"){
				if (dasfelement.value==""){
					var dasfelementstyleborder=dasfelement.style.border;
					dasfelement.setAttribute("derorigstyleborder",dasfelement.style.border);
					dasfelement.style.border='2px solid darkgreen';
					dasfelement.focus();
					fehlermeldung(0);
					return false;
				}
			}else if(inpreq=="email"){
				if ((dasfelement.value.indexOf("@")==-1)||(dasfelement.value.indexOf(".")==-1)||(dasfelement.value.length < 7)){
					var dasfelementstyleborder=dasfelement.style.border;
					dasfelement.setAttribute("derorigstyleborder",dasfelement.style.border);
					dasfelement.style.border='2px solid darkgreen';
					dasfelement.focus();
					fehlermeldung(1);
					return false;
				}
			}else if(inpreq=="agb"){
				if (!dasfelement.checked){
					var dasfelementstyleborder=dasfelement.style.border;
					dasfelement.setAttribute("derorigstyleborder",dasfelement.style.border);
					dasfelement.style.border='2px solid darkgreen';
					dasfelement.focus();
					fehlermeldung(2);
					return false;
				}
			}
		}
	}
}

function tidy() {
if (newwindow.location && !newwindow.closed) { 
   newwindow.close(); } 
}

