// JavaScript Document
$(function(){
	
	
	if ($.browser.mozilla && (parseFloat($.browser.version) < 1.9)) { return this; }
	
	//要素指定
	var gnav = $("#globalNav a, #indexSubNav a, #logo a")
	//新規イメージ制作
	gnav.each(function(){
		$(this).wrapInner('<span class="navWrap"></span>')
				.prepend('<span class="navInsert">'+$(this).text(this)+'</span>')
		//css取得
		var BgI =$(this).css("backgroundImage");
		var Hig =$(this).css("height");
		//backgroundPosition IE
		if ($.browser.msie){ 
			var BpX = $(this).css("backgroundPosition-x");
			var BpY = $(this).css("backgroundPosition-y");
			
		}
		//backgroundPosition その他
		else {
		var test4 =$(this).css("backgroundPosition");
		 var BpX = test4.split(' ')[0];                
		 var BpY = test4.split(' ')[1];
		}
		//スタイル適用
		$(this).children(".navWrap , .navInsert").css({
					backgroundImage : BgI,
					left: "0px",
					top : "0px",
					backgroundPosition : BpX+" "+ BpY,
					cursor :"pointer"
								})
		$(this).children(".navInsert").css({
					backgroundPosition : BpX+" -"+Hig
								})
		
		});
	//フェード
	gnav.hover(function(){
					$(this).children(".navWrap").stop().fadeTo(1000,0);
									
		}
		 ,function(){  
    				$(this).children(".navWrap").stop().fadeTo(1000,1); 
		 });		
		
		
	
		  
		   });
