
    function dswitch(shid)
    {
        var gb=document.getElementById(shid + "_b");
        var gm=document.getElementById(shid + "_m");
		if (gb.className == "")
			{
			gb.className = "dhover";
			gm.className = "";
			}
		else
			{
			gb.className = "";
			gm.className = "hide";
			}
    }
    function dshow(shid)
    {
        var gb=document.getElementById(shid + "_b");
        var gm=document.getElementById(shid + "_m");
		gb.className = "dhover";
		gm.className = "";
	}
    function dhide(shid)
    {
        var navidid=0;
        var gb=document.getElementById(shid + "_b");
        var gm=document.getElementById(shid + "_m");
		if (navidid == "1")
		{
		gb.className = "nav_now";
		gm.className = "hide";
		}
		else
		{
		gb.className = "";
		gm.className = "hide";
		}
	}
    function pshow(shid)
    {
        var gb=document.getElementById(shid + "_b");
        var gm=document.getElementById(shid + "_m");
		gb.className = "popmenu_bh";
		gm.className = "popmenu_m";
	}
    function phide(shid)
    {
        var navidid=0;
        var gb=document.getElementById(shid + "_b");
        var gm=document.getElementById(shid + "_m");
		gb.className = "popmenu_b";
		gm.className = "hide";
	}
    function tswitch(tid)
    {
        var tm=document.getElementById(tid);
		if (tm.className == "hide")
			{
			tm.className = "";
			}
		else
			{
			tm.className = "hide";
			}
    }
    function tshow(tid)
    {
        var tm=document.getElementById(tid);
		tm.className = "";
	}
    function thide(tid)
    {
        var tm=document.getElementById(tid);
		tm.className = "hide";
	}


//
// patch of innerText for firefox
//
(function (bool) {
    function setInnerText(o, s) {
        while (o.childNodes.length != 0) {
            o.removeChild(o.childNodes[0]);
        }

        o.appendChild(document.createTextNode(s));
    }

    function getInnerText(o) {
        var sRet = "";

        for (var i = 0; i < o.childNodes.length; i ++) {
            if (o.childNodes[i].childNodes.length != 0) {
                sRet += getInnerText(o.childNodes[i]);
            }

            if (o.childNodes[i].nodeValue) {
                if (o.currentStyle.display == "block") {
                    sRet += o.childNodes[i].nodeValue + "\n";
                } else {
                    sRet += o.childNodes[i].nodeValue;
                }
            }
        }

        return sRet;
    }

    if (bool) {
        HTMLElement.prototype.__defineGetter__("currentStyle", function () {
            return this.ownerDocument.defaultView.getComputedStyle(this, null);
        });

        HTMLElement.prototype.__defineGetter__("innerText", function () {
            return getInnerText(this);
        })

        HTMLElement.prototype.__defineSetter__("innerText", function(s) {
            setInnerText(this, s);
        })
    }
})(/Firefox/.test(window.navigator.userAgent));

function accMul(arg1,arg2)
{
	var m=0,s1=arg1.toString(),s2=arg2.toString();
	try
	{
		m+=s1.split(".")[1].length;
	}
	catch(e){}
	try
	{
		m+=s2.split(".")[1].length;
	}
	catch(e){}
	return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
}

function accDiv(arg1,arg2)
{
	var t1=0,t2=0,r1,r2;
	try
	{
		t1=arg1.toString().split(".")[1].length;
	}
	catch(e){}
	try
	{
		t2=arg2.toString().split(".")[1].length;
	}
	catch(e){}

	with(Math)
	{
		r1=Number(arg1.toString().replace(".",""))
		r2=Number(arg2.toString().replace(".",""))
		return accMul((r1/r2),pow(10,t2-t1));
	}
}

function accAdd(arg1,arg2)
{
	var r1,r2,m;
	try
	{
		r1=arg1.toString().split(".")[1].length;
	}
	catch(e)
	{
		r1=0;
	}
	try
	{
		r2=arg2.toString().split(".")[1].length;
	}
	catch(e)
	{
		r2=0;
	}
	m=Math.pow(10,Math.max(r1,r2));
	return accDiv((arg1*m+arg2*m),m);
}

function Subtr(arg1,arg2)
{
     var r1,r2,m,n;
     try
     {
     	r1=arg1.toString().split(".")[1].length;
     }
     catch(e)
     {
     	r1=0;
     }
     try
     {
     	r2=arg2.toString().split(".")[1].length;
     }
     catch(e)
     {
     	r2=0;
     }
     m=Math.pow(10,Math.max(r1,r2));
     n=(r1>=r2)?r1:r2;
     return ((arg1*m-arg2*m)/m).toFixed(n);
}

