<!--
function EvaluateLicensePrice(szCurrency)
{
 if (document.PoGoScoOrder.Version==null)
  var iPrice=0;
 else
 {
  var Item=document.PoGoScoOrder.Version.value;
  var iPrice=parseInt(Item.substr(Item.length-2,Item.length-1));
 }

 if (document.PoGoScoOrder.DiscCourses==null)
  var iCourses=0
 else
  var iCourses=parseInt(document.PoGoScoOrder.DiscCourses.value);

 if (document.PoGoScoOrder.DiscCoursesBB==null)
  var iCoursesBB=0
 else
  var iCoursesBB=parseInt(document.PoGoScoOrder.DiscCoursesBB.value);

 if (document.PoGoScoOrder.Delivery==null)
  var iPriceDelivery=0;
 else
 {
  var ItemDelivery=document.PoGoScoOrder.Delivery.value;
  var iPriceDelivery=parseInt(ItemDelivery.substr(ItemDelivery.length-2,ItemDelivery.length-1));
 }

 var ItemCountry=document.PoGoScoOrder.Country.value;

 var iCouponAbs=0;
 var iCouponPerc=0;
 var iPricePostage=0;

 if (document.PoGoScoOrder.Currency==null)
  iPriceDelivery=0;
 else
 {
  if (document.PoGoScoOrder.Currency.value=='€')
  {
   iPrice=parseInt(Item.substr(Item.length-5,Item.length-3));
   iPricePostage=12;
   if (ItemDelivery==null)
    iPriceDelivery=0;
   else
    iPriceDelivery=parseInt(ItemDelivery.substr(ItemDelivery.length-5,ItemDelivery.length-3));
  }
  else
  {
   iPrice=parseInt(Item.substr(Item.length-2,Item.length-1));
   iPricePostage=16;
   if (ItemDelivery==null)
    iPriceDelivery=0;
   else
    iPriceDelivery=parseInt(ItemDelivery.substr(ItemDelivery.length-2,ItemDelivery.length-1));
  }
 }
 
 if (document.PoGoScoOrder.Coupon==null)
 {
  iCouponAbs=0;
  iCouponPerc=0;
 }
 else
 {
  if (document.PoGoScoOrder.CouponPrice==null)
  {
   iCouponAbs=0;
   iCouponPerc=0;
  }
  else
  {
   if (document.PoGoScoOrder.Coupon.value.length>0)
    if (document.PoGoScoOrder.CouponPrice.value.length>0)
    {
     if (document.PoGoScoOrder.CouponPrice.value.charAt(1)=='%')
      iCouponPerc=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,1));
     if (document.PoGoScoOrder.CouponPrice.value.charAt(2)=='%')
      iCouponPerc=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,2));
     if (document.PoGoScoOrder.CouponPrice.value.charAt(1)=='€')
      iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,1));
     if (document.PoGoScoOrder.CouponPrice.value.charAt(2)=='€')
      iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,2));
     if (document.PoGoScoOrder.CouponPrice.value.charAt(1)=='$')
      iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,1));
     if (document.PoGoScoOrder.CouponPrice.value.charAt(2)=='$')
      iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,2));
    }
  }    
 }
 
 if (iCoursesBB>5) iCoursesBB=5;
 if (iCourses+iCoursesBB>5) iCourses=5-iCoursesBB;
  
 iPrice=iPrice-(iCourses*2);
 iPrice=iPrice-(iCoursesBB*5);

 if (iCouponAbs)  iPrice=iPrice-iCouponAbs;
 if (iCouponPerc) iPrice=iPrice-(iPrice*iCouponPerc/100);
 
 if (iPrice<0) iPrice=0;

 if (iPriceDelivery>0)
  if (ItemCountry.length>=6)
   if (ItemCountry.charAt(ItemCountry.length-6)=='€')
   {
    if (document.PoGoScoOrder.Currency.value=='€')
     iPricePostage=parseInt(ItemCountry.substr(ItemCountry.length-5,ItemCountry.length-3));
    else
     iPricePostage=parseInt(ItemCountry.substr(ItemCountry.length-2,ItemCountry.length-1));
   }
 
 if (iPriceDelivery>0)
  iPriceDelivery=iPriceDelivery+iPricePostage;

 if (document.PoGoScoOrder.Currency!=null)
 {
  var szPrice = document.PoGoScoOrder.Currency.value+iPrice.toFixed(2);
  if (document.PoGoScoOrder.Price!=null)
  {
   document.PoGoScoOrder.Price.value=szPrice;
   document.PoGoScoOrder.Price.disabled=true;
  }
 
  var szPriceDelivery = document.PoGoScoOrder.Currency.value+iPriceDelivery.toFixed(2);
  if (document.PoGoScoOrder.PriceDel!=null)
  {
   document.PoGoScoOrder.PriceDel.value=szPriceDelivery;
   document.PoGoScoOrder.PriceDel.disabled=true;
  }

  iPriceTotal=iPrice+iPriceDelivery;
  var szPriceTotal= document.PoGoScoOrder.Currency.value+iPriceTotal.toFixed(2);

  if (document.PoGoScoOrder.PriceTotal!=null)
  {
   document.PoGoScoOrder.PriceTotal.value=szPriceTotal;
   document.PoGoScoOrder.PriceTotal.disabled=true;
  }
 }  

 if (document.PoGoScoOrder.CouponPrice!=null)
  document.PoGoScoOrder.CouponPrice.disabled=true;
} 

