
	var login_check = '/login.php';
	var login_id_text = 'agent_id';
	var login_pw_text = 'agent_pw';


	$(function(){

		// AJAXのキャッシュOFF
		$.ajaxSetup({ cache: false });

		// リンクの点線除去
		$('a').focus( function(){ if(this.blur)this.blur(); });

		// 画像ロールオーバー
		$('img.imgover').rollover('_on');
		// 画像ロールオーバー(点滅)
		$('img.imgfade, a img, input[type="image"]').live('mouseover', function () {
			$(this).animate({opacity:'0.6'}, {duration: 500} );
			$(this).animate({opacity:'1.0'}, {duration: "normal"});
		});

		// コメント内のリンク
		$('div#mainbody a[href^="http"]').addClass('blank');
		$('a[href$=".pdf"]').addClass('blank').click(function(){ _gaq.push(['_trackPageview', $(this).attr('href')]); });
		$('a[href$=".gif"], a[href$=".jpg"]').click(function(){ _gaq.push(['_trackPageview', $(this).attr('href')]); });
		$('a[link]').each(function(){ $(this).addClass('blank').attr('href', $(this).attr('link')); });

		// 別窓
		$('a.blank').live('click', function(){ this.target = "_blank"; });

		// メールスパム対策
		$('span.mail').each(function(){
			var mailadd = $(this).text();
			mailadd = mailadd.replace('atmark', '@');
			$(this).html('<a href="mailto:' + mailadd + '">' + mailadd + '</a>');
		});

		$('#bookmark').bookmark({sites:['yahoo','hatena','livedoor','fc2','buzzurl','newsing','iza','delicious','nifty']});

		// フローティングバナーの表示状態取得
		$.get('/banner_view.php', function(data){
			if (data == 'show') $('#signature').show();
		});
		// フローティングバナーを非表示にし、状態保存
		$('#signature a.close').click(function(){
			$.get('/banner_view.php?view=hide');
			$('#signature').hide();
		});

		$('.lightbox').click(function(){ _gaq.push(['_trackPageview', $(this).attr('href')]); });
		$('.lightbox').lightbox();
		$('#side .mobile.box img:last').wrap('<a href="/m/"></a>');

		$('select.number[max]').each(function(){
			var min = $(this).attr('min') == undefined ? 0 : $(this).attr('min');
			var max = $(this).attr('max');
			var option = "";
			for (i=min; i<=max; i++) {
				option += '<option value="' + i + '">' + i + '</option>';
			}
			$(this).html(option);
		});

		$('dl.accordion > dt').css({ 'cursor':'pointer' });
		$('dl.accordion > dd').hide();
		$('dl.accordion > dt').click(function(){
			var parent = $(this).closest('dl');
			$(this).next().slideToggle();
		});

	});

	function to_object (json_str) {
		return eval('(' + json_str + ')');
	}

	jQuery.postJSON = function(url, data, callback) {
		jQuery.post(url, data, callback, "json");
	};
	
