﻿$(function() {
	// ポップアップ表示処理
	$('#box').hide();
	var _class = 'weddingmark';
	if ($('.weddingiconSet').length > 0) {
		_class = 'weddingiconSet';
	}
	$('.' + _class + ' > li').each(function() {
		var index = $('.' + _class + ' > li').index(this);
		var img = $('.' + _class + ' > li img').eq(index);
		$(this).hover(
			function() {
				var position = $(this).position();
				$('#box').css('top', position.top + img.height());
				$('#box').css('left', position.left + img.width());
				$('#box').text($(img).attr('alt'));
				$('#box').show();
				$('#box').animate({ width : 120, height : 40 }, { queue : false });
			}, 
			function() {
				$('#box').stop();
				$('#box').text();
				$('#box').hide();
				$('#box').css('width', 0);
				$('#box').css('height', 0);
			}
		);
	});

	
	// 写真切り替え処理
	$('.weddingimgBoxR > li').each(function() {
		var index = $('.weddingimgBoxR > li').index(this);
		var img = $('.weddingimgBoxR > li img').eq(index);
		$(this).hover(
			function(){
				$('.weddingimgBoxL img').attr('src', img.attr('src'));
			}, 
			function(){
			}
		);
	});
	// 写真切り替え処理
	$('.dressimgBoxR > li').each(function() {
		var index = $('.dressimgBoxR > li').index(this);
		var img = $('.dressimgBoxR > li img').eq(index);
		$(this).hover(
			function(){
				$('.dressimgBoxL img').attr('src', img.attr('src'));
			}, 
			function(){
			}
		);
	});
});

var agent = navigator.userAgent;
	if(agent.indexOf('Linux; U; Android ') != -1 ||
	agent.indexOf('iPhone; U') != -1){
	location.href = '/mo/';
} 
