/*function changePic(img_id,img_src){//(img_name,img_src) {	
var len = img_src.length;

if (img_src.substring(len-7,len-4)=='sel')	
	document[img_id].src=img_src.substring(0,len-8) + '.gif';
else
	document[img_id].src=img_src.substring(0,len-4) + '_sel.gif';
}*/

$(document).ready(function(){
	$(".menu_image").hover(
		function(){
			if ($(this).attr('src').indexOf('sel')==-1){
				var newSrc = $(this).attr("src").replace(".gif","_sel.gif#hover");
				$(this).attr('src',newSrc);
			}
		},
		function(){
			if ($(this).attr('src').indexOf('sel.gif#hover')!=-1){
				var newSrc = $(this).attr("src").replace("_sel.gif#hover",".gif");
				$(this).attr('src',newSrc);
			}			
	});



});

jQuery.fn.center = function(){

var element = this;
//$(element).load(function(){
	
changeCss();
$(window).bind("resize",function(){
	changeCss();
});
	
function changeCss(){
	
	var elementHeight = $(element).height();
	var elementWidth = $(element).width();
	var windowHeight = $(window).height();
	var windowWidth = $(window).width();	
	
	$(element).css({
		"position" : "absolute",
		"left" : windowWidth / 2 - elementWidth / 2,
		"top" : windowHeight / 2 - elementHeight / 2
	});
};

//});
	
};
	
