/* dynamisches Seitenloading */

jQuery(function() {

	// install flowplayer into flowplayer container
	var player = jQuery("player", "http://www.asandri.com/fileadmin/templates/skins/skin_asandri/source/flowplayer-3.2.7.swf");
	
	// setup button action. it will fire our overlay 
	jQuery("button[rel]").overlay({
		
		// use the Apple effect for overlay
		effect: 'apple',
		
		// when overlay is opened, load our player
		onLoad: function() {
			player.load();
		},
		
		// when overlay is closed, unload our player
		onClose: function() {
			player.unload();
		}
	});
});


jQuery('.sf-menu li a').click(function(){
	var toLoad = jQuery(this).attr('href')+' .contentWrap div.contentSection';
	jQuery('.contentWrap div.contentSection').fadeTo('slow',0,loadContent);
	jQuery('#load').remove();
	jQuery('#pageWrap').append('<span id="load">Ladevorgang...</span>');
	jQuery('#load').fadeIn('normal');
		window.location.hash = jQuery(this).attr('href').substr(0,jQuery(this).attr('href').length);
		function loadContent() {
			jQuery('.contentWrap').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			jQuery('.contentWrap').fadeTo('slow',1,hideLoader());
		}
		function hideLoader() {
			jQuery('#load').fadeOut('normal');
		}
	return false;
});
jQuery(document).ready(function() {

	jQuery(".overlayTrigger").colorbox();
	jQuery('.productDescription').fadeTo(0,0);
	jQuery('.modelContent').hover(
		function(){
			jQuery(this).find('.productDescription').stop().fadeTo(100,0.7);

		},
		function(){
			jQuery(this).find('.productDescription').stop().stop().fadeTo(500,0);
		}
	);
});
