////////////////////////////////////////////////////////////////////////////////메인페이지 제목 대괄호빼기
function restring(st){
newstr = st.split("]");
return document.write(newstr[1]);
}
////////////////////////////////////////////////////////////////////////////////상단메뉴컨트롤
function topMenuList(menu,tot,num){
for(i=1;i<=tot;i++){
if(i==num)document.getElementById(menu+i).style.display="block";
else
document.getElementById(menu+i).style.display="none";
}
}
////////////////////////////////////////////////////////////////////////////////메인롤링
var topcnt = 1;
var maintimer;
function topnext(){
topcnt++;
if(topcnt > 3)
topcnt=1;
topview(topcnt);
}

function topgo(num){
topview(num);
clearInterval(maintimer);
}

function topstart(temp){
maintimer = setInterval(topnext, temp);
}

function topstop(){
clearInterval(maintimer);
}

function topview(num){
for(i=1;i<=3;i++){
var mtop = document.getElementById("mtop_list"+i);
var mlink = document.getElementById("mainimpo"+i);
var mrelay = document.getElementById("relation"+i);
var mcircle = document.getElementById("m_num"+i);
if(i==num){
mtop.style.display="block";
mrelay.style.display="block";
mcircle.src="/images/newimages/circle_orange.gif";
}
else{
mtop.style.display="none";
mrelay.style.display="none";
mcircle.src="/images/newimages/circle_grey.gif";
}
}
topcnt=num;
}
////////////////////////////////////////////////////////////////////////////////오늘의이슈
var tno = 1;

function tdynext(){
tno++;
if(tno > 4)
tno=1;
todayissue(tno);
}

function tdyprev(){
tno--;
if(tno < 1)
tno=4;
todayissue(tno);
}
function todayissue(tno){

  for(i=1;i<=4;i++){
    var tisu = document.getElementById("tisu" + i);
    if(tno==i){
    tisu.style.display="block";
    }
    else{
      tisu.style.display="none";
      }
    }
}


////////////////////////////////////////////////////////////////////////////////포토존

function phototop(num){
var pI = document.getElementById("ptimg");
var pIA = document.getElementById("ptimg_a");
var pT = document.getElementById("pttit");
var tI = document.getElementById("thumb" + num);
var pA = document.getElementById("thumb_a" + num);
var tIi = tI.src.replace("thumb", "imgfiles");
pI.src = tIi;

pT.innerHTML = tI.title;
pT.title = tI.title;
pT.href = pA.href;
pIA.href = pA.href;
tI.style.width="74px";
tI.style.height="74px";
for(i=1;i<=4;i++){
var pA2 = document.getElementById("thumb_a" + i);
var tI2 = document.getElementById("thumb" + num);
if(num==i){
pA2.style.borderWidth="4px";
pA2.style.borderStyle="solid";
pA2.style.borderColor="#ff9728";
pA2.style.width="66px";
pA2.style.height="66px";
tI2.style.margin="-4px";
}
else{
pA2.style.borderWidth="0";
pA2.style.width="74px";
pA2.style.height="74px";
tI2.style.margin="0";
tI2.style.width="78px";
tI2.style.height="78px";
}
}
}

////////////////////////////////////////////////////////////////////////////////리뷰
var rvo  = 1;

function rvnext(){
rvo+=2;
if(rvo > 8)
rvo=1;
rvcontrol(rvo);
}

function rvprev(){
rvo-=2;
if(rvo < 1)
rvo=7;
rvcontrol(rvo);
}
function rvcontrol(rvo){

  for(i=1;i<=8;i++){
    var riv = document.getElementById("rv" + i);
    if(rvo==i || rvo+1==i){
    riv.style.display="block";
    }
    else{
      riv.style.display="none";
      }
    }
}



/////////////////////////뉴스포토

function npPhoto(num){
for(i=1;i<=4;i++){
document.getElementById("NV_tit").innerHTML = document.getElementById("NP_"+num).title;
if(num==i)
document.getElementById("NP_"+i).className="NP_on";
else
document.getElementById("NP_"+i).className="NP_off";
}
}
/////////////////////////////

var nrvo  = 1;

function nrvnext(){
nrvo+=2;
if(nrvo > 6)
nrvo=1;
nrvcontrol(nrvo);
}

function nrvprev(){
nrvo-=2;
if(nrvo < 1)
nrvo=5;
nrvcontrol(nrvo);
}
function nrvcontrol(nrvo){

  for(i=1;i<=6;i++){
    var nriv = document.getElementById("NRV" + i);
    if(nrvo==i || nrvo+1==i){
    nriv.style.display="block";
    }
    else{
      nriv.style.display="none";
      }
    }
}