function EvaluateCurrency()
{
 var szCurrency='€';
 var iCouponAbs=0;

 if (document.PoGoScoOrder.DiscCourses!=null)
  if (document.PoGoScoOrder.Country.value.length>=13)
   if (document.PoGoScoOrder.Country.value.substring(0,13)=='United States')
    szCurrency='$';

 if (document.PoGoScoOrder.Coupon.value.length>0)
  if (document.PoGoScoOrder.CouponPrice.value.length>0)
  {
   if (document.PoGoScoOrder.CouponPrice.value.charAt(1)=='€')
    iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,1));
   if (document.PoGoScoOrder.CouponPrice.value.charAt(2)=='€')
    iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,2));
   if (document.PoGoScoOrder.CouponPrice.value.charAt(1)=='$')
    iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,1));
   if (document.PoGoScoOrder.CouponPrice.value.charAt(2)=='$')
    iCouponAbs=parseInt(document.PoGoScoOrder.CouponPrice.value.substring(0,2));
   if (iCouponAbs)
   {
    var szPrice = iCouponAbs+szCurrency;
    document.PoGoScoOrder.CouponPrice.value=szPrice;
   }
  }

 document.PoGoScoOrder.Currency.value=szCurrency;
 EvaluateLicensePrice();
}

function ConvertFieldCurrencies(szFieldName)
{
 var Item=document.forms["PoGoScoOrder"].elements[szFieldName].value;
 var fPrice=parseFloat(Item.substr(1,Item.length-1));
 
 var szURL='http://www.lachner.com/PoGoSco/English/Licensing/ConvCurrency.asp?EuroValue=';
 szURL=szURL+fPrice*100;
 newwin = window.open(szURL, '', 'toolbar=no, width=350, height=310,directories=no,status=no,scrollbars=no,resize=no,menubar=no');
}

function EvaluateCoupon()
{
 var szURL='CheckCoupon.asp?Code=';
 szURL=szURL+encodeURIComponent(document.PoGoScoOrder.Coupon.value);
 szURL=szURL+'&Currency='+document.PoGoScoOrder.Currency.value;
 newwin = window.open(szURL, '', 'toolbar=no, width=460, height=180,directories=no,status=no,scrollbars=no,resize=no,menubar=no');
} 

function LuhnCheck(str) 
{
 var result = true;

 var sum = 0; 
 var mul = 1; 
 var strLen = str.length;
  
 for (i = 0; i < strLen; i++) 
 {
  var digit = str.substring(strLen-i-1,strLen-i);
  var tproduct = parseInt(digit ,10)*mul;
  if (tproduct >= 10)
   sum += (tproduct % 10) + 1;
  else
   sum += tproduct;
  if (mul == 1)
   mul++;
  else
   mul--;
 }

 if ((sum % 10) != 0)
  result = false;
   
 return result;
}

function inValidCharSet(str,charset)
{
 var result = true;
 for (var i=0;i<str.length;i++)
  if (charset.indexOf(str.substr(i,1))<0)
  {
   result = false;
   break;
  }
 return result;
}

