/*

Last UpDate 2010-05-25

*/

$(function(){
	//現在居るファイル名	   
	var currentFile = location.href.split('/').pop();
	
	//ua取得
	var ua = navigator.userAgent;

   // remove layerX and layerY
    /*var all = $.event.props,
        len = all.length,
        res = [];
    while (len--) {
      var el = all[len];
      if (el != 'layerX' && el != 'layerY') res.push(el);
    }
    $.event.props = res;



	 /*ウィンク効果*/ 
	$(".wink img,.logo img,#content .box p img").hover(function(){
		$(this).css("opacity", "0.2");
		$(this).css("filter", "alpha(opacity=20)");
		$(this).fadeTo("slow", 1.0);
	});

	//fancybox(lightbox)
	try{
		$("#content .fancybox a").fancybox({
			'zoomOpacity' : true,'overlayShow' : false,'zoomSpeedIn' : 500,'zoomSpeedOut' : 500});
	}catch(e){}

	//enterページslide
	try{
	$('#ent_banner').crossSlide({
	  sleep: 0.8 ,  //sec
	  fade: 1.6    //sec
	},[
		{ src: '/slide_2/01.jpg'},
		{ src: '/slide_2/01.jpg'},
		{ src: '/slide_2/02.jpg'},
		{ src: '/slide_2/02.jpg'},
		{ src: '/slide_2/04.jpg'},
		{ src: '/slide_2/04.jpg'},
		{ src: '/slide_2/07.jpg'},
		{ src: '/slide_2/07.jpg'},
		{ src: '/slide_2/05.jpg'},
		{ src: '/slide_2/05.jpg'},
		{ src: '/slide_2/06.jpg'},
		{ src: '/slide_2/06.jpg'}

	]);
	}catch(e){}
	//enterページslide小
	try{
	$('#maps').crossSlide({
	  sleep: 0.8 ,  //sec
	  fade: 0.8    //sec
	},[
		{ src: '/images/ent_jap_site1.jpg', href: 'http://www.libertywalk.co.jp/top.html'},
		{ src: '/images/ent_jap_site2.jpg', href: 'http://www.libertywalk.co.jp/top.html'}

	]);
	}catch(e){}
	
	try{
	$('#content .lightbox  a').lightBox();
	}catch(e){}
	//ゼブラテーブル（しましまのテーブル）実装時に使用してください
	//classが、'list'で終わるulの、偶数の要素に、'even'クラスを付ける
	//$('ul[class$="list"] li:nth-child(even)').addClass('even');
	//classが、'table'で終わるテーブルの、偶数trに、'even'クラスを付ける
	//$('table[class$="table"] tr:nth-child(even)').addClass('even');
	
	
	//rollover
	$('a img').each(function(){
		var imgSrc = $(this).attr('src');
		//smartRollover
		if(imgSrc.match(/(.*)_off(\..*)/)){
			var repSrc = RegExp.$1+'_on'+RegExp.$2;
			$('<img />').attr('src',repSrc);
			$(this).hover(function(){
				$(this).attr('src',repSrc);
				$(this).css({opacity: '1',filter: 'alpha(opacity=100)'});
			},function(){
				$(this).attr('src',imgSrc);
			});
		//ロールオーバーが無い場合は、透明度80%
		}else if(!$(this).hasClass('not')){
			$(this).hover(function(){
					$(this).css({
						opacity: '0.8',
						filter: 'alpha(opacity=80)'
					});
			},function(){
					$(this).css({
						opacity: '1',
						filter: 'alpha(opacity=100)'
					});
			}
			
			);
		}
	});

	/* 
	お問い合わせフォームの送信ボタンで、ロールオーバーやウィンク、とpngに指示があった場合に
	ご利用ください。使わない方は”削除”してください
	*/
	
	//タイプ1.submit押した感 & smartrollover
	$('form p.submit input').mousedown(function(){
		$(this).css({position:'relative',top:'1px',left:'1px'});
	}).mouseup(function(){
		$(this).css({position:'static'});
	}).mouseout(function(){
		$(this).css({position:'static'});
	})
	  .hover(function(){
		$(this).attr('src',$(this).attr('src').replace(/^(.*)_off.(.*)$/,'$1_on.$2'));
	},function(){
		$(this).attr('src',$(this).attr('src').replace(/^(.*)_on.(.*)$/,'$1_off.$2'));
	});
	
	/* ←使う際は、このコメントを削除してください
	//タイプ2.submit押した感 & ウィンク
	$('form p.submit input').mousedown(function(){
		$(this).css({position:'relative',top:'1px',left:'1px'});
	}).mouseup(function(){
		$(this).css({position:'static'});
	}).mouseout(function(){
		$(this).css({position:'static'});
	})
	  .hover(function(){
		$(this).css({opacity:0.2});
		$(this).fadeTo('slow',1.0);
	});
	*/

	if($('div').is('.sell')){
	$(".sell dl").autoHeight({column:4});
	}

	$("ul#gallery li").each(function(i){
		if(i%4==3){
			$(this).addClass("right");
		}
	});



$(window).load(function(){
var currentFile = location.href.split('/').pop();

var content=$('div#content').height();
var side=$('div#side').height();

if(currentFile==="index_new.html" && currentFile=="top.html"){
	if(content>590){
	$('div#main').height(content);
	}else{
	$('div#main').height("590");
	}
}else{
	if(content>790){
	$('div#main').height(content);
	
	}else{
	$('div#main').height("790");
	}
}

});




});






