$(document).ready(function(){$('#bookmarksCont').bookmark();});

$(document).ready(function(){

			$("#underteaser .uitem.ok").hover(
                           function() {$(this).addClass('uhover');},
                           function() {$(this).removeClass('uhover');}
			);
			
/*			$("#underteaser .uitem.ko").hover(
                                function() {
					var tmp = $(this).find('.dist')								   
					t = setTimeout( function() {	
					tmp.show("slow");
				        }, 600 ); 													   
			        },
			        function() {
				        clearTimeout(t); 
				        $(this).find('.dist').hide("fast");
			});
*/
			
			$('#closeclick').click(function () { 
				closeIframe();
				return false;
			});
});


function showmyId(id,url) {
		if ( $("#foldContainerBody").length == 0 ) {		
			for (i= 1; i<=5; i++) {
				$('#fold'+i).fadeOut("slow");
			}	
			$('#foldOutWraper').animate({
				height: 'show'
			}, 'slow');
			$("#fold" + id).fadeIn("slow");
			$("#a" + id).fadeOut("fast");
			$('#preloadCont').html("<div id='ajaxPreloader'>&nbsp;</div>");
			setTimeout( function() {	
				setIframe(url);
			}, 1200 ); 			

		}
}		
	
function setIframe(url) {
	$('#foldContent').ajaxSuccess(function() {
		$('#ajaxPreloader').fadeOut('fast'); 								   
		setTimeout( function() {	
				$('#foldContent').fadeIn('slow');
		}, 1200 ); 	
	
	});
	$('#foldContent').ajaxSend(function() {
		
		$('#ajaxPreloader').html("<div id='txt'>Die Inhalte werden geladen ...</div><div id='closer'><a href='#'>Abbrechen</a></div>");
		$('#ajaxPreloader').fadeTo('slow',1); 	
		$('#closer').click(function () {
				closeIframe();
				return false;									 
			});
	});
	$('#foldContent').load(url);
	$('#closer').click(function() {
		$('#ajaxPreloader').fadeOut();
		closeIframe();						
	});
};



function closeIframe() {
		$('#foldContent').fadeOut();
		setTimeout( function() {	
			for (i= 1; i<=5; i++) {
				$('#fold'+i).hide();
				$("#a" + i).fadeIn("fast");
				$('#fold'+i).animate({
					height: 'show'
				}, 'slow');	
			}
			$('#foldOutWraper').animate({
				height: 'hide'
			}, 'slow');	
			$('#foldContainerBody').remove();
		}, 700 ); 
		$('.disabled').find('.dist').hide();
		
		//$.scrollTo('#fold', 100);
}

