$(function() {
	
	$("#nav > li > a, .translator-button span, .content-index-button a, .apart-nav li a, .gmap a").hover(
		function(){
			$(this).fadeTo(500, 0);
		},
		function(){
			$(this).fadeTo(500, 1);
		}
	);
	
	$(".apart-category").hover(
		function(){
			$(this).fadeTo(500, 0.5);
		},
		function(){
			$(this).fadeTo(500, 1);
		}
	);
	
	$(".right-menu-bbs a, .right-menu-acom a").hover(
		function(){
			$(this).fadeTo(500, 0);
		},
		function(){
			$(this).fadeTo(500, 1);
		}
	);
	
	//マージン、ボーダーなどの調整
	$(".footer-right-colum:odd, .top-category:last-child, .booking-hotel-wrap .booking-hotel:odd").css("margin-right","0");
	$(".page-detail h4:first-child").addClass("first-komidashi");
	$("td a span:last-child").css("margin-bottom","0");
	$("ul.kakomi li:first-child").css("margin-top","0");
	$(".german-wrap .german-container:odd, .appart-container:odd").css("margin-right","0");
	$(".howto-list li:last-child, .ticket-dl dd:last-child").css("border-bottom","none");
	$(".right-menu-apart dt:first-child, .right-comment dt:first-child").css({
												"borderTop":"#999 1px dotted",
												"paddingTop":"1em"
											});
	$(".right-menu-apart dd:last-child a, .right-comment dd:last-child").css({
												"borderBottom":"none",
												"paddingBottom":"0"
											});

	
	//ブロック要素のコーナー表示	
	$("#drop-inner li, #footer,.right-menu, .top-category, .blog-relation, .blog-menu, .page-relation").corner("bottom");
	$(".entry,.blog-menu-ad").corner("round 10px");
	$(".right-ad").corner("round 8px").parent().css('padding', '1px').corner("round 10px");
	$("#exchange, #top-image, .page-detail .ad, #bbs-wrap, .kakomi, .kakomi2, .appart-h4, #searchboxInc form, .apart-navi-wrap, #topnews-wrap, #tophotel-wrap").corner("round 10px");
	$(".right-ad dt,.qanda-form").corner("round 5px");
	
	if(jQuery.support.leadingWhitespace){
	$("#news-ticcar,#topabout-wrap").corner("round 10px");
	}

	
	
	
	//右側メニューのトグル設定
	$(".transrate-wrap").css("display","none");
	$(".translator-button").toggle(
		function(){
			$(".transrate-wrap").show("fast");
		},
		function(){
			$(".transrate-wrap").hide("fast");
		}
	);
	
	//インプレッサ厶のトグル設定
	$(".impressumDetail").css({"display":"none"});
	$(".impressum").css({"margin-bottom":"0"});
	$(".impressum").toggle(
		function(){
			$(".impressumDetail").show("fast");
			$(this).css({"margin-bottom":"1em"});
		},
		function(){
			$(".impressumDetail").hide("fast");
			$(this).css({"margin-bottom":"0"});
		}
	);
	
	//テーブル内の設定
	$("table td a").hover(
		function(){
			$(this).parent().addClass("hover-td");
		},
		function(){
			$(this).parent().removeClass("hover-td");
		}
	);
	
	//$("table tr td").attr("valign","top");
	
	
	
	
	//アパートページのカテゴリーナビの設定
	$(".apart-navi-wrap > ul").addClass("apart-navi");
	//$(".apart-navi").css("display","none");
	$(".apart-navi > li").css("float","left");
	$(".apart-category").click(function () {
			$(".apart-navi").toggle(500);
			
	});
	
	$(".apart-category").toggle(
		function(){
				$(".apart-category").addClass("apart-category_off")
			},
		function(){
				$(".apart-category").removeClass("apart-category_off")
			});
	

	//TOP imageの設定
	
	img = new Array();
	img[0] = "/images/top_image1.jpg";
	img[1] = "/images/top_image2.jpg";
	img[2] = "/images/top_image3.jpg";

	n = Math.floor(Math.random()*img.length);
	
	$("#top-image").css({
						"background-image":"url('"+img[n]+"')" 
						});
	
	
		//banner-aの設定
	
	img = new Array();
	img[0] = "<a href='/about/anzeige/'><img src='/images/banner_a.png' /></a>";
	img[1] = "<a href='http://www.smartdeli.org/' target='_blank'><img src='/images/banner_smadeli.png' /></a>";

	n = Math.floor(Math.random()*img.length);
	
	$("#banner-a").html(img[n]);
	
	
	//banner-bの設定
	
	img = new Array();
	img[0] = '<a href="/about/anzeige/"><img src="/images/banner_b.gif" /></a>';
	img[1] = '<a href="http://www.amazon.co.jp/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.co.jp%2Fgp%2Fentity%2F%E4%B9%85%E4%BF%9D%E7%94%B0-%E7%94%B1%E5%B8%8C%2FB004LVVJD6%3Fie%3DUTF8%26ref_%3Dep_sprkl_at_B004LVVJD6%23&tag=alexsunny-22&linkCode=ur2&camp=247&creative=7399"><img src="/images/banner_kubota1.png" /></a><img src="https://www.assoc-amazon.jp/e/ir??t=alexsunny-22&l=ur2&o=9" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />';
	img[2] = '<a href="http://www.amazon.co.jp/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.co.jp%2Fgp%2Fentity%2F%E4%B9%85%E4%BF%9D%E7%94%B0-%E7%94%B1%E5%B8%8C%2FB004LVVJD6%3Fie%3DUTF8%26ref_%3Dep_sprkl_at_B004LVVJD6%23&tag=alexsunny-22&linkCode=ur2&camp=247&creative=7399"><img src="/images/banner_kubota2.png" /></a><img src="https://www.assoc-amazon.jp/e/ir??t=alexsunny-22&l=ur2&o=9" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />';

	n = Math.floor(Math.random()*img.length);
		
	$("#banner-b").html(img[n]);


	//banner-cの設定
	
	img = new Array();
	img[0] = "<a href='/about/anzeige/'><img src='/images/banner_c.png' /></a>";

	n = Math.floor(Math.random()*img.length);
	
	$("#banner-c").html(img[n]);
	
	

});

