(function($)
{

	// Here is the entry point for your front javascript
  
})(jQuery);

$(document).ready(function () {

	$('.quickflip-wrapper').quickFlip();
	$('a[rel]').overlay({expose: '#004010',
		onBeforeLoad: function(event) {
			if (this.getTrigger().attr('href') != '#')
			{
				$('#' + this.getOverlay().attr('id') + ' .scrollPane').load(this.getTrigger().attr('href'), function() {
					$('#' + this.getOverlay().attr('id') + ' .scrollPane').jScrollPane();
					
				});
			}
			else if (this.getTrigger().attr('id'))
			{	
				$('#formArea').load('/frontend_dev.php/card/contact?id=' + this.getTrigger().attr('id'));
				
			}
			else if(this.getTrigger().attr('rel') == '#kontakt')
			{
				$('#formAreaContact').load('/frontend_dev.php/card/contact');
			}
		},
		onLoad: function(event) {
			$('#' + this.getOverlay().attr('id') + ' .scrollPane').jScrollPane();
			}

	});
	
	$('a.details').click(function() {
		var url = $(this).attr('href');
		$('#mehr' + $(this).attr('id') + ' .details').load(url);
		$('#mehr' + $(this).attr('id')).overlay( {
			expose: '#004010',
			api: true 
			}).load();
		return false;
	});
});

function sendForm(form)
{
	$(form).parent().load('/card/thankYou?' + $(form).serialize());
	return false;
}