
var Country
var State
var SubmitButton
var VATNumber
var ButtonInvoice
var ButtonCC
var ExistingLicenseKey
var TextBoxLicenseKey
var NumOfLicensesSPE


function ValidateCountry (source, arguments)
{
    if (arguments.Value == "0")	
        arguments.IsValid = false;	
    else
        arguments.IsValid = true;
}

function ValidateState(source,arguments)
{
    if (Country.value == 'UNITED STATES' || Country.value == 'United States' || Country.value == 'USA' || Country.value == 'Canada' || Country.value == 'CANADA')
    {
        if(arguments.Value == '0') 
	        arguments.IsValid = false;
        else 
	        arguments.IsValid = true;
    }
}
function CalculatePriceOrder()
{
var tempPricePerUnit; 
var temTotal;
         if(radioButtonDollar.checked)
         {
            tempPricePerUnit = 20.00;
            
         }
         else if(radioButtonEuro.checked)
	     {
	        tempPricePerUnit = 30.00;
	     }
	     else if(radioButtonPound.checked)
	     {
	        tempPricePerUnit = 40.00;
	     
	     }
	     
         
        tempTotal = NumOfLicenses.value * parseFloat(tempPricePerUnit);
		tempPricePerUnit = parseFloat(tempPricePerUnit).toFixed(2);
		tempTotal = parseFloat(tempTotal).toFixed(2);
        
        if(radioButtonDollar.checked)
	    {
	        LabelPricePerUnit.innerHTML = '$'+tempPricePerUnit;
	        LabelTotal.innerHTML = '$'+tempTotal;
	    }
    	
	    else if(radioButtonEuro.checked)
	    {
	        LabelPricePerUnit.innerHTML = '&euro;'+tempPricePerUnit; 
	        LabelTotal.innerHTML = '&euro;'+tempTotal; 
	    }
	    else if(radioButtonPound.checked)
	    {
	        LabelPricePerUnit.innerHTML = '&pound;'+tempPricePerUnit; 
		    LabelTotal.innerHTML = '&pound;'+tempTotal; 
	    }
	    LabelQTY.innerHTML = NumOfLicenses.value;
	    
}
function CheckNumOfLicenses()
{ debugger;
     var decimalNum=(NumOfLicenses.value).indexOf('.');
     var decimalNumP=(NumOfLicenses.value).indexOf(',');
     var number = parseFloat(NumOfLicenses.value) * 2.00;
    
    if(parseInt(NumOfLicenses.value) > 10)
    {
        NumOfLicenses.value = 10;
       
    }
    
    if(parseInt(NumOfLicenses.value) < 1 )
    {
        NumOfLicenses.value = 1;
        
    }
    
    if(decimalNum != -1 || decimalNumP != -1)
    {
        NumOfLicenses.value = 1;
    
    }
   
    debugger;
    
    if(isNaN(NumOfLicenses.value * 2.00))
    {
        NumOfLicenses.value = 1;
    }
    
    
   
     
     LabelQTY.innerHTML =  NumOfLicenses.value 
}


function CheckConditionContact(obj)
{
    ButtonSubmit= document.getElementById('ctl00_ContentPlaceHolder1_btnSubmit');
  
    
    if (obj.checked)
    {
     ButtonSubmit.disabled = false;
     ButtonSubmit.style.cursor = "pointer";
     ButtonSubmit.setAttribute("class", "send-btn"); //For Most Browsers
     ButtonSubmit.setAttribute("className", "send-btn");//For IE only
    
 }
 else
 {
     ButtonSubmit.disabled = true;
     ButtonSubmit.style.cursor = "default";
     ButtonSubmit.setAttribute("class", "send-off"); //For Most Browsers
     ButtonSubmit.setAttribute("className", "send-off");//For IE only
    
 }
}

