function searchCode(idx, oid, st, mode) {
  var mTitle;

  if( st ) {
    var gn = document.getElementById(st).value;
    if(mode == 1) {
      mTitle = "학교구분";
      if(!gn) {
        alert(mTitle + '을 선택해주세요')
        return;
      }
    }

    if (gn == "4371")      idx = "4374";
    else if (gn == "4372") idx = "4055";
    else if (gn == "4373") idx = "4375";
    else if (gn == "9901") idx = "4375";
    else if (gn == "9902") idx = "4375";
    else if (gn == "9903") idx = "4375";
  }
 
  var url = "/recruit/job_search.asp?idx="+idx+"&oid="+oid;
  var popNm = "jobSearch"+idx;
  window.open(url,popNm,"width=455,height=420,scrollbars=no");
}

function compareYear(sdate, edate) {
  var st = true;
//  sdate = parseInt(sdate);
//  edate = parseInt(edate);
  if( sdate > edate ) st = false;
  return st;
}

function JobformReset() {
  if(confirm('현재의 페이지의 입력 폼을 초기화 합니다\n\n저장되지 않은 데이터는 삭제가 됩니다\n\n취소 하기겠습니까?')) {
    document.PageForm.reset();
  }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function NewWindow(mypage, myname, w, h, scroll)
{
	var win = null;
	
	LeftPosition=(screen.width) ? (screen.width-w)/2 : 0;
	TopPosition=(screen.height) ? (screen.height-h)/2 : 0;				
	settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',resizable=no, scrollbars=' + scroll;
	win=window.open(mypage,myname,settings);
	return win;
}

function NewWindow_Ord(mypage, myname, w, h, scroll)
{
	var win = null;
	
	LeftPosition=(screen.width) ? (screen.width-w)/2 : 0;
	TopPosition=(screen.height) ? (screen.height-h)/2 : 0;				
	settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',resizable=no, scrollbars=' + scroll;

	window.open(mypage,myname,settings);
}

//경고창 띄우기 s=>메세지, t=>제목, 
function clubErrMessage(s,t){
	window.showModalDialog("/park/club/error.jsp?title="+t+"&msg="+s,"","dialogHeight:256px;dialogWidth:288px;edge:raised;center:yes;help:no;resizable:no;status:no;scroll:no;unadorned:no");
}

//이미지 사이즈 변환
function resize_image(e, max_width){
	var max_width, max_width;
	var width = e.width;
	if(e.width > max_width) 
	{
		e.width = max_width;
		e.hegith = (e.height * max_width) / width;
	}	
}


// 메인 팝업창 
function mainOpenPop(theURL, winName, features){
	var replacePopup = true;
	var PopupWin = window.open(theURL, winName, features, replacePopup);
	PopupWin.focus();
}

// 이미지 보기 팝업, 2004.06.25
function viewImgPop(path,file){
	var popname = 'ImgView';
	var url =  '/common/pop_img_view.asp?fPath='+ path +'&fName='+ file;
	var imgFile = path +'/'+file;
	var scrollYN='1';
	var popstate = '';
		popstate += 'width=100,';
		popstate += 'height=100,';
		popstate += 'left=100,';
		popstate += 'top=100,';
		popstate += 'fullscreen=no,';
		popstate += 'channelmode=no,';
		popstate += 'toolbar=no,';
		popstate += 'location=no,';
		popstate += 'directories=no,';
		popstate += 'status=no,';
		popstate += 'menubar=no,';
		popstate += 'scrollbars='+ scrollYN +', ';
		popstate += 'resizable=no,';
		popstate += 'titlebar=no,';
		popstate += 'hotkeys=no';
	var PopupWin = window.open(url,popname,popstate);
	PopupWin.focus();
	return;
}

// Modeless형식의 메시지를 보여줌, 2004.06.25
function errModeless(msg){
	if(msg=='') msg='오류가 발생하였습니다';
//	window.showModelessDialog("/library/popup/notice.php",msg,"dialogWidth:296px; dialogHeight:220px; center=yes; screenTop=yes; scroll=no; status=no; help=no;");
}
// window open 형식의 메시지를 보여줌, 2006.06.25
function openErrPop(msg){
	if(msg=='') msg='오류가 발생하였습니다';
	window.open('/common/message_pop.asp?msg='+ msg ,'err_page','width=290,height=195,left=100,top=100');
}

function winPrint(){
	if(confirm("인쇄시에는 왼쪽여백 : 4.5, 오른쪽여백 : 4.5로 설정해 주세요.")){
		print();	
	}
}


// 투명png파일 스크립트 

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 ''; 
} 

