<!--

//~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
	//ÀÎÀÚ °ª
	function isAgm(agm, len, val){
		var agmL = agm.length - 1;
		return agmL < len ? val : agm[len];
	};

	//ºê¶ó¿ìÁ® º° ¾ÆÀÌµð °´Ã¼
	function getObject(objectId) {
		if(document.getElementById && document.getElementById(objectId)){
			return document.getElementById(objectId);
		}else if (document.all && document.all(objectId)){
			return document.all(objectId);
		}else if (document.layers && document.layers[objectId]){
			return document.layers[objectId];
		}else{
			return false;
		}
	};

	//ÇÃ·¡½¬ ½áÁÖ±â
	function writeEmbed(url,wd,ht){
		var id		= isAgm(writeEmbed.arguments, 3, null);
		var n			= 0;
		while(getObject("writeValue_" + n)) n++;
		document.write("<textarea id=\"writeValue_" + n + "\" style=\"display:none;\" cols=\"0\" rows=\"0\">");
		document.write("	<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + wd + "\" height=\"" + ht + "\" id=\"fmedia_\"" + n + ">");
		document.write("	<param name=\"movie\" value=\"" + url + "\">");
		document.write("	<param name=\"menu\" value=\"false\">");
		document.write("	<param name=\"wmode\" value=\"transparent\" >");
		document.write("	<param name=\"quality\" value=\"high\">");
		document.write("	<param name=\"allowScriptAccess\" value=\"always\">");
		document.write("	<param name=\"FlashVars\" value=\"" + id + "\">");
		document.write("	<embed src=\"" + url + "\" quality=\"high\" pluginspage=\"https://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + wd + "\" height=\"" + ht + "\" wmode=\"transparent\" allowScriptAccess=\"always\" name=\"ExtInterface\" FlashVars=\"" + id + "\"></embed>");
		document.write("	</object>");
		document.write("</textarea>")

		document.write(getObject("writeValue_" + n).value);
	};

// addLoadEvent
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function isIE6() {
	var version = navigator.appVersion;
	if (version.indexOf("MSIE 6") != -1) {
		return true;
	} else {
		return false;
	}
}
/*
 * Unit PNG fix
 * http://labs.unitinteractive.com/unitpngfix.php
 */
var clear = "/images/common/clear.gif" //path to clear.gif

pngfix = function() {
	var els = document.getElementsByTagName('*');
	var ip = /\.png/i;
	var i = els.length;
	while (i-- > 0) {
		var el = els[i];
		var es = el.style;
		if (el.src && el.src.match(ip) && !es.filter) {
			es.height = el.height;
			es.width = el.width;
			es.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + el.src + "',sizingMethod='crop')";
			el.src = clear;
		} else {
			var elb = el.currentStyle.backgroundImage;
			if (elb.match(ip)) {
				var path = elb.split('"');
				var rep = (el.currentStyle.backgroundRepeat == 'no-repeat') ? 'crop' : 'scale';
				es.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + path[1] + "',sizingMethod='" + rep + "')";
				es.height = el.clientHeight + 'px';
				es.backgroundImage = 'none';
				var elkids = el.getElementsByTagName('*');
				if (elkids) {
					var j = elkids.length;
					if (el.currentStyle.position != "absolute") es.position = 'static';
					while (j-- > 0) if (!elkids[j].style.position) elkids[j].style.position = "relative";
				}
			}
		}
	}
}

function ie6PngFix() {
	if (isIE6()) {
		window.attachEvent('onload',pngfix);
	} else {
		return false;
	}
}

//popup(center)
function pop_center(fname,wth,hgt){
	var W = wth;
	var H = hgt;
	var X = screen.availWidth/2 - W/2;
	var Y = screen.availHeight/2 - H/2;
	var wname = fname.split(".")[0];
	while(wname.indexOf("/")!=-1){
		wname = wname.replace("/","_");
	}
	newWin = window.open(fname,wname,"width="+W+",height="+H+",left="+X+",top="+Y);
	newWin.focus();
}

