// MyVisana Login
function checkLogin()
{
	return (document.Form1.userID.value != "");
}

// 2 Seiten öffnen (Geschäftsbericht)
function ZweiSeiten()
{
window.location.href ("/fr/visana/ueber_uns/geschaeftsbericht.html");
window.open ("/fr/visana/ueber_uns/geschaeftsbericht_2009.html","Fenster2");
}


// BMI Berechnen
function Addition(Gewicht, Groesse) {
  var Ergebnis = Math.round(Gewicht / ((Groesse/100)*(Groesse/100))*100)/100;
  document.write(Ergebnis)
}



//BMI Resultat
var Params = window.location.search;
		// Beginn der Parameter Suchen
		var strGewicht = Params.substring(Params.indexOf('Gewicht='));
		var strGroesse = Params.substring(Params.indexOf('Groesse='));
		// Vorsichtshalber ein Ampersand erg&auml;nzen, da Reihenfolge der &Uuml;bermittlung unklar ist
		strGewicht = strGewicht + '&';
		strGroesse = strGroesse + '&';
		var Gewicht = strGewicht.substring(8, strGewicht.indexOf('&'));
		var Groesse = strGroesse.substring(8, strGroesse.indexOf('&'));
		var Ergebnis = Math.round(Gewicht / ((Groesse/100)*(Groesse/100))*100)/100;




