jQuery(document).ready(function() {
	$("#overlay").overlay({ 

        // start exposing when overlay starts to load 
        onBeforeLoad: function() { 

            // this line does the magic. it makes the background image sit on top of the mask 
            this.getBackgroundImage().expose({color: '#fff'}); 
        },  

        // when overlay is closed take the expose instance and close it as well 
        onClose: function() {
            $.expose.close(); 
        }

	});
	    
	var api = $("#overlay").overlay();
	
	$("#overlay").next('img').css({display:'none'});
	if(usingIE6){
		$("#overlay").next('img').css({background:'#fff',border:'2px solid #ddd'});
		$("#overlay").next('img').ifixpng();
		$('div.close').ifixpng();
	}
	
	
	
	$('.news-single-link').children('a').click(function(){

		$('#overlay_content_inner').html('<div class="align-center" style="padding: 50px 0;"><img style="display: block; margin: 0 auto;" src="fileadmin/templates/main/images/overlay/loading.gif" alt="Loading.." /></div>');

		api.load();

		//$('#overlay_content_inner').load($(this).attr('href') + "#container_1 div.content_and_menu div.content");

		$('#overlay_content_inner').load($(this).attr('href')+'?type=50'  );
		if(usingIE6){
		
			//$('img[@src$=.png],div.close').ifixpng();

		}

		return false;
	});
	
	$("body").children("img").hide();
});