function render_showhide(show, hide) {
  document.getElementById(show).style.display = "inline";
  document.getElementById(hide).style.display = "none";
}

function render_layer(layname) {
  if(document.getElementById(layname).style.display == "none") {
    for(i=1; i<=9; i++) { if((layname != "_pop"+i)) document.getElementById("_pop"+i).style.display = "none"; }
    document.getElementById(layname).style.display = "inline";
    document.getElementById(layname).style.top = document.documentElement.scrollTop+100 + "px";
  } else document.getElementById(layname).style.display = "none";
}


function customCopy(model_code)
{
    var mypage = "detail_copy.html?model_code="+model_code ;
    var myname = "ccpopup" ;
    var w = 500 ;
    var h = 450 ;
    var scroll = "yes" ;

    var winl = (screen.width - w) / 2 ;
    var wint = (screen.height - h) / 2 ;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll ;
    win = window.open(mypage, myname, winprops) ;
    if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus() ;
	}
}

//¿À¸¥ÂÊ ½ºÅ©·Ñ º£³Ê¸¦ À§ÇÑ ºÎºÐ-----------------------------//
/*	self.onError=null; 
    currentX = currentY = 0; 
    whichIt = null; 
    lastScrollX = 0; lastScrollY = 0; 
    NS = (document.layers) ? 1 : 0; 
    IE = (document.all) ? 1: 0; 

    function heartBeat() 
    { 
        //spaceTop : È­¸é »ó´Ü ¿©¹é ³ôÀÌ 
        //spaceBottom : È­¸é ÇÏ´Ü ¿©¹é ³ôÀÌ 
        //barHeight : ÀÌµ¿ Äü¹ÙÀÇ ³ôÀÌ 
		spaceTop = 20 ; 
        spaceBottom = 250 ; 
        barHeight = 549 ; 
        DIV_MAX_Y = document.body.scrollHeight - barHeight - spaceTop - spaceBottom ; 
        if(IE) { 
            diffY = document.body.scrollTop; 
            diffX = 0; 
        } 
        if(NS) { 
            diffY = self.pageYOffset; 
            diffX = self.pageXOffset; 
        }  
        if(diffY != lastScrollY) { 
            if( !((diffY >= lastScrollY) && (document.all.quickbar.style.pixelTop >= DIV_MAX_Y)) ) 
            { 
                percent = .1 * (diffY - lastScrollY); 

                if(percent > 0) { 
                    percent = Math.ceil(percent); 
                } 
                else { 
                    percent = Math.floor(percent); 
                } 

                if(IE) document.all.quickbar.style.pixelTop += percent; 
                if(NS) document.quickbar.top += percent; 
                lastScrollY = lastScrollY + percent; 
            } 
        } 
        if(diffX != lastScrollX) { 
            percent = .1 * (diffX - lastScrollX); 

            if(percent > 0) percent = Math.ceil(percent); 
            else percent = Math.floor(percent); 

            if(IE) document.all.quickbar.style.pixelLeft += percent; 
            if(NS) document.quickbar.left += percent; 
            lastScrollX = lastScrollX + percent; 
        } 


/*	myObj = document.getElementById("varsize"); // °³Ã¼ÀÇ ±¸¼º ¿ä¼Ò °¡Á®¿È 
	if(document.all.quickbar.style.pixelTop=="140"){
	myObj.style.height = (10+(document.all.quickbar.style.pixelTop-140)); // Áõ°¡
	}else{
	myObj.style.height = (10+(document.all.quickbar.style.pixelTop)); // Áõ°¡
	}
*/	
	
	
	/*} 

    if(NS || IE) action = window.setInterval("heartBeat()",1); */


//¿À¸¥ÂÊ ½ºÅ©·Ñ º£³ÊºÎºÐ ³¡..------//




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// #####################ÇÃ·¡½¬ ·Îµå..------//
/*
IE Flash ActiveContent Activation Script
Author: Faisal Iqbal (chall3ng3r)
Blog: http://www.orison.biz/blog/chall3ng3r/

Feel free to modify or distribute.
*/
 
