/* Title */
document.title="µå¸²ÆÄ¸¶";


/* PNG Img */
function setPNG24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bPNG24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

function quickLink( linkNo ) {
	if ( linkNo == 1 ) {					// ÀÎÀçÃ¤¿ë ¹Ù·Î°¡±â
	/*
		var oUrl;
		oUrl = "http://www.netcruit.co.kr/index.jsp";
		width = "1024"
		height = "768";

		netcruit = window.open(oUrl,'', 'toolbar=yes, directories=yes, location=yes, status=yes, menubar=yes, resizable=yes, width='+width+', height='+height);
		netcruit.focus();
	*/
		location.href="/company/recruit/recruit_list.jsp";
	} else if ( linkNo == 2 ) {			// °í°´Áö¿ø¼¾ÅÍ 1:1 °í°´¹®ÀÇ
		location.href = "/customer/ask/ask_list.jsp";
	} else if ( linkNo == 6 ) {
		var oUrl;
		oUrl = "https://www.dreampharma.co.kr/special/login.jsp";
		width = "800"
		height = "600";

		remote = window.open(oUrl,'', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, width='+width+', height='+height);
		remote.focus();
	}
}

// ¹è³Ê ¸µÅ©(»õÃ¢ÀÌµ¿)
function bannerLinkPop(strUrl){

		width = "1024"
		height = "768";

		netcruit = window.open(strUrl,'', 'toolbar=yes, directories=yes, location=yes, status=yes, menubar=yes, resizable=yes, width='+width+', height='+height);
		netcruit.focus();

}

/*¸ÞÀÎÇÃ·¡½Ã tapNews(µå¸²´º½º) ¸µÅ©*/

function mainTabNewsLink(linkno, url){
	if(linkno == 100){
		var oUrl;
		width = "1024"
		height = "768";

		netcruit = window.open(url,'', 'toolbar=yes, directories=yes, scrollbars=yes, location=yes, status=yes, menubar=yes, resizable=yes, width='+width+', height='+height);
		netcruit.focus();

	}else{
		location.href="/cyberad/news/news_view.jsp?NewsIDX="+url;
	}
}

/* Blur */

//¸µÅ© ÁÖº¯ Á¡¼± ¾ø¾Ö±â

function allblur() {
	for (i=0;i<myAnchors.length;i++) {
		myAnchors[i].onfocus=new Function("blur()");
	}
}


function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;



/* RollOver */
function ImageOver(imgEL){
	imgEL.src = imgEL.src.replace(".gif", "_.gif");
}
function ImageOut(imgEL){
	imgEL.src = imgEL.src.replace("_.gif", ".gif");
}



/* Dic List */
function initToggleDefList(listEl) {
        listEl.currentItem = false;
        listEl.dtList = listEl.getElementsByTagName("dt");
        listEl.ddList = listEl.getElementsByTagName("dd");

        for (i=0; i<listEl.getElementsByTagName("dt").length; i++) {
                listEl.dtList.item(i).dlEl = listEl;
                listEl.dtList.item(i).listNum = i;
                listEl.dtList.item(i).onclick = toggleDefinitionList;
        }
}

function toggleDefinitionList() {
        if (this.dlEl.dtList.item(this.dlEl.currentItem) && this.dlEl.ddList.item(this.dlEl.currentItem) && this.dlEl.currentItem != this.listNum) {
                this.dlEl.dtList.item(this.dlEl.currentItem).className = null;
                this.dlEl.ddList.item(this.dlEl.currentItem).className = null;
        }

        if (this.dlEl.ddList.item(this.listNum).className == "on") {
                this.dlEl.dtList.item(this.listNum).className = null;
                this.dlEl.ddList.item(this.listNum).className = null;
        } else {
                this.dlEl.dtList.item(this.listNum).className = "on";
                this.dlEl.ddList.item(this.listNum).className = "on";
        }

        this.dlEl.currentItem = this.listNum;
}


/* Shopping Sort List Box */
function gn_ClickSortList( nType )
{
	document.all.SortBox1.style.display = 'none';
	document.all.SortBox2.style.display = 'none';

	if ( nType == 1 )
		document.all.SortBox1.style.display = '';
	else if ( nType == 2 )
		document.all.SortBox2.style.display = '';
}

/* Shopping Goods Num*/
function setncheck(){

	var chkflag=true;
	num = document.ProdDetail.cnt.value

	for(var i =0;i<num.length;i++){
		c=num.charAt(i);
	    if(!(c>='0' && c<='9')) {
     		chkflag = false;
    		break;
	    }
	}
	if(chkflag == false) document.ProdDetail.cnt.value = 1;
}
function setProdCNT(type){
	cnt = document.ProdDetail.cnt.value;
	cnt = ncheck(cnt);
	if(type == 'up'){
		if(cnt >= 1 && cnt <= 999)
			document.ProdDetail.cnt.value = eval(eval(cnt)+1);
		else
			document.ProdDetail.cnt.value = 1;
	}else{
		if(cnt > 1)
			document.ProdDetail.cnt.value = eval(eval(cnt)-1);
		else
			document.ProdDetail.cnt.value = 1;
	}
	return;
}
function ncheck(num){
	var chkflg=true;
	for(var i =0;i<num.length;i++){
		c=num.charAt(i);
	    if(!(c>='0' && c<='9')) {
	            chkflag=false;
	            break;
	    }
	}
	if(chkflg) return num;
	else return 1;
}

/***** Ç¥ÁØÇü SCROLL TOP ************************************************************/


function A2YSlide(name,id,range,sec,tb,margin){ //°´Ã¼¸í,·¹ÀÌ¾îid,ÀÌµ¿°ª,ÀÌµ¿ÃÊ,»óÇÏÀ§Ä¡(false)?t:b,°è»êµÈ »óÇÏ À§Ä¡¿¡¼­ ¶³¾îÁú ¹üÀ§
	//¼Ó¼º
	this.name = name;
	this.obj = document.getElementById(id);
	this.range = range;
	this.sec = sec;
	this.tb = tb;
	this.margin = margin;

	this.Timer();
}

/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬private ¸Þ¼Òµå ÇÔ¼ö ¼±¾ðºÎ¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
A2YSlide.prototype.Move = function A2YSlide_Move(fix_y){
	objY = parseInt(this.obj.style.top);
	if(objY != fix_y){
		this.obj.style.top = (objY + this.GetMoveValue(objY,fix_y)) + 'px';
	}
	this.Timer();
}

A2YSlide.prototype.GetMoveValue = function A2YSlide_GetMoveValue(start, end){ //ÇöÀç À§Ä¡¿Í ÀÌµ¿ÇÒ À§Ä¡¿¡ µû¸¥ ÀÌµ¿°Å¸®¸¦ ¸®ÅÏÇÑ´Ù.
	return (end - start) * this.range;
}

A2YSlide.prototype.GetDocTnB = function A2YSlide_GetDocTnB(bTB){ //¹®¼­ÀÇ »ó´ÜorÇÏ´Ü ÇÈ¼¿°ªÀ» ¹ÝÈ¯ÇÑ´Ù. (!bTB) ? Top : Bottom
	return ((bTB)?document.documentElement.clientHeight:0) + document.documentElement.scrollTop;
}

A2YSlide.prototype.Timer = function A2YSlide_Timer(){
	setTimeout(this.name + '.Move('+(this.GetDocTnB(this.tb)+this.margin)+')',this.sec);
}


/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¿ÜºÎ ¸¶¹ý»ç ÄÚµå¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
function A2Wzd_YSlide(id,range,sec,tb,margin){ //A2YSlideÀÇ »ý¼ºÀ» µµ¿ÍÁØ´Ù.
	eval('C'+id+" = new A2YSlide('C"+id+"','"+id+"',"+range+","+sec+","+tb+","+margin+');');
	//½ÇÇà¿¹ - CSMenu = new A2YSlide('CSMenu','SMenu',0.2,10,0,50); => varÀ» »ç¿ëÇÏÁö ¾ÊÀº Àü¿ªº¯¼ö¸¦ »ý¼ºÇÑ´Ù.
}

function OnTop(){
	scrollTo(0,0);
}


/* ÆäÀÌÁö°æ·Î ***************************************************************************************************************/
// XML¸µÅ©
var xmlDoc , lineMapStr = "" , currentPath="" , index = 0;
var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');
var ie = (typeof window.ActiveXObject != 'undefined');

importXML("/inc/js/menu.xml");
function importXML(file) {
	if (moz) {
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.async = false;
	} else if (ie) {
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = false;
	}
	xmlDoc.load(file);
}

function getLineMapNode(id){
	var menuXpath , node;
	menuXpath = "//menu[@id='" + id + "']";
	if (moz) {
		node = xmlDoc.evaluate(menuXpath, xmlDoc, null, 9,null).singleNodeValue;
	} else if (ie) {
		node = xmlDoc.selectSingleNode(menuXpath);
	}
	return node;
}

function setString(node){
	var spStr = "" , last="";
	var name = node.getAttribute("name");
	var url  = node.getAttribute("url");
	var nodeId  = node.getAttribute("id");

	if(index++ != 0) spStr = "<span> > </span>";
	if(node != xmlDoc.documentElement) 	setString(node.parentNode);
//		lineMapStr += name + spStr;
	rename = name;
	name = rename.replace("Home", "<b>Home</b>");
	if(currentPath != nodeId)
		lineMapStr += "<a href='"+url+"'>"+ name+"</a>" + spStr;
	else
		lineMapStr += "<em class='point1'>"+ name+"</em>" + spStr;
}

function path(id){
	try{
		var node = getLineMapNode(id);
		lineMapStr = "";
		index = 0;
		currentPath=id;
		setString(node);
		document.write(lineMapStr);
	}catch(e){
		if(node == null){
			document.write("¾ÆÀÌµð°¡ Á¸Àç ÇÏÁö ¾Ê½À´Ï´Ù : " + id);
		}else{
			document.write("¿¹¿ÜÃ³¸® ¹ß»ý : " +  e);
		}
	}
}

function name(id){
	var node = getLineMapNode(id);
	var name  = node.getAttribute("name");
	var url  = node.getAttribute("url");
	var nameStr = "<a href='"+url+"'>"+ name+"</a>";
	document.write(nameStr);
}


function link(){
	var id = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else if(depth==1) id = eval("'"+arguments[0]+"'");
		else if(depth==2) id = eval("'"+arguments[0]+"_"+arguments[1]+"'");
		else if(depth==3) id = eval("'"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"'");
		else if(depth==4) id = eval("'"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"'");

		if(id=="") { alert("ÁØºñÁßÀÔ´Ï´Ù."); }
		else {
			var node = getLineMapNode(id);
			var url  = node.getAttribute("url");
			location.href = url;
		}

	}catch(e) { alert("ÁØºñÁßÀÔ´Ï´Ù."); }
}

