/*ActiveX 플래쉬*/
// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (window/transparent/opaque)
function Flash(id,url,w,h,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='sameDomain' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

// 팝업창 
	function newwin(url) { 
POP = window.open( url, "WIN_SUB", "status=0,scrollbars=no,resizable=0,left=200,top=100,width=800,height=600" ); 
POP.focus(); 
} 

//결제방식
function setKind(obj){
	if(obj.value == "account"){
		document.getElementById("bank_account").style.display = "block";
		document.getElementById("card_cost").style.display = "none";
	}else if(obj.value == "card"){
		document.getElementById("bank_account").style.display = "none";
		document.getElementById("card_cost").style.display = "block";
	}
}


//드래그 & 우클릭 막기
//FF
//var omitformtags=["input", "textarea", "select"]

//omitformtags=omitformtags.join("|")

//function disableselect(e){

//     if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)

//          return false

//}

//function reEnable(){
//     return true
//}

//if (typeof document.onselectstart!="undefined")
//     document.onselectstart=new Function ("return false")
//else{
//     document.onmousedown=disableselect
//     document.onmouseup=reEnable
//}

//IE
//document.oncontextmenu = function() {return false;};
//document.onselectstart = function() {return false;};
//document.ondragstart = function() {return false;};

function check_focus()
 {
 var strnum = document.pageForm.userNo1.value.length;
 if (strnum == 6)
  document.pageForm.userNo2.focus();
 }

function downloadFile(){
	uForm = document.downloadForm;
	uForm.submit();
}
function downloadFile(filePath,fileName){

	//UTF 테이터 전송
	document.charset = 'euc-kr';
	//window.open('downloadFile.action?filePath='+filePath+'&fileName='+fileName,'_self');
	window.open('common/download.jsp?filePath='+filePath+'&fileName='+fileName,'_self');
	document.charset = 'utf-8';
}
function downloadFile(filePath,fileName,fileNameSeq){
	//UTF 테이터 전송
	//document.charset = 'euc-kr';
	//window.open('downloadFile.action?filePath='+filePath+'&fileName='+fileName+'&fileNameSeq='+fileNameSeq,'_self');
	window.open('common/download.jsp?filePath='+filePath+'&fileName='+fileName+'&fileNameSeq='+fileNameSeq,'_self');
	//document.charset = 'utf-8';
}
function isNumber() { 
	//alert(event.keyCode);
	
	if(event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 45) return;
	if(event.keyCode >= 96 && event.keyCode <= 105) return;
	
	if((event.keyCode< 48) || (event.keyCode > 57)) {
		alert("숫자를 입력하셔야 합니다.")
		event.returnValue = false;
	}
}

//이미지 가로 사이즈 제한
function imgSizeConv(){ 
    Limit = 600; //가로 제한 사이즈
    var IMG = document.getElementsByTagName('IMG');
    for(i=0,cnt=IMG.length;i<cnt;i++){
        if(IMG[i].width > Limit) {
            IMG[i].width = Limit; 
        }    
    }   
    //window.onload=imgSizeConv();
}
//제목글자수 제한
function checkTitleLength(thisForm) { 
	 var str = thisForm.value.length; 
	 var con = thisForm.value; 
	 
	 if (str >= 255) { 
	  alert('최대 255글자 까지만 작성 할 수 있습니다.'); 
	  thisForm.value=con.substring(0,255); 
	  thisForm.focus(); 
	  } 
} 

function getFileSize(path)
{
   //var img = new Image();
   //img.dynsrc = path;
   //return img.fileSize;
	return 1;
}


/*입력폼 하이라이트 효과
function overInput(f) {
    f.className = "Highlight";
}

function outInput(f) {
    f.className = "inputTypeText";
}

function overlogInput(f) {
    f.className = "logHighlight";
}

function outlogInput(f) {
    f.className = "loginputTypeText";
}

function overTextarea(f) {
    f.className = "Highlight";
}

function outTextarea(f) {
    f.className = "inputTextarea";
}*/

