
	
function shopOver(a){
	for(var i=1;i<6;i++){
		if(a==i){
			document.getElementById("shopImg"+i).src = "http://images.wwn.hyundai.com/images/Web/Main/mb_Shmenu"+i+"_on.gif";
		}
	}
}
function shopOut(a){
	for(var i=1;i<6;i++){
		if(a==i){
			document.getElementById("shopImg"+i).src = "http://images.wwn.hyundai.com/images/Web/Main/mb_Shmenu"+i+".gif";
		}
	}
}

// IE6 PNG
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 change_img(index){
    var srcObj = document.getElementById("img_big_"+index);
    var targetObj = document.getElementById("show_img");
    targetObj.src = srcObj.href;
}

function change_img_sr(index){
    var srcObj = document.getElementById("img_big_"+index);
    var targetObj = document.getElementById("show_img");
    targetObj.src = srcObj.href;

    var divCnt = document.getElementById("ex_txt").getElementsByTagName("div").length;
    for (var i=0; i<divCnt; i++) document.getElementById("ex_txt").getElementsByTagName("div")[i].style.display = "none";
    document.getElementById("ex_txt").getElementsByTagName("div")[index - 1].style.display = "block";
}


// thumbnail moving
var thumbnail_cnt = 0;
var maxDisplayCnt = 0;
var move_px = 3;
var move_sr_px = 5;
var max_move_px = 69;
var max_move_tb_px = 39;
var max_move_sr_px = 50;
var movingState = false;
var strPosLeft = 0;
var movetotal = 0;

function setScroll(maxCnt) {
	maxDisplayCnt = maxCnt;
	thumbnail_cnt = document.getElementById("thumb_img").getElementsByTagName("li").length;

	if (thumbnail_cnt > maxCnt) {
		document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" />";
		document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('l');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" /></a>";
	} else {
		document.getElementById("arrowL").innerHTML = "&nbsp;";
		document.getElementById("arrowR").innerHTML = "&nbsp;";
	}
}


function setScroll_2(maxCnt) {
	maxDisplayCnt = maxCnt;
	thumbnail_cnt = document.getElementById("thumb_img").getElementsByTagName("li").length;

	if (thumbnail_cnt > maxCnt) {
		document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('ar');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" /></a>";
		document.getElementById("arrowR").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" />";
	} else {
		document.getElementById("arrowL").innerHTML = "&nbsp;";
		document.getElementById("arrowR").innerHTML = "&nbsp;";
	}
}

function setScroll_TB(maxCnt) {
	maxDisplayCnt = maxCnt;
	thumbnail_cnt = document.getElementById("thumb_img").getElementsByTagName("li").length;

	if (thumbnail_cnt > maxCnt) {
		document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awTop.gif\" alt=\"\" />";
		document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('t');\"><img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awBtm.gif\" alt=\"\" /></a>";
	} else {
		document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awTop.gif\" alt=\"\" />";
		document.getElementById("arrowR").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awBtm.gif\" alt=\"\" />";
	}
}

function setScroll_SR(maxCnt) {
	maxDisplayCnt = maxCnt;
	thumbnail_cnt = document.getElementById("thumb_img").getElementsByTagName("li").length;

	if (thumbnail_cnt > maxCnt) {
		document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aLeft.gif\" alt=\"\" />";
		document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('sl');\"><img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aRight.gif\" alt=\"\" /></a>";

	} else {
		document.getElementById("arrowL").innerHTML = "&nbsp;";
		document.getElementById("arrowR").innerHTML = "&nbsp;";
	}
}

function moveScroll(direction) {
    if (movingState) { return; }
	else {movingState = true; }

	movetotal = 0;

	actMove(direction);
}

