
						   
						   
$(document).ready(function() {	
						
	$.mmwidths=[771,862,453,927,869,786];
	$.menuspeed=1500;
	$.menuimages=new Array();
	$('img.mmbar_img').each(function(){
				$.menuimages.push($(this).attr('src'));
									 });
	
									 
	$('div.mmbar').hide().width('5px').css('visibility','visible');
	$('#openimg_opacity').hide();
	
	$.openimg_inani=false;

	
$('div.mm_wrapper').mouseleave(function(event){
			var count=$(this).attr('id').replace('mm_wrapper','');
			
			if($(this).hasClass('stay')==false){
			$(this).children('div.mmbar').stop().clearQueue().delay(1500).animate({width : 0}, $.menuspeed, function() { $(this).hide(); });
			}
			
			$previmg=$(this).children('img.mmbut');
			if(count!==$.countup){
			$previmg.attr('src',$previmg.attr('src').replace('_h','_n'));
			}
			$(this).children('img.mmbar_img').attr('src',$.menuimages[count]);
			$('#openimg_opacity').stop().delay(1100).hide();
			    });
	
	$('div.mm_wrapper').mouseover(function(){
			$(this).children('img.mmbut').attr('src',$(this).children('img.mmbut').attr('src').replace('_n','_h'));
			$nextbar=$(this).children('div.mmbar');
			var widthto=$.mmwidths[$('#menu_wrapper div.mm_wrapper').index($(this))];
			if($(this).hasClass('stay')==false){
			$(this).children('div.mmbar').show().stop().clearQueue().animate({width : widthto} , $.menuspeed);
			}
			$('#openimg_opacity').clearQueue().show();
	});
	
	
	$('area.menumap').mouseenter(function(){
		var count=parseInt(($(this).parent().children('area.menumap').index($(this))))-1;
		var upcount=$(this).parent().attr('id').replace('map','');
		if(count>=0){
		$('div.menu'+upcount+' img.mmbar_img').attr('src','ximg/menu/mm'+upcount+'_'+count+'.jpg');	
		}
		var widthto=$.mmwidths[parseInt(upcount)-1];
		
		$('div.menu'+upcount).children('div.mmbar').clearQueue().width($.mmwidths[parseInt(upcount)-1]);
		
		
		$previmg=$('div.menu'+upcount).children('img.mmbut');
		$previmg.attr('src',$previmg.attr('src').replace('_n','_h'));
		$('#openimg_opacity').clearQueue().show();
		
	});
	
	$('area.menumap').mouseout(function(){
		var upcount=$(this).parent().attr('id').replace('map','');
		$('div.menu'+upcount+' img.mmbar_img').attr('src',$.menuimages[upcount-1]);	
		
		if($('#mm_wrapper'+upcount).hasClass('stay')==false){
		$('div.menu'+upcount).children('div.mmbar').stop().clearQueue().delay(2500).animate({width : 0}, $.menuspeed, function() { $(this).hide(); });
		}
		
		$previmg=$('div.menu'+upcount).children('img.mmbut');
		if(upcount!==$.countup){
		$previmg.attr('src',$previmg.attr('src').replace('_h','_n'));
		}
		$('#openimg_opacity').stop().delay(1100).hide();
	});
	
	$.opacity_switch=true;
	
	$('div.stay').each(function(){
								var widthto=$.mmwidths[$('#menu_wrapper div.mm_wrapper').index($(this))];
				$(this).children('div.mmbar').show().width(widthto);
								});
	
	$('#open_img').css('visibility','visible');
	
	$('#search_but').click(function(){
									$('#search_form').submit();
									});
	
	$('.hp').hide();
	$('div.send').click(function(){
			$.send=true;
			$('.form_in').each(function(index){
			  if($(this).val().length<2){
				$.send=false;
				$(this).css("border","1px solid #b40cc1");
			}else{
				$(this).css("border","1px inset #666666");
			}
			  });
		if($('.hp').val().length>0){
			$.send=false;
		}
		if($.send){
			$('form').submit();
		}
		 });
	
	if($('.fadein img').length>1){
			$('.fadein img:gt(0)').hide();
    		setInterval(function(){
      		$('.fadein :first-child').fadeOut(4000)
         	.next('img').fadeIn(4000)
         	.end().appendTo('.fadein');}, 
     		 9000);
			}
			
				$('span.originalSize').click(function(){
				$('body').css('font-size','14px');
				$.cookie('fontSize', '14px', { expires: 1 });
			});
			
			$('span.mediumSize').click(function(){
			$('body').css('font-size','16px');
			$.cookie('fontSize', '16px', { expires: 1 });
			});
			
			$('span.bigSize').click(function(){
				$('body').css('font-size','18px');
				$.cookie('fontSize', '18px', { expires: 1 });
			});
			
			if($.cookie('fontSize')){
				$('body').css('font-size',$.cookie('fontSize'));
			}
						   });

	
