var xtimes = 0;
$(document).ready(function() {
   //abonneerPrice();
   if(xtimes < 1)
   {
      abonneerPrice();
      xtimes = xtimes + 1;
   } 
   if ($("#countryid")) {
       $("#countryid").change(function() {
          abonneerPrice();
          priceInField();
       });
   }
});
function abonneerPriceInField(pubId){
  if ($("#countryid").val() && $("input[@name=typeabo]:checked").val()) { 
          $.get("cs/ContentServer?pagename=Royals/CSElements/GetPriceByAboAndCountry", {countryId: $("#countryid").val() , publicationId: pubId, lang: document.abonneerForm.lang.value }, function(html){
              document.getElementById('Price').value= html;
          });
  }
}
function abonneerPrice() {
      if ($("#countryid").val() && $("input[@name=typeabo]:checked").val()) { 
          $.get("cs/ContentServer?pagename=Royals/CSElements/GetPriceByAboAndCountry", {countryId: $("#countryid").val() , publicationId: $("#typeabo3").val(), lang: document.abonneerForm.lang.value }, function(html){
              $("#lblPrice3").html(html);
          });
          $.get("cs/ContentServer?pagename=Royals/CSElements/GetPriceByAboAndCountry", {countryId: $("#countryid").val() , publicationId: $("#typeabo1").val(), lang: document.abonneerForm.lang.value}, function(html){
              $("#lblPrice4").html(html);
          });
          $.get("cs/ContentServer?pagename=Royals/CSElements/GetPriceByAboAndCountry", {countryId: $("#countryid").val() , publicationId: $("#typeabo2").val(), lang: document.abonneerForm.lang.value }, function(html){
              $("#lblPrice5").html(html);
          });
      }
}
function priceInField()
{
     for(i=0;i<document.abonneerForm["typeabo"].length;i++)
     {
        if (document.abonneerForm["typeabo"][i].checked == true)
            abonneerPriceInField(document.abonneerForm["typeabo"][i].value);
           
     }
    
}
function changePayment(e)
{
     if(e == 2 || e == 3)
     {
       document.getElementById("PaymentInfo").style.display= 'block';
     }
     if(e == 1)
     {
       document.getElementById("PaymentInfo").style.display = 'none';
     }
}
