<!-- Begin

var dLicenseValue = 0;
var dOptionsValue = 0;
var strLicenseName = "";
var strOptionsName = "";
var strParam = "";
var strLicenseValue = "";
var strOptionsValue = "";
var strFrom = "";
var dDiscountValue = 0;

function Popup(strPage, iWidth, iHeight)
{
   var w = iWidth;
   var h = iHeight;
   var winl = (screen.width-w)/2;
   var wint = (screen.height-h)/2;
	
   var strText = "";
   if (document.m_OrderForm.item_number.value != null)
   {
      strText = document.m_OrderForm.item_number.value;
   }

   if (strText.indexOf("PADEXPRESSPROFESSIONAL") == 0)
   {
      strPage += "#PROFESSIONAL";
   }
   else if (strText.indexOf("PADEXPRESSPERSONAL") == 0)
   {
      strPage += "#PERSONAL";
   }
   else if (strText.indexOf("PADEXPRESSMASTER") == 0)
   {
      strPage += "#CORPORATE";
   }
   else
   {
      strPage += "#LICENSES";
   }

   if (winl < 0)
   	winl = 0;
		
   if (wint < 0)
   	wint = 0;
		
   windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes,status=no";
   window.open(strPage, "", windowprops);
}

function QSHandler()
{
   var qs=location.search.substr(1).split("&");
   this.data=[];
   for(var i=0;i<qs.length;i++) this.data[qs[i].split("=")[0]]=qs[i].split("=")[1];

   this.QueryString=function(x) 
   {
      return this.data[x];
   };
} 

var Request = new QSHandler();

function GetReferral()
{
   if (Request.QueryString("license"))
   {
      strParam = Request.QueryString("license");

      if (strParam == "PERSONAL")
      {
         document.m_OrderForm.m_License.selectedIndex = 2;
      }
      else if (strParam == "PROFESSIONAL")
      {
         document.m_OrderForm.m_License.selectedIndex = 1;
      }
      else if (strParam == "MASTER")
      {
         document.m_OrderForm.m_License.selectedIndex = 0;
      }
   }

   if (Request.QueryString("from"))
   {
      strFrom = Request.QueryString("from");
   }

   if (Request.QueryString("coupon"))
   {
      if (Request.QueryString("coupon") == "KSOFT10")
      {
         dDiscountValue = 10;
      }

      if (dDiscountValue > 0)
      {
         m_Discount.innerHTML = "Discount Applied: <font color='#008800'><B>$" + dDiscountValue + "</B></font>";
      }
   }
} 

function ChangeLicense()
{
   var strValue = "";
   dLicenseValue = 0;
   var dTotal = 0;
   
   box = document.m_OrderForm.m_License;
   strValue = box.options[box.selectedIndex].value;

   if (strValue == "PADEXPRESSPERSONAL")
   {
      dLicenseValue = 74.95;
      strLicenseName = "PADexpress Personal Edition";
   }
   else if (strValue == "PADEXPRESSPROFESSIONAL")
   {
      dLicenseValue = 94.95;
      strLicenseName = "PADexpress Professional Edition";
   }
   else if (strValue == "PADEXPRESSMASTER")
   {
      dLicenseValue = 124.95;
      strLicenseName = "PADexpress Master Edition";
   }
  
   dTotal = (dLicenseValue + dOptionsValue - dDiscountValue);
   dTotal = dTotal.toFixed(2);
   if (dTotal < 0)
   {
      dTotal = 0;
   }
   document.m_OrderForm.m_OrderTotal.value = dTotal;

   // Fill out the item_name.
   document.m_OrderForm.item_name.value = strLicenseName;
   
   if (strOptionsName.length > 0)
   {
      document.m_OrderForm.item_name.value += ", ";
      document.m_OrderForm.item_name.value += strOptionsName;
   }

   strLicenseValue = strValue;

   // Fill out the item_number.
   document.m_OrderForm.item_number.value = strLicenseValue;
   if (strOptionsValue.length > 0)
   {
      document.m_OrderForm.item_number.value += "_";
      document.m_OrderForm.item_number.value += strOptionsValue;
   }

   if (strFrom.length > 0)
   {
      document.m_OrderForm.item_number.value += "_";
      document.m_OrderForm.item_number.value += strFrom;
   }

   // Update amount.
   document.m_OrderForm.amount.value = document.m_OrderForm.m_OrderTotal.value;   
}

function CheckBox()
{
   var dTotal = 0;
   var strValue = "";
   dOptionsValue = 0;
   strOptionsName = "";

   if (document.m_OrderForm.m_Check1 && document.m_OrderForm.m_Check1.checked)
   {
      dOptionsValue += 34.95;
      strOptionsName += "SEO Expansion Plug-in Pack";
      
      strValue = "EXPANSIONPACK_";
   }

   if (document.m_OrderForm.m_Check2 && document.m_OrderForm.m_Check2.checked)
   {
      dOptionsValue += 24.95;
      if (strOptionsName.length > 0)
      {
         strOptionsName += ", ";
      }
      strOptionsName += "RSSTop55 Plug-in";
      
      strValue += "RSSTOPFIVE_";
   }

   if (document.m_OrderForm.m_Check3 && document.m_OrderForm.m_Check3.checked)
   {
      dOptionsValue += 34.95;
      if (strOptionsName.length > 0)
      {
         strOptionsName += ", ";
      }
      strOptionsName += "Podcast Plug-in";
      
      strValue += "PODCAST_";
   }

   if (document.m_OrderForm.m_Check4 && document.m_OrderForm.m_Check4.checked)
   {
      dOptionsValue += 49.95;
      if (strOptionsName.length > 0)
      {
         strOptionsName += ", ";
      }
      strOptionsName += "Blog Blaster SEO Edition";
      
      strValue += "BLOGBLASTERSEO_";
   }

   if (document.m_OrderForm.m_Check5 && document.m_OrderForm.m_Check5.checked)
   {
      dOptionsValue += 94.95;
      if (strOptionsName.length > 0)
      {
         strOptionsName += ", ";
      }
      strOptionsName += "TrackbackSpeed SEO Edition";
      
      strValue += "TRACKBACKSPEEDSEO";
   }
   
   dTotal = dLicenseValue + dOptionsValue - dDiscountValue;
   dTotal = dTotal.toFixed(2);
   if (dTotal < 0)
   {
      dTotal = 0;
   }
   document.m_OrderForm.m_OrderTotal.value = dTotal;
   
   // Fill out the item_name.
   document.m_OrderForm.item_name.value = strLicenseName;
   
   if (strOptionsName.length > 0)
   {
      document.m_OrderForm.item_name.value += ", ";
      document.m_OrderForm.item_name.value += strOptionsName;
   }

   strOptionsValue = strValue;
   
   // Fill out the item_number.
   document.m_OrderForm.item_number.value = strLicenseValue;
   if (strOptionsValue.length > 0)
   {
      document.m_OrderForm.item_number.value += "_";
      document.m_OrderForm.item_number.value += strOptionsValue;
   }
   
   if (strFrom.length > 0)
   {
      document.m_OrderForm.item_number.value += "_";
      document.m_OrderForm.item_number.value += strFrom;
   }

   // Update amount.
   document.m_OrderForm.amount.value = document.m_OrderForm.m_OrderTotal.value;   
}

//  End -->