$(document).ready(function() {
	$('.infoLink').click(function() {
		jAlert($(this).attr('alt'), $(this).attr('title'));
		return false;
	})
	$('.prompt').click(function() {
		$.alerts.dialogClass = 'helpPrompt';
		showText = $(this).next('span').html();
		if(!(showTitle = $(this).attr('title'))) {
			showTitle = 'Häufig gestellte Fragen - unsere Antworten';
		}
		jAlert(showText, showTitle);
		return false;
	})
	$(".input, textarea").bind('focus', function() {
		$(this).css({borderColor: "#f00"});
	})
	$(".input, textarea").bind('blur', function() {
		$(this).css({borderColor: "#ccc"});
	})
	$(".imageswitch a").lightBox();
	
	// Forms
		
	$('#contactForm, #orderForm').formValidation ({
			newmask : /[0-9]{1}-[0-9]{1}/,	// 1-1
			err_class : "invalidInput"
	})
	
/*
	$('#firstname').example('Max');
	$('#lastname').example('Mustermann');
	$('#email').example('ihre@email.com');
	
*/
	$('.faq h2').click(function() {
		$(this).next('span').toggle();
	})
	$('#2ndAdress').click(function() {
		$('.2ndAdress').animate({opacity: 'toggle'});
	})
	$('#stepsToDo a').click(function(event) {
		linkTarget = $(this).attr('href');
		form = $('form#orderForm');
		$(form).attr('action', linkTarget);
		$(form).get(0).submit();
		return false;
		
	})
})

function stopBubble(event) {
	if(agent.msie) {
		event.cancelBubble = true;
	} else {
		event.stopPropagation();
	}
}