(function(){

	$.fn.component_resize = function()
	{
        /*if(!$.fn.component_resize.first && $.ie6 && _theme=='manhattan') {
            $.fn.component_resize.first = true;
            $('#menu li a').pngfix();
        }
        if(_theme=='headline') {
            $.fn.component_resize.o_h = 293;
            $.fn.component_resize.f = function() 
            {
                $.fn.component_resize.c_h = $(".widget_contact").height() + 115;
                $.fn.component_resize.b_h = $(".widget_biography").height() + 105;

                $.fn.component_resize.h = Math.min(Math.max($.fn.component_resize.c_h, $.fn.component_resize.b_h), $.fn.component_resize.o_h);
                if($.ie6 && $.fn.component_resize.h >= $.fn.component_resize.o_h) { $(".widget_biography .summary").height(173); }
                $.fn.component_resize.dec = $.fn.component_resize.o_h - $.fn.component_resize.h;

                $("#banner").height($.fn.component_resize.h);
                $("#cv").css({backgroundPosition: "right -"+ $.fn.component_resize.dec +"px"});
                $("#menu").css("top", $.fn.component_resize.h);
                $("#cv_bloc").css({backgroundPosition: "right -"+ $.fn.component_resize.dec +"px"});
                $.fn.component_resize.t = setTimeout($.fn.component_resize.f, 300);
            };
            if($.fn.component_resize.t) clearTimeout($.fn.component_resize.t);
            $.fn.component_resize.t = setTimeout($.fn.component_resize.f, 50);

        }
        else if(_theme!='headline'){
            if($.fn.component_resize.t)
            {
                $.fn.component_resize.f = function() {
                    $("#banner").css("height","");
                    $("#cv").removeAttr("style");
                    $("#menu").removeAttr("style");
                    $("#cv_bloc").removeAttr("style");
                    $.fn.component_resize.headline = false;
                    clearTimeout($.fn.component_resize.t);
                    $.fn.component_resize.t = null;
                };
                $.fn.component_resize.f(); 
            }                   
        }*/
    };
    
})(jQuery);

(function(){
	$.fn.component_reloadMenu = function(wname,t,wname_oldon) 
	{ 		
		if(!window.user_cv_id)return false;
		t=$("#menu");
		wname_oldon = t.find('li.on a').attr('rel');
		$.get(window.reloadMenu_url, null, function(data) 
		{	
			data=$(data);t.replaceWith(data); 	
			if(wname)var newmenu = data.find('li.'+wname+' a');
			if(wname && wname==wname_oldon && !newmenu.length){location.href=window.uri; return false;}
			else {
				data.find("li."+wname_oldon).addClass("on");
			}
			if(wname)data.find('li.'+wname+' a').animate({opacity:0}, 150, function() {
				$(this).animate({opacity:1}, 150, function() {
					$(this).animate({opacity:0}, 150, function() {
						$(this).animate({opacity:1}, 150, function() {
				
						});
					});
				});
			});
		});
		$.get(window.reloadAddContent_url, null, function(data) 
		{	
			var old_sel_href = $("#addcontent .submenu-on").attr("href").split("#")[1];
			if(data!="")$("#addcontent").html(data);
			$("#addcontent a[href*=#"+old_sel_href+"]").trigger("click");
		});
		return this;
	};
})(jQuery);