function formatNumber(num,pattern)
{
	var strarr = num?num.toString().split('.'):['0'];
	var fmtarr = pattern?pattern.split('.'):[''];
 	var retstr = '';

	var str = strarr[0];
	var fmt = fmtarr[0];
	var i = str.length-1;
	var comma = false;
	for(var f=fmt.length-1;f>=0;f--)
	{
		switch(fmt.substr(f,1))
		{
		   case '#':
		    if(i>=0)
	     retstr = str.substr(i--,1) + retstr;
    break;
   case '0':
    if(i>=0)
     retstr = str.substr(i--,1) + retstr;
    else
     retstr = '0' + retstr;
    break;
   case ',':
    comma = true;
    retstr=','+retstr;
    break;
  }
 }
 if(i>=0)
 {
  if(comma)
  {
   var l = str.length;
   for(;i>=0;i--)
   {
    retstr = str.substr(i,l) + retstr;
    if(i>0 && ((l-i)%3)==0)
     retstr = ',' + retstr;
   }
  }
  else{
   retstr = str.substr(0,i+1) + retstr;}
 }
 retstr = retstr + '.';
 //
 str = strarr.length>1?strarr[1]:'';
 fmt = fmtarr.length>1?fmtarr[1]:'';
 i=0;
 for(var f=0;f<fmt.length;f++)
 {
  switch(fmt.substr(f,1))
  {
   case '#':
    if(i<str.length)
     retstr+=str.substr(i++,1);
    break;
   case '0':
    if(i<str.length)
     retstr+=str.substr(i++,1);
    else
     retstr+='0';
    break;
  }
 }
 return retstr.replace(/^,+/,'').replace(/\.$/,'');
}

