$(document).ready(function(){
	$('#floating img').bind('mouseover', function(){
		if($(this).data("qtip")) $(this).qtip("destroy");
		if($(this).attr('tooltiptext') != null){
			$(this).qtip({
				content:$(this).attr('tooltiptext'),
				position: {
					corner: {
						tooltip: "bottomMiddle",
						target:"topMiddle"
					}
				},
				show: {
					when: false,
					ready: true
				},
				style: {
					border: {
						width: 0,
						radius: 4
					},
					paddingTop: '2px',
					paddingBottom: '0px',
					paddingLeft:'5px',
					paddingRight: '5px',
					textAlign: 'center',
					color: 'white',
					lineHeight: '100%',
					tip:{
						corner: 'bottomMiddle',
        			    color:false,
		            	size: { width: 10, height: 5 }
					},
					name:'gray'
				}
			});
		}
		
//		if($(this).attr('src').match(/(menu_01\.gif|menu_02\.gif)/)){
//			var file = $(this).attr('src').slice(1, $(this).attr('src').lastIndexOf('.'));
//			var ext = $(this).attr('src').slice($(this).attr('src').lastIndexOf('.'));
//			$(this).attr('src', file+'b'+ext);
//		}
	});
	
//	$('#floating img').bind('mouseout', function(){
//		if($(this).attr('src').match(/(menu_01b\.gif|menu_02b\.gif)/)){
//			var file = $(this).attr('src').slice(1, $(this).attr('src').lastIndexOf('.')-1);
//			var ext = $(this).attr('src').slice($(this).attr('src').lastIndexOf('.'));
//			$(this).attr('src', file+ext);
//		}

//	});
	
	$(window).resize(function(){
		resize();
	});
	
	resize();
	
	
});

function resize(){
	var space = 40+($(this).width() - 980) / 2;
	if(space < 50){
		space = 50;
	}
	$('#floating').css('left', space+'px');
}