function actMove(direction) {
	if (direction == "t" || direction == "b") {
		if (movetotal < max_move_tb_px) {
			if(direction == "t"){strPosLeft = strPosLeft - move_px;}
			else{strPosLeft = strPosLeft + move_px;}

			document.getElementById("moveDiv").style.top = strPosLeft + "px";

			movetotal += move_px;

			go = setTimeout ("actMove('" + direction + "')", 1)
		} else {
	    	clearTimeout(go);
	    	setBtn(direction);
	    	movingState = false;
		}
	} else if (direction == "sl" || direction == "sr") {
		if (movetotal < max_move_sr_px) {
			if(direction == "sl"){strPosLeft = strPosLeft - move_sr_px;}
			else{strPosLeft = strPosLeft + move_sr_px;}

			document.getElementById("moveDiv").style.left = strPosLeft + "px";

			movetotal += move_sr_px;

			go = setTimeout ("actMove('" + direction + "')", 1)
		} else {
	    	clearTimeout(go);
	    	setBtn(direction);
	    	movingState = false;
		}
	}else if (direction == "al" || direction == "ar") {
		if (movetotal < max_move_px) {
			if(direction == "al"){strPosLeft = strPosLeft + move_px;}
			else{strPosLeft = strPosLeft - move_px;}

			document.getElementById("moveDiv").style.right = strPosLeft + "px";

			movetotal += move_px;

			go = setTimeout ("actMove('" + direction + "')", 1)
		} else {
	    	clearTimeout(go);
	    	setBtn(direction);
	    	movingState = false;
		}

	}else {
		if (movetotal < max_move_px) {
			if(direction == "l"){strPosLeft = strPosLeft - move_px;}
			else{strPosLeft = strPosLeft + move_px;}

			document.getElementById("moveDiv").style.left = strPosLeft + "px";

			movetotal += move_px;

			go = setTimeout ("actMove('" + direction + "')", 1)
		} else {
	    	clearTimeout(go);
	    	setBtn(direction);
	    	movingState = false;
		}
	}

}

function setBtn(direction) {
	if (direction == "t" || direction == "b") {
		if (document.getElementById("moveDiv").style.top == "0px") {
			document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awTop.gif\" alt=\"\" />";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('t');\"><img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awBtm.gif\" alt=\"\" /></a>";
		} else if (document.getElementById("moveDiv").style.top == -((thumbnail_cnt - maxDisplayCnt) * max_move_tb_px) + "px") {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('b');\"><img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awTop.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awBtm.gif\" alt=\"\" />";
		} else {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('b');\"><img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awTop.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('t');\"><img src=\"http://images.wwn.hyundai.com/images/Web/CI/fw_ga_awBtm.gif\" alt=\"\" /></a>";
		}
	} else if (direction == "sl" || direction == "sr") {
		if (document.getElementById("moveDiv").style.left == "0px") {
			document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aLeft.gif\" alt=\"\" />";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('sl');\"><img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aRight.gif\" alt=\"\" /></a>";
		} else if (document.getElementById("moveDiv").style.left == -((thumbnail_cnt - maxDisplayCnt) * max_move_sr_px) + "px") {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('sr');\"><img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aLeft.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aRight.gif\" alt=\"\" />";
		} else {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('sr');\"><img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aLeft.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('sl');\"><img src=\"http://images.wwn.hyundai.com/images/Web/SR/ex_aRight.gif\" alt=\"\" /></a>";
		}
	}else if (direction == "al" || direction == "ar") {
		if (document.getElementById("moveDiv").style.right == "0px") {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('ar');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" />";
		} else if (document.getElementById("moveDiv").style.right == -((thumbnail_cnt - maxDisplayCnt) * max_move_px) + "px") {
			document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" />";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('al');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" /></a>";
		} else {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('ar');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('al');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" /></a>";
		}
	}else {
		if (document.getElementById("moveDiv").style.left == "0px") {
			document.getElementById("arrowL").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" />";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('l');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" /></a>";
		} else if (document.getElementById("moveDiv").style.left == -((thumbnail_cnt - maxDisplayCnt) * max_move_px) + "px") {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('r');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" />";
		} else {
			document.getElementById("arrowL").innerHTML = "<a href=\"javascript:moveScroll('r');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowL.gif\" alt=\"\" /></a>";
			document.getElementById("arrowR").innerHTML = "<a href=\"javascript:moveScroll('l');\"><img src=\"http://images.wwn.hyundai.com/images/Web/NE/NE_MS2009_arrowR.gif\" alt=\"\" /></a>";
		}
	}
}




