﻿// JScript File
function upgradelicense()  {
   var uc=GEID("txtActivationCode").value;
   GEID("btnUpgradeNow").disabled=true;
   var lcnid=GetRadioValue("lcn2");
   Licensing.UpgradeLicense(uc,lcnid,ProductID,BuyResult);
}
function buylicense()  {
   GEID("btnBuyNow").disabled=true;
   var lcnid=GetRadioValue("lcn1");
   Licensing.BuyLicense(lcnid,ProductID,BuyResult);
}
function GetRadioValue(name)    {
   var o=document.getElementsByName(name);
   for(var i=0;i<o.length;i++)  {
        if (o[i].checked)
            return  o[i].value;
   } 
}
function BuyResult(oResult) {
    if (oResult[0]=="-1")    {
        GEID("btnUpgradeNow").disabled=false; 
        GEID("btnBuyNow").disabled=false;  
        alert(oResult[1]); 
   }
   else
   {
        window.frames["frmPaypal"].document.forms[0]["item_number"].value=oResult[0].toString();
        window.frames["frmPaypal"].document.forms[0]["amount"].value=oResult[2].toString(); 
        window.frames["frmPaypal"].document.forms[0]["item_name"].value=oResult[3].toString();  
        window.frames["frmPaypal"].document.forms[0].submit();
   }
}
function enteroffer() {
   var s=prompt("Please enter your discount code:","");
   if (s!="")
   {
        ProductInformation.CheckDiscountCode(s,ProductID,offerresult);
   }
}
function offerresult(oResponse)  {
    alert(oResponse);
}
if (typeof(Sys) !== 'undefined') {
    Sys.Application.notifyScriptLoaded();
} 