function allDigits(str)
{
 return inValidCharSet(str,"0123456789");
}

function ValidExpDate(expMonth,expYear)
{
 var now = new Date();
 var nowMonth = now.getMonth() + 1;
 var nowYear = now.getFullYear();

 expYear=expYear+2000;
 
 return (!((nowYear > expYear) || ((nowYear == expYear) && (nowMonth > expMonth))));
}

function EvaluateCreditCard()
{
 if (document.PoGoScoOrder.CCNumber.value.length>0)
 {
  if (!LuhnCheck(document.PoGoScoOrder.CCNumber.value))
  {
   alert('Die Kreditkartennummer scheint falsch zu sein, bitte überprüfen!');
   document["CCNumberOK"].src="../../Images/notavailable.gif";      
  }
  else document["CCNumberOK"].src="../../Images/available.gif";      
 }  
 else document["CCNumberOK"].src="../../Images/notavailable.gif";      

 if (document.PoGoScoOrder.CCNumberVal.value.length>0)
 {
  if ((!allDigits(document.PoGoScoOrder.CCNumberVal.value))||(document.PoGoScoOrder.CCNumberVal.value.length!=3))
  {
   alert('Die Kreditkartenprüfnummer scheint falsch zu sein, bitte überprüfen!');
   document["CCNumberValOK"].src="../../Images/notavailable.gif";      
  }
  else document["CCNumberValOK"].src="../../Images/available.gif";      
 }  
 else document["CCNumberValOK"].src="../../Images/notavailable.gif";      
}

function EvaluateCreditCardExp()
{
 if (!ValidExpDate(parseInt(document.PoGoScoOrder.CCExpMonth.value),parseInt(document.PoGoScoOrder.CCExpYear .value)))
 {
  alert('Die Kreditkarte scheint abgelaufen zu sein, bitte überprüfen!');
  document["CCExpOK"].src="../../Images/notavailable.gif";      
 }
 else document["CCExpOK"].src="../../Images/available.gif";      
}

function SetCCVImage()
{
 var iEnglish=0;
 var szURL=document.URL.toLowerCase();

 if (szURL.indexOf("english/licensing")!=-1)
  iEnglish=1;
 
 if (((document.forms["PoGoScoOrder"].elements["CCType"].options.selectedIndex==5)&&(iEnglish==0)) ||
     ((document.forms["PoGoScoOrder"].elements["CCType"].options.selectedIndex==4)&&(iEnglish==1))   )
 {
  if (iEnglish==1)
  {
   document.getElementById("CCVImage").src = "https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif";
   document.getElementById("CCVText").innerHTML="Save time. Pay securely without sharing your financial information.";
  }
  else
  {
   document.getElementById("CCVImage").src = "https://www.paypal.com/de_DE/i/btn/btn_xpressCheckout.gif";
   document.getElementById("CCVText").innerHTML="Mit PayPal können Sie Ihre Einkäufe im Internet einfach, schnell und sicher bezahlen.";
  }
  document.PoGoScoOrder.CCExpMonth.disabled=true;
  document.PoGoScoOrder.CCExpYear.disabled=true;
  document.PoGoScoOrder.CCNumberVal.disabled=true;
  document.PoGoScoOrder.CCNumber.disabled=true;
  document.PoGoScoOrder.CCName.disabled=true;
 }
 else
 {
  if (((document.forms["PoGoScoOrder"].elements["CCType"].options.selectedIndex==4)&&(iEnglish==0)) ||
      ((document.forms["PoGoScoOrder"].elements["CCType"].options.selectedIndex==3)&&(iEnglish==1))   )
  {
   document.getElementById("CCVImage").src = "../../Images/amex-cvv-mini.gif";
   if (iEnglish==1)
    document.getElementById("CCVText").innerHTML="(a 4-digit number located on the front side of the credit card, usually<br>displayed right above the credit card number)";
   else
    document.getElementById("CCVText").innerHTML="(eine vierstellige Nummer, die auf der Vorderseite der Kreditkarte rechts über der Kartennummer eingedruckt ist)";
  }
  else
  {
   document.getElementById("CCVImage").src = "../../Images/visamaster-cvv-mini.gif";
   if (iEnglish==1)
    document.getElementById("CCVText").innerHTML="(a 3-digit number located on the back side of the credit card, usually<br>displayed following the last four digits of the card number)";
   else
    document.getElementById("CCVText").innerHTML="(eine dreistellige Nummer, die auf der Rückseite der Kreditkarte im Unterschriftenfeld nach den letzten 4 Ziffern der Kartennummer aufgedruckt ist)";
  }
  document.PoGoScoOrder.CCExpMonth.disabled=false;
  document.PoGoScoOrder.CCExpYear.disabled=false;
  document.PoGoScoOrder.CCNumberVal.disabled=false;
  document.PoGoScoOrder.CCNumber.disabled=false;
  document.PoGoScoOrder.CCName.disabled=false;
 }
}

