





	/**
	*
	*	Funktion, die das Bestellformular eines nicht direkt
	*	käuflichen Artikels anzeigt
	*
	**/
	
		function orderItem(item) {
		
			if(item != '') {
			
				new Effect.ScrollTo('container', { duration:0.3 });
			
				new Effect.BlindUp('shopcontainer', { 
					afterFinish:function() { 
					
						new Ajax.Request('./html/ajax_load_formular.php', {
							method:'post',
							postBody:'item='+item,
							onFailure:function() { alert('ajax request error'); },
							onSuccess:function(t) {
					
								Element.update('shopajaxcontainer', t.responseText);
								new Effect.BlindDown('shopajaxcontainer');
								
							}
						});					
						
					}
				});
				
			}
			
		}
		
	
		function orderItemen(item) {
		
			if(item != '') {
			
				new Effect.ScrollTo('container', { duration:0.3 });
			
				new Effect.BlindUp('shopcontainer', { 
					afterFinish:function() { 
					
						new Ajax.Request('./html/ajax_load_formular_en.php', {
							method:'post',
							postBody:'item='+item,
							onFailure:function() { alert('ajax request error'); },
							onSuccess:function(t) {
					
								Element.update('shopajaxcontainer', t.responseText);
								new Effect.BlindDown('shopajaxcontainer');
								
							}
						});					
						
					}
				});
				
			}
			
		}
	
	
	
	
	/**
	*
	*	Funktion, die per Ajax das Formular auswertet
	*
	**/
	
	function doKostenvoranschlag() {
	
		new Ajax.Request('./html/ajax_send_formular_en.php', {
			method:'post',
			postBody:Form.serialize('shop_bestellanfrage'),
			onFailure:function() { alert('ajax request error'); },
			onSuccess:function(t) {
			
				if(/shop_error/.test(t.responseText)) {
				
					// Fehler zurückgeben
					Element.update('errors', t.responseText);
					if(!Element.visible('errors')) new Effect.BlindDown('errors');
					new Effect.ScrollTo('errors', { offset:-60 });
					
				}
				
				else {
				
					// Fehler ausblenden
					if(Element.visible('errors')) new Effect.BlindUp('errors');
					
					// Ergebnisseite anzeigen
					new Effect.BlindUp('shop_bestellanfrage', {
						afterFinish:function() {
							Element.update('shop_bestellanfrage', '<p>Vielen Dank f&uuml;r Ihre Anfrage! Wir werden uns baldm&ouml;glichst mit Ihnen in Verbindung setzen.</p>');
							new Effect.BlindDown('shop_bestellanfrage', {
								afterFinish:function() {
									window.setTimeout(function() { new Effect.BlindDown('shopcontainer'); new Effect.BlindUp('shop_bestellanfrage'); }, 2500);
									
								}
							});
						}
					});
					
				}
			
			
			}
		});
		
		return false;
	
	}
	
	
	
	
	
	