<!--
var isselected = 0;
var Layer_no;
// Ãß°¡ after6.24---------------------------------------------------------
var Layer_no2;
var Layer_ex;
//------------------------------------------------------------------------

/*
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
*/

// Ãß°¡ after6.24---------------------------------------------------------
function stepchange(no)
{
	Layer_no = no;
	Layer_no2 = no;
	Layer_ex = 1;
}

function ChangeTexts0(no)
{

	eval('document.getElementById("Label' + no +'")').innerHTML = textArr[no - 1][0];

}
function ChangeTexts1(no)
{

	eval('document.getElementById("Label' + no +'")').innerHTML = textArr[no - 1][1];

}
function ChangeTexts2(no)
{

	eval('document.getElementById("Label' + no +'")').innerHTML = textArr[no - 1][0];
	srContent.innerHTML = textArr[no - 1][1];

}
//------------------------------------------------------------------------

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_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3)
	{
		if ((obj=MM_findObj(args[i]))!=null)
		{
			v=args[i+2];
			if (obj.style)
			{
				obj=obj.style;
				v=(v=='show')?'visible':(v='hide')?'hidden':v;
			}
			obj.visibility=v;
		}
	}
}

function MM_showHideLayers2(args)
{
	for(i = 0; i < 10; i++)
	{
		if(eval("document.all.menu" + i))
		{
			if(args == i)
			{
				eval("document.all.menu" + args + ".style.visibility = 'visible';");
			}
			else
			{
				eval("document.all.menu" + i + ".style.visibility = 'hidden';");
			}
		}
	}


/*
	all id·Î ÇÏ¸é ½ÇÇà¼Óµµ°¡ ¶³¾îÁö¹Ç·Î 10±îÁö¸¸ µ¹¸°´Ù. abraxas 2004/08/20
	for (i = 0 ; i < document.all.length ; i++)
	{
		if (document.all[i].id == "menu" + args)
		{
			document.all[i].style.visibility = 'visible';
			//alert(document.all[i].id);
		}
		else if (document.all[i].id.substring(0,4) == "menu")
		{
			document.all[i].style.visibility = 'hidden';
			//alert(document.all[i].id);
		}
	}
*/
}

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_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_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];}
}

function changeOverImage(pos)
{
	var changeImage = "../../../images/showroom/atos_prime/atos_prime_safety_rol_01_1.gif";
	var changeColor = "326593";

	eval('document.getElementById("arrow' + pos + '").src = changeImage;');
	eval('document.getElementById("desc' + pos + '").style.color = changeColor;');
}

