/************************
* script.js
* common jsvascript definition
************************/

jQuery(function(){
	//add target(_blank) attribute to external links(except shiragazome.jp)
	$("a").each(function(){
		if($(this).attr("href")){
			var a = $(this).attr("href");
		
			if(/*!a.match(/shiragazome/) &&*/ a.match(/http:\/\//)){
				$(this).attr("target","_blank");
			}
		}
	});
	
	//pagetop button position
	var p = $("div#pagetop");
	var c = $("div#box_contents");
	var s = $("div#box_side");
	
	if(c.height() < s.height()){
		p.css({"top":s.height() - 25});
	}else{
		p.css({"top":c.height()});
		c.css({"padding-bottom":"25px"});
	}
});