/* 팝업창띄우기 */
function winOpen(file,wid,hei){

	if(file==""){ alert('페이지 준비중'); return false;}

	window.open(file, 'add', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrollbars=yes, width='+wid+', height='+hei+',top=200,left=400');
}


//document.oncontextmenu = function (e) {
//  alert("상품이미지 무단도용방지를 위하여\n\n마우스 오른쪽 버튼을 사용하실 수 없습니다!");
//  return false;
//}
//document.onselectstart = function (e) {
//  return false;
//}


// 폼값과 에디트의 값을 초기화
function formReset(formName) {
  if(confirm('게시글을 새로 작성하시겠습니까?')) {
    eval("document."+formName).reset();
    myeditor.resetEditArea('');
  }
}

function formWriteCancel(form) {
  if(confirm('글작성을 취소 하시겠습니까?')) {
    history.back();    
  }
}

function inputBgClear() {
  
}

function flashLiveFlv(file,img,h,w) {

var flashFlv =
//"<object id='id_player' height='248' width='348' type='application/x-shockwave-flash' classid='clsid 27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'>"+
"<object id='id_player' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' type='application/x-shockwave-flash' height='"+h+"' width='"+w+"'>"+
"<PARAM value='always' name='allowScriptAccess' />"+
"<PARAM value='/swf/flvPlayer.swf' name='movie' />"+
"<PARAM value='transparent' name='wmode' />"+
"<PARAM value='masterloader' name='name' />"+
"<PARAM value='/swf/flvPlayer.swf' name='src' />"+
"<PARAM value='https://www.macromedia.com/go/getflashplayer' name='pluginspage' />"+
"<PARAM value='high' name='quality' />"+
"<PARAM value='false' name='loop' />"+
"<PARAM value='false' name='menu' />"+
"<PARAM value='#000' name='bgcolor' />"+
"<PARAM value='true' name='allowFullScreen' />"+
"<PARAM value='true' name='swLiveConnect' />"+
"<PARAM value='flvurl="+file+"&imageurl="+ img +"' name='FlashVars' />"+
"<embed src='/swf/flvPlayer.swf' FlashVars='flvurl="+file+"&imageurl="+ img +"' wmode='transparent' menu='false' quality='high' bgcolor='#000' width='"+w+"' height='"+h+"' name='id_player' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />"+
"</object>";
document.write(flashFlv);
}

function wmaPlayer(file) {
  document.write('<object ID="Player"  CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width=1 height=1>');
  document.write('<param name="autoStart" value="False">');
  document.write('<param name="URL" value="'+file+'">');
  document.write('<param name="ShowTracker" value="True">');
  document.write('<param name="uiMode" value="none">');
  document.write('<param name="ShowPositionControls" value="0">');
  document.write('<param name="ShowDisplay" value="True">');
  document.write('<param name="DisplaySize" value="0">');
  document.write('</object>');
}


//// 따라다니는 레이어 
//function positionMessage(){   
//	//dvSidebar menu id
//	var elem=document.getElementById("top");   
//	// 초기 top 위치 
//	elem.style.top=document.documentElement.scrollTop + 540 + "px"; 				
//	setTimeout("moveElement()", 10); 
//} 
//
//function moveElement(){ 
//	var elem = document.getElementById("top"); 
//	start = parseInt (elem.style.top);  
//	end = document.documentElement.scrollTop + 540; // limit 정하기
//	 
//	//start 와 end 같으면 멈춘다.
//	if ( start != end ) {
//		scale =   Math.ceil( Math.abs( end - start ) / 10 );		
//		
//		//스크롤이 상단으로 이동이시 마이너스값...
//		if ( end < start )	{
//			scale = -scale; // alert("end = "+end+" start = "+start);
//		}
//			elem.style.top = parseInt (elem.style.top)+ scale + "px"; 
//	}	
//	setTimeout("moveElement()", 10);
//}
//
//function topMove(){	 
//	 document.documentElement.scrollTop = 0 +"px";
//}
//
//function addLoadEvent(func){	
//  var oldonload = window.onload;
//  if( navigator.userAgent.toLowerCase().indexOf('safari') == "-1") {
//    if (typeof window.onload != 'function') {	 
//      window.onload = func;
//    } else {
//      window.onload = function() {
//        oldonload();
//        func();
//      }
//    }
//  } else {
//    //new Floating(적용할개체 , X축여백 , Y축여백 , 미끄러지는속도:작을수록빠름..기본20 , 빠르기:작을수록부드러움..기본10); 
//    new Floating(document.getElementById("top"),925,120,20,10); 
//  } 
//}
/* 따라다니는 레이어 */

 function positionMessage(){   
	//dvSidebar menu id
	var elem=document.getElementById("quick");
	// 초기 top 위치 

	elem.style.top=document.documentElement.scrollTop + 220 + "px"; 				
	setTimeout("moveElement()", 10); 
} 

function moveElement(){ 
	var elem = document.getElementById("quick"); 
	start = parseInt (elem.style.top);  
	end = document.documentElement.scrollTop + 220; // limit 정하기
	 
	//start 와 end 같으면 멈춘다.
	if ( start != end ) {
		scale =   Math.ceil( Math.abs( end - start ) / 10 );		
		
		//스크롤이 상단으로 이동이시 마이너스값...
		if ( end < start )	{
			scale = -scale;  //alert("end = "+end+" start = "+start);
		}
			elem.style.top = parseInt (elem.style.top)+ scale + "px"; 
//			alert(elem.style.top);
	}	
	setTimeout("moveElement()", 10);
}

function topMove(){	 
	 document.documentElement.scrollTop = 0 +"px";
}
 
function addLoadEvent(func){	
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {	 
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
 
}
