// JavaScript Document
$(function(){

	$('.magazine img').hover(function(){
		var boxheight = $(this).closest('div').css("height").replace('px','');
		eval(boxheight);
		var magazineheight = $(this).height();
		var height = boxheight - magazineheight;
		$(this).stop().animate({top:height},1000);
	}, function() {
		$(this).stop().animate({top:'0px'},1000);
	});
	
	
	$("li").mouseover(function(){	
		$("span",this).addClass("hover");	
		$("div.dropbox",this).css("display","block");
	});
	$("li").mouseout(function(){	
		$("span",this).removeClass("hover");
		$("div.dropbox",this).css("display","none");
	});
	
	$("img.rollover").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
    });
});
$(function(){
	$(".box,.box02>.inner>.inner2").equalbox();
});
function showbadge(){
	var side = "r"; //"l":左寄せ "r":右寄せ
	var top = 300; //画像の上位置
	var width = 32; //画像の幅
	var height = 179; //画像の高さ
	var imgUrl = "/common/images/icon/icon_followus.png"; //画像のURL
	var divId = "TwitterBadge"; //生成するDIVのID(任意で)
	var tipTitle = "followUs"; //ToolTipの文言
	var linkUrl = "http://twitter.com/freepapernavi"; //リンク先URL

	if(!window.XMLHttpRequest)return;
	if(side!='l')
	{
		side='r';
	}
	tabStyleCode='position:fixed;'+'top:'+top+'px;'+'width:'+width+'px;'+'height:'+height+'px;'+'z-index:10000;'+'cursor:pointer;'+'background:url('+imgUrl+') no-repeat;';
	if(side=='l')
	{
		tabStyleCode+='left:0; background-position:right top;';
	}
	else
	{
		tabStyleCode+='right:0; background-position:left top;';
	}

	if(!document.getElementById(divId))
	{
		tfbMainDiv = document.createElement('div');
		tfbMainDiv.setAttribute('id',divId);
		document.body.appendChild(tfbMainDiv);
	}
	else
	{
		tfbMainDiv = document.getElementById(divId);
	}
	tfbMainDiv.innerHTML += '<div style="'+tabStyleCode+'" title="'+tipTitle+'" onclick="window.open(\''+linkUrl+'\');"></div>';
}
