function calculatePrice()
   {
      var userCount=document.getElementById('inputLicenses').value;
      var syncuserCount=document.getElementById('inputSyncLicenses').value;
      var price=0;


      if (!isNaN(userCount) )
      {
	price = 0;
 	 if (userCount>0)
	 {
         	if (userCount<=4)
	 	{
	 	     	price = price + userCount*49.95;
		}
		else
		{
			price = price + 4*49.95;
		}
		
	 	if (userCount>=5)
	 	{
			if (userCount>=9)
			{
	     	     		price = price + 5*39.95;	
			}
			else
			{
				price = price + (userCount-5+1)*39.95;	
			}
	 	}
	 	if (userCount>=10)
	 	{
	     	     	if (userCount>=24)
			{
	     	     		price = price + 10*31.95;	
			}
			else
			{
				price = price + (userCount-10+1)*31.95;	
			}
	 	}
		if (userCount>=25)
	 	{
	     	     	if (userCount>=49)
			{
	     	     		price = price + 25*26.95;	
			}
			else
			{
				price = price + (userCount-25+1)*26.95;	
			}
	 	}
		if (userCount>=50)
	 	{
	     	     	if (userCount>=99)
			{
	     	     		price = price + 50*22.95;	
			}
			else
			{
				price = price + (userCount-50+1)*22.95;	
			}
	 	}
		if (userCount>=100)
	 	{
	     	     	if (userCount>=199)
			{
	     	     		price = price + 100*19.95;	
			}
			else
			{
				price = price + (userCount-100+1)*19.95;	
			}
	 	}
		if (userCount>=200)
	 	{
	     	     	if (userCount>=499)
			{
	     	     		price = price + 200*17.45;	
			}
			else
			{
				price = price + (userCount-200+1)*17.45;	
			}
	 	}
		if (userCount>=500)
	 	{
	     	     	price = price + (userCount-500+1)*15.45;	
	 	}
		

         
	 
		
	 	if (userCount>=1000)
		{
	            document.getElementById('spanPrice').innerHTML = "Contact Sales";
	            document.getElementById('spanUnitPrice').innerHTML = "Contact Sales";
                }
	        else
	        {
	            if (document.getElementById('cbLifetime').checked)
		         price = price + userCount *100;

                    document.getElementById('spanPrice').innerHTML ='$'+ Math.round(price*100)/100;
	            document.getElementById('spanUnitPrice').innerHTML = '$'+ Math.round(price*100/userCount)/100;
		}
	 }
	 else
	 {
	    document.getElementById('spanPrice').innerHTML = "n/a";
	    document.getElementById('spanUnitPrice').innerHTML = "n/a";

	 }


      }
      else
      {
	 document.getElementById('spanPrice').innerHTML = "n/a";
      }
   }

function changeLanguage()
{
  if (document.getElementById('language-combo').selectedIndex = 0)
  {

       window.location.href= 'http://www.emclient.com';
  }   
  else
  {

       window.location.href= 'http://cz.emclient.com';

  }
}
function postdata()
{
   var fieldValue = document.getElementById("field1").value;
   postwith("http://someothersite.com",{field1:fieldValue});
}

function postwith (to,p) {
  var myForm = document.createElement("form");
  myForm.method="post" ;
  myForm.action = to ;
  for (var k in p) {
    var myInput = document.createElement("input") ;
    myInput.setAttribute("name", k) ;
    myInput.setAttribute("value", p[k]);
    myForm.appendChild(myInput) ;
  }
  document.body.appendChild(myForm) ;
  myForm.submit() ;
  document.body.removeChild(myForm) ;
}
