function setLanguage(lang) {
	window.document.cookie = 'lang='+lang+';path=/; expires=Mon, 01-Jan-2018 00:00:01 GMT';
	window.document.location.reload();
}

function setCurrency(currency) {
	window.document.cookie = 'currency='+currency+';path=/; expires=Mon, 01-Jan-2018 00:00:01 GMT';
	window.document.location.reload();
}





/*
* Search
*/


function lookup(inputString) {
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
		$.post("rpc.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
		});
	}
}





/*
Tree
*/

function shoh(id) { 
	
	if (document.getElementById) { 
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
			} else {
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				document.all.id.style.display = 'none';
			}
		}
	}
}


/* cart controls */

function incquant(id) {
	current = document.getElementById('quant_'+id).value;
	current = current*1 + 1;
	document.getElementById('quant_'+id).value = current;
	document.getElementById('post_action').value='updatecart';
	document.forms['remove_cart'].submit();
}

function decquant(id) {
	current = document.getElementById('quant_'+id).value;
	current = current*1 - 1;
	document.getElementById('quant_'+id).value = current;
	document.getElementById('post_action').value='updatecart';
	document.forms['remove_cart'].submit();
}


