categories = new Array("praxis", "hypnose", "therapie", "heilung", "karten", "kontakt");


$(document).ready( function() {
	
	/* getting the form by the 1und1 formmailer */
	$('#kontakt form, #popup form').after('<div id="contactform"></div>').remove();
	
	var options = {
	    success:    function() { 
	        $('#contactform form').after('Vielen Dank für Ihre Nachricht.').remove();
	    } 
	}; 
	$('#kontakt #contactform').load('/tinc?key=W4MgiPGp&formname=kontakt_geburtskurse form', function() {
		$('#kontakt #contactform form').ajaxForm(options); 
	});
	$('#popup #contactform').load('/tinc?key=W4MgiPGp&formname=kontakt_geburtskurse2 form', function() {
		$('#popup #contactform form').ajaxForm(options); 
	});
	
	if ($('body').attr('id') == "home") {
		for (var x = 0; x < categories.length; ++x) {
			var Bild = new Image();
			Bild.src = "images/visual-" + categories[x] + ".png";
			//console.log("image preloading - " + Bild.src);
		}
		
		$('#popup_home').click( function() {
			window.open($(this).attr('href'), 'popup_home', 'width=680,height=530,scrollbars=yes');
			return false;
		});
	}
});