// Formularfelder kontrollieren
function validate() {
if (document.form.arbeitgeber_verband && document.form.arbeitgeber_verband.value=="") {
alert("Veuillez indiquer votre EMPLOYEUR/ASSOCIATION!");
return false;
}
if (document.form.gueltig_ab_neu && document.form.gueltig_ab_neu.value=="") {
alert("Veuillez indiquer la DATE DE VALIDITE!");
return false;
}
if (document.form.adresse && checkRadioEinzeln(document.form.adresse)==false) { 
alert("Veuillez choisir le GENRE DE CHANGEMENT!");
return false; 
}
if (document.form.maedchen_knabe && checkRadioEinzeln(document.form.maedchen_knabe)==false) { 
alert("Veuillez choisir le SEXE de l'enfant!");
return false; 
}
if (document.form.vorname_baby && document.form.vorname_baby.value=="") {
alert("Veuillez indiquer le PRENOM DU BEBE!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_DateOfBirth_baby && document.form.Ecom_ShipTo_Visana_DateOfBirth_baby.value=="") {
alert("Veuillez indiquer la DATE DE NAISSANCE du b&eacute;b&eacute;!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_Company_Name && document.form.Ecom_ShipTo_Visana_Company_Name.value=="") {
alert("Veuillez indiquer le NOM DE L'ENTREPRISE!");
return false;
}
if (document.form.Ecom_ShipTo_Postal_Name_Prefix && checkRadioEinzeln(document.form.Ecom_ShipTo_Postal_Name_Prefix)==false) { 
alert("Veuillez choisir le TITRE!");
return false; 
}
if (document.form.Ecom_ShipTo_Postal_Name_Last && document.form.Ecom_ShipTo_Postal_Name_Last.value=="") {
alert("Veuillez indiquer votre NOM!");
return false;
}
if (document.form.Ecom_ShipTo_Postal_Name_Last_Kontakt && document.form.Ecom_ShipTo_Postal_Name_Last_Kontakt.value=="") {
alert("Veuillez indiquer le NOM DE LA PERSONNE DE CONTACT!");
return false;
}
if (document.form.Ecom_ShipTo_Postal_Name_First && document.form.Ecom_ShipTo_Postal_Name_First.value=="") {
alert("Veuillez indiquer votre PRENOM!");
return false;
}
if (document.form.Ecom_ShipTo_Postal_Name_First_Kontakt && document.form.Ecom_ShipTo_Postal_Name_First_Kontakt.value=="") {
alert("Veuillez indiquer le PRENOM DE LA PERSONNE DE CONTACT!");
return false;
}
if (document.form.user_id && document.form.user_id.value=="") {
alert("Veuillez indiquer le votre USER-ID!");
return false;
}
if (document.form.visana_versichert && checkRadioEinzeln(document.form.visana_versichert)==false) { 
alert("Veuillez choisir si vous êtes ASSURE/E A LA VISANA!");
return false; 
}
if (document.form.Ecom_ShipTo_Visana_DateOfBirth && document.form.Ecom_ShipTo_Visana_DateOfBirth.value=="") {
alert("Veuillez indiquer votre DATE DE NAISSANCE!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_DateOfBirth_baby_termin && document.form.Ecom_ShipTo_Visana_DateOfBirth_baby_termin.value=="") {
alert("Veuillez indiquer la DATE DE NAISSANCE PREVUE du b&eacute;b&eacute;!");
return false;
}
if (document.form.Unfalldeckung && checkRadioEinzeln(document.form.Unfalldeckung)==false) { 
alert("Veuillez choisir le RISQUE D'ACCIDENT!");
return false; 
}
if (document.form.Ecom_ShipTo_Postal_Street_Line1 && document.form.Ecom_ShipTo_Postal_Street_Line1.value=="") {
alert("Veuillez indiquer votre ADRESSE!");
return false;
}
if (document.form.Ecom_ShipTo_Postal_PostalCode && document.form.Ecom_ShipTo_Postal_PostalCode.value=="") {
alert("Veuillez indiquer votre NPA!");
return false;
}
if (document.form.Ecom_ShipTo_Postal_City && document.form.Ecom_ShipTo_Postal_City.value=="") {
alert("Veuillez indiquer votre DOMICILE!");
return false;
}
if (document.form.strasse_neu && document.form.strasse_neu.value=="") {
alert("Veuillez indiquer votre NOUVELLE ADRESSE!");
return false;
}
if (document.form.plz_neu && document.form.plz_neu.value=="") {
alert("Veuillez indiquer votre NOUVEAU NPA!");
return false;
}
if (document.form.wohnort_neu && document.form.wohnort_neu.value=="") {
alert("Veuillez indiquer votre NOUVEAU LIEU DE DOMICILE!");
return false;
}
if (document.form.Ecom_ShipTo_Telecom_Phone_Number && document.form.Ecom_ShipTo_Telecom_Phone_Number.value=="") {
alert("Veuillez indiquer votre NUMERO DE TELEPHONE PRIVE!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_Phone_Number_Office && document.form.Ecom_ShipTo_Visana_Phone_Number_Office.value=="") {
alert("Veuillez indiquer votre NUMERO DE TELEPHONE PROFESSIONEL!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_Departure && document.form.Ecom_ShipTo_Visana_Departure.value=="") {
alert("Veuillez indiquer votre DATE DE DEPART!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_Return && document.form.Ecom_ShipTo_Visana_Return.value=="") {
alert("euillez indiquer votre DATE DE RETOUR!");
return false;
}
if (document.form.bankverbindung_name_bank && document.form.bankverbindung_name_bank.value=="") {
alert("Veuillez indiquer le NOM DE LA BANQUE!");
return false;
}
if (document.form.bankverbindung_filiale && document.form.bankverbindung_filiale.value=="") {
alert("Veuillez indiquer le NPA OU LE LIEU de la filiale comp&eacute;tente !");
return false;
}
if (document.form.bankverbindung_kontoinhaber && document.form.bankverbindung_kontoinhaber.value=="") {
alert("Veuillez indiquer le NOM DU TITULAIRE DU COMPTE!");
return false;
}
if (document.form.postcheck_kontoinhaber && document.form.postcheck_kontoinhaber.value=="") {
alert("Veuillez indiquer le NOM DU TITULAIRE DU COMPTE!");
return false;
}
if (document.form.bankverbindung_kontonummer && document.form.bankverbindung_kontonummer.value=="") {
alert("Veuillez indiquer le NUMERO DE COMPTE!");
return false;
}
if (document.form.bankverbindung_ibannummer && document.form.bankverbindung_ibannummer.value=="") {
alert("Veuillez indiquer le NUMERO IBAN!");
return false;
}
if (document.form.postcheck_kontonummer && document.form.postcheck_kontonummer.value=="") {
alert("Veuillez indiquer le NUMERO DE COMPTE!");
return false;
}
if (document.form.bankverbindung_gueltig_ab && document.form.bankverbindung_gueltig_ab.value=="") {
alert("Veuillez indiquer la DATE DE VALIDITE!");
return false;
}
if (document.form.postcheck_gueltig_ab && document.form.postcheck_gueltig_ab.value=="") {
alert("Veuillez indiquer la DATE DE VALIDITE!");
return false;
}
if (document.form.postcheck_auszahlungen && checkRadioEinzeln(document.form.postcheck_auszahlungen)==false) { 
alert("Veuillez choisir quels PAIEMENTS SONT CONCERNES!");
return false; 
}
if (document.form.bankverbindung_auszahlungen && checkRadioEinzeln(document.form.bankverbindung_auszahlungen)==false) { 
alert("Veuillez choisir quels PAIEMENTS SONT CONCERNES!");
return false; 
}
if (document.form.Schule_Jugendorganisation && document.form.Schule_Jugendorganisation.value=="") {
alert("Veuillez indiquer L'&Eacute;COLE SCHULE OU L'ASSOCIATION DE JEUNES!");
return false;
}
if (document.form.Ecom_ShipTo_Visana_All_Travel && checkRadioEinzeln(document.form.Ecom_ShipTo_Visana_All_Travel)==false) { 
alert("Veuillez choisir QUI PARTICIPE AU VOYAGE!");
return false; 
}
if (document.form.bemerkungen && document.form.bemerkungen.value=="") {
alert("Veuillez indiquer vos REMARRQUES!");
return false;
}
if (document.form.andereKostentr && checkRadioEinzeln(document.form.andereKostentr)==false) { 
alert("Veuillez choisir si vous transmettez d&eacute;jà vos factures à D'AUTRES CENTRES DE PAIEMENT par la voie &eacute;lectronique!");
return false; 
}
if (document.form.bestellgrund && checkRadioEinzeln(document.form.bestellgrund)==false) { 
alert("Veuillez choisir un MOTIF DE LA COMMANDE");
return false; 
}

if (document.form.antwort_via_mail && document.form.antwort_via_mail.checked) {
  if (document.form.Ecom_ShipTo_Online_Email.value == "") {
alert("Veuillez indiquer votre ADRESSE E-MAIL pour que nous puissons vous r&eacute;pondre par e-mail!");
  return false;
}
}
return true;
}

function checkRadioEinzeln(name) {
var radiogroup = name; // Variable aus Aufruf definiert den Namen der Gruppe
var itemchecked = false; 
for(var j = 0 ; j < radiogroup.length ; ++j) {
if(radiogroup[j].checked) {
itemchecked = true;
break;
}
}
return itemchecked;
}



// PopUp
function popup(theURL,winName,features)
{
window.open(theURL,winName,features);
}

 

//Popup-Bild
var breite=160;
var bgtext="#EEF7FE";
kopf="<table border=0 cellpadding=4 cellspacing=0 width="+breite+"><tr><td bgcolor="+bgtext+">";
fuss="</td></tr></table>";
if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text)
{
if (document.all&&document.readyState=="complete")
{
document.all.tooltip2.innerHTML=kopf+text+fuss
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}
else if (document.layers)
{
document.tooltip2.document.write(kopf+text+fuss)
document.tooltip2.document.close()
document.tooltip2.left=0
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2()
{
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
document.tooltip2.visibility="hidden"
}}

/* Auto center window script- Eric King (http://redrival.com/eak/index.shtml) */
var win = null;
function NewWindow(mypage,myname,w,h,scroll,text){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable'
win = window.open("","NewWindow",settings);
win = window.open("","NewWindow",settings);
win.document.write ("<HTML><HEAD><TITLE>VisanaFORUM");
win.document.write ("</TITLE></HEAD>");
win.document.write ("<BODY BGCOLOR='#EEF7FE'>");
win.document.write (" ");
win.document.write (" ");
win.document.write (" ");
win.document.write ("<CENTER><IMG SRC='");
win.document.write (mypage);
win.document.write ("' BORDER=0></CENTER>");
win.document.write (" ");
win.document.write (" ");
win.document.write (" ");
win.document.write ("</BODY></HTML>");
win.document.close();
win.document.bgColor="#EEF7FE"
if(win.window.focus)
{win.window.focus();}
}



//Ebenen einblenden
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_showhidelayers() { //v6.0
  var i,p,v,obj,args=mm_showhidelayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=mm_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//reloads the window if Nav4 resized
function MM_reloadPage(init) { if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
 document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// fileUpload
var cookieWert;
	var cookieName;
	function holeCookie(){
		alleCookies=document.cookie;
		
		cookieArr=alleCookies.split(";");
		cookieName="uploadpath";
		for(var i=0;i<cookieArr.length;i++){		
			if (trim(cookieArr[i].split("=")[0]) == cookieName){
				cookieWert=cookieArr[i].split("=");
				cookieWert=unescape(cookieWert[1]);			
				document.form.Ecom_Attachment_From_Customer.value = cookieWert;
				return true;
			}
		}		
		return false;
	}
	
	function trim(str){
		while(str.substring(0,1)==' ')str=str.substring(1,str.length);
		while(str.substring(str.length-1,str.length)==' ')str=str.substring(0,str.length-1);
		return str;
	}
	