function changeOutImage(pos)
{
	var changeImage = "../../../images/showroom/atos_prime/atos_prime_safety_rol_01.gif";
	var changeColor = "999999";

	eval('document.getElementById("arrow' + pos + '").src = changeImage;');
	eval('document.getElementById("desc' + pos + '").style.color   = changeColor;');
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

// showroom layer expand javascript - 2002.09.16 flyfork
var SetDefaultLayerWidth	= 210;
var SetDefaultLayerHeight	= 100;
var SetExpandLayerWidth	= 10;
var SetExpandLayerHeight	= 10;
var SetExpandLayerPSWidth	= 50;
var SetExpandLayerPSHeight	= 50;

function ExpandLayer(cObj, expandType, addWidth, addHeight)	{

	cObj.style.cursor = 'default';

	if (expandType == 'show')	{

		cObj.style.width	= SetDefaultLayerWidth + SetExpandLayerWidth;
		cObj.style.height	= SetDefaultLayerHeight + SetExpandLayerHeight;
		cObj.style.overflowY = 'auto';
	}
	else if (expandType == 'hide')	{

		cObj.style.width	= SetDefaultLayerHeight - SetExpandLayerWidth;
		cObj.style.height	= SetDefaultLayerHeight - SetExpandLayerHeight;
		cObj.style.overflowY = 'hidden';
	}

}

function ExpandPSLayer(cObj, flag, expandType, width, height)	{


	if (flag)
	{
		cObj.style.cursor = 'default';

		cObj.style.width	= width;
		cObj.style.height	= height;

		if (expandType == 'over')	{

			cObj.style.overflowY = 'auto';
		}
		else if (expandType == 'out')	{

			cObj.style.overflowY = 'hidden';
		}
	}

}

function check2(obj)
{
	alert(obj.style.width);
}
/*
function ExpandPSLayer(cObj, expandType, addWidth, addHeight)	{

	cObj.cursor = 'hand';

	if (expandType == 'show')	{

		cObj.style.width	+= addWidth;
		cObj.style.height	+= addHeight;
		cObj.style.overflow = 'auto';
	}
	else if (expandType == 'hide')	{

		cObj.style.width	= SetDefaultLayerWidth;
		cObj.style.height	= SetDefaultLayerHeight;
		cObj.style.overflow = 'hidden';
	}

}
*/
function TypePerformanceText(no)		{

	if(no!=-1)
	{
		for (var i = 0; i < no; i ++)
		{
			var k = parseInt(i + 1)
			eval('document.getElementById("rMenu' + k + '").innerHTML = textArr[i][0]');
			eval('document.getElementById("title' + k + '").innerHTML = textArr[i][0]');
			eval('document.getElementById("contents' + k + '").innerHTML = textArr[i][1]');
	//		eval('layerContents' + parseInt(i + 1) + '.innerHTML = textArr[i][1]');

	//		eval('contents' + parseInt(i + 1) + '.style.color = \'#FFFFFF\'');
		}
	}
	else
	{

		var S_Layer;

		for(var i=0;i<SLayer_count;i++)
		{
			var k = parseInt(i + 1)
			S_Layer = eval('document.getElementById("spec' + k + '")');
			S_Layer.innerHTML=textArr[i][1];
		}
	}
}

function ChangeShowroomText(cObj, no)
{
	Layer_no=no;
	isselected = 1;
	if (cObj != '' && cObj != null)
		//cObj.style.cursor = 'hand';

	eval('Label' + no).innerHTML = textArr[no - 1][0];
	//psjang °íÄ§... 2002-11-15 ¼î·ë ÀÚ±¹¾î ÆíÁý ºÎºÐ¿¡¼­ <BR> ÅÂ±×°¡ µû¶ó ºÙÀ½
	srContent.innerHTML = '<br>'+textArr[no - 1][1];
	//srContent.innerHTML = textArr[no - 1][1];
	//alert(eval("Label" +no).style.coursor);
	eval('Layer' + no).style.cursor="default";
	srContent.style.cursor ="default";

}

function closeCarDescWindow()
{
//	for(var i=0;i <5000; i++);
//alert("This Window will closed!");
	window.close();
}

function ChangeLayerForColor(obj, layerName, totalLayer, layerId)
{
	var i;
	var cmd;



	if(layerId == 0)	return;

	cmd =  "MM_showHideLayers(";
	for(i = 1; i < totalLayer + 1; i++)
	{
		if(i == layerId)
		{
			cmd += "'" + layerName + (i + 0) + "', '', 'show',";
			cmd += "'" + layerName + (i + totalLayer) + "', '', 'show',";
		}
		else
		{
			cmd += "'" + layerName + (i + 0) +              "', '', 'hide',";
			cmd += "'" + layerName + (i + totalLayer) + "', '', 'hide',";
		}
	}
	cmd += "'" + layerName + (totalLayer * 2 + 1) + "', '', 'hide')";
	eval(cmd);
}

//edit car titlecontext - window titlename, distirbutor, carcode, showroom(interior, exterior...), exterior1(front), exterior2(end)
function openEditWindow(writer, carcode, show_no, angle, ocarname, title, carType)
{

	if (isselected == 0)
	{

		if(carType == "BUS" || carType == "TRUCK")
		{
			alert("Please select what you want to edit!");
			return -1;
		}
		else if((trim(show_no) ==2 || trim(show_no) ==3) && carcode != 14) 	//interior,exterior
		{
			Layer_no = "999";
		}
		else
		{
			alert("Please select what you want to edit!");
			return -1;
		}
	}

	if(carType == "BUS" || carType == "TRUCK")
	{
		if(angle == "")
		{
			angle = title;
		}
	}

	if(carcode == "07" && show_no == 5 )			//XG safety
	{
		angle = "safety";
	}
	if(carcode == "17" && show_no == 10 )			// H100 Truck safety
	{
		angle = "style";
	}

	if(trim(show_no) ==1)							//Showroom Detail Custom page
	{
		var strurl = "../../../components/showroom/DetailDescription.aspx";
		var windowFeatures = "width=417, height=260" ;
	}
	else
	{
		var strurl = "../../../components/showroom/CarDescription.aspx";
		var windowFeatures = "width=417, height=240" ;
	}

	// Ãß°¡ after6.24---------------------------------------------------------
	if(Layer_ex==1)
	{
		Layer_no = Layer_no2;
	}
	//------------------------------------------------------------------------

	strurl = strurl + "?writer=" + writer;
	strurl = strurl + "&carcode=" + carcode;
	strurl = strurl + "&show_no=" + show_no;
	strurl = strurl + "&step=" + Layer_no;
	strurl = strurl + "&angle=" + angle;
	strurl = strurl + "&ocarname=" + ocarname;
	strurl = strurl + "&menuTitle=" + title;
	strurl = strurl + "&carType=" + carType;



	if(trim(carcode) == 10 && trim(show_no) == 3 && angle == "PS")
	{
		strurl = strurl + "&chkno=" + g_no;
	}

	var newwindow = window.open(strurl, "", windowFeatures);

	txturl = null;
}



function CarSubmit(form, kind)
{
	//alert('test');
	form.Method.value = kind;
	//alert(form.Method.value);
	form.submit();
}

function ChangeLayer(obj, totalLayer, layerId)
{
	obj.style.cursor = "default";


	var i;
	var cmd;
	Layer_no=layerId;
	isselected = 1;
	if(layerId == 0)	return;

	cmd =  "MM_showHideLayers(";
	for(i = 1; i < totalLayer + 1; i++)
	{
		if(i == layerId)
		{
			cmd += "'Layer" + (i + 0) + "', '', 'show',";
			cmd += "'Layer" + (i + totalLayer) + "', '', 'show',";
		}
		else
		{
			cmd += "'Layer" + (i + 0) +              "', '', 'hide',";
			cmd += "'Layer" + (i + totalLayer) + "', '', 'hide',";
		}
	}
	cmd += "'Layer" + (totalLayer * 2 + 1) + "', '', 'hide')";

	eval(cmd);

	isselected = 1;
//	imgstep = layerId;

	ChangeShowroomText(obj, layerId);
}

function ChangeLayer2(obj, totalLayer, layerId)
{
	var i;
	var cmd;
//	var change;
	eval('document.getElementById("rMenu' + layerId + '")').style.cursor="default";
	eval('document.getElementById("Layer' + layerId + '")').style.cursor = "default";
//	alert('hi');
	if(layerId == 0)	return;

	cmd =  "MM_showHideLayers(";
	for(i = 1; i < totalLayer ; i++)
	{
		if(i == layerId)
		{
			eval("document.getElementById('Layer" + (i + 0) + "').style.visibility = 'visible';");
		}
		else
		{
			eval("document.getElementById('Layer" + (i + 0) + "').style.visibility = 'hidden';");
		}
	}
	//cmd += "'Layer" + (totalLayer * 2 + 1) + "', '', 'hide')";
	if ( i == layerId )
	{
		cmd += "'Layer" + (i + 0) + "', '', 'show')";
	}
	else
	{
		cmd += "'Layer" + (i + 0) + "', '', 'hide')";
	}
	if(i == layerId)
	{
		eval("document.getElementById('Layer" + (i + 0) + "').style.visibility = 'visible';");
	}
	else
	{
		eval("document.getElementById('Layer" + (i + 0) + "').style.visibility = 'hidden';");
	}

	//alert(cmd);
	eval(cmd);

	isselected = 1;
	Layer_no = layerId;
//	imgstep = layerId;

	//change = "changeOverImage("
/*
	for (change= "", i = 1; i < totalLayer + 1; i++ )
	{
		if ( i == layerId )
		{
			change += "changeOverImage(" + (i + 0) + ");";
		}
		else
		{
			change += "changeOutImage(" + (i + 0) + ");";
		}
	}

	//alert(change);
	eval(change);
*/
	//alert('change layer');
//	MM_showHideLayers('Layer1','','hide','Layer2','','show','Layer3','','hide','Layer4','','hide','Layer5','','hide','Layer6','','show','Layer7','','hide','Layer8','','hide');MM_SetLayerText('/wwn/images/showroom/accent/accent_exterior_img_04.gif', '2');
//	ChangeShowroomText(obj, layerId);

}

function SetLayerPosForAdmin(totalLayer)
{
	var i;
	var s;

	for(i = 1; i < totalLayer + 1; i++)
	{
		s = eval("Layer" + i + ".style");
		s.top = (parseInt(s.top)-24) + "px";
	}
}

// getting number of division ID of specification page in showroom part - flyfork 2002.10.08
	function selLabel(cObj)
	{
		for (i = 0 ; i < document.all.length ; i++)
		{
			if (document.all[i].id.substring(0,4) == "spec")
				document.all[i].style.fontWeight = 'normal';
		}

		cObj.style.fontWeight = 'bold';

		var val = cObj.id;

		//var e = eval(val + ".innerHtml");
		//alert(e);

		val = val.replace('spec', '');

		isselected = 1;
		Layer_no = val;

		//alert((val));
	}

	function selLabel2(cObj)
	{
		for (i = 0 ; i < document.all.length ; i++)
		{
			if (document.all[i].id.substring(0,4) == "spec" || document.all[i].id.substring(0,4) == "Laye")
				document.all[i].style.fontWeight = 'normal';
		}

		cObj.style.fontWeight = 'bold';

		var val = cObj.id;

		val = val.replace('Layer', '');

		isselected = 1;
		Layer_no = val;

		//alert((val));

	}

	function selLabel3(cObj)
	{
		for (i = 0 ; i < document.all.length ; i++)
		{
			if (document.all[i].id.substring(0,4) == "spec")
				document.all[i].style.fontWeight = 'normal';
		}

		cObj.style.fontWeight = 'bold';

		var val = cObj.id;

		val = val.replace('Layer_h', '');

		isselected = 1;
		Layer_no = val;

//		alert((val));

	}


	var Page_choose;
	var Page_index;
	var select_object;
	
	function Select(c, obj)
	{
		if(obj.selectedIndex != 0)
		{
			Page_choose = c;
			Page_index = obj.selectedIndex;
			select_object = obj;
		}
	}

	function MoveLink()
	{
		if(select_object != null && select_object.options(Page_index).car_name != null)
		{
			var url;
			var car_name;
			var carname;

			if(Page_choose == 1)
			{
				url = "../../../User/showroom/UserCar/CarForm2.aspx";
			}
			else
			{
				url = "../../../user/showroom/UserCar/CarForm2.aspx";
			}

			car_name = select_object.options(Page_index).car_name;
			car_name = car_name.replace("-","");
			car_name = car_name.replace(" ","_");
			car_name = car_name.replace("Galloper_","");

			carname = select_object.options(Page_index).text;
			carname = carname.replace("-","");
			carname = carname.replace(" ","_");

			//alert(car_name);
			//alert(carname);

			/*
			º£³×ÁÖ¿¤¶ó Æ¯¼ö Ã³¸®
			*/
			if(car_name == "venezuela1")
			{
				//url = "http://venezuela.hyundai-motor.com/user/General/Custom/LinkPage.aspx?LinkURL=http://200.74.198.40/hyundai/user/showroom/accent/Detail.html";
				url = "http://venezuela.hyundai-motor.com/user/General/Custom/LinkPage.aspx?LinkURL=http://www.hyundai-motor.com.ve/user/showroom/accent/Detail.html";
			}
			else if(car_name == "venezuela2")
			{
				//url = "http://venezuela.hyundai-motor.com/user/General/Custom/LinkPage.aspx?LinkURL=http://200.74.198.40/hyundai/user/showroom/accenttaxi/Detail.html";
				url = "http://venezuela.hyundai-motor.com/user/General/Custom/LinkPage.aspx?LinkURL=http://www.hyundai-motor.com.ve/user/showroom/accenttaxi/Detail.html";
			}
			else
			{
				url = url + "?Menu_no=" + select_object.options(Page_index).accessKey +
				"&carcode="+select_object.options(Page_index).value+"&CarName="+car_name+"&OCarName="+carname+
				"&PageName=Details";
			}

			//document.location = url;
			location.href = url;
		}
	}



function DetailLayer(obj,method)
{
	var layer= eval(obj);
	if(method==1)
	{
		layer.style.visibility="visible";
	}
	else
	{
		layer.style.visibility="hidden"
	}
}

function videowin(vb_id)
{
	if(vb_id != "")
	{
		window.open("../../../admin/data_bank/ad_bank_view_popup.aspx?AD_id="+vb_id,"video","location=no ,resizable=no, scrollbars=no ,status=no toolbar=no ,width=620,height=450");
	}
}

//-----------------------------------------
// ¹®ÀÚ¿­ Left Trim ÇÔ¼ö
//-----------------------------------------
function ltrim(str)
{
	var s = new String(str);

	if (s.substr(0,1) == " ")
		return ltrim(s.substr(1));
	else
		return s;
}

//-----------------------------------------
// ¹®ÀÚ¿­ Right Trim ÇÔ¼ö
//-----------------------------------------
function rtrim(str)
{
	var s = new String(str);

	if(s.substr(s.length-1,1) == " ")
		return rtrim(s.substring(0, s.length-1))
	else
		return s;
}

//-----------------------------------------
// ¹®ÀÚ¿­ Left & Right Trim ¸ð¹«µÇµµ·Ï ÇÏ´Â ÇÔ¼ö
//-----------------------------------------
function trim(str)
{
	return ltrim(rtrim(str));
}

//-----------------------------------------
// °¢ Æû¿¡¼­ °Ë»ö¾î ¹Ú½º¿¡¼­ ¿£ÅÍÅ° ÀÔ·Â½Ã °Ë»ö ¹öÆ° Å¬¸¯°ú µ¿ÀÏÇÑ È¿°ú
//-----------------------------------------
function OnKeyDown(obj)
{
		if(window.event.keyCode == 13)
		{
			obj.click();
			return true;
		}
}

//-----------------------------------------
// ¼ýÀÚ¸¦ ÅëÈ­·Î Ç¥Çö
//-----------------------------------------
function commaNum(num)
{
  if (num < 0) { num *= -1; var minus = true}
  else var minus = false

  var dotPos = (num+"").split(".")
  var dotU = dotPos[0]
  var dotD = dotPos[1]
  var commaFlag = dotU.length%3

  if(commaFlag)
  {
    var out = dotU.substring(0, commaFlag)
    if (dotU.length > 3) out += ","
  }
  else var out = ""

  for (var i=commaFlag; i < dotU.length; i+=3)
  {
      out += dotU.substring(i, i+3)
      if( i < dotU.length-3) out += ","
  }

  if(minus) out = "-" + out
  if(dotD) return out + "." + dotD
  else return out
}

function ExcelClick(Form,LType)
{
	var theForm = Form;
	theForm.ListType.value = LType;

	theForm.action = "../../common/ExcelDownLoad.aspx";
	theForm.submit();
	theForm.action = "";
}
//-->

