var theme_id=1;
var select_menu="";
var vbid="";



function bbsv(sa,idx){
if(sa){
if(vbid){vbid.style.backgroundColor='';}
sa.style.backgroundColor='#FFF7C4';
vbid=sa;}

class_set('bbs_view->bbs_view2','wgs','idx='+idx);
class_do();
}




//--------------------------- 비디오 보기 --------------------------
function viv(vid){
mvwizJS_closePOPUP('video_play',1);
class_set('video_play->video_play','wgs','vid='+vid);
class_do();
}


//--------------------------- 사진 보기 --------------------------
function imgv(kwzf){
mvwizJS_closePOPUP('kwzf_viewer',1);
class_set('kwzf_viewer->kwzf_viewer','wgs','kwzf='+kwzf);
class_do();
}

//--------------------------- 사진첩에서 사진 보기 보기 --------------------------
function iv2(idx){
mvwizJS_closePOPUP('kwzf_viewer',1);
class_set('photos3->kwzf_viewer','wgs','idx='+idx);
class_do();
}


/*
//------------------------------ 테마 바꾸기 -----------------------------------
function theme_change(){
var this_theme = getCookie("main_theme");
if((!this_theme)||(this_theme>=4)){this_theme = 0;}
this_theme++;
var curCookie = 'main_theme' + "=" + this_theme+";expires=99999999999999";
document.cookie = curCookie;
document.getElementById('top_theme').src=('img/theme'+this_theme+'.jpg');
}


//--------------------------- 쿠키 가져오기 ----------------------------------
function getCookie(uName) { 
var strCookie = " " + window.document.cookie; 
var ptrFr = strCookie.indexOf(" " + uName + '='); 
if (ptrFr != -1) { 
ptrFr = ptrFr + uName.length + 2; 
ptrTo = strCookie.indexOf(';', ptrFr); 
if (ptrTo == -1) { 
ptrTo = strCookie.length; 
} 
return unescape(strCookie.substring(ptrFr, ptrTo)); 
}else { 
return ""; 
} 
}



//----------------------------- 테마 돌리기--------------------------------------
function theme_loop(){if(!document.getElementById('top_theme')){return false;}
theme_id++;if(theme_id>3){theme_id = 1;}
document.getElementById('top_theme').src=('img/theme'+theme_id+'.jpg');
return false;}setInterval(theme_loop,60000);
*/


//--------------------------- 가사 보기 --------------------------
function lyric(lyric){
mvwizJS_closePOPUP('lyric',1);
class_set('lyric->lyric','wgs','lyric='+lyric);
class_do();
}



//--------------------------- 동영상 보기 --------------------------
function mv(lyric){
mvwizJS_closePOPUP('mv',1);
class_set('lyric->mv','wgs','mv=1&lyric='+lyric);
class_do();
}


//--------------------------- 플래쉬 임베드 --------------------------
function make_flash(src,width,height,span_id){
if(document.getElementById(span_id)){
var new_flash = document.createElement("embed");
new_flash.setAttribute("src",src);
new_flash.setAttribute("width",width);
new_flash.setAttribute("height",height);
new_flash.setAttribute("id","flash_player");
new_flash.setAttribute("wmode","transparent");
new_flash.setAttribute("allowFullScreen","true");
document.getElementById(span_id).appendChild(new_flash);
}
}



//----------------------------- 창 관리 하기 ---------------------------------
document.onkeydown = function(ev){
ev = ev || window.event;
if(ev.ctrlKey){
if(ev.keyCode==49){mvwizJS_window_arrange();return false;}
if(ev.keyCode==50){mvwizJS_window_arrange('next');return false;}
if(ev.keyCode==51){mvwizJS_window_arrange('prev');return false;}
if(ev.keyCode==52){mvwizJS_window_arrange('focus');return false;}
if(ev.keyCode==53){mvwizJS_window_arrange('clear');return false;}
}
if(ev.keyCode==27){mvwizJS_closePOPUPtop();return false;}
}