	
	function menue_show_hide(LAYER, WHAT) {
		
  	if (document.getElementById(LAYER))
			document.getElementById(LAYER).style.visibility = WHAT;

  }
	
  function change_view(FORM,LIST) {
      
    if(LIST == "result") {
      document.search_form.list.value = 'all';
			document.search_form.submit();
    }
    else {
    	document.search_form.list.value = 'result';
			document.search_form.submit();
    }
  
  }
  
  
	function select_catalogue(SHOW_ID) {
	
		document.getElementById('einzel').style.display = 'none';
		document.getElementById('sammel').style.display = 'none';
    document.getElementById('alle').style.display = 'none';
		
		document.getElementById(SHOW_ID).style.display 	= 'inline';
		
	}		
	
	function bid (PRICE, CN_ID, FORM) {
		
		var ORDER = document.getElementById('gb' + CN_ID).value;
		
		if (ORDER < (parseInt(PRICE.replace(/\./, ""))/2)) {
		
			//alert("Der Schätzpreis liegt bei " + PRICE + ".");
      alert("Sorry, zu wenig. Bieten Sie mehr.")
			return;
			
		}
		
  	document.search_form.click2print.value = 'bid';
		document.search_form.order.value = document.getElementById('gb' + CN_ID).value;
		document.search_form.cn_id.value = CN_ID;
		document.search_form.submit();
		
	}
	
	function bid_ajax (PRICE, CN_ID) {
		
		var ORDER = document.getElementById('gb' + CN_ID).value;
		
		if (ORDER < parseInt(PRICE.replace(/\./, ""))) {
			
      alert("Sorry, zu wenig. Bieten Sie mehr.")
			return;
			
		}		
		
		if(window.XMLHttpRequest) {
	    requestobj = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    	requestobj = new ActiveXObject("Microsoft.XMLHTTP");
  	}            
    
  	requestobj.onreadystatechange = update_cart;
		requestobj.open("get", "index.php?page_id=32&type=updateCart&cn_id=" + CN_ID + "&order=" + document.getElementById('gb' + CN_ID).value);
		requestobj.send("");		
		
	}
		
  function update_cart() {
  	switch (requestobj.readyState) {
  		case 4:					
      	alert("Artikel wurde mit dem angegebenen Gebot zu Ihrem Warenkorb hinzugefügt.");
      break;      
    }
  }
	
	function order () {
		
		document.search_form.click2print.value = 'order';
    document.search_form.submit();		
		
	}
	
	function order_delete (CN_ID) {

    document.bid.click2print.value = 'order_delete';
    document.bid.cn_id.value = CN_ID;
    document.bid.submit();
    
	}	
	
	function bid_delete (CN_ID, FORM) {
				
  	document.search_form.click2print.value = 'delete';
		document.search_form.cn_id.value = CN_ID;
		document.search_form.submit();
	
  }
	
	function bid_save() {
		
		if (!document.bid)
			return;
		
		var FORM	 = document.bid;
		
		document.cookie = "Maximum=" + FORM.Maximum.value + ";";
		document.cookie = "Name=" + FORM.Name.value + ";";
		document.cookie = "Strasse=" + FORM.Strasse.value + ";";
		document.cookie = "PLZOrt=" + FORM.PLZOrt.value + ";";
		document.cookie = "Telefon=" + FORM.Telefon.value + ";";
		document.cookie = "Telefax=" + FORM.Telefax.value + ";";
		document.cookie = "KundenNr=" + FORM.KundenNr.value + ";";
		document.cookie = "EMail=" + FORM.EMail.value + ";";
		
	}
	
	function bid_load() {
		
  	var COOKIE = document.cookie.split(";");
  	
  	for (var cn = 0; cn < COOKIE.length; cn++) {
  		
  		var TEMP 				= COOKIE[cn].split("=");
  		var TEMP_COOKIE = TEMP[0].replace(/ /, "");
  		
  		if (document.getElementById(TEMP_COOKIE) && TEMP[1])
  			eval('document.bid.' + TEMP_COOKIE + '.value = "' + TEMP[1] + '";');
  	
  	}
  }
  
  function nw_status(STATUS, VISIBILITY, event) {

		if (STATUS != '') {
		
  		if (navigator.appName.indexOf("Netscape") > -1) {
      
      	var status = document.getElementById('status' + STATUS);
  			
  			status.style.left 			= event.clientX + 15;
  			status.style.top 				= event.clientY + document.body.scrollTop + 20;
  			status.style.visibility = VISIBILITY;
        
      }
  		
      if (navigator.appName.indexOf("Explorer") > -1) {
      
      	var status = document.getElementById('status' + STATUS);
  			
  			status.style.left 			= window.event.clientX + 15;
  			status.style.top 				= window.event.clientY + document.body.scrollTop - window.event.offsetY + 20;
  			status.style.visibility = VISIBILITY;
        
      }
    			
		}
	}