
var index = 0;
var fehlermeldung;

var text1 = new Array(); //Fehlermeldungen Deutsch
text1[0] = "Das Feld ist nicht ausgef&uuml;llt.&nbsp;&nbsp;";
text1[1] = "OK&nbsp;&nbsp;";
text1[2] = "Email-Adresse ist nicht g&uuml;lltig.&nbsp;&nbsp;";
text1[3] = "Bitte f&uuml;llen Sie die Felder korrekt aus.";

var text2 = new Array(); //Fehlermeldungen English
text2[0] = "Field is empty.";
text2[1] = "OK";
text2[2] = "Emailaddress is not valid.&nbsp;&nbsp;";
text2[3] = "Please fill in all the fields.";

var ebene1 = "result1";
var ebene2 = "result2";
var ebene3 = "result3";
var senden = 0;


function get_error(act_lang,index){
	
	if (act_lang == 'de'){
   		fehlermeldung = text1[index];
   		}
	else {
   		fehlermeldung = text2[index];
 		}
 }// END FUNCTION


function chkFormular(object,act_lang) {

//alert(act_lang);
 
 if (object == document.formular.email_sender){
   
    if (object.value != "") {
      if ((object.value.indexOf("@") != -1) && (object.value.indexOf(".")!=-1)) {
     
     	var index = 1;
     	get_error(act_lang,index);
     	 Einblenden(ebene1,fehlermeldung);
     	senden = 1;
      }
      else {
     	var index = 2;
     	get_error(act_lang,index);
        Einblenden(ebene1,fehlermeldung);
     	senden = 0;
      }
    }  
   else{
   	 var index = 0;
     get_error(act_lang,index);
     Einblenden(ebene1,fehlermeldung);
     senden = 0;
    }   	 
}
 if (object == document.formular.benutzername){
	
	if (object.value == "") {
      var index = 0;
      get_error(act_lang,index);
       Einblenden(ebene2,fehlermeldung);
     // senden = 0;
     }
    else{
      var index = 1;
      get_error(act_lang,index);
      Einblenden(ebene2,fehlermeldung);
      //senden = 1;
   }
 }
} //Function End

function Einblenden(ebene,fehlermeldung) {
	
	document.getElementById(ebene).style.visibility = "visible";
   	document.getElementById(ebene).innerHTML = fehlermeldung;

}// END FUNCTION


function checkSubmit(act_lang){
      
     if (senden == 1){
      Einblenden(ebene3,text1[1]);
      document.formular.submit(); 
     } 
     else{
      var index = 3;
      get_error(act_lang,index);
     Einblenden(ebene3,fehlermeldung); 
     }     
  
} // Function End



function open_popup_horiz(id, lang, filename, bvid, alt, diashowindex) {	
	diashowindex = parseInt(diashowindex) + 1;
	loc = filename + '?templ=pub_popup_horiz.tpl&cont=' + id + '&lang=' + lang + '&Bv_ID=' + bvid + '&Alttext=' + alt + '&start=' + diashowindex;
	
	window_id = 'popup_' + id;
	
	width = 520;
	height = 700;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,left=' + winLeft + ',top=' + winTop;
	
	window.open(loc, window_id, window_options);
}

function open_popup_vertikal(id, lang, filename, bvid, alt, diashowindex) {
	diashowindex = parseInt(diashowindex) + 1;
	loc = filename + '?templ=pub_popup_vertikal.tpl&cont=' + id + '&lang=' + lang + '&Bv_ID=' + bvid + '&Alttext=' + alt+ '&start=' + diashowindex;
	
	window_id = 'popup_' + id;
	
	width = 620;
	height = 740;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,left=' + winLeft + ',top=' + winTop;
	
	window.open(loc, window_id, window_options);
}

/*
function open_popup_tour2(id, lang, filename, bvid) {
	//diashowindex = parseInt(diashowindex) + 1;
	loc = filename + '?templ=pub_popup_tour.tpl&cont=' + id + '&lang=' + lang + '&Bv_ID=' + bvid ;
	
	window_id = 'popup_' + id;
	
	width = 700;
	height = 740;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,left=' + winLeft + ',top=' + winTop;
	
	window.open(loc, window_id, window_options);
}
*/

function open_popup_list(lang,filename,type) {
	loc = filename + '?templ=pub_popup_list.tpl&lang=' + lang + '&type=' + type;	
	width = 520;
	height = 700;	
	window_options = 'width=' + width + ',height=' + height + ',left=0,top=0,scrollbars=yes,resizable=yes';	
	window.open(loc, 'popup_list', window_options);	
}

function open_popup_tour(url) {
	loc = url;
	width = 700;
	height = 700;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',left=' + winLeft + ',top=' + winTop+ ',left=0,top=0,scrollbars=no,resizable=no';
	window.open(loc, 'channel_info', window_options);
}

function open_popup_loginPic(url) {
	loc = url;
	width =330;
	height = 410;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',left=' + winLeft + ',top=' + winTop+ ',left=0,top=0,scrollbars=no,resizable=no';
	window.open(loc, 'channel_info', window_options);
}

function open_popup_video(id,lang) {
    loc = 'index.php?templ=pub_popup_video.tpl&id=' + id;
//	loc = url;
 //23.01.2008
	width =528;
	height = 520;
	//width =850;
	//height = 800;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',left=' + winLeft + ',top=' + winTop+ ',left=0,top=0,scrollbars=no,resizable=no';
	window.open(loc, 'channel_info', window_options);
}

function open_popup_channel_info(url) {
	loc = url;
	width = 300;
	height = 300;
	winLeft = (screen.width - width) / 2;
	winTop = (screen.height - (height + 110)) / 2;
	window_options = 'width=' + width + ',height=' + height + ',left=' + winLeft + ',top=' + winTop;
	window.open(loc, 'channel_info', window_options);
}

/* Funktionen zum bildtausch in horiz. Navigation */

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];}
}