<!--

	function setText(id, text)
	{
		if (text == null)
			text = "";
	
		document.getElementById(id).innerHTML = text;
		return false;
	}

	function validateQty(id, lang)
	{
		var qty = document.getElementById(id).value;
		
		if (qty > 0 && qty < 1000)
		{
			return true;
		}
		else
		{
			if (lang = "swe")
			{
				alert("Ange ett giltigt nummer");
			}
			else
			{
				alert("Enter a valid number");
			}
			
			return false;
		}
	}


	function validateCheckout(checkoutform)
	{
		var validated = true;
		
		if (empty(checkoutform.name.value))
		{
			$('name_info').innerHTML = "Fill in your name!";
			validated = false;
		}
		else
			$('name_info').innerHTML = "";
			

		if (empty(checkoutform.full_adress.value))
		{
			$('full_adress_info').innerHTML = "Fill in your adress!";
			validated = false;
		}
		else
			$('full_adress_info').innerHTML = "";


		if (empty(checkoutform.country.value))
		{
			$('country_info').innerHTML = "Fill in in the country";
			validated = false;
		}
		else
			$('country_info').innerHTML = "";


		if (empty(checkoutform.phone.value))
		{
			$('phone_info').innerHTML = "Fill in in your phone number";
			validated = false;
		}
		else
			$('country_info').innerHTML = "";


		if (empty(checkoutform.email.value))
		{
			$('email_info').innerHTML = "Fill in your email-adress";
			validated = false;
		}
		else
		{
			if (!checkoutform.email.value.isValidEmail())
			{
				$('email_info').innerHTML = "Enter a valid email-adress!";
				validated = false;
			}
			else
				$('email_info').innerHTML = "";
		}
	
		return validated;
	}
	
	String.prototype.isValidEmail = function(){
		return !!this.match(/^([a-zA-Z0-9\_\-]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9\_-]{1})@([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})\.([a-zA-Z]{2,4})$/)
	}
	
	function empty(text)
	{
		if (text == 0)
			return true;
		else
			return false;
	}
	
	function termsOfSale()
	{
		open_window('/scripts/termsofsale.php', 'termsofuse', 'height=380,width=450,resizable=yes');
		return false;
	}
	
	function open_window(window_url, window_name, window_features)
	{
		var  new_window = window.open(window_url, window_name, window_features);
		
		if(javascript_version > 1.0)
		{
			setTimeout('new_window.focus();', 250);
		}
	}
//-->