function ShowCCVImage()
{
 var szURL='ShowCCVImage.asp?Card=';

 var iSelCard=document.PoGoScoOrder.CCType.selectedIndex;
 var szSelCard=document.PoGoScoOrder.CCType.options[iSelCard].text;
 
 if (szSelCard.indexOf("American")!=-1)
  szURL=szURL+'Amex';
 else
  szURL=szURL+'ViMa';

 newwin = window.open(szURL, '', 'toolbar=no, width=380, height=220,directories=no,status=no,scrollbars=no,resize=no,menubar=no');
} 

function getQueryVariable(variable) 
{
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) 
  {
    var pair = vars[i].split("=");
    if (pair[0] == variable) 
    {
     return pair[1];
    }
  } 
}

function EnableAllFields()
{
 document.PoGoScoOrder.Name.disabled=false; 
 document.PoGoScoOrder.Email.disabled=false; 
 document.PoGoScoOrder.Country.disabled=false;
 document.PoGoScoOrder.Adr1.disabled=false;
 document.PoGoScoOrder.Adr2.disabled=false;
 document.PoGoScoOrder.Coupon.disabled=false;
 document.PoGoScoOrder.Version.disabled=false;
 document.PoGoScoOrder.Delivery.disabled=false;
 document.PoGoScoOrder.CCType.disabled=false;
 if (document.PoGoScoOrder.CCName!=null)
  document.PoGoScoOrder.CCName.disabled=false;
 if (document.PoGoScoOrder.CCNumber!=null)
  document.PoGoScoOrder.CCNumber.disabled=false;
 if (document.PoGoScoOrder.CCNumberVal!=null)
  document.PoGoScoOrder.CCNumberVal.disabled=false;
 if (document.PoGoScoOrder.CCExpMonth!=null)
  document.PoGoScoOrder.CCExpMonth.disabled=false;
 if (document.PoGoScoOrder.CCExpYear!=null)
  document.PoGoScoOrder.CCExpYear.disabled=false;
 if (document.PoGoScoOrder.PriceTotal!=null)
  document.PoGoScoOrder.PriceTotal.disabled=false;
}

function SetSelectedCountry()
{
 var szSelectedCountryOrg=getQueryVariable("Country");
 var szSelectedCountry="";
 var szListCountry;

 for (var ploop=0;ploop<szSelectedCountryOrg.length;ploop++)
 {
  if (szSelectedCountryOrg.substr(ploop,1)=="+")
   szSelectedCountry=szSelectedCountry+" ";
  else
   szSelectedCountry=szSelectedCountry+szSelectedCountryOrg.substr(ploop,1);
 }
 
 for (var cloop=0;cloop<document.PoGoScoOrder.Country.length;cloop++)
 {
  szListCountry=document.PoGoScoOrder.Country.options[cloop].text;
  if (szSelectedCountry.indexOf(szListCountry)!=-1)
  {
   document.PoGoScoOrder.Country.selectedIndex=cloop;
  }
 }
 
 document.PoGoScoOrder.Country.disabled=true;

 EvaluateLicensePrice();
}

