$(function() {
	$('a[href^=#]').click(function() {
		var speed = 400;//ミリ秒
		var href= $(this).attr("href");
		var target = $(href == "#" || href == "" ? 'html' : href);
		var position = target.offset().top;
		$($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, speed, 'swing');
		return false;
	});

	$("#sub_content").css("height","0px");

	$(".mainmenuclass").mouseover(function() {
		$('.submenuclass').fadeOut(250);
	});

	$("#cloud").hover(
		function () {
			$('#submenu-cloud').fadeIn(250);
		},
		function () {
			$("#submenu-cloud").hover(
				function () {
				},
				function () {
					$('#submenu-cloud').fadeOut(250);
				}
			);
		}
	);

	$("#schedule").hover(
		function () {
			$('#submenu-schedule').fadeIn(250);
		},
		function () {
			$("#submenu-schedule").hover(
				function () {
				},
				function () {
					$('#submenu-schedule').fadeOut(250);
				}
			);
		}
	);

});

function get_tl(url,twid,page,target) {

//alert (target);

	$.ajax({
		type: "GET",
		url : url,
		data: "twid="+twid+"&page="+page+"&target="+target,
		cache: false,
		success: function(html){
			$(target).html(html);
			var subContentHeightEnd = $("#main").height() - 187 + "px";
			$(target).animate(
				{
					height:subContentHeightEnd
				},1500
			);
		}
	});
}

function get_tl_work(url,twid,page,target) {

	$.ajax({
		type: "GET",
		url : url,
		data: "twid="+twid+"&page="+page+"&target="+target,
		cache: false,
		success: function(html){
			$(target).html(html);
		}
	});
}

