$(function(){
	gpTarget = $('#gpTopImage');
	gpCycleOption = {
		fx: 'fade',
		timeout: 4000,
		speed: 1000,
		pause: 0
	}
	cycleTopimage();
	
	var uai = new UAIdentifier();
	if (uai.ie <= 6.0){
//		randomNo = Math.floor( (Math.random()*100) % tmpImagelength )+1;
//		gpTarget.html('<img src="/src/lib_images/topImg_'+tmpSeason+'_'+randomNo+'.jpg" />')
		OutputImage();
		if(gpTarget.length){
			gpTarget.cycle({
				fx: 'none',
				timeout: 4000,
				speed: 1000,
				pause: 0
			});
			gpTarget.children('img').css('position','');
			gpTarget.css('position','static');
		}
	}else{
		OutputImage();
		gpTarget.cycle(gpCycleOption);
		}
});

function cycleTopimage(){
	gpToday = new Date();
	tmpMonth = gpToday.getMonth() +1;
	tmpMinute = gpToday.getMinutes();
//	tmpImagePath = '/src/lib_images/topImg_';
	tmpImagePath = '/hs_data/Image/top_image/topImg_';
	tmpImageType = 'jpg';
	tmpSeason = 'sec1';
	tmpImagelength = 3;
	tmpTopimage = '';
	switch( tmpMonth ){
		case 2: case 3: case 4:	case 5:	case 9:	case 10: case 11:
			tmpSeason = 'sec1';	tmpSeasonText = '天然温泉　いそのシティホテル';
		break;
		case 6: case 7:	case 8:
			tmpSeason = 'sec2';	tmpSeasonText = 'ビアガーデン　いそのシティホテル';
			tmpImagelength = 4;
		break;
		case 12: case 1:
			tmpSeason = 'sec3';	tmpSeasonText = '忘新年会　いそのシティホテル';
		break;
	}
}

function OutputImage(){
	for( var i=0; i<tmpImagelength; i++ ){
		tmpTopimage += '<img src="'+tmpImagePath+''
		+tmpSeason+'_'+(i+1)+'.'+tmpImageType+'" title="'
		+tmpSeasonText+'" />';
	}
	gpTarget.html(tmpTopimage);
}
