﻿$(document).ready(function(){
	
	if($("div#subRanking > ul.nav").length>0){
		
		var ul_nav = $("div#subRanking > ul.nav");
		
		ul_nav.css({display:"block"});
		
		ul_nav.tabs();
		
		var svr = "http://i.yimg.jp/images/talent/2009/images/";
		var nav_img = "sub_ranking_nav_bg0";
		
		
		ul_nav.css({backgroundImage:"url("+svr+nav_img+"1"+".gif)"});
		
		
		ul_nav.find("li:eq(0) a").click(function(){
				ul_nav.css({backgroundImage:"url("+svr+nav_img+"1"+".gif)"});
		});
		ul_nav.find("li:eq(1) a").click(function(){
				ul_nav.css({backgroundImage:"url("+svr+nav_img+"2"+".gif)"});
		});
		ul_nav.find("li:eq(2) a").click(function(){
				ul_nav.css({backgroundImage:"url("+svr+nav_img+"3"+".gif)"});
		});
	}
	
});

$(document).ready(function(){
	
	if($("div#yms li p.ymsthumb").length>0){
		
		var ymsthumb = $("div#yms li p.ymsthumb");
		
		ymsthumb.hover(function (){
			$(this).css({borderColor:"#26a7e3"});
		}, function (){
			$(this).css({borderColor:"#d0dde3"});
		});
	}
	
	if($("div#yjvs li p.yjvsthumb").length>0){
		
		var yjvsthumb = $("div#yjvs li p.yjvsthumb");
		
		yjvsthumb.hover(function (){
			$(this).css({borderColor:"#26a7e3"});
		}, function (){
			$(this).css({borderColor:"#d0dde3"});
		});
	}
	
	if($("div#clubBitway dd.ph").length>0){
		
		var yjvsthumb = $("div#clubBitway dd.ph");
		
		yjvsthumb.hover(function (){
			$(this).css({borderColor:"#26a7e3"});
		}, function (){
			$(this).css({borderColor:"#e5e9f1"});
		});
	}
	
});

$(document).ready(function(){
	var valueTxt = "例：佐藤";
	
	var input_area = $("input.df");
	
	if(input_area.val() == ""){
		input_area.val(valueTxt);
		input_area.css({color:"#888888"});
		
		input_area.focus(function(){
			if($(this).val() == valueTxt){
				$(this).val("");
				$(this).css({color:"#000000"});
			} else {
				$(this).css({color:"#000000"});
			}
		});
	
		input_area.blur(function(){
			if($(this).val() == ""){
				$(this).val(valueTxt);
				$(this).css({color:"#888888"});
			} else {
				$(this).css({color:"#000000"});
			}
		});
	}	
	
});


$(document).ready(function(){
	if(jQuery.browser.msie){
		var agent = navigator.userAgent;
		
		if(!(agent.indexOf("MSIE 7") == -1)) {
	 		var img = $("ol.grid li a img");
	 		$.each(img,function(){
				var img_h_hrf = $(this).height()/2;
				var img_w_hrf = $(this).width()/2;
				
				img_h_hrf = Math.ceil(img_h_hrf);
				img_w_hrf = Math.ceil(img_w_hrf);
				
				$(this).css({
						"position":"absolute",
						"top":"50%",
						"left":"50%",
						"marginTop":-img_h_hrf,
						"marginLeft":-img_w_hrf
					});
			}); 
		}
		
		if(!(agent.indexOf("MSIE 6") == -1)) {
	 		var img = $("ol.grid li a img");
	 		$.each(img,function(){
				var img_h_hrf = $(this).height()/2;
				var img_w_hrf = $(this).width()/2;
				
				img_h_hrf = Math.floor(img_h_hrf);
				img_w_hrf = Math.floor(img_w_hrf);
				
				$(this).css({"position":"absolute",
						"top":"50%",
						"left":"50%",
						"marginTop":-img_h_hrf,
						"marginLeft":-img_w_hrf
					});
    			}); 
		}
	}
});


$(document).ready(function(){
	if(jQuery.browser.msie){
		var agent = navigator.userAgent;
		
		if(!(agent.indexOf("MSIE 7") == -1)) {
	 		var img = $("div#clubBitway dd.ph a img");
	 		$.each(img,function(){
				var img_h_hrf = $(this).height()/2;
				var img_w_hrf = $(this).width()/2;
				
				img_h_hrf = Math.ceil(img_h_hrf);
				img_w_hrf = Math.ceil(img_w_hrf);
				
				$(this).css({
						"position":"absolute",
						"top":"50%",
						"left":"50%",
						"marginTop":-img_h_hrf,
						"marginLeft":-img_w_hrf
					});
			}); 
		}
		
		if(!(agent.indexOf("MSIE 6") == -1)) {
	 		var img = $("div#clubBitway dd.ph a img");
	 		$.each(img,function(){
				var img_h_hrf = $(this).height()/2;
				var img_w_hrf = $(this).width()/2;
				
				img_h_hrf = Math.floor(img_h_hrf);
				img_w_hrf = Math.floor(img_w_hrf);
				
				$(this).css({"position":"absolute",
						"top":"50%",
						"left":"50%",
						"marginTop":-img_h_hrf,
						"marginLeft":-img_w_hrf
					});
    			}); 
		}
	}
});