function evalChk(frm){
   if (AutoValidate(frm) == false)
   {
        return false ;
   }
   else
   {
   		return true;
   }
}

/* Popup */
function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=auto') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
function popr(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=auto,resizable=1') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
function popL(url,name,w,h,t,l){ window.open(url,name,'top='+t+',left='+l+',width='+w+',height='+h+',scrollbars=auto') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½), À§Ä¡ÁöÁ¤
function popsL(url,name,w,h,t,l){ window.open(url,name,'top='+t+',left='+l+',width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½), À§Ä¡ÁöÁ¤
function newwin(url,w,h){ window.open(url,'new','width='+w+',height='+h+',location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1') } //NewPopup(½ºÅ©·Ñ¹Ù¾øÀ½)

/* ±×·ì»ç ¹Ù·Î°¡±â */
	region_name = new Array(17);

	region_name[0] = new Array();
	region_name[0][0] = new Option('all', '±×·ì»ç ¼±ÅÃ');
	region_name[0][1] = new Option('', '');

	region_name[1] = new Array();
	region_name[1][0] = new Option('all', '±×·ì»ç ¼±ÅÃ');
	region_name[1][1] = new Option('http://www.hanwhacorp.co.kr', '¢ßÇÑÈ­/È­¾à');
	region_name[1][2] = new Option('http://www.hanwhatrade.com', '¢ßÇÑÈ­/¹«¿ª');
	region_name[1][3] = new Option('http://www.hwenc.co.kr', '¢ßÇÑÈ­°Ç¼³');
	region_name[1][4] = new Option('http://hcc.hanwha.co.kr', 'ÇÑÈ­ÄÉ¹ÌÄ®¢ß');
	region_name[1][5] = new Option('http://www.hlcc.co.kr', 'ÇÑÈ­L&C¢ß');
	region_name[1][6] = new Option('http://www.hwpd.net', 'ÇÑÈ­Æú¸®µå¸®¸Ó¢ß');
	region_name[1][7] = new Option('http://www.dreampharma.co.kr', '¢ßµå¸²ÆÄ¸¶');
	region_name[1][8] = new Option('http://hanwhatechm.co.kr', 'ÇÑÈ­Å×Å©¿¥¢ß');
	region_name[1][9] = new Option('http://www.yncc.co.kr', '¿©ÃµNCC¢ß');
	region_name[1][10] = new Option('http://www.atv21.co.kr', '¢ß¾Æ»êÅ×Å©³ë¹ë¸®');
	region_name[1][11] = new Option('http://www.stv21.co.kr', '¢ß¼­»êÅ×Å©³ë¹ë¸®');
	region_name[1][12] = new Option('http://www.ycogen.co.kr', '¿©¼ö¿­º´ÇÕ¹ßÀü¢ß');
	region_name[1][13] = new Option('http://www.gcogen.co.kr', '±ºÀå¿­º´ÇÕ¹ßÀü¢ß');

	region_name[2] = new Array();
	region_name[2][0] = new Option('all', '±×·ì»ç ¼±ÅÃ');
	region_name[2][1] = new Option('http://www.korealife.com', '´ëÇÑ»ý¸íº¸Çè¢ß');
	region_name[2][2] = new Option('http://www.koreastock.co.kr', 'ÇÑÈ­Áõ±Ç¢ß');
	region_name[2][3] = new Option('http://www.hwgeneralins.com', 'ÇÑÈ­¼ÕÇØº¸Çè¢ß');
	region_name[2][4] = new Option('http://www.hanwhafund.co.kr', 'ÇÑÈ­ÀÚ»ê¿î¿ë¢ß');
	region_name[2][5] = new Option('http://www.hwvc.co.kr', 'ÇÑÈ­±â¼ú±ÝÀ¶¢ß');
	region_name[2][6] = new Option('http://www.hanwhastock.com', 'ÇÑÈ­ÅõÀÚÁõ±Ç¢ß');


	region_name[3] = new Array();
	region_name[3][0] = new Option('all', '±×·ì»ç ¼±ÅÃ');
	region_name[3][1] = new Option('http://dept.galleria.co.kr', '¢ßÇÑÈ­°¶·¯¸®¾Æ');
	region_name[3][2] = new Option('http://www.galleria.co.kr/Branch/index_event.jsp?bID=8', '¢ßÇÑÈ­Å¸ÀÓ¿ùµå');
	region_name[3][3] = new Option('http://www.hwrc.co.kr', 'ÇÑÈ­È£ÅÚ&¸®Á¶Æ®¢ß');
	region_name[3][4] = new Option('http://www.hwsd.co.kr', 'ÇÑÈ­¿ª»ç¢ß');
	region_name[3][5] = new Option('http://www.63city.co.kr', '¢ßÇÑÈ­63½ÃÆ¼');
	region_name[3][6] = new Option('http://www.hancomm.co.kr', '¢ßÇÑÄÄ');
	region_name[3][7] = new Option('http://www.hsnc.co.kr', 'ÇÑÈ­S&C¢ß');
	region_name[3][8] = new Option('http://www.hanwhaeagles.co.kr', '¢ßÇÑÈ­ÀÌ±Û½º');
	/*
	region_name[3][9] = new Option('ÇÑÈ­¿ª»ç¢ß ', 'ÇÑÈ­¿ª»ç¢ß ');
	*/

function selectRegion(index, obj){
	for (i=obj.length; i>0; i--){
		obj.options[i] = null;
	}

	if (region_name[index].length > 0){

		for (i=0; i< region_name[index].length; i++){
			obj.options[i] = new Option(region_name[index][i].value, region_name[index][i].text);
			//alert(region_name[index][i].text);

		}

		//alert(document.getElementById("searchField02"));
		//document.getElementById("search2").reInitializeSelectBox();

	}

	makeSelectBox02("searchField02");
}

function goGroup(){
	var frm	=	document.form_submain;

	if(frm.searchField01.value == "all" || frm.searchField01.value == ""){
		alert('ºÐ·ù¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
		return;
	}else if(frm.searchField02.value == "all" || frm.searchField02.value == ""){
		alert('±×·ì»ç¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
		return;
	}else{
		var url	=	frm.searchField02.value;
		window.open(url,"HANWHAGROUP","");
	}

}

	function js_Chk_Number(Object) {
		var chars = "0123456789";
		if(!js_Chk_CharYes(Object,chars)){
			alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
			Object.value = "";
			Object.focus();
			return false;
		}else {
			return ;
		}
	}

	function js_Chk_CharYes(Object,chars) {
		for (var inx = 0; inx < Object.value.length; inx++) {
			if (chars.indexOf(Object.value.charAt(inx)) == -1){
				return false;
			}
		}
		return true;
	}

	function checkEmail(EmailForm)
	{
		strEmail=EmailForm;
			//alert(strEmail);

	//	ÀÌ¸ÞÀÏ ÁÖ¼Ò´Â ÀÔ·ÂÇÑ °æ¿ì¿¡¸¸ validÇÑÁö Ã¼Å©ÇÑ´Ù.
		var i;
		var strCheck1 = false;
		var strCheck2 = false;
		var iEmailLen = strEmail.length
		if (iEmailLen > 0) {
			// strEmail ¿¡ '.@', '@.' ÀÌ ÀÖ´Â °æ¿ì ¿¡·¯¸Þ½ÃÁö.
			// strEmailÀÇ ¸Ç¾Õ ¶Ç´Â ¸ÇµÚ¿¡  '@', '.' ÀÌ ÀÖ´Â °æ¿ì ¿¡·¯¸Þ½ÃÁö.
			if ((strEmail.indexOf(".@") != -1) || (strEmail.indexOf("@.") != -1) ||
				(strEmail.substring(0,1) == ".") || (strEmail.substring(0,1) == "@") ||
				(strEmail.substring(iEmailLen-1,iEmailLen) == ".") || (strEmail.substring(iEmailLen-1,iEmailLen) == "@"))
			{
				alert("\n¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù.");
				//EmailForm.focus();
				return false;
			}

			for(i=0; i < iEmailLen; i++) {
				if ((strEmail.substring(i,i+1) == ".") ||
					(strEmail.substring(i,i+1) == "-") || (strEmail.substring(i,i+1) == "_") ||
				   ((strEmail.substring(i,i+1) >= "0") && (strEmail.substring(i,i+1) <= "9")) ||
				   ((strEmail.substring(i,i+1) >= "@") && (strEmail.substring(i,i+1) <= "Z")) ||
				   ((strEmail.substring(i,i+1) >= "a") && (strEmail.substring(i,i+1) <= "z"))) {
						if (strEmail.substring(i,i+1) == ".")
							strCheck1 = true;
						if (strEmail.substring(i,i+1) == "@")
							strCheck2 = true;
				}
				else {
					alert("\n¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù. ");
					//EmailForm.focus();
					return false;
				}
			}

			if ((strCheck1 == false) || (strCheck2 == false)) {
				alert("\n¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù. ");
				//EmailForm.focus();
				return false;
			}
		}
	}

