// JavaScript Document

//トップの画像切替
function imgchange(){
	$('#photo-area').hover(function(){this.css('cursor','default')});
	$('#photo-area').panelGallery({
		viewDuration:4000,
		boxSize:100,
		boxFadeDuration:100,
		boxTransitionDuration:30,
		FX: new Array('boxNorthEast','boxRandom')
	})
}
//iPhoneとiPodTouchの画面サイズは320px*480px、縦でも横でもこの値は変化しない。
//iPadは768px×1024pxらしい、実機では試してないので誰か教えてください。
//このPGはJSでアップルスマートフォンとそれ以外を判別するものです。
function ScreenChecker(){
	var Swidth  = screen.width;
	var Sheight = screen.height;
	var ua =navigator.userAgent;
	//まずユーザーエージェントで判定する。
	//どれかひっかかればとりあえずOK
	if(ua.indexOf('iPhone') > -1 || ua.indexOf('iPad') > -1 || ua.indexOf('iPod')  > -1){
		//ディスプレイサイズでチェック
		if((Swidth == 320 && Sheight== 480) || (Swidth == 768 && Sheight== 1024)){
			if(Swidth == 320){
				//window.alert('あなたはiphoneで見てますね。');
				
				$('#photo-area').panelGallery({
					viewDuration:4000,
					boxFadeDuration:300,
					boxTransitionDuration:10,
					FX: new Array('fade')
				})
			}else{
				//window.alert('あなたはiPadで見てますね。');
				imgchange();
			}

		}else{
			//ユーザーエージェント偽造
			//iphone,ipad以外のキャリアを拒否するならここにリダイレクトなり、エラーコードなりをいれればいい。
			//window.alert('ユーザーエージェント偽造してますね？;
			imgchange();
		}
	}else{
		//iphone,ipad以外のキャリアを拒否するならここにリダイレクトなり、エラーコードなりをいれればいい。
		//window.alert('あなたはPCを使ってますね。');
		imgchange();
	}
}
//スクリーンサイズ
function ScreenSizeAlert(){
	window.alert('横幅：'+screen.width+'\n縦幅：'+screen.height+'です。');
}

//メイン
//まず、スクリーンサイズチェッカー、特定ブラウザに対して、ファンクション開始
window.onload = function(){ScreenChecker();}

//ボタン背景変更
/*
$(function() {
	var num = 1;
	$('.index-col-btn a').hover(
		function(){  
			$(this).stop().animate({'opacity' : '0'}, 500);  
		},
		function(){
			$(this).stop().animate({'opacity' : '1'}, 1000);
		}
	); 
});
*/