function formatprice(nPrice)
{
	var n=parseInt(nPrice);
	var x=nPrice-n;

	if (x>=0 && x<=0.25) return n;
	if (x>0.25 && x<=0.75) return accAdd(n,0.5);
	if (x>0.75) return n+1;
}

	var	nProduct=0, nLicense=1, nUpgrade=1, nDiscount=0;
	var sPromoCode="";
	var nLicenseSave0=1,nLicenseSave1=1,nLicenseSave2=1,nLicenseSave3=1,nLicenseSave4=1,nLicenseSave5=1;

	function selectproducts(sParam)
	{
		var sParamObject;

		if (sParam=="chkAll1")
		{
			nProduct=0;
			nLicense=nLicenseSave0;
		}
		if (sParam=="chkSD1")
		{
			nProduct=1;
			nLicense=nLicenseSave1;
		}
		if (sParam=="chkRC1")
		{
			nProduct=2;
			nLicense=nLicenseSave2;
		}
		if (sParam=="chkHC1")
		{
			nProduct=3;
			nLicense=nLicenseSave3;
		}
		if (sParam=="chkDC1")
		{
			nProduct=4;
			nLicense=nLicenseSave4;
		}
		if (sParam=="chkDR1")
		{
			nProduct=5;
			nLicense=nLicenseSave5;
		}


		if (sParam=="lstProductPriceAll1") nLicense=1;
		if (sParam=="lstProductPriceAll2") nLicense=2;
		if (sParam=="lstProductPriceAll3") nLicense=3;
		if (sParam=="lstProductPriceAll4") nLicense=4;
		if (sParam=="lstProductPriceAll5") nLicense=5;
		if (sParam=="lstProductPriceAll10") nLicense=10;
		if (sParam=="lstProductPriceAll15") nLicense=15;
		if (sParam=="lstProductPriceAll25") nLicense=25;
		if (sParam=="lstProductPriceAll50") nLicense=50;
		if (sParam=="lstProductPriceAllsite") nLicense=1000;

		if (sParam=="lstProductPriceSD1") nLicense=1;
		if (sParam=="lstProductPriceSD2") nLicense=2;
		if (sParam=="lstProductPriceSD3") nLicense=3;
		if (sParam=="lstProductPriceSD4") nLicense=4;
		if (sParam=="lstProductPriceSD5") nLicense=5;
		if (sParam=="lstProductPriceSD10") nLicense=10;
		if (sParam=="lstProductPriceSD15") nLicense=15;
		if (sParam=="lstProductPriceSD25") nLicense=25;
		if (sParam=="lstProductPriceSD50") nLicense=50;
		if (sParam=="lstProductPriceSDsite") nLicense=1000;

		if (sParam=="lstProductPriceRC1") nLicense=1;
		if (sParam=="lstProductPriceRC2") nLicense=2;
		if (sParam=="lstProductPriceRC3") nLicense=3;
		if (sParam=="lstProductPriceRC4") nLicense=4;
		if (sParam=="lstProductPriceRC5") nLicense=5;
		if (sParam=="lstProductPriceRC10") nLicense=10;
		if (sParam=="lstProductPriceRC15") nLicense=15;
		if (sParam=="lstProductPriceRC25") nLicense=25;
		if (sParam=="lstProductPriceRC50") nLicense=50;
		if (sParam=="lstProductPriceRCsite") nLicense=1000;

		if (sParam=="lstProductPriceHC1") nLicense=1;
		if (sParam=="lstProductPriceHC2") nLicense=2;
		if (sParam=="lstProductPriceHC3") nLicense=3;
		if (sParam=="lstProductPriceHC4") nLicense=4;
		if (sParam=="lstProductPriceHC5") nLicense=5;
		if (sParam=="lstProductPriceHC10") nLicense=10;
		if (sParam=="lstProductPriceHC15") nLicense=15;
		if (sParam=="lstProductPriceHC25") nLicense=25;
		if (sParam=="lstProductPriceHC50") nLicense=50;
		if (sParam=="lstProductPriceHCsite") nLicense=1000;

		if (sParam=="lstProductPriceDC1") nLicense=1;
		if (sParam=="lstProductPriceDC2") nLicense=2;
		if (sParam=="lstProductPriceDC3") nLicense=3;
		if (sParam=="lstProductPriceDC4") nLicense=4;
		if (sParam=="lstProductPriceDC5") nLicense=5;
		if (sParam=="lstProductPriceDC10") nLicense=10;
		if (sParam=="lstProductPriceDC15") nLicense=15;
		if (sParam=="lstProductPriceDC25") nLicense=25;
		if (sParam=="lstProductPriceDC50") nLicense=50;
		if (sParam=="lstProductPriceDCsite") nLicense=1000;

		if (sParam=="lstProductPriceDR1") nLicense=1;
		if (sParam=="lstProductPriceDR2") nLicense=2;
		if (sParam=="lstProductPriceDR3") nLicense=3;
		if (sParam=="lstProductPriceDR4") nLicense=4;
		if (sParam=="lstProductPriceDR5") nLicense=5;
		if (sParam=="lstProductPriceDR10") nLicense=10;
		if (sParam=="lstProductPriceDR15") nLicense=15;
		if (sParam=="lstProductPriceDR25") nLicense=25;
		if (sParam=="lstProductPriceDR50") nLicense=50;
		if (sParam=="lstProductPriceDRsite") nLicense=1000;


		if (sParam=="lstProductPriceAll1") nLicenseSave0=1;
		if (sParam=="lstProductPriceAll2") nLicenseSave0=2;
		if (sParam=="lstProductPriceAll3") nLicenseSave0=3;
		if (sParam=="lstProductPriceAll4") nLicenseSave0=4;
		if (sParam=="lstProductPriceAll5") nLicenseSave0=5;
		if (sParam=="lstProductPriceAll10") nLicenseSave0=10;
		if (sParam=="lstProductPriceAll15") nLicenseSave0=15;
		if (sParam=="lstProductPriceAll25") nLicenseSave0=25;
		if (sParam=="lstProductPriceAll50") nLicenseSave0=50;
		if (sParam=="lstProductPriceAllsite") nLicenseSave0=1000;

		if (sParam=="lstProductPriceSD1") nLicenseSave1=1;
		if (sParam=="lstProductPriceSD2") nLicenseSave1=2;
		if (sParam=="lstProductPriceSD3") nLicenseSave1=3;
		if (sParam=="lstProductPriceSD4") nLicenseSave1=4;
		if (sParam=="lstProductPriceSD5") nLicenseSave1=5;
		if (sParam=="lstProductPriceSD10") nLicenseSave1=10;
		if (sParam=="lstProductPriceSD15") nLicenseSave1=15;
		if (sParam=="lstProductPriceSD25") nLicenseSave1=25;
		if (sParam=="lstProductPriceSD50") nLicenseSave1=50;
		if (sParam=="lstProductPriceSDsite") nLicenseSave1=1000;

		if (sParam=="lstProductPriceRC1") nLicenseSave2=1;
		if (sParam=="lstProductPriceRC2") nLicenseSave2=2;
		if (sParam=="lstProductPriceRC3") nLicenseSave2=3;
		if (sParam=="lstProductPriceRC4") nLicenseSave2=4;
		if (sParam=="lstProductPriceRC5") nLicenseSave2=5;
		if (sParam=="lstProductPriceRC10") nLicenseSave2=10;
		if (sParam=="lstProductPriceRC15") nLicenseSave2=15;
		if (sParam=="lstProductPriceRC25") nLicenseSave2=25;
		if (sParam=="lstProductPriceRC50") nLicenseSave2=50;
		if (sParam=="lstProductPriceRCsite") nLicenseSave2=1000;

		if (sParam=="lstProductPriceHC1") nLicenseSave3=1;
		if (sParam=="lstProductPriceHC2") nLicenseSave3=2;
		if (sParam=="lstProductPriceHC3") nLicenseSave3=3;
		if (sParam=="lstProductPriceHC4") nLicenseSave3=4;
		if (sParam=="lstProductPriceHC5") nLicenseSave3=5;
		if (sParam=="lstProductPriceHC10") nLicenseSave3=10;
		if (sParam=="lstProductPriceHC15") nLicenseSave3=15;
		if (sParam=="lstProductPriceHC25") nLicenseSave3=25;
		if (sParam=="lstProductPriceHC50") nLicenseSave3=50;
		if (sParam=="lstProductPriceHCsite") nLicenseSave3=1000;

		if (sParam=="lstProductPriceDC1") nLicenseSave4=1;
		if (sParam=="lstProductPriceDC2") nLicenseSave4=2;
		if (sParam=="lstProductPriceDC3") nLicenseSave4=3;
		if (sParam=="lstProductPriceDC4") nLicenseSave4=4;
		if (sParam=="lstProductPriceDC5") nLicenseSave4=5;
		if (sParam=="lstProductPriceDC10") nLicenseSave4=10;
		if (sParam=="lstProductPriceDC15") nLicenseSave4=15;
		if (sParam=="lstProductPriceDC25") nLicenseSave4=25;
		if (sParam=="lstProductPriceDC50") nLicenseSave4=50;
		if (sParam=="lstProductPriceDCsite") nLicenseSave4=1000;

		if (sParam=="lstProductPriceDR1") nLicenseSave5=1;
		if (sParam=="lstProductPriceDR2") nLicenseSave5=2;
		if (sParam=="lstProductPriceDR3") nLicenseSave5=3;
		if (sParam=="lstProductPriceDR4") nLicenseSave5=4;
		if (sParam=="lstProductPriceDR5") nLicenseSave5=5;
		if (sParam=="lstProductPriceDR10") nLicenseSave5=10;
		if (sParam=="lstProductPriceDR15") nLicenseSave5=15;
		if (sParam=="lstProductPriceDR25") nLicenseSave5=25;
		if (sParam=="lstProductPriceDR50") nLicenseSave5=50;
		if (sParam=="lstProductPriceDRsite") nLicenseSave5=1000;


		if (sParam=="lstProductUpgrade1") nUpgrade=1;
		if (sParam=="lstProductUpgrade2") nUpgrade=2;
		if (sParam=="lstProductUpgrade3") nUpgrade=3;
		if (sParam=="lstProductUpgrade4") nUpgrade=4;
		if (sParam=="lstProductUpgrade5") nUpgrade=5;

		if (sParam=="Discount0") nDiscount=0;
		if (sParam=="Discount20%") nDiscount=2;
		if (sParam=="Discount3m") nDiscount=3;

		//------------------------------------------------------------------------------------
		var chkAll1=document.getElementById("chkAll1");
		var chkAll2=document.getElementById("chkAll2");

		var chkSD1=document.getElementById("chkSD1");
		var chkSD2=document.getElementById("chkSD2");

		var chkRC1=document.getElementById("chkRC1");
		var chkRC2=document.getElementById("chkRC2");

		var chkHC1=document.getElementById("chkHC1");
		var chkHC2=document.getElementById("chkHC2");

		var chkDC1=document.getElementById("chkDC1");
		var chkDC2=document.getElementById("chkDC2");

		var chkDR1=document.getElementById("chkDR1");
		var chkDR2=document.getElementById("chkDR2");

		var tableAll=document.getElementById("tableAll");
		var tableSD=document.getElementById("tableSD");
		var tableRC=document.getElementById("tableRC");
		var tableHC=document.getElementById("tableHC");
		var tableDC=document.getElementById("tableDC");
		var tableDR=document.getElementById("tableDR");

		var tablePriceProducts=document.getElementById("tablePriceProducts");

		var lstPriceAll1=document.getElementById("lstPriceAll1");
		var lstPriceAll2=document.getElementById("lstPriceAll2");

		var lstPriceSD1=document.getElementById("lstPriceSD1");
		var lstPriceSD2=document.getElementById("lstPriceSD2");

		var lstPriceRC1=document.getElementById("lstPriceRC1");
		var lstPriceRC2=document.getElementById("lstPriceRC2");

		var lstPriceHC1=document.getElementById("lstPriceHC1");
		var lstPriceHC2=document.getElementById("lstPriceHC2");

		var lstPriceDC1=document.getElementById("lstPriceDC1");
		var lstPriceDC2=document.getElementById("lstPriceDC2");

		var lstPriceDR1=document.getElementById("lstPriceDR1");
		var lstPriceDR2=document.getElementById("lstPriceDR2");

		var DisplayPriceAll0=document.getElementById("DisplayPriceAll0");
		var DisplayPriceAll1=document.getElementById("DisplayPriceAll1");

		var DisplayPriceSD0=document.getElementById("DisplayPriceSD0");
		var DisplayPriceSD1=document.getElementById("DisplayPriceSD1");

		var DisplayPriceRC0=document.getElementById("DisplayPriceRC0");
		var DisplayPriceRC1=document.getElementById("DisplayPriceRC1");

		var DisplayPriceHC0=document.getElementById("DisplayPriceHC0");
		var DisplayPriceHC1=document.getElementById("DisplayPriceHC1");

		var DisplayPriceDC0=document.getElementById("DisplayPriceDC0");
		var DisplayPriceDC1=document.getElementById("DisplayPriceDC1");

		var DisplayPriceDR0=document.getElementById("DisplayPriceDR0");
		var DisplayPriceDR1=document.getElementById("DisplayPriceDR1");

		lstPriceAll1.className="";
		lstPriceSD1.className="";
		lstPriceRC1.className="";
		lstPriceHC1.className="";
		lstPriceDC1.className="";
		lstPriceDR1.className="";

		lstPriceAll2.className="hide";
		lstPriceSD2.className="hide";
		lstPriceRC2.className="hide";
		lstPriceHC2.className="hide";
		lstPriceDC2.className="hide";
		lstPriceDR2.className="hide";

		chkAll1.style.display="block";
		chkAll2.style.display="none";

		chkSD1.style.display="block";
		chkSD2.style.display="none";

		chkRC1.style.display="block";
		chkRC2.style.display="none";

		chkHC1.style.display="block";
		chkHC2.style.display="none";

		chkDC1.style.display="block";
		chkDC2.style.display="none";

		chkDR1.style.display="block";
		chkDR2.style.display="none";

		phide('pop01');
		phide('pop02');
		phide('pop03');
		phide('pop04');
		phide('pop05');
		phide('pop06');
		phide('pop07');

		tableAll.className="purchaseli_n";
		tableSD.className="purchaseli_n";
		tableRC.className="purchaseli_n";
		tableHC.className="purchaseli_n";
		tableDC.className="purchaseli_n";
		tableDR.className="purchaseli_n";


		if (nProduct==0)
		{
			chkAll1.style.display="none";
			chkAll2.style.display="block";
			tablePriceProducts.className="purchase_mm pmm_01";
			tableAll.className="purchaseli_d";
			lstPriceAll1.className="hide";
			lstPriceAll2.className="";
			if (sParam.indexOf("lstProductPrice")==0)
			{
				sParamObject=document.getElementById(sParam);
				DisplayPriceAll0.innerText=sParamObject.innerText;
				DisplayPriceAll1.innerText=sParamObject.innerText;
			}
		}

		if (nProduct==1)
		{
			chkSD1.style.display="none";
			chkSD2.style.display="block";
			tablePriceProducts.className="purchase_mm pmm_02";
			tableSD.className="purchaseli_d";
			lstPriceSD1.className="hide";
			lstPriceSD2.className="";
			if (sParam.indexOf("lstProductPrice")==0)
			{
				sParamObject=document.getElementById(sParam);
				DisplayPriceSD0.innerText=sParamObject.innerText;
				DisplayPriceSD1.innerText=sParamObject.innerText;
			}
		}

		if (nProduct==2)
		{
			chkRC1.style.display="none";
			chkRC2.style.display="block";
			tablePriceProducts.className="purchase_mm pmm_03";
			tableRC.className="purchaseli_d";
			lstPriceRC1.className="hide";
			lstPriceRC2.className="";
			if (sParam.indexOf("lstProductPrice")==0)
			{
				sParamObject=document.getElementById(sParam);
				DisplayPriceRC0.innerText=sParamObject.innerText;
				DisplayPriceRC1.innerText=sParamObject.innerText;
			}
		}

		if (nProduct==3)
		{
			chkHC1.style.display="none";
			chkHC2.style.display="block";
			tablePriceProducts.className="purchase_mm pmm_04";
			tableHC.className="purchaseli_d";
			lstPriceHC1.className="hide";
			lstPriceHC2.className="";
			if (sParam.indexOf("lstProductPrice")==0)
			{
				sParamObject=document.getElementById(sParam);
				DisplayPriceHC0.innerText=sParamObject.innerText;
				DisplayPriceHC1.innerText=sParamObject.innerText;
			}
		}

		if (nProduct==4)
		{
			chkDC1.style.display="none";
			chkDC2.style.display="block";
			tablePriceProducts.className="purchase_mm pmm_05";
			tableDC.className="purchaseli_d";
			lstPriceDC1.className="hide";
			lstPriceDC2.className="";
			if (sParam.indexOf("lstProductPrice")==0)
			{
				sParamObject=document.getElementById(sParam);
				DisplayPriceDC0.innerText=sParamObject.innerText;
				DisplayPriceDC1.innerText=sParamObject.innerText;
			}
		}

		if (nProduct==5)
		{
			chkDR1.style.display="none";
			chkDR2.style.display="block";
			tablePriceProducts.className="purchase_mm pmm_06";
			tableDR.className="purchaseli_d";
			lstPriceDR1.className="hide";
			lstPriceDR2.className="";
			if (sParam.indexOf("lstProductPrice")==0)
			{
				sParamObject=document.getElementById(sParam);
				DisplayPriceDR0.innerText=sParamObject.innerText;
				DisplayPriceDR1.innerText=sParamObject.innerText;
			}
		}

		//-------------------------------------------------------------------------------
		// Calc Price
		//-------------------------------------------------------------------------------
		var nSoftPriceNow,nSoftPriceOld,nUpgradePrice,nUpgradePrice2,nUpgradePrice3,nUpgradePrice4,nUpgradePrice5,nDiscountPrice,nTotalPriceNow,nTotalPriceOld;
/*
		if (nLicense==1)    nSoftPriceNow=9.95;
		if (nLicense==2)    nSoftPriceNow=16.00;
		if (nLicense==3)    nSoftPriceNow=23.00;
		if (nLicense==4)    nSoftPriceNow=29.00;
		if (nLicense==5)    nSoftPriceNow=35.00;
		if (nLicense==10)   nSoftPriceNow=65.00;
		if (nLicense==15)   nSoftPriceNow=90.00;
		if (nLicense==25)   nSoftPriceNow=138.00;
		if (nLicense==50)   nSoftPriceNow=250.00;
		if (nLicense==1000) nSoftPriceNow=450.00;

		nSoftPriceOld=accMul(nSoftPriceNow,3);
		if (nProduct==0) nSoftPriceOld=accMul(nSoftPriceNow,5);

		if (nProduct==0)
		{
			if (nLicense==1) nSoftPriceNow=10.95;
			if (nLicense==2) nSoftPriceNow=18.00;
			if (nLicense==3) nSoftPriceNow=26.00;
			if (nLicense==4) nSoftPriceNow=33.00;
			if (nLicense==5) nSoftPriceNow=40.00;
			if (nLicense==10) nSoftPriceNow=75.00;
			if (nLicense==15) nSoftPriceNow=105.00;
			if (nLicense==25) nSoftPriceNow=163.00;
			if (nLicense==50) nSoftPriceNow=300.00;
			if (nLicense==1000) nSoftPriceNow=499.00;
		}
   */
	/*	if (nLicense==1)    nSoftPriceNow=29.95;
		if (nLicense==2)    nSoftPriceNow=56.00;
		if (nLicense==3)    nSoftPriceNow=80.85;
		if (nLicense==4)    nSoftPriceNow=101.00;
		if (nLicense==5)    nSoftPriceNow=119.75;
		if (nLicense==10)   nSoftPriceNow=222.50;
		if (nLicense==15)   nSoftPriceNow=299.25;
		if (nLicense==25)   nSoftPriceNow=456.25;
		if (nLicense==50)   nSoftPriceNow=825.00;
		if (nLicense==1000) nSoftPriceNow=1600.00;

		nSoftPriceOld=accMul(nSoftPriceNow,3);
		if (nProduct==0) nSoftPriceOld=accMul(nSoftPriceNow,5);

		if (nProduct==0)
		{
			if (nLicense==1) nSoftPriceNow=30.95;
			if (nLicense==2) nSoftPriceNow=58.00;
			if (nLicense==3) nSoftPriceNow=83.83;
			if (nLicense==4) nSoftPriceNow=105.00;
			if (nLicense==5) nSoftPriceNow=124.75;
			if (nLicense==10) nSoftPriceNow=232.50;
			if (nLicense==15) nSoftPriceNow=314.25;
			if (nLicense==25) nSoftPriceNow=481.25;
			if (nLicense==50) nSoftPriceNow=875.00;
			if (nLicense==1000) nSoftPriceNow=2000.00;
		}

*/
        if (nLicense==1)    nSoftPriceNow=19.95;
		if (nLicense==2)    nSoftPriceNow=37.90;
		if (nLicense==3)    nSoftPriceNow=55.35;
		if (nLicense==4)    nSoftPriceNow=71.80;
		if (nLicense==5)    nSoftPriceNow=87.25;
		if (nLicense==10)   nSoftPriceNow=149.50;
		if (nLicense==15)   nSoftPriceNow=217.50;
		if (nLicense==25)   nSoftPriceNow=350.50;
		if (nLicense==50)   nSoftPriceNow=650.50;
		if (nLicense==1000) nSoftPriceNow=1200.00;

		nSoftPriceOld=accMul(nSoftPriceNow,3);
		if (nProduct==0) nSoftPriceOld=accMul(nSoftPriceNow,5);

		if (nProduct==0)
		{
			if (nLicense==1) nSoftPriceNow=20.95;
			if (nLicense==2) nSoftPriceNow=39.90;
			if (nLicense==3) nSoftPriceNow=58.35;
			if (nLicense==4) nSoftPriceNow=75.80;
			if (nLicense==5) nSoftPriceNow=92.25;
			if (nLicense==10) nSoftPriceNow=159.50;
			if (nLicense==15) nSoftPriceNow=232.50;
			if (nLicense==25) nSoftPriceNow=375.00;
			if (nLicense==50) nSoftPriceNow=700.00;
			if (nLicense==1000) nSoftPriceNow=1500.00;
		}


		/*if (nProduct > 0) nSoftPriceOld=nSoftPriceNow+10*nLicense;*/
        if (nProduct > 0)
        {
            nSoftPriceOld = nLicense*39.95;
        }

		nUpgradePrice=0;

		nUpgradePrice2=accMul(nSoftPriceNow,0.6);
		nUpgradePrice3=nUpgradePrice2+accMul(nSoftPriceNow,0.5);
		nUpgradePrice4=nUpgradePrice3+accMul(nSoftPriceNow,0.4);
		nUpgradePrice5=nUpgradePrice4+accMul(nSoftPriceNow,0.3);

		nUpgradePrice2=formatprice(nUpgradePrice2);
		nUpgradePrice3=formatprice(nUpgradePrice3);
		nUpgradePrice4=formatprice(nUpgradePrice4);
		nUpgradePrice5=formatprice(nUpgradePrice5);

		if (nUpgrade==2) nUpgradePrice=nUpgradePrice2;
		if (nUpgrade==3) nUpgradePrice=nUpgradePrice3;
		if (nUpgrade==4) nUpgradePrice=nUpgradePrice4;
		if (nUpgrade==5) nUpgradePrice=nUpgradePrice5;


		nDiscountPrice=0;

		if (nDiscount==2)
		{
			nDiscountPrice=accAdd(nSoftPriceNow,nUpgradePrice);
			if (nDiscountPrice.toString().indexOf(".95")>0) nDiscountPrice=accAdd(nDiscountPrice,0.05);
			nDiscountPrice=-formatprice(accMul(nDiscountPrice,0.2));
		}

		nTotalPriceNow=accAdd(accAdd(nSoftPriceNow,nUpgradePrice),nDiscountPrice);
		nTotalPriceOld=accAdd(nSoftPriceOld,nUpgradePrice);

		//-------------------------------------------------------------------------------
		var sUpgradePrice1,sUpgradePrice2,sUpgradePrice3,sUpgradePrice4,sUpgradePrice5;

		var DisplayUpgradeService=document.getElementById("DisplayUpgradeService");
		var lstProductUpgrade1=document.getElementById("lstProductUpgrade1");
		var lstProductUpgrade2=document.getElementById("lstProductUpgrade2");
		var lstProductUpgrade3=document.getElementById("lstProductUpgrade3");
		var lstProductUpgrade4=document.getElementById("lstProductUpgrade4");
		var lstProductUpgrade5=document.getElementById("lstProductUpgrade5");

		sUpgradePrice1="1 Year Software Upgrade Service ($0.00)"
		sUpgradePrice2="2 Year Software Upgrade Service ($"+formatNumber(nUpgradePrice2,"###,###,###.00")+")"
		sUpgradePrice3="3 Year Software Upgrade Service ($"+formatNumber(nUpgradePrice3,"###,###,###.00")+")"
		sUpgradePrice4="4 Year Software Upgrade Service ($"+formatNumber(nUpgradePrice4,"###,###,###.00")+")"
		sUpgradePrice5="5 Year Software Upgrade Service ($"+formatNumber(nUpgradePrice5,"###,###,###.00")+")"

		lstProductUpgrade1.innerText=sUpgradePrice1;
		lstProductUpgrade2.innerText=sUpgradePrice2;
		lstProductUpgrade3.innerText=sUpgradePrice3;
		lstProductUpgrade4.innerText=sUpgradePrice4;
		lstProductUpgrade5.innerText=sUpgradePrice5;

		if (nUpgrade==1) DisplayUpgradeService.innerText=sUpgradePrice1;
		if (nUpgrade==2) DisplayUpgradeService.innerText=sUpgradePrice2;
		if (nUpgrade==3) DisplayUpgradeService.innerText=sUpgradePrice3;
		if (nUpgrade==4) DisplayUpgradeService.innerText=sUpgradePrice4;
		if (nUpgrade==5) DisplayUpgradeService.innerText=sUpgradePrice5;

		var DisplayUpgradeYear=document.getElementById("DisplayUpgradeYear");
		DisplayUpgradeYear.innerText=nUpgrade;


		var lblSoftPriceOld=document.getElementById("lblSoftPriceOld");
		var lblSoftPriceNow=document.getElementById("lblSoftPriceNow");

		var lblDiscountPrice=document.getElementById("lblDiscountPrice");
		var lblUpgradePrice=document.getElementById("lblUpgradePrice");

		var lblTotalPriceOld=document.getElementById("lblTotalPriceOld");
		var lblTotalPriceNow=document.getElementById("lblTotalPriceNow");

		var sSoftPriceOld,sSoftPriceNow,sUpgradePrice,sDiscountPrice,sTotalPriceOld,sTotalPriceNow;

		sSoftPriceOld="$"+formatNumber(nSoftPriceOld,"###,###,###.00");
		sSoftPriceNow="$"+formatNumber(nSoftPriceNow,"###,###,###.00");
		sUpgradePrice="$"+formatNumber(nUpgradePrice,"###,###,###.00");
		sDiscountPrice="-$"+formatNumber(-nDiscountPrice,"###,###,###.00");
		sTotalPriceOld="$"+formatNumber(nTotalPriceOld,"###,###,###.00");
		sTotalPriceNow="$"+formatNumber(nTotalPriceNow,"###,###,###.00");


		lblSoftPriceOld.innerText=sSoftPriceOld;
		lblSoftPriceNow.innerText=sSoftPriceNow;
		lblUpgradePrice.innerText=sUpgradePrice;
		lblDiscountPrice.innerText=sDiscountPrice;
		lblTotalPriceOld.innerText=sTotalPriceOld;
		lblTotalPriceNow.innerText=sTotalPriceNow;

		var DiscountPriceTable=document.getElementById("DiscountPriceTable");

		if (nDiscount==0)
		{
			DiscountPriceTable.style.display="none";
			lblDiscountPrice.className="green z18";
		}
		if (nDiscount==2)
		{
			DiscountPriceTable.style.display="";
			lblDiscountPrice.className="green z18";
		}
		if (nDiscount==3)
		{
			DiscountPriceTable.style.display="";
			lblDiscountPrice.innerText="Additional free 3 months software upgrade service.";
			lblDiscountPrice.className="green";
		}
	}