function CheckCondition(obj)
{
    ButtonSubmit= document.getElementById('btnSubmit');
   
    if (obj.checked)
    {
     ButtonSubmit.disabled = false;
     ButtonSubmit.style.cursor = "pointer";
     ButtonSubmit.setAttribute("class", "submit-btn"); //For Most Browsers
     ButtonSubmit.setAttribute("className", "submit-btn");//For IE only
    
 }
 else
 {
     ButtonSubmit.disabled = true;
     ButtonSubmit.style.cursor = "default";
     ButtonSubmit.setAttribute("class", "submit-off"); //For Most Browsers
     ButtonSubmit.setAttribute("className", "submit-off");//For IE only
    
 }
}

function CheckConditionRegister(obj)
{
    ButtonSubmit= document.getElementById('btnSubmit');
   
    if (obj.checked)
    {
     ButtonSubmit.disabled = false;
     ButtonSubmit.style.cursor = "pointer";
     ButtonSubmit.setAttribute("class", "submit-btn-orange"); //For Most Browsers
     ButtonSubmit.setAttribute("className", "submit-btn-orange");//For IE only
    
 }
 else
 {
     ButtonSubmit.disabled = true;
     ButtonSubmit.style.cursor = "default";
     ButtonSubmit.setAttribute("class", "submit-off-orange"); //For Most Browsers
     ButtonSubmit.setAttribute("className", "submit-off-orange");//For IE only
    
 }
}

function CheckConditionOneYearOrder(obj)
{
    ButtonInvoice= document.getElementById('ctl00_Contentplaceholder1_btnOrderInvoice');
    ButtonCC= document.getElementById('ctl00_Contentplaceholder1_btnOrderCC');
  
    
    if (obj.checked)
    {
     ButtonInvoice.disabled = false;
     ButtonInvoice.style.cursor = "pointer";
     ButtonInvoice.setAttribute("class", "orderinvoice-btn"); //For Most Browsers
     ButtonInvoice.setAttribute("className", "orderinvoice-btn");//For IE only
     ButtonCC.disabled = false;
     ButtonCC.style.cursor = "pointer";
     ButtonCC.setAttribute("class", "orderviacc-btn"); //For Most Browsers
     ButtonCC.setAttribute("className", "orderviacc-btn");//For IE only
    
 }
 else
 {
     ButtonInvoice.disabled = true;
     ButtonInvoice.style.cursor = "default";
     ButtonInvoice.setAttribute("class", "orderinvoice-off"); //For Most Browsers
     ButtonInvoice.setAttribute("className", "orderinvoice-off");//For IE only
     ButtonCC.disabled = true;
     ButtonCC.style.cursor = "default";
     ButtonCC.setAttribute("class", "orderviacc-off"); //For Most Browsers
     ButtonCC.setAttribute("className", "orderviacc-off");//For IE only
    
 }
}

function CheckPlatform()
{

    RadioButtonWin= document.getElementById('ctl00_ContentPlaceHolder1_rbWin');
    RadioButtonMac= document.getElementById('ctl00_ContentPlaceHolder1_rbMac');
    RadioButtonLinux = document.getElementById('ctl00_ContentPlaceHolder1_rbLinux');
    CheckBoxWeb = document.getElementById('ctl00_ContentPlaceHolder1_cbWeb');
    CheckBoxDesktop = document.getElementById('ctl00_ContentPlaceHolder1_cbDesktop');
    
    if(CheckBoxWeb.checked)
    {
        RadioButtonWin.disabled = true;
        RadioButtonMac.disabled = true;
        RadioButtonLinux.disabled = true;
        
    }
    if(CheckBoxDesktop.checked)
    {
        RadioButtonWin.disabled = false;
        RadioButtonMac.disabled = false;
        RadioButtonLinux.disabled = false;
    }
    if(CheckBoxWeb.checked && CheckBoxDesktop.checked)
    {
        RadioButtonWin.disabled = false;
        RadioButtonMac.disabled = false;
        RadioButtonLinux.disabled = false;
    
    }
    if(!CheckBoxWeb.checked && !CheckBoxDesktop.checked)
    {
        RadioButtonWin.disabled = true;
        RadioButtonMac.disabled = true;
        RadioButtonLinux.disabled = true;
        
    }
}

