EGebuehr=50;StakursZahl=6;Stakurs=Array(StakursZahl);for(i=0;i<StakursZahl;i++)Stakurs[i]=Array(3);StakursPreise="0,0,0,175,325,150,220,415,195,265,505,240,300,575,275,425,825,400,";countArray2=countArray1=counte=counta=0;countDimension=3;for(i=0;i<=StakursPreise.length;i++)counte=i,StakursPreise.charCodeAt(counte)==44&&(Stakurs[countArray1][countArray2]=StakursPreise.substring(counta,counte),counta=counte+1,countArray2+=1,countArray2==countDimension&&(countArray1+=1,countArray2=0));
LangZeit=[140,185,230];BildungsUrlaub=[325,565];Schreiben=50;UnoPreise="300,450,600,750,900,";UnoPreis=Array(5);for(i=countArray1=counte=counta=0;i<=UnoPreise.length;i++)counte=i,UnoPreise.charCodeAt(counte)==44&&(UnoPreis[countArray1]=UnoPreise.substring(counta,counte),counta=counte+1,countArray1+=1);Lehrer=[315,570,900];ErasmusPreis=190;JuniorPreis=920;JuniorEZZ=40;DelePreise=[1920,1425,500];WirtschaftPreis=[425,1560,425,425];KulturKurs=[125,250];Tango=Flamenco=100;Gourmet=Kochen=120;Reiten=130;
TrekkingPreis=0;Culture=365;UGebuehr=30;AlojPreise1="0,0,0,130,220,90,110,190,80,130,220,90,110,190,80,25,30,35,22,27,32,28,33,38,25,30,35,";AlojPreise2="58,48,54,27,35,22,";AlojPreis1=Array(9);for(i=0;i<9;i++)AlojPreis1[i]=Array(3);AlojPreis2=Array(3);for(i=0;i<3;i++)AlojPreis2[i]=Array(2);AlojPreis3=[60,95,52,67];countArray2=countArray1=counte=counta=0;countDimension=3;
for(i=0;i<=AlojPreise1.length;i++)counte=i,AlojPreise1.charCodeAt(counte)==44&&(AlojPreis1[countArray1][countArray2]=AlojPreise1.substring(counta,counte),counta=counte+1,countArray2+=1,countArray2==countDimension&&(countArray1+=1,countArray2=0));countArray2=countArray1=counte=counta=0;countDimension=2;
for(i=0;i<=AlojPreise2.length;i++)counte=i,AlojPreise2.charCodeAt(counte)==44&&(AlojPreis2[countArray1][countArray2]=AlojPreise2.substring(counta,counte),counta=counte+1,countArray2+=1,countArray2==countDimension&&(countArray1+=1,countArray2=0));function start(){init("course",CursoText);init("TeacherCourse",TeacherText);init("special",SpecialText);init("DeleCourse",DeleText);init("BusinessCourse",BusinessText);init("accommodation",AlojText)}function init(b,a){for(i=0;i<a.length;i+=2)NewOption=new Option(a[i],a[i+1],!1,!1),document.anmeldung[b].options[i/2+1]=NewOption}
function wechsel(b){MenuName=b;WochenName=MenuName+"_weeks";KursIndex=document.anmeldung[MenuName].selectedIndex;MenuName=="course"&&(KursIndex==0&&wochen(0),document.anmeldung[MenuName].length==8?KursIndex==7?wochen(2):wochen(24):wochen(24),KursIndex==6?zufuegen():loeschen());MenuName=="taller"&&wochen(24);if(MenuName=="TeacherCourse")switch(KursIndex){case 0:loeschen();wochen(0);break;case 1:wochen(2);loeschen();break;case 2:wochen(-1),loeschen()}if(MenuName=="special")switch(KursIndex){case 0:loeschen();
wochen(0);break;case 1:wochen(-2);loeschen();break;case 2:wochen(412),loeschen()}if(MenuName=="DeleCourse")switch(KursIndex){case 0:wochen(0);break;case 1:wochen(-8);break;case 2:wochen(-4);break;case 3:wochen(-4)}if(MenuName=="BusinessCourse")switch(KursIndex){case 0:wochen(0);break;case 1:wochen(4);break;case 2:wochen(-1);break;case 3:wochen(4);break;case 4:wochen(4)}MenuName=="cultura"&&(document.anmeldung.cultura.checked==!0?wochen(2):wochen(0));MenuName=="flamenco"&&(document.anmeldung.flamenco.checked==
!0?wochen(24):wochen(0));MenuName=="tango"&&(document.anmeldung.tango.checked==!0?wochen(24):wochen(0));MenuName=="cooking"&&(document.anmeldung.cooking.checked==!0?wochen(24):wochen(0));MenuName=="gourmet"&&(document.anmeldung.gourmet.checked==!0?wochen(4):wochen(0));MenuName=="equitacion"&&(document.anmeldung.equitacion.checked==!0?wochen(2):wochen(0));MenuName=="culture"&&(document.anmeldung.culture.checked==!0?wochen(2):wochen(0));rechnekurs()}
function wochen(b){function a(){WochenWert=document.anmeldung[WochenName].length-1;for(i=0;i<WochenWert;i++)document.anmeldung[WochenName].options[document.anmeldung[WochenName].length-1]=null;document.anmeldung[WochenName].selectedIndex=0;document.anmeldung[WochenName].disabled=!1}b==0&&a();if(b==24|b==4||b==2||b==1){a();for(i=1;i<b+1;i++)NewOption=new Option(i,i+" weeks",!1,!1),document.anmeldung[WochenName].options[i]=NewOption;document.anmeldung[WochenName].selectedIndex=1;document.anmeldung[WochenName].disabled=
!1}if(b==412){a();for(i=1;i<4;i++)NewOption=new Option(i*4,i*4+" weeks",!1,!1),document.anmeldung[WochenName].options[i]=NewOption;document.anmeldung[WochenName].selectedIndex=1;document.anmeldung[WochenName].disabled=!1}if(b<0)a(),FesterWert=Math.abs(b),NewOption=new Option(FesterWert,FesterWert+" weeks",!1,!1),document.anmeldung[WochenName].options[1]=NewOption,document.anmeldung[WochenName].selectedIndex=1,document.anmeldung[WochenName].disabled=!0}
function zufuegen(){if(KursIndex==6){document.getElementById("detailsBox").style.display="block";for(i=10;i<35;i+=5)NewOption=new Option(i+" "+SpecialDetailText,i+" clases privadas",!1,!1),document.anmeldung.detail.options[document.anmeldung.detail.length]=NewOption}}
function loeschen(){document.getElementById("detailsBox").style.display="none";DetailWert=document.anmeldung.detail.length-1;for(i=0;i<DetailWert;i++)document.anmeldung.detail.options[document.anmeldung.detail.length-1]=null;document.anmeldung.detail.options[0].value="";document.anmeldung.detail.options[0].text="-----????-----"}AlojIndex=[0,1,1,2,2,2,2,1,3,4];EssenIndex=!1;
function uwechsel(){Aloj=document.anmeldung.accommodation.selectedIndex;AlojIndexWert=AlojIndex[Aloj];WochenName="accommodation_weeks";Aloj!=0?wochen(24):wochen(0);AlojIndexWert==0&&zimmerraus();AlojIndexWert!=0&&zimmerrein();AlojIndexWert==2&&(essenrein(0),EssenIndex=!0);AlojIndexWert!=2&&EssenIndex==!0&&(EssenIndex=!1,essenraus());rechnealoj()}
function zimmerrein(){AlojIndexWert==3&&(NewOption=new Option(ZimmerartText[6],ZimmerartText[7],!1,!1),document.anmeldung.accommodation_detail.options[0]=NewOption,NewOption=new Option(ZimmerartText[8],ZimmerartText[9],!1,!1),document.anmeldung.accommodation_detail.options[1]=NewOption);AlojIndexWert==4&&(NewOption=new Option(ZimmerartText[6],ZimmerartText[8],!1,!1),document.anmeldung.accommodation_detail.options[0]=NewOption,NewOption=new Option(ZimmerartText[10],ZimmerartText[11],!1,!1),document.anmeldung.accommodation_detail.options[1]=
NewOption);if(AlojIndexWert==1||AlojIndexWert==2)ZimmerIndex=2,NewOption=new Option(ZimmerartText[ZimmerIndex],ZimmerartText[ZimmerIndex+1],!1,!1),document.anmeldung.accommodation_detail.options[0]=NewOption,NewOption=new Option(ZimmerartText[ZimmerIndex+2],ZimmerartText[ZimmerIndex+3],!1,!1),document.anmeldung.accommodation_detail.options[1]=NewOption,document.anmeldung.accommodation_detail.options[2]=null}
function zimmerraus(){ZimmerWert=document.anmeldung.accommodation_detail.length-1;for(i=0;i<ZimmerWert;i++)document.anmeldung.accommodation_detail.options[document.anmeldung.accommodation_detail.length-1]=null;NewOption=new Option(ZimmerartText[0],ZimmerartText[0],!1,!1);document.anmeldung.accommodation_detail.options[0]=NewOption}
function essenrein(){for(i=2;i<8;i+=2)NewOption=new Option(VerpflegungText[i],VerpflegungText[i+1],!1,!1),document.anmeldung.accommodation_catering.options[i/2-1]=NewOption;document.anmeldung.accommodation_catering.disabled=!1;if(Aloj==5||Aloj==6)document.anmeldung.accommodation_catering.disabled=!0}
function essenraus(){wert=document.anmeldung.accommodation_catering.length-1;for(i=0;i<wert;i++)document.anmeldung.accommodation_catering.options[document.anmeldung.accommodation_catering.length-1]=null;document.anmeldung.accommodation_catering.options[0].value="";document.anmeldung.accommodation_catering.options[0].text="-----????-----";document.anmeldung.accommodation_catering.disabled=!1};var GesamtPreis=0,Upreis=0,Preis=0,CTotal=0,UTotal=0;
function rechnekurs(){var b=["course","TeacherCourse","special","DeleCourse","BusinessCourse"],a=[],c=[];for(i=0;i<b.length;i++)a[i]=document.anmeldung[b[i]].selectedIndex,c[i]=document.anmeldung[b[i]+"_weeks"].selectedIndex;b=document.anmeldung.detail.selectedIndex;Preis=wert=0;if(a[0]==1||a[0]==2||a[0]==3)Faktor=c[0]-2,c[0]==0&&(Preis=0),c[0]>2&&c[0]<8&&(Preis=Number(Stakurs[a[0]][1])+Number(Stakurs[a[0]][2])*Faktor),c[0]<=2&&c[0]>0&&(Preis=Number(Stakurs[a[0]][c[0]-1])),c[0]>7&&(Preis=Number(c[0]*
LangZeit[a[0]-1]));if(a[0]==4||a[0]==5)Faktor=c[0]-2,c[0]==0&&(Preis=0),c[0]>2&&(Preis=Number(Stakurs[a[0]][1])+Number(Stakurs[a[0]][2])*Faktor),c[0]<=2&&c[0]>0&&(Preis=Number(Stakurs[a[0]][c[0]-1]));a[0]==6&&b>0&&(Preis=UnoPreis[b-1]*c[0]);a[0]==7&&(Preis=c[0]==0?0:Number(BildungsUrlaub[c[0]-1]));document.anmeldung.taller.checked==!0?(wert=Number(Schreiben*document.anmeldung.taller_weeks.selectedIndex),Preis+=wert):document.anmeldung.taller_weeks.selectedIndex=0;a[1]==1&&c[1]>0&&(wert=Lehrer[c[1]-
1],Preis+=wert);a[1]==2&&(wert=Lehrer[2],Preis+=wert);a[2]==1&&(wert=JuniorPreis-EGebuehr,Preis+=wert);a[2]==2&&(wert=ErasmusPreis*c[2]-EGebuehr,Preis+=wert);a[3]>0&&(wert=DelePreise[a[3]-1],Preis+=wert);a[4]==1&&(wert=WirtschaftPreis[0]*c[4],Preis+=wert);a[4]==2&&(wert=WirtschaftPreis[1],Preis+=wert);a[4]==3&&(wert=WirtschaftPreis[2]*c[4],Preis+=wert);a[4]==4&&(wert=WirtschaftPreis[3]*c[4],Preis+=wert);document.anmeldung.cultura.checked==!0?(wert=KulturKurs[document.anmeldung.cultura_weeks.selectedIndex-
1],Preis+=wert):document.anmeldung.cultura_weeks.selectedIndex=0;document.anmeldung.flamenco.checked==!0?(wert=Number(Flamenco*document.anmeldung.flamenco_weeks.selectedIndex),Preis+=wert):document.anmeldung.flamenco_weeks.selectedIndex=0;document.anmeldung.tango.checked==!0?(wert=Number(Tango*document.anmeldung.tango_weeks.selectedIndex),Preis+=wert):document.anmeldung.tango_weeks.selectedIndex=0;document.anmeldung.cooking.checked==!0?(wert=Number(Kochen*document.anmeldung.cooking_weeks.selectedIndex),
Preis+=wert):document.anmeldung.cooking_weeks.selectedIndex=0;document.anmeldung.gourmet.checked==!0?(wert=Number(Kochen*document.anmeldung.gourmet_weeks.selectedIndex),Preis+=wert):document.anmeldung.gourmet_weeks.selectedIndex=0;document.anmeldung.equitacion.checked==!0?(wert=Number(Reiten*document.anmeldung.equitacion_weeks.selectedIndex),Preis+=wert):document.anmeldung.equitacion_weeks.selectedIndex=0;document.anmeldung.culture.checked==!0?(wert=Number(Culture*document.anmeldung.culture_weeks.selectedIndex)-
EGebuehr,Preis+=wert):document.anmeldung.culture_weeks.selectedIndex=0;CTotal=Preis+EGebuehr;Preis==0&&(CTotal=0);document.anmeldung.course_fee.value=CTotal;GesamtPreis=UTotal+CTotal;Preis==0&Upreis==0&&(GesamtPreis=0);document.anmeldung.fee.value=GesamtPreis}
function rechnealoj(){var b=document.anmeldung.accommodation.selectedIndex,a=document.anmeldung.accommodation_detail.selectedIndex,c=document.anmeldung.accommodation_catering.selectedIndex,d=document.anmeldung.accommodation_weeks.selectedIndex;Wert=b*2-1+1*a;if(d!=0)if(b==1||b==2)Faktor=d-2,d>2&&(Upreis=Number(AlojPreis1[Wert][1])+Number(AlojPreis1[Wert][2])*Faktor),d<=2&&d>0&&(Upreis=Number(AlojPreis1[Wert][d-1]));else{Faktor=d*7-1;if(b==3||b==4)Upreis=Number(AlojPreis1[Wert][c])*Faktor;if(b==5||
b==6||b==7)Upreis=Number(AlojPreis2[b-5][a])*Faktor;b==8&&(Upreis=Number(AlojPreis3[a])*Faktor);b==9&&(Upreis=Number(AlojPreis3[a+2])*Faktor)}else Upreis=0;UTotal=Upreis+UGebuehr;Upreis==0&&(UTotal=0);document.anmeldung.accommodation_fee.value=UTotal;GesamtPreis=UTotal+CTotal;Preis==0&Upreis==0&&(GesamtPreis=0);document.anmeldung.fee.value=GesamtPreis};

