//드롭다운 소스
/*function MM_NewwinMenu(targ,selObj,restore){ //v3.0
  open(selObj.options[selObj.selectedIndex].value);
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}*/

//드롭다운 소스
function MM_NewwinMenu(targ,selObj,restore){ //v3.0
  //open(selObj.options[selObj.selectedIndex].value);
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//롤오버 소스
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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}



//탑으로 가기 스크롤 소스
        var stmnLEFT = 0; 
        var stmnGAP1 = 0; 
        var stmnGAP2 = 0; 
        var stmnBASE = 0; 
        var stmnActivateSpeed = 0;
        var stmnScrollSpeed = 30; 


        function RefreshSTATICMENU2()
        {
                var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

                stmnStartPoint = parseInt(STATICMENU2.style.top, 10);
                stmnEndPoint = document.body.scrollTop + stmnGAP2;
                if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

                if ( stmnStartPoint != stmnEndPoint ) {
                        stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
                        STATICMENU2.style.top = parseInt(STATICMENU2.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
                        stmnRefreshTimer = stmnScrollSpeed;
                }
                                         else {
                        stmnRefreshTimer = stmnActivateSpeed;
                }

                setTimeout ('RefreshSTATICMENU2();', stmnRefreshTimer);
        }



        function InitializeSTATICMENU2()
        {
                STATICMENU2.style.top = document.body.scrollTop + stmnBASE;
                RefreshSTATICMENU2();
                STATICMENU2.style.left = stmnLEFT;
        }



//커뮤니티 FAQ 답변 나오기
function showhide(num, p_totcount, id){ 	  	
	
	for (m=0; m<=p_totcount; m++){ 
		menu = eval("document.all.block"+m+".style"); 
		
		if (num == m ){
			if (menu.display == "block"){
				menu.display = "none"; 
			} 
			else{
				menu.display = "block"; 
                readNum(id);
			}
		}
		else{ 
				menu.display = "none"; 
		} 
	} 
} 

function readNum(id){
    var f = document.readFrm;
    f.idx.value = id;
    f.submit();
}


//테두리 점선 없애기
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;
 
 
//openBrWindow 소스
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features).focus();
}


// 이올라스? 버그 관련 플래시 삽입 소스 
function flashinto(URL, w, h, t ) {
	
 document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+w+"' height='"+h+"'> ");
 document.write("    <param name='movie' value='"+URL+"'>  ");
 document.write("    <param name='quality' value='high'> ");
 if (t==1) { document.write(" <param name='wmode' value='transparent'> ");}
 document.write("    <embed src='"+URL+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'></embed> ");
 document.write("  </object> ");            
 
}


function FileChk(id, mp){
	var iMyWidth;
	var iMyHeight;

	iMyWidth  = (window.screen.width/2) - (208 + 10);  
	iMyHeight = (window.screen.height/2) - (143+ 50);

	document.file_chk.idx.value			= id;
    document.file_chk.mp.value          = mp;

	var mp3Win = window.open("","file_pop","status,width=418,height=286,directories=no,status=no,resizable=no,menubar=no,scrollbars=0,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + " ");
	mp3Win.focus();

	document.file_chk.target			= "file_pop";
	document.file_chk.action			= "ms_pop.asp";
	document.file_chk.submit();
}

//내용보기
function go_view(obj0,obj1,obj2){
	//alert(obj2+"?"+"idx="+obj0+"&gbn="+obj1)
	location.href=obj2+"?"+"idx="+obj0+"&gbn="+obj1
}

//삭제하기 (질문과 답변)
function del_chk_zion(idx ,page) {
    
    url = "../include/del_chk_zion.asp?idx="+idx+"&page="+page ;
	window.open(url, 'chk','width=300,height=100,scrollbars=0,resizable=0');
	
}

//페이지 이동
function chk_page(chk_page_name, chk_idx) {
    document.file_chk.target            = ""
	document.file_chk.idx.value			= chk_idx;
	document.file_chk.action			= chk_page_name+".asp"; 
	document.file_chk.submit();
}



//삭제하기 (질문과 답변)
function del_chk_qna(data ,idx ,page ,dir ) {
    
    url = "../include/del_chk_qna.asp?data="+data+"&idx="+idx+"&page="+page+"&dir="+dir ; 
	window.open(url, 'chk','width=300,height=100,scrollbars=0,resizable=0');
	
}


//삭제하기 (질문과 답변)
function del_chk_info(write_id ,gubun ,boardlist ,idx ,page ,dir ) {
    
    url = "../include/del_chk_info.asp?write_id="+write_id+"&gubun="+gubun+"&boardlist="+boardlist+"&idx="+idx+"&page="+page+"&dir="+dir ; 
	window.open(url, 'chk','width=300,height=100,scrollbars=0,resizable=0');
	
}


function login() {
    
			if(confirm('로그인이 필요합니다. 로그인하시겠습니까?')) {

var iMyWidth;
var iMyHeight;
iMyWidth = (window.screen.width/2) - (170 + 10);  

iMyHeight = (window.screen.height/2) - (165 + 50);
var win2 = window.open("/sign/signin.asp","login","status,width=450,height=400,resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no");
win2.focus(); 

			}
}
