$.menu = function(){
	return {
		init: function() {
			
			$("#news_update").load("/news/newsupdate.php");
			
			$('#gnavi ul li a img').bind('mouseover', function() {
				$(this).attr("src",$(this).attr("src").replace("_off","_on"));
				$("#main_img img").attr("src",$(this).parent().attr("rel"));
			});
			
			$('#gnavi ul li a img').bind('touchstart', function() {
  			//event.preventDefault();
				$(this).attr("src",$(this).attr("src").replace("_off","_on"));
				$("#main_img img").attr("src",$(this).parent().attr("rel"));
			});
			
			$('#gnavi ul li a img').bind('touchmove', function() {
				//event.preventDefault();
  			$("#dEvent").prepend($(this));
				$(this).attr("src",$(this).attr("src").replace("_off","_on"));
				$("#main_img img").attr("src",$(this).parent().attr("rel"));
			});
			
			$('#gnavi ul li a img').bind('mouseout', function() {
  			$(this).attr("src",$(this).attr("src").replace("_on","_off"));
				$("#main_img img").attr("src","img/main_img_top.jpg");
			});
			
			$('#gnavi ul li a img').bind('touchend', function() {
  			$(this).attr("src",$(this).attr("src").replace("_on","_off"));
				$("#main_img img").attr("src","img/main_img_top.jpg");
			});
			
			
			
			
/*		document.addEventListener("touchstart", touchStart, false);
			document.addEventListener("touchmove", touchMove, false);
			document.addEventListener("touchend", touchEnd, false);
			window.onorientationchange = function() {
				$('#dTurn').html(window.orientation);
			}
			
			function touchStart(e) {
				e.preventDefault();
				var t = e.touches[0];
				$('#dEvent').html('touchstart');
				$('#dX').html(t.pageX);
				$('#dY').html(t.pageY);
			}
			
			function touchMove(e) {
				e.preventDefault();
				$('#dEvent').html('touchmove');
				var t = e.touches[0];
				$('#dX').html(t.pageX);
				$('#dY').html(t.pageY);
			}
			
			function touchEnd(e) {
				e.preventDefault();
				$('#dEvent').html('touchend');
				$('#dX').html('-');
				$('#dY').html('-');
			}*/

		}		
		
	}
}();


$(function() {
	$.menu.init();
})

