/* popup */ 
function winOpen(file,wid,hei,name){ 
	var win = null;
	var LeftPosition=(screen.width) ? (screen.width-wid)/2 : 0;
	var TopPosition=(screen.height) ? (screen.height-hei)/2 : 0;				
	win = window.open(file, name, 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizable=no, scrolling=no, width='+wid+', height='+hei+',top='+ TopPosition +',left='+ LeftPosition);	 
	win.focus();
 }
/* popup */ 
function winOpen1(file,wid,hei,name){ 
	window.open(file, name, 'status=yes, toolbar=yes, location=yes, menubar=yes, directories=no, resizable=yes, scrollbars=yes, width='+wid+', height='+hei+',top=10,left=10');	 
 }
function winOpen2(file,wid,hei,name,top,left){
	window.open(file, name, 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizable=no, scrolling=no, width='+wid+', height='+hei+',top='+top+',left='+left);	
}
/* record add*/
function addTr(str) {
  var ele=document.getElementById(str);
  var tot=1;
  var tr = ele.getElementsByTagName("tr");
  for(var i=1; i<tr.length;i++){
    if (tr[i].className == "isView" ){ tot++; }
  }
  if(tot<"11"){
    tr[tot].className ="isView";
  }else{
    alert("10개까지만 등록가능합니다");
  }
}

function eventTr(ele){ 
	var trbg = document.getElementById(ele);
	var bg = trbg.getElementsByTagName("tr");
	for(var i=0; i<bg.length;i++){
		bg[i].onmouseover = function (){
			 this.className="on";	 
		}
		
		bg[i].onmouseout = function (){
			 this.className="";	 
		}
	}
}

/* 우편번호 팝업 */
function winPost(mode){
  var url = "/popup/post.asp?mode="+mode;
  var wid = "345";
  var hei = "290";
  window.open(url, 'winPost','status=no,toolbar=no,location=no,menubar=no,directories=no, resizeable=no, scrollbars=no, width='+wid+', height='+hei+',top=200,left=400');
}

function readyAlert() {
  alert('준비중입니다');
}

/*맨 위로가가기*/
function topMove(){
	 document.documentElement.scrollTop = 0 +"px";
}


function quickMenu(str) {
	 this.top = 322;														// default top 위치;
	 this.left = 923;														// default left 위치;
	 this.ele = document.getElementById(str);		//액션 element

	 this.footlimit = 700;											//하단에서 300까지 limit.
	 this.timer = null;

	 this.yHeight = parseInt(document.documentElement.scrollHeight); //문서높이
	 this.ele.limit = this.yHeight- this.footlimit; //
	 // element  position, left, top value setup
	 this.ele.style.position	=	"absolute";
	 this.ele.style.top = this.top+"px";
	 this.ele.style.left =	this.left+"px";
	 this.moveY = this.top;

	}
	quickMenu.prototype.pos = function(){this.ele.style.top=this.moveY+"px";}
	//quickMenu.prototype.pos = function(){this.ele.style.top=this.end+"px";}
	quickMenu.prototype.move = function(){

		this.end = document.documentElement.scrollTop+this.top; /*스크룰바+위치값*/
		this.moveY +=   Math.floor((this.end - this.moveY ) / 10 );

		if(this.moveY>this.ele.limit){this.moveY = this.ele.limit; }
		this.pos();// 위치값 입력
		this.timer = setTimeout(this.name+".move()",10);
	}

	quickMenu.prototype.start = function(){
		this.start = parseInt (this.ele.style.top);
		this.timer = setTimeout(this.name+".move()",10);
	}

	// 파일 업로드 팝업, 2005/07/04 
	function openUploadPopup(menuCd,headIdx){
		var WIP = window.open("/common/fileupload/popup_fileupload.asp?menuCd="+ menuCd +"&heaIdx="+ headIdx,"IWin","menubar=no,scrollbars=no,width=350,height=250,status=1");	
		WIP.focus();
	}
	
	// 파일 업로드 팝업, 2005/07/04 
	function openBbsPreview(obj,gb){
		var WIP = window.open("/editor/preview.asp?obj="+obj+"&gb="+gb,"IWin","menubar=no,scrollbars=1,width=714,height=600,status=1");
		WIP.focus();
	}

	// 삭제확인, 2005/07/04 
	function ConfirmDel(url){
		if(confirm("정말로 삭제하시겠습니까?")){
			window.location.href=url;
			return;
		}
	}

	function winPrint(){
		if(confirm("인쇄시에는 왼쪽여백 : 4.5, 오른쪽여백 : 4.5로 설정해 주세요.")){
			print();	
		}
	}

  // gnb 영역사이즈 변경
  function gnbChange(mode) {
    if(mode == "over") {
      document.getElementById("header").className = "gnb_over";
    } else if(mode == "out") {
      document.getElementById("header").className = "gnb_out";
    }
  }


function callExternalInterface() {
    thisMovie("bottomFooter").closeSlide();
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

function popLetter(){
	window.open("/newsletter/vol_35/lh_letter35_web.html", "popLetter", "scrollbars=yes, status=no, resizable=yes, width=950, height=700, left=0, top=0");
}

function popNewsLetter(vurl){
	window.open(vurl, "popLetter", "scrollbars=yes, status=no, resizable=yes, width=950, height=700, left=0, top=0");
}

function mRefresh(val){
	var selval = document.getElementById(val).value
	location.href = selval;
}
