function flashWrite(url,w,h,vars,bg,win){
	
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; 
	if(vars==null) vars='';
	if(bg==null) bg='#FFFFFF';
	if(win==null) win='transparent';



	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0'";
		flashStr+="			width='"+w+"'";
		flashStr+="			height='"+h+"'";
		flashStr+="			id='"+id+"'";
		flashStr+="			align='middle'>";

		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";
	
	
		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";


	document.write(flashStr);
}


/* png24 */
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 ''; 
}


/*클릭시 점선 없애는 onfocus=blur() 자동으로 넣기 */
function autoblur() {
  if(event.srcElement.tagName == "A") document.body.focus();
}
document.onfocusin = autoblur;


/* 팝업 */
function popUp(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/* 레이어 SHOW/HIDE **********************************************************************/
function showdiv(targetEl, uniqid) {
	if(document.getElementById(targetEl)) document.getElementById(targetEl).style.display="block";
}
function hidediv(targetEl) {
	if(document.getElementById(targetEl)) document.getElementById(targetEl).style.display="none";
}

//image rollover
	function overImg( obj ) {
		obj.src = obj.src.replace( 'off.gif', 'on.gif' );
	}

	function outImg( obj ) {
	    obj.src = obj.src.replace( 'on.gif', 'off.gif' );
	}
// class name change
function changeClass(tagName,before,after) { 
    var elms = document.getElementsByTagName(tagName); 
    var cnt = 0; 
    for (var i=0; i<elms.length; i++) { 
        if (elms[i].className == before) { 
            elms[i].className = after; 
            cnt++; 
        } 
    } 
    //alert(cnt); 
} 

var old_menu = '';
function menuclick(getMenu) {
	var submenu = document.getElementById(getMenu);
	if( old_menu != submenu ) {
	if( old_menu !='' ) {
		old_menu.style.display = 'none';
		}
		
		
		submenu.style.top = event.y + document.body.scrollTop; ;	 
		submenu.style.left = event.x ;
		
		submenu.style.display = 'block';
		old_menu = submenu;
	}
	else{
		submenu.style.display = 'none';
		old_menu = '';
	}
}

/* 고객센터_tab */

/* div_view */
function Tabgo(no){
	for (i=0; i<idtab.length; i++){
		if (i==no) {
			document.all.idtab[i].style.display="block";
		}else{
			document.all.idtab[i].style.display="none";
		}
	}
}



var Radio = function(name)
{
	this.img_on = "http://image.yoitt.com/helpdesk/common/radio_on.gif";
	this.img_off = "http://image.yoitt.com/helpdesk/common/radio_off.gif";
	this.radio = {};
	this.checked_id = "";
	var self=this;

	var ra = null,img=null;
	var cid = "";
	for(var i=0; i<document.getElementsByName(name).length; i++)
	{
		ra = document.getElementsByName(name)[i];
		cid =ra.id;
		img=ra.parentNode.insertBefore(document.createElement('img'), ra);

		img.src = this.img_off;
		if(ra.checked)
		{
			img.src = this.img_on;
			this.checked_id = cid;
		}
		
		img.cid = cid;
		img.onclick = function() {
			self.select(this.cid);
			if(self.radio[this.cid].ra.onclick) self.radio[this.cid].ra.onclick();
		};
		ra.style.display="none";
		this.radio[cid] = {ra:ra, img:img};
	}
};
Radio.prototype={
	select : function(cid) {
		this.radio[cid].img.src = this.img_on;
		this.radio[cid].ra.checked=true;
		if(this.checked_id && this.checked_id!=cid) this.radio[this.checked_id].img.src = this.img_off;
		this.checked_id=cid;
	},
	showValue : function() {
		return this.radio[this.checked_id].ra.value;
	}
};



/* 레이어 */
function MSGView(obj) {
   
	var obj;
	
	var div = eval("document.all.div_" + obj);
	
    if(div.style.display == ''){ div.style.display = "none"; }
    else{
		
		div.style.top = event.y - 235;	 
		div.style.left = event.x - 450 ;
        div.style.display = "";
        }
}
 

/* 신고하기 tab */
function mt_tab ( name ) {
  div1 = document.getElementById('mtc01');
  div2 = document.getElementById('mtc02');
  div3 = document.getElementById('mtc03');
  if ( name == 'mtc01' ) {
    div1.style.display = 'block';
    div2.style.display = 'none';
    div3.style.display = 'none';
  } else if ( name == 'mtc02' ) {
    div1.style.display = 'none';
    div2.style.display = 'block';
    div3.style.display = 'none';
  } else {
    div1.style.display = 'none';
    div2.style.display = 'none';
    div3.style.display = 'block';
  }
}



var fileCount=0;
    function AddFile()
    {
		alert('a');
        var txtFile = eval(document.all['ctl00$ContentPlaceHolder1$txtFile'+fileCount]);
        if(FileValidate(txtFile))
        {
            AddInList(txtFile);
            var newInputFile = document.createElement("<input name='ctl00$ContentPlaceHolder1$txtFile"+Number(++fileCount)+"'>");
            newInputFile.type = "file";
            newInputFile.className="input_text";
            newInputFile.style.width="412px";
            newInputFile.style.height="20px";
            txtFile.insertAdjacentElement("afterEnd", newInputFile);
            txtFile.style.display = 'none';
        }
    }

    function AddInList(txtFile)
    {
        var select = eval(document.all['selectList']);
        select.options[select.options.length] = new Option(txtFile.value, txtFile.name, false, true);    
    }

    function RemoveFile()
    {    
        var select = eval(document.all['selectList']);
        if(select.selectedIndex <0)
        {
            alert('삭제할 파일을 선택 하세요.');
        }
        else
        {
            var id = select.options[select.selectedIndex].value;
            eval(document.all[id]).removeNode();
            select.options[select.selectedIndex] = null;
        }
    }

    function FileValidate(txtFile)
    {
        if(txtFile.value == '')
        {     
            alert('파일을 선택 하지 않았습니다\n파일 선택후 추가해 주세요.');   
            return false;
        }
        var imgSize = 1024 * 1024 * 10;
        var img = new Image();
        img.dynsrc = txtFile.value;
        if(img.fileSize < 0)
        {
            alert('알 수 없는 파일 사이즈 입니다.');
            return false;
        }
        else if(img.fileSize > imgSize)
        {
            alert(imgSize+'바이트 이상의 파일은 업로드 할 수 없습니다.');
            return false;
        }
        return true;
    }

    function DeleteFile(ctl, fileId)
    {
        var deleteFileList = eval(document.all['<%=txtDeleteFileList.ClientID %>']);
        if(ctl.checked)
        {
            deleteFileList.value += fileId+'&';
        }
        else
        {
            deleteFileList.value = deleteFileList.value.replace('&'+fileId+'&','&');        
        }
    }
