// png file
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 '';
}

// link
function open_window(target,url)	{eval(target).location = url;}
function open_pop(url)	{window.open(url, '', '');}
function close_pop(url)	{window.close(url, '', '');}
function open_drawing(img)	{
	img_pop = window.open('','','width=100, height=100, resizable=no');
	img_pop.document.write("<html><head><title>HYUNDAI MOTOR DOMESTIC PR</title></head>");
	img_pop.document.write("<script type='text/javascript' language='javascript' charset='euc-kr'>");
	img_pop.document.write("function resizeWin() {");
	img_pop.document.write("var obj = document.getElementById('img');");
	img_pop.document.write("var w = obj.width;");
	img_pop.document.write("var h = obj.height;");
	img_pop.document.write("window.resizeTo(w +13, h +75);");
	img_pop.document.write("}");
	img_pop.document.write("</script>");
	img_pop.document.write("<body style='margin:0; padding:0' onload='resizeWin();' scroll='auto'>");
	img_pop.document.write("<img src='" + img + "' onclick='self.close()' style='cursor:pointer' id='img'>");
	img_pop.document.close();
}
function tab_link	(t_val){
	document.location = t_val; // + '.html';
}

// Familysite
function show_con(idName)	{
	var obj = document.getElementById(idName);
	obj.style.left = "0";	
	obj.style.top = "-129px";	
}

function hide_con(idName)	{
	var obj = document.getElementById(idName);
	obj.style.left = "-5000px";
	obj.style.top = "-5000px";
}

// show_hidden_layer
function show_layer(idName) {
	var obj = document.getElementById(idName);
	obj.style.display = "block";
}
function hide_layer(idName) {
	var obj = document.getElementById(idName);
	obj.style.display = "none";
}

// faqlist
function expand_list(idName, idName2) {

	var obj = document.getElementById(idName);
	var obj2 = document.getElementById(idName2);
	var btn = obj.getElementsByTagName('span')[0];

	if (btn.className == "expand") {
		obj.className = "on";
		btn.className = "reduce";
		obj2.style.display = "block";
	} else if (btn.className == "reduce") {
		obj.className = "";
		btn.className = "expand";
		obj2.style.display = "none";
	}
}

// view, hide input_box for IE6.0
if(navigator.appVersion.indexOf("MSIE 6") != -1) {
	var o_body = null;
	o_body = document.documentElement.getElementsByTagName('body').length > 0 ? document.documentElement.getElementsByTagName('body')[0]: null;	
	var selects = null;
	if(o_body != "undefined" && o_body != null)
	    selects = o_body.getElementsByTagName("select")
	    //document.getElementsByTagName("select");
}

function hide_select() {
	 if(navigator.appVersion.indexOf("MSIE 6") != -1) {
		 for (var i=0 ; i<selects.length ; i++) {selects[i].style.visibility = "hidden";}
	 }
}
function show_select() {
	if(navigator.appVersion.indexOf("MSIE 6") != -1) {
		 for (var i=0 ; i<selects.length ; i++) { selects[i].style.visibility = "visible";}
	}
}

// expand photo
function expand_photo (idName, imgName) {	
	document.getElementById(idName).src = '/images/sample/' + imgName;
}

// exchange_class_on
function change_on (a)	{
	var obj = document.getElementById('id_activity_list').getElementsByTagName('li');
	for (var i=0; i<obj.length; i++)	{
		obj[i].className = "";
		if (i == a-1) {obj[i].className = "on";}
	}
}

// ?˜ì´ì§€ ?¸ì¶œ ?¨ìˆ˜
var please_wait = null;

function open_url(url, target) {
	
	if (!document.getElementById) {
		return false;
	}

    if (please_wait != null) {
		document.getElementById(target).innerHTML = please_wait;
    }

	if (window.XMLHttpRequest) {
		link = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) {
			link = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	if (link == undefined) {
		return false;
	}

    link.onreadystatechange = function() { response(url, target); }
    link.open("GET", url, true);
	link.setRequestHeader("Accept-Language","ko"); 
	//link.send("action="+action+"&id="+id+"&rule="+rule);
    link.send(null);
}

function response(url, target) {
    if (link.readyState == 4) {
         document.getElementById(target).innerHTML = (link.status == 200) ? link.responseText : "ï§ê³¹ê²•åª›? ?ëº¥ì†—??? ??†ë’¿??ˆë–Ž. ?ë¨?œ­?„ë¶¾ë±? " + link.status;
    }
}

function set_loading_message(msg) {
    please_wait = msg;
}

/* flash_player */
function cf_start(url){
	thisMovie("player").cf_start(url);
}
function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window.document[movieName];
	} else {
		return document[movieName];
	}
}