//input css reset
$(document).ready(function(){
	$("input:text, input:password").addClass("inputTextfield_default");
	$("img",$("input:text, input:password").parent()).addClass("imgVerticalAlignMiddle");
	$("input:radio, input:checkbox").css({
		height:"15px"
	});
});

//»çÁø »çÀÌÁî
function autoImgSize(imgNode, maxWidth, maxHeight){
	var currWidth = $(imgNode).width(); //ÀÌ¹ÌÁö »çÀÌÁî ÃßÃâ
	var currHeight = $(imgNode).height(); //ÀÌ¹ÌÁö »çÀÌÁî ÃßÃâ
	if(currWidth > maxWidth || currHeight > maxHeight){
		if(currWidth/maxWidth > currHeight/maxHeight){
			$(imgNode).width(maxWidth); //ÀÌ¹ÌÁö ³ÐÀÌ ÃÖ´ë°ªÀ¸·Î ±³Ã¼
		}
		else{
			$(imgNode).height(maxHeight); //ÀÌ¹ÌÁö ³ôÀÌ ÃÖ´ë°ªÀ¸·Î ±³Ã¼
		}
	}
	var mgTop = (maxHeight - $(imgNode).height()) / 2 + "px"; //margin-top
	$(imgNode).css("margin-top",mgTop);
}



//ÅÇ
function tabAction(){
	var obj = $(".tabAction img"); //ÅÇ ÀÌ¹ÌÁö
	if(!$(obj).size()){
		return false;
	}
	var objCont = $(".tabCont"); //ÅÇ ÄÁÅÙÃ÷
	$(obj).css("cursor","pointer");
	$(obj).each(function(i){
		$(this).click(function(){
			if($(".curr").size()>0){
				$(".curr").attr("src",$(".curr").attr("src").replace("_on.gif",".gif"));
				$(".curr").css("cursor","pointer");
				$(".curr").removeClass("curr");
			}
			$(".curr_cont").css("display","none");
			$(".curr_cont").removeClass("curr_cont");
			$(this).attr("src",$(this).attr("src").replace(".gif","_on.gif"));
			$(objCont).eq(i).css("display","block");
			$(this).addClass("curr");
			$(this).css("cursor","none");
			$(objCont).eq(i).addClass("curr_cont");
		});
	});
	$(objCont).hide()
	
	$(obj).eq(0).click();
}

//rollover
function rollover(parentNode,imgType){
	var obj = $("img",parentNode);
	$(obj).mouseover(function(){
		var flag = $(this).attr("src").indexOf("_on") > -1 ? true : false;
		if(!flag){
			$(this).attr("src",$(this).attr("src").replace("."+imgType,"_on."+imgType));
		}
	});
	$(obj).mouseout(function(){
		var flag = $(this).attr("src").indexOf("_on") > -1 ? true : false;
		if(flag){
			$(this).attr("src",$(this).attr("src").replace("_on."+imgType,"."+imgType));
		}
	});
}

//set_ol_1
function set_ol_1(){
	var obj = $("ol.ol_1 li");
	if(!obj.size()){return false;}
	$(obj).each(function(i){
		$(this)
			.wrapInner("<div class='content'></div>")
			.prepend("<div class='num'>"+(i+1)+".</div>");
		$("input.w2",this)
			.wrap("<p></p>");
		$(this).css({
			fontSize : 0
		});
	});
	setLayout();
}

//document ready
$(function(){
	//tabAction();
	$("tr:even",$("tbody","div.bbs_list")).addClass("even");
	$(".tableWrap_form_2 .table_2:last").addClass("mb0");
	$(".ol_1 li:odd").addClass("odd");
	$(":first:not(.nocl)",".tableWrap_form_2>.table_2>*>tr").addClass("brl0");
	$(":first:not(.nocl)",".tableWrap_form>.table_2>*>tr").addClass("brl0");
	set_ol_1();
});
