<!--
var a,b,c,d,e,r,visa,transfer,rebate,week1,week2,room1,room2,total,price_of_course,cur_val,price_of_room;


function group()
{
  if (document.priceForm.typeofTuition.selectedIndex == 1)
  window.alert("A two to four week group course with max 6 participants and 20 lessons per week starts every week on Monday. Other group courses can start at any other time if you apply as a group with min 3 people. If you apply as a group of more than 4 students we will be happy to make an individual offer reflecting further discounts.");
}

function group_de()
{
  if (document.priceForm.typeofTuition.selectedIndex == 1)
  window.alert("2, 3 und 4-Wochen Gruppenkurse für Anfänger und Mittleres Niveau mit 20 Lektionen pro Woche starten jeden Montag. Spezielle Gruppenkurse sind auch möglich, wenn sich eine Gruppe (min 3 Personen) mit gleichen Kenntnissen gleichzeitig anmeldet. Melden Sie eine Gruppe von mehr als 4 Personen an, machen wir gerne eine individuelle Offerte.");
}

function group_fr()
{
  if (document.priceForm.typeofTuition.selectedIndex == 1)
  window.alert("Un cours de de group de 2, 3 oubien 4 semaines pour débutants et niveau intermédiaire avec 20 lecons par semaine commence chaque semaine le lundi. Des cours de groupes speciales sont aussi possibles si votre groupe (min 3 personnes avec des connaissances de Russe equivalentes) s'inscrit en même temps. Si vous êtes un groupe de plus de 4 personnes, nous pouvons vous offrir des prix encore plus favorables.");
}

function min2weeks()
{
if (document.priceForm.duration.value==1)
window.alert("The minumum length of stay is 2 weeks in order to guarantee an effective tuition. Please modify your input.");
}

function min2weeks_de()
{
if (document.priceForm.duration.value==1)
window.alert("Um einen optimalen Lerneffekt zu erzielen, haben wir die minimale Aufenthaltsdauer in Moskau auf 2 Wochen festgelegt. Bitte ändern und neu eingeben.");
}


function min2weeks_fr()
{
if (document.priceForm.duration.value==1) 
window.alert("Pour garantir un séjour optimal, la durée minimale est de 2 semaines. Veuillez corriger vos données.");
}

