/* Title */

document.title="Hanwha S&C.";





/* 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 '';

}



/* Blur */



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

//var myAnchors=document.all.tags("A");

function allblur() {

	for (i=0;i<myAnchors.length;i++) {

		myAnchors[i].onfocus=new Function("blur()");

	}

}



//allblur();



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;

}





// faq »ç¿ë

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;

}



/***** Ç¥ÁØÇü 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);

}







/*swfÆÄÀÏ*/

function swf(src,w,h,id){

 html = '';

 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="'+id+'" width="'+w+'" height="'+h+'">';

 html += '<param name="movie" value="'+src+'">';

 html += '<param name="quality" value="best">';

 html += '<param name="wmode" value="transparent">';

 html += '<embed src="'+src+'" quality=best width="'+w+'" height="'+h+'" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"><\/embed>';

 html += '<\/object>';

 document.write(html);

}



/* ÆäÀÌÁö°æ·Î ***************************************************************************************************************/

// 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("/include/xml/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;

	if(currentPath != nodeId)

		lineMapStr += "<a href='"+url+"'>"+ name+"</a>" + spStr;

	else

		lineMapStr += "<em class='point1 bo'>"+ 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;

   }

}



/* quickSearch */

function openLayer(vOnOff){

	if (vOnOff == "on"){

		document.all.quickService.style.display = '';

		callSearch("quick");

	}

	else if (vOnOff == "off"){

		document.all.quickService.style.display = 'none';

	}

}



function callSearch(movieName) {

	getMovieName(movieName).openSearch();

}



function getMovieName(movieName) {

    if (navigator.appName.indexOf("Microsoft") != -1) {

        return window[movieName]

   }

   else {

	   return document[movieName]

   }

}



/* 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(½ºÅ©·Ñ¹Ù¾øÀ½)







// iframe ÀÚµ¿ ¸®»çÀÌÂ¡

var NS4;

var IE4;

if (document.all)

{

    IE4 = true;

    NS4 = false;

}

else

{

    IE4 = false;

    NS4 = true;

}



// == Iframe Handling ==

// iframe resize½Ã ÃÖ¼Ò width, height

var frmMinWidth;

var frmMinHeight;

var applyMinSize = false;

// iframe resize½Ã ÃÖ´ë width, height

var frmMaxWidth;

var frmMaxHeight;

var applyMaxSize = false;



function resizeIframe(name)

{

    if (name == null || name == "")

    {

        name = "cafe_main";

    }



    try

    {

        if (IE4)

            var oBody   = document.frames(name).document.body;

        else

            var oBody = document.getElementById(name).contentDocument.body;



        var oIFrame = document.getElementById(name);



        var frmWidth  = oBody.scrollWidth;

        var frmHeight = oBody.scrollHeight;



        if (applyMinSize)

        {

            frmWidth  = Math.max(frmWidth, frmMinWidth);

            frmHeight = Math.max(frmHeight, frmMinHeight);

        }

        if (applyMaxSize)

        {

            frmWidth  = Math.min(frmWidth, frmMaxWidth);

            frmHeight = Math.min(frmHeight, frmMaxHeight);

        }



//        if (oIFrame.src.indexOf("BoardList.do")>0&&frmWidth>600)

//        {

//            frmWidth = 600;

//        }



        oIFrame.style.height = frmHeight;

        oIFrame.style.width = frmWidth;

    }

    catch (e) {}

}



function parentResizeIframe(name)

{

    if (parent && parent != this && parent.resizeIframe != null)

    {

        parent.resizeIframe(name);

    }

}



function resizePage(name)

{

	self.setTimeout("parentResizeIframe('" + name + "')",50);

}





<!--

	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.dtv21.co.kr', '¢ß´ë´öÅ×Å©³ë¹ë¸®');

	region_name[1][11] = new Option('http://www.atv21.co.kr', '¢ß¾Æ»êÅ×Å©³ë¹ë¸®');

	region_name[1][12] = new Option('http://www.stv21.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.firstfire.co.kr/index.jsp', 'Á¦ÀÏÈ­ÀçÇØ»óº¸Çè¢ß');
	region_name[2][5] = new Option('http://www.koreatrust.co.kr', 'ÇÑÈ­ÅõÀÚ½ÅÅ¹¿î¿ë¢ß');

	region_name[2][6] = new Option('http://www.hwvc.co.kr', 'ÇÑÈ­±â¼ú±ÝÀ¶¢ß');





	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.hoteltheplaza.com', 'ÇÃ¶óÀÚÈ£ÅÚ');

	region_name[3][5] = new Option('www.63realty.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('http://www.hwsd.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","");

	}



}
