	//on ENTER pressed
	document.onkeydown = checkKeycode;

	function checkKeycode(e) {
	
		var keycode;
		if (window.event) keycode = window.event.keyCode;
		else if(e) keycode = e.which;
		if(keycode == 13){
				
			k1 = document.searchform0.s.value;	
			k2 = document.searchform1.s.value;
		
			if(k1!=""){
			
				searchKeyword($k1);
				return;
				
			}		
			
			if(k2!=""){
			
				searchKeyword($k2);
				return;
				
			}
			
			return;		
			
		}
	}  

	//delete all things from warenkorb
	function deleteAll(){
	
		request_url = "/warencorb.html?action=deleteall&";
		window.location.href = request_url;		
	
	}

	
	//zur Kasse
	function zurKasse(){
	
		request_url = "http://www.herrenausstatter.de/php/basket/index.php";
		window.location.href = request_url;
			
	}
	
	//insert a new artikel into warenkorb
	function insertIntoWarencorb(id){
		
		if(isNaN(document.mengeform.menge.value)||document.mengeform.menge.value<1||document.mengeform.menge.value>999){
		
			alert("Menge Wert ungültig!");
			document.mengeform.menge.value = 1;
			document.mengeform.menge.focus();
			
			return false;
		}
		
		
		request_url = "http://www.herrenausstatter.de/php/basket/index.php?m=a&h=http://www.herrenausstatter.de/produkte/22/"+id+".html&p="+id;
		//window.frames["warencorb"].location = request_url;
		window.frames[0].location = request_url;
		
		var timeout = 1000;		
		setTimeout("postToWarencorb()",timeout);
				
	}
	
	//action to insert artikel
	function postToWarencorb(){
		
		document.pidform.menge.value =  document.mengeform.menge.value;
		document.pidform.submit();
	
	}
	
	//make a zoom view of a picture	
	function einZoomen(id){	
	
		window.open('/zoom.html?pid='+id,'zoom','resizable=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,toolbar=0,width=400,height=555');

	}
	
	//sort list of products
	function sortNach(links,obj){

		window.location= links+obj.options[obj.selectedIndex].value;
  
	}
	
	//change number of products
	function updateMenge(flag){
	
		var target = document.mengeform.menge;		
		if(isNaN(target.value)) target.value = 1;
		if(target.value>100||target.value<1) target.value = 1;
				
		if(flag==0){
		
			if(target.value>1 && target.value<=100) target.value--;			
			else			
			if(target.value==1) target.value = 100;			
		
		}else
	
		if(flag==1){
		
			if(target.value>0 && target.value<100) target.value++;			
			else			
			if(target.value==100) target.value = 1;			
		
		}
	
	}

	//take action to search
	function doSearch($flag){
	
		var target;
		
		if($flag == 0)	target = document.searchform0; 
		else
		if($flag == 1)	target = document.searchform1; 
		
		if(target.s.value.length<3){
			
			alert("das Keyword muss mindestens 3 Buchstaben enthalten!");
			target.focus();
			return false;
		
		}
		
		$k = target.s.value;
		
		if($k!="")searchKeyword($k);
		
	}
	
	//take action to search
	function searchKeyword($k){
	
		request_url = "/suche/"+escape($k)+"/1/";
		window.location = request_url;
	
	}
	