/*
Method: FlashObject
 Param1: SWF path
 Param2: Movie width
 Param3: Movie height
 Param4: BGColor
 Param5: Flashvars (Optional)
*/
function FlashObject(swf, width, height, bgcolor, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
 		strFlashTag += 'width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
  	if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
  	strFlashTag += '<param name="menu" value="false"/>';
  	strFlashTag += '<param name="salign" value="LT"/>';
   	//strFlashTag += '<param name="salign" value="T"/>';
  	strFlashTag += '<param name="scale" value="noscale"/>';
 	strFlashTag += '<param name="wmode" value="transparent"/>';
  	//strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
	strFlashTag += '<param name="allowScriptAccess" value="always"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
  	strFlashTag += 'menu="false" ';
  	strFlashTag += 'scale="noscale" ';
  	strFlashTag += 'salign="LT" ';
 	//strFlashTag += 'wmode="transparent" ';
  	//strFlashTag += 'allowScriptAccess="sameDomain" ';
  	strFlashTag += 'allowScriptAccess="always" ';
        //if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}




// Flash Object »ý¼º
function makeFlashObject(param) {
	var params		= new Array();
	var classID		= "D27CDB6E-AE6D-11cf-96B8-444553540000";
	var codeBase	= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0";
	var type		= "application/x-shockwave-flash";
	var pluginsPage	= "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
	var cnt = 0;

	var movie		= param["movie"] == null	? ""	: param["movie"];
	var width		= param["width"] == null	? "0"	: param["width"];
	var height		= param["height"] == null	? "0"	: param["height"];
	var id			= param["id"] == null		? ""	: param["id"];
	var quality		= param["quality"] == null	? ""	: param["quality"];
	var bgcolor		= param["bgcolor"] == null	? ""	: param["bgcolor"];
	var loop		= param["loop"] == null		? ""	: param["loop"];
	var wmode		= param["wmode"] == null	? ""	: param["wmode"];

	// Ç×¸ñ °Ë»ç
	if (movie == "") return;

	params["classID"]		= classID;
	params["codeBase"]		= codeBase;
	params["width"]			= width;
	params["height"]		= height;
	params["type"]			= type;
	params["pluginsPage"]	= pluginsPage;
	params["params"]		= new Array();
	params["name"]			= id;

	// ¼¼ºÎÆÄ¶ó¸ÞÅÍ ÁöÁ¤
	params["params"][cnt++] = new paramValue("movie"	, movie);
	if (quality != "")	params["params"][cnt++] = new paramValue("quality"	, quality);
	if (bgcolor != "")	params["params"][cnt++] = new paramValue("bgcolor"	, bgcolor);
	if (loop != "")		params["params"][cnt++] = new paramValue("loop"		, loop);
	if (wmode != "")	params["params"][cnt++] = new paramValue("wmode"	, wmode);

	params["extParam"]		= makeEmbedObject(params, false);
	params["id"]			= id;
	params["name"]			= "";

	makeActiveXObject(params);
}

// ActiveX Objext »ý¼º
function makeActiveXObject(param) {
	var makeString	= "";
	var classID		= param["classID"] == null	? ""	: param["classID"];
	var codeBase	= param["codeBase"] == null	? ""	: param["codeBase"];
	var width		= param["width"] == null	? "0"	: param["width"];
	var height		= param["height"] == null	? "0"	: param["height"];
	var id			= param["id"] == null		? ""	: param["id"];
	var name		= param["name"] == null		? ""	: param["name"];
	var params		= param["params"];
	var extParam	= param["extParam"] == null	? ""	: param["extParam"];

	if (classID == "") return;

	// object ±âº»Á¤º¸
	makeString += "<object classid=\"clsid:" + classID + "\" width=" + width + " height=" + height;

	if (codeBase != "") {
		makeString += " codebase=\"" + codeBase + "\"";
	}

	if (id != "") {
		makeString += " id=\"" + id + "\"";
	}
	
	if (name != "") {
		makeString += " name=\"" + name + "\"";
	}
	
	makeString += ">\n";

	// ÆÄ¶ó¸ÞÅÍ ÁöÁ¤
	if (params != null) {
		for (var i=0; i < params.length; i++) {
			if (params[i].value == "") continue;

			makeString += "\t<param name=\"" + params[i].name + "\" value=\"" + params[i].value + "\">\n";
		}
	}

	// ±âÅ¸ÆÄ¶ó¸ÞÅÍ
	if (extParam != "") {
		makeString += "\t" + extParam;
	}

	makeString += "</object>\n";

	document.write (makeString);
}

// embed Object »ý¼º
function makeEmbedObject(param, print) {
	var makeString = "";
	var type		= param["type"] == null			? ""	: param["type"];
	var pluginsPage	= param["pluginsPage"] == null	? ""	: param["pluginsPage"];
	var width		= param["width"] == null		? "0"	: param["width"];
	var height		= param["height"] == null		? "0"	: param["height"];
	var id			= param["id"] == null			? ""	: param["id"];
	var name		= param["name"] == null			? ""	: param["name"];
	var src			= param["src"] == null			? ""	: param["src"];
	var params		= param["params"];

	makeString += "<embed width=" + width + " height=" + height;

	if (type != "") {
		makeString += " type=\"" + type + "\"";
	}

	if (pluginsPage != "") {
		makeString += " pluginsPath=\"" + pluginsPage + "\"";
	}

	if (id != "") {
		makeString += " id=\"" + id + "\"";
	}
	
	if (name != "") {
		makeString += " name=\"" + name + "\"";
	}

	if (src != "") {
		makeString += " src=\"" + src + "\"";
	}

	// ÆÄ¶ó¸ÞÅÍ ÁöÁ¤
	if (params != null) {
		for (var i=0; i < params.length; i++) {
			if (params[i].value == "") continue;

			if ((params[i].name.toLowerCase() == "movie" || params[i].name.toLowerCase() == "filename") 
				&& makeString.indexOf("src=\"") < 0) {
				makeString += " src=\"" + params[i].value + "\"";
			}
			else {
				makeString += " " + params[i].name + "=\"" + params[i].value + "\"";
			}
		}
	}

	makeString += ">\n";

	if (print) {
		document.write (makeString);
	}

	return makeString;
}

// paramValue
function paramValue(name, value) {
	this.name	= name;
	this.value	= value;
}


function syncHeight(el) {
                el = typeof el == 'string' ? document.getElementById(el) : el;
                el.setExpression('height','contentWindow.document.body.scrollHeight+5');
}


// ÀüÃ¼ ÆäÀÌÁö Àû¿ë : ¸µÅ©½Ã Á¡¼± ¾ø¾Ö±â
function bluring(){ 
 if(!event.srcElement) return;
 if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
 document.body.focus(); 
} 
document.onfocusin=bluring; 

function autoBlur(){ 

 try{
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
 }catch(e) {}
}
document.onfocusin=autoBlur;


 // Footer °ü·Ã (¼¿·ºÆ®¹Ú½º)
 function showcombo(what){
	if (what.style.display=='none')
		what.style.display='';

}
function hidecombo(what){
	if (what.style.display=='')
		what.style.display='none';

}


// ÀÌº¥Æ® ÆË¾÷ ¶ç¿ì±â
function popupWindow(url, w, h) {
        var posX = (screen.width - w) / 2;
        var posY = (screen.height - h) / 2;
        var option = ",resizable=no,scrollbars=yes,status=no";
        window.open(url, "new_win","width="+w+",height="+h+",left="+posX +",top="+posY+option);
}

function popup(url,w,h,s,uname,l,t)
{
    var url = url;
    var width = w;
    var height = h;
    var left = l;
    var top = t;

    var toolbar = 'no';
    var menubar = 'no';
    var status = 'no';
    var scrollbars = s;
    var resizable = 'no';
    var uname = uname;
    var help = window.open( url, uname, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar+', menubar='+menubar+', status='+status+', scrollbars='+scrollbars+', resizable='+resizable);
}


function click_div_view(frm){
var str = document.getElementById(frm).style.display
	if(str == 'none')
		document.getElementById(frm).style.display = 'block';
	else 
		document.getElementById(frm).style.display = 'none';
}
