//smoothScroll
jQuery.fn.extend({
	scrollTo : function(speed, easing) {
		if(!$(this)[0].hash || $(this)[0].hash == "#") {
			return false;
		}
		return this.each(function() {
			var targetOffset = $($(this)[0].hash).offset().top;
			$('html,body').animate({scrollTop: targetOffset}, speed, easing);
		});
	}
});

$(function() {

//smoothScroll
	$('a[href*=#]').click(function() {
		$(this).scrollTo(1000);
		return false;
	});

//common,swap-image
	$(".swap,.group-swap a img").mouseover(function() {
		if($(this).attr("src").match("_on.")) {
			$(this).addClass("current");
		};
		if(!$(this).attr("src").match("_on")) {
			$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
		};
	});
	$(".swap,.group-swap a img").mouseout(function() {
		if(!$(this).attr("class").match("current")) {
			if($(this).attr("src").match("_on.")) {
				$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"))
			};
		};
	});
	$(window).unload(function(){
		null;
	});

//mainTable,Odd & Even
	$("table tr:even").addClass("even");
	$("table tr:odd").addClass("odd");
	$("table td:even").addClass("even");
	$("table td:odd").addClass("odd");
	$("table th:even").addClass("even");
	$("table th:odd").addClass("odd");

//list first-child & last-child
	$("li:first-child").addClass("first-child");
	$("li:last-child").addClass("last-child");
	$("dt:first-child").addClass("first-child");
	$("dt:first-child").next("dd").addClass("first-child");
	$("dd:last-child").addClass("last-child");
	$("dd:last-child").prev("dt").addClass("last-child");

//formclass
	$(":text").addClass("fm-text");
	$(":password").addClass("fm-pass");
	$(":image").addClass("fm-submit");

//form focus
	$(":text").focus(function(){$(this).addClass("fm-text-focus");});
	$(":text").blur(function(){$(this).removeClass("fm-text-focus");});
	$(":password").focus(function(){$(this).addClass("fm-pass-focus");});
	$(":password").blur(function(){$(this).removeClass("fm-pass-focus");});
	$("textarea").focus(function(){$(this).addClass("fm-text-focus");});
	$("textarea").blur(function(){$(this).removeClass("fm-text-focus");});

//indexpageSetting
	$(".idx_qrcode").nextAll(".news_loops").find("p").css("padding-right","170px");
	$(".idx_qrcode").nextAll(".news_loops").find(".more").css("padding-right","180px");

});