function calculate()
{ 
  a=document.priceForm.typeofCourse.selectedIndex;
  b=document.priceForm.duration.value;
  c=document.priceForm.accomodation.selectedIndex;
  d=document.priceForm.typeofTuition.selectedIndex;
  e=document.priceForm.typeofProg.selectedIndex;
  var selection=document.priceForm.currency;
  f=selection.options[selection.selectedIndex].value;

r=5;
adj=1;

if (f=="GBP") {curr=adj*0.95; currtext="£ ";}
if (f=="USD") {curr=adj*1.56; currtext="$ ";}
if (f=="CAN") {curr=adj*1.70; currtext="Can ";}
if (f=="AUS") {curr=adj*2.00; currtext="Aus$ ";}
if (f=="EUR") {curr=adj; currtext="Euro ";}
if (f=="YEN") {curr=adj*158; r=100; currtext="Yen ";}
if (f=="RUR") {curr=adj*50; r=100; currtext="Ru ";}
if (f=="SFR") {curr=adj*1.60; r=5; currtext="SFr ";}

  
if (b==0) {b=2;}
if (b==1) {b=2;}

  if (c==0) room1=round(140*curr,r);
  if (c==1) room1=round(180*curr,r);
  if (c==2) room1=round(160*curr,r);
  if (c==3) room1=round(560*curr,r);
  if (c==4) room1=0;

if (b>4)
 {
  if (c==0) room2=round(120*curr,r);
  if (c==1) room2=round(160*curr,r);
  if (c==2) room2=round(140*curr,r);
  if (c==3) room2=round(560*curr,r);
  if (c==4) room2=0;
 }
 
 if (d == 0)
  {
  if (e == 0)
   {
    if (a == 0)  week1=2*round(300*curr,r)-round(250*curr,r);
    if (a == 1)  week1=round(300*curr,r);
    if (a == 2)  week1=round(250*curr,r);
   if (b>4)
    { 
    if (a == 0)  week2=2*round(290*curr,r)-round(240*curr,r);
    if (a == 1)  week2=round(290*curr,r);
    if (a == 2)  week2=round(240*curr,r);
    }
   }
  if (e == 1)
   {
    if (a == 0)  week1=2*round(400*curr,r)-round(320*curr,r);
    if (a == 1)  week1=round(400*curr,r);
    if (a == 2)  week1=round(320*curr,r);
   if (b>4) 
    { 
    if (a == 0)  week2=2*round(370*curr,r)-round(300*curr,r);
    if (a == 1)  week2=round(370*curr,r);
    if (a == 2)  week2=round(300*curr,r);
    }
   }
  }

if (d == 1)
  {
  if (e == 0)
   {
    if (a == 0)  week1=2*round(200*curr,r)-round(170*curr,r);
    if (a == 1)  week1=round(200*curr,r);
    if (a == 2)  week1=round(170*curr,r);
   if (b>4) 
    { 
    if (a == 0)  week2=2*round(190*curr,r)-round(160*curr,r);
    if (a == 1)  week2=round(190*curr,r);
    if (a == 2)  week2=round(160*curr,r);
    }
   }
  if (e == 1)
   {
    if (a == 0)  week1=2*round(250*curr,r)-round(200*curr,r);
    if (a == 1)  week1=round(250*curr,r);
    if (a == 2)  week1=round(200*curr,r);
   if (b>4) 
    { 
    if (a == 0)  week2=2*round(230*curr,r)-round(190*curr,r);
    if (a == 1)  week2=round(230*curr,r);
    if (a == 2)  week2=round(190*curr,r);
    }
   }
  }
 
if (b<5)
{
 price_of_course=b*week1;
 price_of_room=b*room1;
}

if ((b>4) && (b<15))
 {
 price_of_course=4*week1+(b-4)*week2;
 price_of_room=4*room1+(b-4)*room2;
 }
if (b>=15)
 {
 price_of_course=4*week1+11*week2+(b-15)*week2*0.9;
 price_of_room=4*room1+11*room2+(b-15)*room2*0.9;
 }  
 if (b>=32)  
 {
 price_of_course=4*week1+11*week2+17*week2*0.9+(b-32)*week2*0.8;
 price_of_room=4*room1+11*room2+17*room2*0.9+(b-32)*room2*0.8;
 }
 visa=0;
 if (document.priceForm.visacheck.checked) visa=40;
 fee=98;
 transfer=0; transfer1=0; transfer2=0;
 if (document.priceForm.transfercheck1.checked) 
 {
   if (d==0) transfer1=50;
   if (d==1) transfer1=50;
 }

 if (document.priceForm.transfercheck2.checked) 
 {
   if (d==0) transfer2=40;
   if (d==1) transfer2=40;
 }

 transfer1=round(transfer1*curr,r);
 transfer2=round(transfer2*curr,r);
 transfer=transfer1+transfer2;
 fee=round(fee*curr,r);
 visa=round(visa*curr,r);
 price_of_course=round(price_of_course,r);
 price_of_room=round(price_of_room,r);
 total=price_of_course+price_of_room+visa+transfer+fee;
 document.priceForm.Course.value=currtext+price_of_course+".-";
 document.priceForm.Room.value=currtext+price_of_room+".-";
 document.priceForm.Visa.value=currtext+visa+".-";
 document.priceForm.Transfer.value=currtext+transfer+".-";
 document.priceForm.Fee.value=currtext+fee+".-";
 document.priceForm.Total.value=currtext+total+".-";
} 

// This function rounds up the value to the next decimal

function round(cur_val,r)
{
rest=cur_val%r;
 if (rest>r/2) rest=rest-r;
cur_val=cur_val-rest;
return cur_val;
}
// -->

