jQuery.noConflict();

(function($){//BEGIN jQuery
$(function(){//BEGIN jQuery.ready()
	
	/*main, side*/
	$main = $("#mainContents");
	$side = $("#sidebar");
	
	
	/*gNav*/
	$("#gNav > ul ")
		.pageInit({
			".siteIndex": "> li:eq(0)",
			".company": "> li:eq(1)",
			".solution": "> li:eq(2)",
			".recruit": "> li:eq(3)",
			".contact": "> li:eq(4)"
		}, function(cond, target){
			$(this)
				.addClass("active");
			if(cond == ".company"){
				$(this).find("> ul")
					.css("display", "block")
					.find(">li > a")
						.each(function(){
							var hash = this.hash;
							$(this)
								.click(function(){
									$("html,body").animate({
										scrollTop: $(hash).offset().top
									}, 500);
									return false;
								});
							
						});
			}
		})
		.find("> li")
			.each(function(){
				var $this = $(this);
				var $link = $this.find("> a");
				var $img = $link.find("> img");
				var src = $img.attr("src");
				var asrc = $.srcReplace(src, "", "_o");
				var $aimg = $img.clone().attr("src", asrc);
				
				var animateSpeed = 400;
				
				var flag_over, flag_out;
				
				if($this.is(".active")){
					$img.replaceWith($aimg);
				}else{
					$link
						.append($aimg.css("opacity", 0))
						.hover(function(){
							$img.stop().fadeTo(animateSpeed, 0);
							$aimg.stop().fadeTo(animateSpeed, 1);
						}, function(){
							$img.stop().fadeTo(animateSpeed, 1);
							$aimg.stop().fadeTo(animateSpeed, 0);
						});
				}
			});
	
	
	/*hdrNav*/
	$("#hdrNav")
		.chimg();
	
	
	/*toPageTop*/
	$("div.toPageTop a", $main)
		.click(function(){
			$("html,body").animate({
				scrollTop: 0
			}, 500);
			return false;
		});
	
	
	/*tblStyle03*/
	$("table.tblStyle03", $main)
		.alternate()
		.each(function(){
			$table = $(this);
			$wrap = $table.parent(".wrapTblStyle03");
			$th = $table.find("th:eq(0)");
			
			var toNum = function(num){
				return num.match(/([\d\.]+)/)[0] - 0;
			}
			
			var thWidth = $th.width() + toNum($th.css("padding-left")) + toNum($th.css("padding-right")) + ($.browser.msie ? 1 : 0);
			var wrapPaddingTop = toNum($wrap.css("padding-top"));
			
			$wrapInner = $('<div></div>')
				.css({
					"height": wrapPaddingTop,
					"position": "relative",
					"top": "-8px",
					"margin-bottom": "-" + wrapPaddingTop + "px",
					"margin-left": thWidth,
					"border-left": "1px solid #ffffff",
					"font-size": "1px",
					"line-height": 1
				});
			
			$wrap.prepend($wrapInner);
		});
	
	
	
	
	
});//END jQuery.ready()
})(jQuery);//END jQuery