/* ir_tab_con */
function tag_index(this_obj, idName){
	var obj_top = this_obj.parentNode;
	var count = 1;
	for (var i=1; i<=obj_top.parentNode.getElementsByTagName('tr').length/2 ; i++){
		if(i == idName ){
			return count;
		}
		else{
			count++;
		}
	}
}

function open_list(this_obj, idName)	 {
	var this_index = tag_index(this_obj, idName);	
	var obj_top = this_obj.parentNode;
	var list_max = obj_top.parentNode.getElementsByTagName('tr').length/2;
	var obj_btm = document.getElementById('id_list' + idName);

	for (var n=1 ; n<=list_max ; ++n) {
		
		if (this_index == n) {
			if (obj_top.className == "") {
				obj_top.className = "on_top";
				obj_btm.parentNode.style.cssText = "display:block";
			} else {
				obj_top.className = "";
				obj_btm.parentNode.style.cssText = "display:none";
			}
		} else if (this_index != n) {
			obj_top.parentNode.getElementsByTagName('tr')[n*2-2].className = "";
			document.getElementById('id_list' + n).parentNode.style.cssText = "display:none";
		}
	}
}

/* ??ë¾½ï§?·ëŽ…??*/
function showLayer() {
	hide_select();
	document.getElementById('flash_map').style.cssText = "overflow:hidden; height:403px";
	document.getElementById('id_fieldset_facility').style.zIndex = -1;
}
function hideLayer() {
	show_select();
	document.getElementById('flash_map').style.cssText = "overflow:hidden; height:80px";
	document.getElementById('id_fieldset_facility').style.zIndex = 20;
}

/* quick */
if (document.getElementById("quick_top")){
	var quick_h = document.getElementById("quick_top").style.height;
	var content_c = document.getElementById("content_wrap").clientHeight;
	var content_s = document.body.clientHeight;
	if (content_c <= content_s) {
		quick_h = content_c + "px";
	} else {
		quick_h = "100%";
	}
}

function csnotice_pop(url, name, options)
{
    window.open(url,name,options);    
}

function micro_pop(url, name)
{
	var micro_width	= screen.availWidth - 10;
	var micro_height	= screen.availHeight - 250;
    window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,copyhistory=0,width='+micro_width+'px,height='+micro_height+'px,left=0,top=190px');    
}

/* 111123 Ãß°¡ */
function hgalleryPop (url, name)
{
	var hgallery_width	= screen.availWidth - 10;
	var hgallery_height	= screen.availHeight - 250;
    window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,copyhistory=0,width='+hgallery_width+'px,height='+hgallery_height+'px,left=0,top=190px');    
}
/* //111123 Ãß°¡ */
/* 100310 Ãß°¡ */
function f_open_window_max( aURL, aWinName )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=no,menubar=no,scrollbars=no,resizable=yes,toolbar=no, fullscreen=yes';
   sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
   sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', aWinName, sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   wOpen.moveTo( 0, 0 );
   wOpen.resizeTo( screen.availWidth, screen.availHeight );
   return wOpen;
}
/* //100310 Ãß°¡ */

function newWinTest(){
  newWin=window.open('100%','100%','toolbar=no,scrollbars=no,top=200,left=300,width=170,height=50');
}


function commonPopup( link, PopWidth,PopHeight)
{
    commonPopWin(link,"",PopWidth,PopHeight,1,"c",null);
}

function commonPopWin(url,wname,w,h,ptype,t,l)
{
    var popupWin, tVal, lVal;
    if (t == "c") {
        lVal = (screen.Width - w) / 2;
        tVal = (screen.Height - h) / 2;
    } else {
        tVal = (t!=null)?t:0;
        lVal = (l!=null)?l:0;
    }
    var popOpt = "width="+w+",height="+h+", top="+tVal+", left="+lVal;
    if(ptype == 0){
        popOpt += ",scrollbars=no";
    }
    if(ptype == 1){
        popOpt += ",scrollbars=yes";
    }
    if(ptype == 2){
        popOpt += ",scrollbars=yes,resizable=yes";
    }
    popupWin = window.open(url,wname,popOpt);
    popupWin.focus();
}
function isField(keyword) { 
        var st_num,key_len; 
        st_num = keyword.indexOf(" "); 
    while (st_num != -1){ 
        keyword = keyword.replace(" ", ""); 
        st_num = keyword.indexOf(" "); 
    }
        key_len=keyword.length; 
        return key_len; 
}
/* //101201 Ãß°¡ */
function brochure_pop(url, name)
{
    window.open(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,copyhistory=0,width=850px,height=650px,left=0,top=0px');    
}
/* //101201 Ãß°¡ */
