(function($) {
    $.fn.customFadeIn = function(speed, callback) {
        $(this).fadeIn(speed, function() {
                if(jQuery.browser.msie)
                        $(this).get(0).style.removeAttribute('filter');
                if(callback != undefined)
                        callback();
        });
    };
    $.fn.customFadeOut = function(speed, callback) {
        $(this).fadeOut(speed, function() {
                if(jQuery.browser.msie)
                        $(this).get(0).style.removeAttribute('filter');
                if(callback != undefined)
                        callback();
        });
    };
})(jQuery);


$(document).ready(function() {
	loadToMain('home.php', 'home.jpg');

});



//zonder effect
function loadToMain(page, img) {

	$("#main_text").load('/pages/'+page);
	$("#print_text").load('/pages/'+page);
	$("#main_img").attr('src', '/mainbg/'+img);

}

function loadToMain2(page, img) {

	$("#main_text").fadeOut(200, function(){
		if(jQuery.browser.msie)
			$(this).get(0).style.removeAttribute('filter');
		$("#main_text").load('/pages/'+page);
		$("#print_text").load('/pages/'+page);
	}).fadeIn(200, function(){
		if(jQuery.browser.msie)
			$(this).get(0).style.removeAttribute('filter');
	});

	$("#main_img").fadeOut(200, function(){
		$("#main_img").attr('src', '/mainbg/'+img);
	}).fadeIn(200);

}


function loadToMain3(page, img) {

	$("#main_img").fadeOut(200);
	$("#main_text").fadeOut(200, function(){
		if(jQuery.browser.msie)
			$(this).get(0).style.removeAttribute('filter');
		$("#main_img").attr('src', '/mainbg/'+img);
		$("#print_text").load('/pages/'+page);
		$("#main_text").load('/pages/'+page, function(){
			$("#main_text").fadeIn(200, function(){
				if(jQuery.browser.msie)
					$(this).get(0).style.removeAttribute('filter');
			});
			$("#main_img").fadeIn(200);
		});
	});
	
}


function loadToMain4(page, img) {

	$("#main_text").load('/pages/'+page);
	$("#print_text").load('/pages/'+page);


	$("#main_img").fadeOut(300, function(){
		$("#main_img").attr('src', '/mainbg/'+img).delay(500).fadeIn(300);
	});

}