var xmlHttp;
function createXHR()
{
	if (window.XMLHttpRequest)
	{
		xmlHttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (xmlHttp)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function CheckDiscountResult()
{
    var DiscountError=document.getElementById("DiscountError");
    var DiscountOK=document.getElementById("DiscountOK");
	if (xmlHttp.readyState==4)
	{
		window.status="Completed";
		s=xmlHttp.responseText;
		//alert(s);
		if (xmlHttp.status == 200)
		{
    		if (s=="3m")
    		{
    			DiscountError.style.display="none";
    			DiscountOK.style.display="block";
    			selectproducts("Discount3m");
    		}
    		else if (s=="20%")
    		{
    			DiscountError.style.display="none";
    			DiscountOK.style.display="block";
    			selectproducts("Discount20%");
    		}
    		else
    		{
    			DiscountError.style.display="block";
    			DiscountOK.style.display="none";
    			selectproducts("Discount0");
    		}
		}
	}
}

function checkdiscount()
{
	var txtDiscountCode=document.getElementById("txtDiscountCode");
	var sValue=txtDiscountCode.value;
	sPromoCode=sValue;
	if (sValue=="")
	{
	}
	if (!createXHR())
	{
		//alert("error");
	}
	var url="/include/checkdiscount.asp?id=" + sValue + "&timeStamp=" + new Date().getTime();
	window.status="Checking coupon or discount code...";
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange=CheckDiscountResult;
	xmlHttp.send(null);
}

	function submitorder()
	{
        var orderCategory=nProduct.toString();
        var orderNum=nLicense.toString();
        switch (orderCategory)
        {
            case '0':
                if(orderNum=='1000')
                {
                    var productSec='3514995';
                    var orderTrueNum='1';
                }
                else
                {
                    var productSec='3514974';
                    var orderTrueNum=orderNum;
                }
                break;
            case '1':
                if(orderNum=='1000')
                {
                    var productSec='3514742';
                    var orderTrueNum='1';
                }
                else
                {
                    var productSec='3513241';
                    var orderTrueNum=orderNum;
                }
                break;
            case '2':
                if(orderNum=='1000')
                {
                    var productSec='3514768';
                    var orderTrueNum='1';
                }
                else
                {
                    var productSec='3513689';
                    var orderTrueNum=orderNum;
                }
                break;
            case '3':
                if(orderNum=='1000')
                {
                    var productSec='3514794';
                    var orderTrueNum='1';
                }
                else
                {
                    var productSec='3513733';
                    var orderTrueNum=orderNum;
                }
                break;
            case '4':
                if(orderNum=='1000')
                {
                    var productSec='3514818';
                    var orderTrueNum='1';
                }
                else
                {
                    var productSec='3513770';
                    var orderTrueNum=orderNum;
                }
                break;
            case '5':
                if(orderNum=='1000')
                {
                    var productSec='3514836';
                    var orderTrueNum='1';
                }
                else
                {
                    var productSec='3508644';
                    var orderTrueNum=orderNum;
                }
                break;
        }
        var url="https://secure.avangate.com/order/checkout.php?PRODS="+productSec+"&QTY="+orderTrueNum+"&CART=1";
		//location.href=url;
        window.open(url,"_blank");
	}