function SetSelectedVersion()
{
 var szURL=document.URL.toLowerCase();
 var szSelectedVersionOrg=unescape(getQueryVariable("Version"));
 var szSelectedVersion="";

 for (var ploop=0;ploop<szSelectedVersionOrg.length;ploop++)
 {
  if (szSelectedVersionOrg.substr(ploop,1)=="+")
   szSelectedVersion=szSelectedVersion+" ";
  else
  {
   //alert(szSelectedVersionOrg.substr(ploop,1)+"|"+szSelectedVersionOrg.charCodeAt(ploop));
   if (szSelectedVersionOrg.charCodeAt(ploop)!=153)
   {
    szSelectedVersion=szSelectedVersion+szSelectedVersionOrg.substr(ploop,1);
   }
  }
 }

 if (szURL.indexOf("english/licensing")!=-1)
  szSelectedVersion = szSelectedVersion.replace(/auf/, "to");

 for (var cloop=0;cloop<document.PoGoScoOrder.Version.length;cloop++)
 {
  var szListVersionOrg=document.PoGoScoOrder.Version.options[cloop].text;
  var szListVersion="";

  for (var vloop=0;vloop<szListVersionOrg.length;vloop++)
  {
   if (szListVersionOrg.charCodeAt(vloop)<256)
   {
    szListVersion=szListVersion+szListVersionOrg.substr(vloop,1);
   }
  }
  
  if (szSelectedVersion.indexOf(szListVersion)!=-1)
  {
   document.PoGoScoOrder.Version.selectedIndex=cloop;
  }
 }

 document.PoGoScoOrder.Version.disabled=true;

 EvaluateLicensePrice();

}

function SetSelectedCoupon()
{
 document.PoGoScoOrder.Coupon.disabled=true;
 EvaluateLicensePrice();
}

function SetSelectedDelivery()
{
 var szSelectedDeliveryOrg=getQueryVariable("Delivery");
 var szSelectedDelivery="";
 var szListDelivery;

 for (var ploop=0;ploop<szSelectedDeliveryOrg.length;ploop++)
 {
  if (szSelectedDeliveryOrg.substr(ploop,1)=="+")
   szSelectedDelivery=szSelectedDelivery+" ";
  else
   szSelectedDelivery=szSelectedDelivery+szSelectedDeliveryOrg.substr(ploop,1);
 }
 
 for (var cloop=0;cloop<document.PoGoScoOrder.Delivery.length;cloop++)
 {
  szListDelivery=document.PoGoScoOrder.Delivery.options[cloop].value;
  if (szListDelivery.slice(0,8)==szSelectedDelivery.slice(0,8))  
  {
   document.PoGoScoOrder.Delivery.selectedIndex=cloop;
  }
 }

 document.PoGoScoOrder.Delivery.disabled=true;
 EvaluateLicensePrice();
}

function SetSelectedCardType()
{
 var szSelectedCardOrg=getQueryVariable("CCType");
 var szSelectedCard="";
 var szListCard;

 for (var ploop=0;ploop<szSelectedCardOrg.length;ploop++)
 {
  if (szSelectedCardOrg.substr(ploop,1)=="+")
   szSelectedCard=szSelectedCard+" ";
  else
   szSelectedCard=szSelectedCard+szSelectedCardOrg.substr(ploop,1);
 }
 
 for (var cloop=0;cloop<document.PoGoScoOrder.CCType.length;cloop++)
 {
  szListCard=document.PoGoScoOrder.CCType.options[cloop].text;
  if (szSelectedCard.indexOf(szListCard)!=-1)
  {
   document.PoGoScoOrder.CCType.selectedIndex=cloop;
  }
 }

 document.PoGoScoOrder.CCType.disabled=true;
 EvaluateLicensePrice();
}

function SetSelectedCardExp()
{
 var szSelectedExpMonth=getQueryVariable("CCExpMonth");
 var szSelectedExpYear=getQueryVariable("CCExpYear");
 var szListExp;

 for (var cloop=0;cloop<document.PoGoScoOrder.CCExpMonth.length;cloop++)
 {
  szListExp=document.PoGoScoOrder.CCExpMonth.options[cloop].text;
  if (szSelectedExpMonth.indexOf(szListExp)!=-1)
  {
   document.PoGoScoOrder.CCExpMonth.selectedIndex=cloop;
  }
 }

 for (cloop=0;cloop<document.PoGoScoOrder.CCExpYear.length;cloop++)
 {
  szListExp=document.PoGoScoOrder.CCExpYear.options[cloop].text;
  if (szSelectedExpYear.indexOf(szListExp)!=-1)
  {
   document.PoGoScoOrder.CCExpYear.selectedIndex=cloop;
  }
 }

 document.PoGoScoOrder.CCExpMonth.disabled=true;
 document.PoGoScoOrder.CCExpYear.disabled=true;
}



//-->



