(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);
jQuery(document).ready(function($){	
	$('#btn_service').click(function(){ $('#service').slideToggle('fast'); });
	$('#btn_back').click(function(){ history.back() });
	$('#btn_copyright').click(function(){ window.open("http://www.blupoint.ch", '_parent', ''); return false; });
	$('#btn_edit').click(function(){
		$('#login').toggle();
		$('#thumbs').toggle();
		$('#gallery').toggle();
	});
	$('#enpix li').clone().appendTo('#gpp');
	$('#gpp li img').removeAttr("style").addClass('gppaddliimg');
	$('#gpp li').addClass('gppaddli');
	$('#gpp li').filter(function(index){
		var gppi = index;
		var picid = $('#enpix li').filter(function(index){
			return index == gppi;			
		});
		var thepic = $(picid).find('img');
		$(this).hover(function(){			
			$(this).css({'border-color' : '#FFF'});
			$(picid).customFadeIn(100);
		},
		function(){
			$(this).css({'border-color' : '#333'});
			$('#enpix li').css({ 'display' : 'none' });
		});
	});
	$('#enpix li').mouseover().css({ 'display' : 'none' });
	if($('#txtlinks').height() > 442) {
		$('#txtlinks').css({ 'height' : '442px', 'overflow' : 'hidden' });
	}
	if($('#txtright1').height() > 169) {
		$('#txtright1').css({ 'height' : '169px', 'overflow' : 'hidden' });
	}
	if($('#txtright2').height() > 169) {
		$('#txtright2').css({ 'height' : '169px', 'overflow' : 'hidden' });
	} 
});
