﻿var uri="http://www.tabicon.net/js/";

function myfile(n) {
    this.length = n;
    for (i = 0; i < n; i++) {
        this[i] = null
    }
}
var n = 10;
var file = new myfile(n)
file[0] = "jquery.livequery.js";
file[1] = "jquery.lightbox-0.5.js";
file[2] = "ticker.js";
file[3] = "jquery.easing.1.3.js";
file[4] = "jquery.spritemenu-0.2.js";
file[5] = "jquery.infinite-carousel.js";
file[6] = "opacity-rollover2.js";
file[7] = "jqTabContents-comp.js";
file[8] = "jquery.jgrowl.js";
file[9] = "jquery.innerfade.js";

for (i = 0; i <n; i++) {
    document.write('<script type="text/javascript" charset="UTF-8" src="',uri,file[i],'"></script>');
}

$(function(){

	$('#head_menu2').spritemenu({
		  grid:"/images/share/main_menu2.png",
		  buttonwidth: 118,
		  buttonheight: 39
	});
	$('#company_menu_top ul').spritemenu({
		  grid:"/images/company/menu.png",
		  buttonwidth: 90,
		  buttonheight: 27
	});
	
	$('#company_menu_bottom ul').spritemenu({
		  grid:"/images/company/menu_b.png",
		  buttonwidth: 90,
		  buttonheight: 27
	});
	
	$('#spot_menu_top ul').spritemenu({
		  grid:"/images/spot/menu.png",
		  buttonwidth: 90,
		  buttonheight: 27
	});
	
	$('#spot_menu_bottom ul').spritemenu({
		  grid:"/images/spot/menu_b.png",
		  buttonwidth: 90,
		  buttonheight: 27
	});
	
	$('#news_menu').spritemenu({
		  grid:"/images/news/menu.png",
		  buttonwidth: 105,
		  buttonheight: 28
	});
	
	$('.hover_link').opOver(1.0,0.6,200,500);
	$('.latest_spot_box').hover(
	   function(){
	       $(this).css('background-color','#f7f5eb');
	   },
	   function(){
	       $(this).css('background-color','#ffffff');
	   }
	);
	$('.latest_spot_box').click(function(){
	   location.href = $(this).attr('title');
	});
	
	
    $(".request_check,.request_del").livequery('click',function(){
        var companyId = $(this).attr('title').replace('request','');
        if($(this).attr('checked')){
            $.get("/company/request/add/"+companyId,function(data){
                $("#request_list").html(data);
            });
            $.jGrowl.defaults.position = 'center';
            $.jGrowl("まとめて資料請求の<br />リストに追加しました。", { life: 1000 });
        }else{
            $.get("/company/request/del/"+companyId,function(data){
                $("#request_list").html(data);
            });
            $.jGrowl.defaults.position = 'center';
            $.jGrowl("まとめて資料請求の<br />リストから外しました。", { life: 1000 });
        }
    });
    
    $("#bt_side_spot_search").click(function(){
        location.href = "/spot/search/" + $("#side_area1_val").val() + '/n/' + $("#side_point_val").val() + '/' + $("#side_kind_val").val();
    });
    $("#bt_side_company_search").click(function(){
        location.href = "/company/search/" + $("#side_com_area1_val").val() + '/n/' + $("#side_com_point_val").val() + '/' + $("#side_shoparea_val").val();
    });
    $("#bt_side_plan_search").click(function(){
        location.href = "/plan/index/" + $("#side_plan_area1_val").val() + '/n/' + $("#side_travel_val").val();
    });
	
    $(".data_table tr:even").addClass("even");
	$(".data_table2 tr:even").addClass("even2");
	
	$('#head_banner ul').innerfade({
				speed: 'slow',
				timeout: 4000,
				type: 'sequence',
				containerheight: '60px'
			});
});