$(function(){
	//現在居るファイル名	   
	var currentFile = location.href.split('/').pop();
	
	//ua取得
	var ua = navigator.userAgent;
	
	//fancybox 物件詳細で使用中
	try{
		$(".gallery a").fancybox({
			'zoomOpacity' : true,'overlayShow' : false,'zoomSpeedIn' : 500,'zoomSpeedOut' : 500});
	}catch(e){}
	
	//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)'
					});
			}
			
			);
		}
	});
	
	try{
		$('#slide').crossSlide({
		  fade: 1.5    //sec
		}, [
			{ src: 'n_image/slide01_1.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:1},
			{ src: 'n_image/slide01.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:4},
			{ src: 'n_image/slide02_1.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:1},
			{ src: 'n_image/slide02.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:4},
			{ src: 'n_image/slide03_1.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:1},
			{ src: 'n_image/slide03.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:4},
			{ src: 'n_image/slide04_1.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:2},
			{ src: 'n_image/slide04.jpg' , from: '100% 100%' , to:   '100% 100%' ,time:10}
		]);
	}catch(e){}
	
});
