﻿
$(function(){
$('div#navi li.nav_main').hover(
	function(){
		$(this).find('ul').show();
	},
	function(){
		$(this).find('ul').hide();
	}
);


});

/* swapImg */
jQuery.fn.extend({
	swapImg: $(document).ready(function(){
		return $('.swapImg').each(function(){
			if($(this).attr('class').match('swapImg change')){
				//ImgPreLoad
				swapObj = new Image();
				preLoad = $(this).attr('class').split('swapImg change(')[1].split(')')[0];
				swapObj.src = preLoad;
				imgNm = $(this).attr('name',preLoad);
				
				//MouseOver
				$(this).hover(
					function(){
						$(this).attr('lowsrc',$(this).attr('src'));
						$(this).attr('src',$(this).attr('name'));
					},
					function(){
						$(this).attr('src',$(this).attr('lowsrc'));
					}
				);
			}else if($(this).attr('src').match('_no.')){
				//ImgPreLoad
				swapObj = new Image();
				imgpath = $(this).attr('src');
				preLoad = imgpath.replace('_no.','_ro.');
				swapObj.src = preLoad;
				
				$(this).hover(
					function(){
						$(this).attr('src',$(this).attr('src').replace('_no.','_ro.'));
					},
					function(){
						$(this).attr('src',$(this).attr('src').replace('_ro.','_no.'));
					}
				);
			}
		});
	})
});

