jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}

$(document).ready(function(){
$(".menuimg img").hover(
			function()
			{
				src=this.src.replace("chb.JPG", "1_resize.jpg");
				this.src = src;
				$(this).fadeTo('fast', 1);
				$(this).css('border','3px solid RGB(231,120,23)');
				
			}
			,
			function()
			{
			
			
			if (this.id=='main')
				{
				$(this).css('border','3px solid #d1d3d4');	
				} else {
					if (this.id=='mainpage')
					 {$(this).css('border','3px solid #e0e1e2');} else{
			
				if (this.id!='selectid')
				{
				$(this).fadeTo('fast', 0.7);
				src=this.src.replace("1_resize.jpg", "chb.JPG");
				this.src = src;
				$(this).css('border','3px solid #d1d3d4');
				} 
			  }
			}
				
				
			}
		);
		


});

function selectmenu(number)
{
	if (number==0)
	{
				
		$(".menuimg img").each(
	       function(el) { 
				$(this).attr('src',$(this).attr('src').replace("chb.JPG", "1_resize.jpg"));
				$(this).attr('id','main');		
						
						});
				
		}
		else {
		  if(number=='mainpage')
		  {
			 $(".menuimg img").each(
	       function(el) { 
				$(this).attr('src',$(this).attr('src').replace("chb.JPG", "1_resize_2.jpg"));
				$(this).attr('id','mainpage');		
						
						}); 
			  
			  }
		
		  else
		{
	$(".menuimg img").eq(number-1).attr('src',$(".menuimg img").eq(number-1).attr('src').replace("chb.JPG", "1_resize.jpg"));
	$(".menuimg img").eq(number-1).addClass("selectimg");
	$(".menuimg img").eq(number-1).attr('id','selectid');
	$(".menuimg img").css('opacity',0.7);
	$(".menuimg img").eq(number-1).css('opacity',1);
		}
		}
}		