//map
function rollover(obj_img){
 var re = new RegExp('off');
 obj_img.src = obj_img.src.replace(re,'on');
 obj_img.style.zIndex = "2";
}

function rollout(obj_img){
 var re = new RegExp('on');
 obj_img.src = obj_img.src.replace(re,'off');
 obj_img.style.zIndex = "1";
}

function storyView(a){
	for(var i=1;i<6;i++){
		if(a==i){
			document.getElementById("storyMap"+i).style.display = "block";
			var re = new RegExp('on');
 			document.getElementById("sMap"+i).src = document.getElementById("sMap"+i).src.replace(re,'click');
		}else{
			document.getElementById("storyMap"+i).style.display = "none";
			var re = new RegExp('click');
 			document.getElementById("sMap"+i).src = document.getElementById("sMap"+i).src.replace(re,'off');
		}
	}
}

/*showroom tab*/
/*
function naviOver(objValue,num){
	var tableId = document.getElementById("showMenuT");
	var tableP = document.getElementById("showMenuT").getElementsByTagName("p");
	objValue.className = "Meon";
	for(var i=0;i<tableP.length;i++){
		if(num==i){
			if(num!=0){
				document.getElementById("bgn"+i).style.background = "none";
			}
			if(num!=6){
				document.getElementById("bgn"+parseInt(i+1)).style.background = "none";
			}
		}
	}
}
function naviOut(objValue,num){
	var tableId = document.getElementById("showMenuT");
	var tableP = document.getElementById("showMenuT").getElementsByTagName("p");
	objValue.className = "";
	for(var i=0;i<tableP.length;i++){
		if(num==i){
			document.getElementById("bgn"+i).style.background = "url('http://images.wwn.hyundai.com/images/Web/SR/show_bar.gif') no-repeat";
			if(num==0){
				document.getElementById("bgn"+i).style.background = "none";
			}
			if(num!=6){
				document.getElementById("bgn"+parseInt(i+1)).style.background = "url('http://images.wwn.hyundai.com/images/Web/SR/show_bar.gif') no-repeat";
			}
		}
	}
}
*/
function naviOver(objValue){
	objValue.className = "Meon";
}
function naviOut(objValue){
	objValue.className = "";
}

function naviOver2(objValue){
	objValue.className = "exSON";
}
function naviOut2(objValue){
	objValue.className = "";
}

function naviOver3(objValue){
	objValue.className = "buiMON";
}
function naviOut3(objValue){
	objValue.className = "";
}

function naviOver4(objValue){
	objValue.className = "buiMONBold";
}
function naviOut4(objValue){
	objValue.className = "";
}

function carChange(imgObj){
	var srcObj = document.getElementById("bigImg");
	var bigObj = imgObj.src
	var re = new RegExp('Small');
	srcObj.src = imgObj.src.replace(re,'Big');
}

function userPrint(){
	window.print();
}

function openGNBLayer(){
	document.getElementById("Stop_nav").style.height = "180px";
}

function closeGNBLayer(){
	document.getElementById("Stop_nav").style.height = "50px";

}


/***********************************************************************/
/*ÅÇÀÌµ¿	- Áßµ¿ Dealer Info 2010.08.04		   											*/ 
/************************************************************************/
function moveTab(objName)
{
	try
	{
		return document.getElementById(objName);
	}
	catch(e)
	{
		
	}
}
/************************************************************************/
/*@ ÅÇÀÌµ¿			- Áßµ¿ Dealer Info 2010.08.04								   			       */
/************************************************************************/
function goTab(objIndex)
{
  var n = 4;
  for(var i = 1; i <= n; i++)
  {
      moveTab('tab' + i).style.display = 'none';
  }
  moveTab('tab' + objIndex).style.display = 'inline';
}
