var currentBoard = 1;
function newsTabChange(key, e, lang) 
{
//	if ( isAccess(e) ) {
		if (key == 1) 
		{ //업계동향
			if(lang == "en")
				document.getElementById("news_title").style.background = "url(engSet/Images/main_v1.gif) 0 -216px  no-repeat";
			else				
				document.getElementById("news_title").style.background = "url(Images/main_v1.gif) 0 -216px  no-repeat";
			document.getElementById("movement").style.display = "block";
			document.getElementById("notice").style.display = "none";
			if(currentBoard == 1)
				window.open("brand/BrandMain.jsp?pageId=2", "_self");
			currentBoard = 1;
			return;
		} 
		else if(key==2) 
		{ //공지사항
			if(lang == "en")
				document.getElementById("news_title").style.background = "url(engSet/Images/main_v1.gif) 0 -261px  no-repeat";
			else
				document.getElementById("news_title").style.background = "url(Images/main_v1.gif) 0 -261px  no-repeat";
			document.getElementById("movement").style.display = "none";
			document.getElementById("notice").style.display = "block";
			if(currentBoard == 2)
				window.open("kaida/kaida.jsp?pageId=7", "_self");
			else
				currentBoard = 2;
			return;
		}
//	}
};

/* 이달의신차Start */
// 이미지 슬라이드 경로부분
var imagepath = "Images/";
NewImg = new Array (
"car_1.gif",
"car_2.gif",
"car_1.gif",
"car_2.gif"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
var lock = false;
var run;

function chgImg(direction) {
	if (document.images) {
		ImgNum = ImgNum + direction;

		if (ImgNum > ImgLength) {
			ImgNum = 0;
		}
		if (ImgNum < 0) {
			ImgNum = ImgLength;
		}
		document.getElementById("slideshow").filters.blendTrans.apply();
		document.getElementById("slideshow").src = imagepath+NewImg[ImgNum];
		document.getElementById("slideshow").filters.blendTrans.duration=0.5;
		document.getElementById("slideshow").filters.blendTrans.play();
	}
}

function auto() {
	run = setInterval("chgImg(1)", 3000);
}

function prevImage() {
	if (document.images) {
		ImgNum = ImgNum - 1;

		if (ImgNum > ImgLength) {
			ImgNum = 0;
		}
		if (ImgNum < 0) {
			ImgNum = ImgLength;
		}
		clearInterval(run);
		document.getElementById("slideshow").src = imagepath+NewImg[ImgNum];
	}
};

function nextImage() {
	if (document.images) {
		ImgNum = ImgNum + 1;

		if (ImgNum > ImgLength) {
			ImgNum = 0;
		}
		if (ImgNum < 0) {
			ImgNum = ImgLength;
		}
		clearInterval(run);
		document.getElementById("slideshow").src = imagepath+NewImg[ImgNum];
	}
};
//auto();
/* 이달의신차End */

/* 연간자료Start */
old_debate="1"; 
function ShowPopup(objid) { 
	document.getElementById("pds"+old_debate).className="pds"+old_debate; 
	document.getElementById("pds"+objid).className="pds"+objid+"On"; 
	document.getElementById("pds_area"+old_debate).style.display="none"; 
	document.getElementById("pds_area"+objid).filters.blendTrans.apply();
	document.getElementById("pds_area"+objid).style.display="block"; 
	document.getElementById("pds_area"+objid).filters.blendTrans.duration=0.5;
	document.getElementById("pds_area"+objid).filters.blendTrans.play();
	old_debate=objid; 
}; 
var objid = 1; 
var interval_best; 

function transparent() { 
	if( objid == 3 ) 
		objid = 1; 
	else 
		objid++; 
		ShowPopup(objid); 
};
function roll_start() { 
	interval_best = setInterval("transparent()",3000);//속도조절 
}; 
function roll_stop() { 
	clearInterval(interval_best); 
};
roll_start(); 
/* 연간자료End */

/* 회원사 사이트Start */
var sliderwidth="324px";  //스크롤 가로 사이즈
var sliderheight="34px";  //스크롤 세로 사이즈
var slidespeed="1";

var leftrightslide=new Array();
var finalslide='';


    leftrightslide='<a href="#"><img src="Images/common/bn_1.gif" height="28" alt="Audi" /></a> <a href="#"><img src="Images/common/bn_2.gif" height="28" alt="BMW" /></a> <a href="#"><img src="Images/common/bn_3.gif" height="28" alt="Cadillac" /></a> <a href="#"><img src="Images/common/bn_4.gif" height="28" alt="CHRYSLER" /></a> <a href="#"><img src="Images/common/bn_5.gif" height="29" alt="DODGE" /></a> <a href="#"><img src="Images/common/bn_6.gif" height="28" alt="Ford" /></a> <a href="#"><img src="Images/common/bn_7.gif" height="28" alt="HONDA" /></a> <a href="#"><img src="Images/common/bn_8.gif" height="28" alt="INFINITI" /></a> <a href="#"><img src="Images/common/bn_9.gif" height="28" alt="JAGUAR" /></a> <a href="#"><img src="Images/common/bn_10.gif" height="28" alt="Jeep" /></a> <a href="#"><img src="Images/common/bn_11.gif" height="28" alt="LAND-ROVER" /></a> <a href="#"><img src="Images/common/bn_12.gif" height="28" alt="LEXUS" /></a> <a href="#"><img src="Images/common/bn_13.gif" height="28" alt="LINCOLN" /></a> <a href="#"><img src="Images/common/bn_14.gif" height="28" alt="MAYBACH" /></a> <a href="#"><img src="Images/common/bn_15.gif" height="28" alt="Mercedes-Benz" /></a> <a href="#"><img src="Images/common/bn_16.gif" height="28" alt="MINI" /></a> <a href="#"><img src="Images/common/bn_17.gif" height="34" alt="MITSUBISHI MOTORS" /></a> <a href="#"><img src="Images/common/bn_18.gif" height="28" alt="NISSAN" /></a> <a href="#"><img src="Images/common/bn_19.gif" height="28" alt="PEUGEOT" /></a> <a href="#"><img src="Images/common/bn_20.gif" height="28" alt="PORSCHE" /></a> <a href="#"><img src="Images/common/bn_21.gif" height="28" alt="SAAB" /></a> <a href="#"><img src="Images/common/bn_22.gif" height="28" alt="Volkswagen" /></a> <a href="#"><img src="Images/common/bn_23.gif" height="28" alt="VOLVO" /></a>';

var imagegap=" ";
var slideshowgap=0;

var copyspeed=slidespeed
    //leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
	leftrightslide='<nobr>'+leftrightslide+'</nobr>'
var iedom=document.all||document.getElementById
    if (iedom)
        document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px;">'+leftrightslide+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>')

var actualwidth=''
var cross_slide, ns_slide
var righttime,lefttime

function fillup() {
    if (iedom) {
        cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
        cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
        cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
        actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
        cross_slide2.style.left=actualwidth+slideshowgap+"px"
    } else if (document.layers) {
        ns_slide=document.ns_slidemenu.document.ns_slidemenuorange
        ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
        ns_slide.document.write(leftrightslide)
        ns_slide.document.close()
        actualwidth=ns_slide.document.width
        ns_slide2.left=actualwidth+slideshowgap
        ns_slide2.document.write(leftrightslide)
        ns_slide2.document.close()
    }
    lefttime=setInterval("slideleft()",30)
}
//window.onload=fillup

function slideleft() {
    if (iedom) {
        if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
            cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
        else
            cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
        if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
            cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
        else
            cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
    } else if (document.layers) {
        if (ns_slide.left>(actualwidth*(-1)+8))
            ns_slide.left-=copyspeed
        else
            ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
        if (ns_slide2.left>(actualwidth*(-1)+8))
            ns_slide2.left-=copyspeed
        else
            ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
    }
}

function slideright() {
    if (iedom) {
        if (parseInt(cross_slide.style.left)<(actualwidth+8))
            cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px"
        else
            cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth*(-1)+slideshowgap+"px"
        if (parseInt(cross_slide2.style.left)<(actualwidth+8))
            cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px"
        else
            cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth*(-1)+slideshowgap+"px"
    } else if (document.layers) {
        if (ns_slide.left>(actualwidth*(-1)+8))
            ns_slide.left-=copyspeed
        else
            ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
        if (ns_slide2.left>(actualwidth*(-1)+8))
            ns_slide2.left-=copyspeed
        else
            ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
    }
}


function right() {
    if(lefttime) {
        clearInterval(lefttime)
        clearInterval(righttime)
        righttime=setInterval("slideright()",30)
    }
}

function left() {
    if(righttime) {
        clearInterval(lefttime)
        clearInterval(righttime)
        lefttime=setInterval("slideleft()",30)
    }
}

function bnRolling() {
	document.write('<div class="prev" onMouseover="left();copyspeed=2" onMouseout="copyspeed=1"  onfocus="left();copyspeed=2" onblur="copyspeed=1">회원사 사이트 이전목록</div>')

	if (iedom||document.layers) {
		with (document) {
			if (iedom) {
				write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';padding-top:22px;left:36px;overflow:hidden">')
				write('<div id="company_layout" onMouseover="copyspeed=0" onMouseout="copyspeed=1" onfocus="copyspeed=0" onblur="copyspeed=1">')
				write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
				write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
				write('</div></div>')
			} else if (document.layers) {
				write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu">')
				write('<layer name="ns_slidemenuorange" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed" onfocus="copyspeed=0" onblur="copyspeed=slidespeed"></layer>')
				write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed" onfocus="copyspeed=0" onblur="copyspeed=slidespeed"></layer>')
				write('</ilayer>')
			}
		}
	}

	document.write('<div class="next" onMouseover="right();copyspeed=2" onblur="copyspeed=1" onfocus="right();copyspeed=2" onMouseout="copyspeed=1">회원사 사이트 다음목록</div>')
}
/* 회원사사이트End */

/* 서브메뉴Start */
var nscp = (navigator.appName == "Netscape") 
var ismc = (navigator.appVersion.indexOf("Mac") != -1) 
var vers = parseFloat(navigator.appVersion.substring(22,25)) 

function getObj(obj) { 
	if (nscp) { 
		compLayr = document.layers[obj] 
	} else { 
		compLayr = eval("document.all." + obj + ".style") 
	} 
	return compLayr 
} 

function showHide(name) { 
	obj = getObj(name) ;

	if (obj.visibility=="hidden") { 
		obj.visibility = "visible" ;
	} else {
		obj.visibility = "hidden" ;
	} 
} 

/* 서브메뉴End */
