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='http://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='/common/flash/player.swf' name='movie' />"+
"<PARAM value='transparent' name='wmode' />"+
"<PARAM value='masterloader' name='name' />"+
"<PARAM value='/common/flash/player.swf' name='src' />"+
"<PARAM value='http://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='/common/flash/player.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='http://www.macromedia.com/go/getflashplayer' />"+
"</object>";
document.write(flashFlv);
}

// 각종 flv 동영상 보기
function flashFlVWrite(filePath, imgUrl, widthValue, heightValue) {
	flashTagValue = "" +
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+ widthValue + "' height='" + heightValue + "' id='mv' align='middle'>" +
	"<param name='allowScriptAccess' value='sameDomain' />" +
	"<param name='allowFullScreen' value='true' />" +
	"<param name='movie' value='/common/flash/CF_vodPlayer.swf' />" +
	"<param name='quality' value='high' />" +
	"<param name='FlashVars' value='filePath=" + filePath + "&imgUrl=" + imgUrl + "&width=" + widthValue + "&height=" + heightValue + "' />" +
	"<param name='wmode' value='transparent' />" +
	"<embed src='/common/flash/CF_vodPlayer.swf' FlashVars='filePath=" + filePath + "&imgUrl=" + imgUrl + "&width=" + widthValue + "&height=" + heightValue + "' quality='high' width='" + widthValue + "' height='" + heightValue + "' id='mv' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
	"</object>";

	document.write(flashTagValue);
}

function flashFlVWrite2(filePath, imgUrl, widthValue, heightValue) {
	flashTagValue = "" +
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+ widthValue + "' height='" + heightValue + "' id='mv' align='middle'>" +
	"<param name='allowScriptAccess' value='sameDomain' />" +
	"<param name='allowFullScreen' value='true' />" +
	"<param name='movie' value='/common/flash/LoveVirus_vodPlayer.swf' />" +
	"<param name='quality' value='high' />" +
	"<param name='FlashVars' value='filePath=" + filePath + "&imgUrl=" + imgUrl + "&width=" + widthValue + "&height=" + heightValue + "' />" +
	"<param name='wmode' value='transparent' />" +
	"<embed src='/common/flash/LoveVirus_vodPlayer.swf' FlashVars='filePath=" + filePath + "&imgUrl=" + imgUrl + "&width=" + widthValue + "&height=" + heightValue + "' quality='high' width='" + widthValue + "' height='" + heightValue + "' id='mv' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
	"</object>";

	document.write(flashTagValue);
}

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();
    }
  }
 }

 // 회원정보 보기 팝업 띄우기
function memView(seq,Flag){
//	window.open('/pop/zip_search.asp','','width=418, height=300, scrollbars=yes');
	var intWidth = 800;
	var intHeight = 470;
	if (Flag == 'Y'){
		var urlPopup = '/webadmin/member/memView.asp?MIDX='+ seq ;
	}else if (Flag == 'N'){
		var urlPopup = '/webadmin/member/memOutView.asp?MIDX='+ seq ;
	}

	var namePopup = 'memInfoView';
	var featuresPopup = '';
		featuresPopup += 'width='+intWidth+',';
		featuresPopup += 'height='+intHeight+',';
		featuresPopup += 'left='+((window.document.body.clientWidth-intWidth)/2)+',';
		featuresPopup += 'top='+((window.document.body.clientHeight-intHeight)/2)+',';
		featuresPopup += 'fullscreen=no,';
		featuresPopup += 'channelmode=no,';
		featuresPopup += 'toolbar=no,';
		featuresPopup += 'location=no,';
		featuresPopup += 'directories=no,';
		featuresPopup += 'status=1,';
		featuresPopup += 'menubar=no,';
		featuresPopup += 'scrollbars=yes,';
		featuresPopup += 'resizable=no,';
		featuresPopup += 'titlebar=no,';
		featuresPopup += 'hotkeys=no';
	var replacePopup = true;

	var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
	PopupWin.focus();
	window.status = window.defaultStatus;
	return ;
}

// 회원정보 보기 팝업 띄우기
function memView2(id,Flag){
//	window.open('/pop/zip_search.asp','','width=418, height=300, scrollbars=yes');
	var intWidth = 800;
	var intHeight = 470;
	var urlPopup = '/webadmin/member/memView2.asp?id='+ id ;

	var namePopup = 'memInfoView';
	var featuresPopup = '';
		featuresPopup += 'width='+intWidth+',';
		featuresPopup += 'height='+intHeight+',';
		featuresPopup += 'left='+((window.document.body.clientWidth-intWidth)/2)+',';
		featuresPopup += 'top='+((window.document.body.clientHeight-intHeight)/2)+',';
		featuresPopup += 'fullscreen=no,';
		featuresPopup += 'channelmode=no,';
		featuresPopup += 'toolbar=no,';
		featuresPopup += 'location=no,';
		featuresPopup += 'directories=no,';
		featuresPopup += 'status=1,';
		featuresPopup += 'menubar=no,';
		featuresPopup += 'scrollbars=yes,';
		featuresPopup += 'resizable=no,';
		featuresPopup += 'titlebar=no,';
		featuresPopup += 'hotkeys=no';
	var replacePopup = true;

	var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
	PopupWin.focus();
	window.status = window.defaultStatus;
	return ;
}

function alertEnjoy() {
  alert('응모기간이 마감되었습니다.');
}

var ImgNum = new Array();
var ImgTag = new Array();

// 에디터 첨부이미지 삭제
var iRow = 1;
function create_request_del(params, iNum) {

  var content = myeditor.outputBodyHTML();

	if(confirm("삭제 하시겠습니까? \n수정완료를 하셔야 정상적인 수정 및 파일 삭제가 됩니다.")){
// ----------------------------------------------------------------------------------
		// 섬네일 리스트 삭제
		document.getElementById("img_"+iNum).style.display = 'none';
		// 본문 내용 삭제 이미지 제거후 재입력
		var eContent = content;
			str = params; //없앨 파일명
			Reg = eval('/<[^<]*'+str+'[^>]*>/gi');

				ImgNum[iRow] = iNum;
				ImgTag[iRow] = str;     // 파일명 배열에 담기

			eContent = eContent.replace(Reg, '');
			myeditor.putContents(eContent);

			iRow = iRow + 1;

	}
}

function valueChk()
{
	var sWord = document.getElementById("sWord");

	if(sWord.value == "검색어를 입력하세요")
	{
		sWord.value = "";
	}
}

//레이어 로드뷰
//XLayerLoad('로드할파일이름','전달할 파라미터','로드후 실행할 함수명',{lname:"다중레이어명",ltype:"view/''")}
  function XLayerLoad(lurl,lparam,lfunc,lmode){
    $.ajax({
      async: false,
      type: "POST",
      url: lurl,
      data: lparam,
      contentType: "application/json; charset=utf-8",
      dataType: "html",
      success: function(data) {
        var bgClickClose;
        if(lmode!=undefined&&lmode!=""){
          this.lmode = lmode;
          lname = this.lmode.lname;
          ltype = this.lmode.ltype;
          bgClickClose = this.lmode.bgClickClose;
        }
        if(lmode==undefined||lmode==""){ // 단일 레이어 모드
          if($("#LayerHtml").length == 0){$(document.body).append("<div id='LayerHtml' style='position:absolute;display:block;left:0px;top:0px;'></div>");}else{$("#LayerHtml").css({"width":"","height":"","background":""});}
          $("#LayerHtml").html(data);
          $("#LayerHtml").lhDialog({ opacity: 0.3, zIndex: 10000, closeButtonId: "XLayer_Close" ,bgClickClose: bgClickClose});
        }
        else { //다중레이어 뷰 모드
          if(ltype=="view"){
            $("#LayerHtml"+lname).lhDialog({ opacity: 0.3, zIndex: 10000, closeButtonId: "XLayer_Close"+lname });
          }
          else if(ltype=="order"&&bgClickClose!=undefined){ //결제 레이어
            if($("#LayerHtml").length == 0){$(document.body).append("<div id='LayerHtml' style='position:absolute;display:block;background:url(/order/images/ordwrap.png) no-repeat;left:0px;top:0px;'></div>");$("#LayerHtml").css({"width":"970px","height":"610px"});}else{$("#LayerHtml").css({"width":"970px","height":"610px","background":"url(/order/images/ordwrap.png) no-repeat;"});}
            $("#LayerHtml").html(data);
            $("#LayerHtml").lhDialog({ opacity: 0.3, zIndex: 10000, closeButtonId: "XLayer_Close" ,bgClickClose: bgClickClose});
            window.setTimeout("goOrderPage()", 3000);

          }
          else{ //다중레이어 모드
            if($("#LayerHtml"+lname).length == 0){$(document.body).append("<div id='LayerHtml"+lname+"' style='position:absolute;display:block;left:0px;top:0px;'></div>");}else{$("#LayerHtml").css({"width":"","height":"","background":""});}
            $("#LayerHtml"+lname).html(data);
            $("#LayerHtml"+lname).lhDialog({ opacity: 0.3, zIndex: 10000, closeButtonId: "XLayer_Close"+lname });
          }
          
        }
        
        //alert(data);
        if(lfunc!=undefined&&lfunc!=""){lfunc();} //함수 실행
      },
      error: function(request, error) {
          alert('오류가 발생 했습니다.');
          //alert(request.statusText);
          //alert(request.responseText);
      }
    });
  }

  // 온라인 주문 아이플레임 높이 복원
  function goOrderPage()
  {
    //document.getElementById('order_loading').style.display = 'none';
    document.getElementById('iframeLogin').height = '610px';
  }

  // 자식창 부모창 아이플레임 높이 제어
  function setOrderFrameHeightControl()
  {
    document.getElementById('iframeLogin').height = '0px';
    window.setTimeout("goOrderPage()", 3000);
  }

// 온라인 주문하기
  function go_order_site(ourl) {
    $.ajax({
      async: "false",
      type: "POST",
      url: CON_URL_ORDER+"/order/login/auth_connect_prc.asp",
      contentType:"application/x-www-form-urlencoded",
      data: {},
      dataType: "jsonp",
      success: function(data) {
        if (data.result != "SUCCESS") {
          alert(data.result);
        }
//        var order_frame = $("<iframe src='"+CON_URL_HOME+"/auth/order_login.asp' width='970' height='610' frameborder='0' scrolling='no' allowTransparency='true' style='position:absolute;'></iframe>");
//        $(".pop_order").empty().dialog({ top: 200, width: 970, height: 610, position: 'center', closeText: '', modal: true }).append($(order_frame));
          XLayerLoad('/auth/order_layer.asp?ourl='+ourl,'','',{bgClickClose: false,ltype:"order"});
      },
      error: function(request, error) {
        //alert(request.statusText);
        //alert(request.responseText);
      }
    }); // ajax
  }

var canvas = document[ 'CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];


//마우스 X좌표 취득
function getMouseX(e) {
  if(document.all) return canvas.scrollLeft+event.clientX;
  else if(document.getElementById) return e.pageX;
}

//마우스 Y좌표 취득
function getMouseY(e) {
  if(document.all) return canvas.scrollTop+event.clientY;
  else if(document.getElementById) return e.pageY;
}

//포커스 텍스트 기본값 설정
  function focusText(obj, word){
    if($("#"+obj).val()==""){$("#"+obj).val(word);}
    $("#"+obj).focusin(function(){
      if($(this).val()== word){$(this).val("");}
    });
    $("#"+obj).focusout(function(){
      if($(this).val()==""){$(this).val(word);}
    });
  }


/*
  2010.02.17   by 심재훈
  textarea 글제수 제한   
   byteCheck(cont, vByte, textLen)
  byteCheck(textarea ID, 길이 표현 ID, 글자수)  
*/
function byteCheck(cont, vByte, textLen){
  var maxByte = textLen;
  var obj = document.getElementById(cont);
  var len = getByteLength(obj);
  document.getElementById(vByte).innerHTML = len+" / 200";

  if ( len > maxByte) {
   alert(maxByte +" Byte 까지 가능합니다.");
   cutText(obj, obj.value, cont, vByte, textLen);
 }
 }

function getByteLength(input) {
 var byteLength = 0;
 for (var inx = 0; inx < input.value.length; inx++) {
   var oneChar = escape(input.value.charAt(inx));
   if ( oneChar.length == 1 ) {
     byteLength ++;
   } else if (oneChar.indexOf("%u") != -1) {
     byteLength += 2;
   } else if (oneChar.indexOf("%") != -1) {
     byteLength += oneChar.length/3;
   }
 }
 return byteLength;
} 

function cutText(obj, txt, cont, vByte, textLen){
  var tmpStr;
  var temp=0;
  var onechar;
  var tcount;
  var thisText
  var lastByte

  tcount = 0;
  tmpStr = new String(txt);
  temp = tmpStr.length;

  for(k=0;k<temp;k++){
   onechar = tmpStr.charAt(k);
   if(escape(onechar).length > 4)
    tcount += 2;
   else if(onechar!='\r')
    tcount +=1;
   if(tcount > textLen){
    tmpStr = tmpStr.substring(0,k);

    thisText = tmpStr.substring(0, k);
    obj.value = thisText;
  var len = getByteLength(document.getElementById(cont));
  document.getElementById(vByte).innerHTML = len +" / 200";
    break;
   }
  }
 }

function ScrollBottom(){
    ScrollBottom = CrossBrowserScrollHeight()-(CrossBrowserScrollTop()+CrossBrowerClientHeight()); //모조리 스크립트
	return ScrollBottom;
//    alert(CrossBrowserScrollHeight()-($(window).scrollTop()+CrossBrowerClientHeight())); //제이쿼리 짬뽕
}

var userAgent = navigator.userAgent.toLowerCase();
  var browser = {
    msie    : /msie/.test( userAgent ) && !/opera/.test( userAgent ),
    safari  : /webkit/.test( userAgent ),
    firefox : /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
    opera   : /opera/.test( userAgent )
  };

  function CrossBrowserScrollHeight(){
    var totalHeight = 0;
    if( browser.msie ){ //IE
      var scrollHeight = document.documentElement.scrollHeight;
      var browserHeight = document.documentElement.clientHeight;
      totalHeight = scrollHeight < browserHeight ? browserHeight : scrollHeight;
    }
    else if ( browser.safari ){ //Chrome || Safari
      totalHeight = document.body.scrollHeight;
    }
    else if ( browser.firefox ){ // Firefox || NS
    var bodyHeight = document.documentElement.scrollHeight;
    totalHeight = window.innerHeight < bodyHeight ? bodyHeight : window.innerHeight;
    }
    else if ( browser.opera ){ // Opera
    var bodyHeight = document.body.clientHeight;
    totalHeight = window.innerHeight < bodyHeight ? bodyHeight : window.innerHeight;
    }
    else {
    alert("지원하지 않는 브라우져!!");
    }
    return totalHeight;
  }

  function CrossBrowserScrollTop(){
    if( browser.msie ){ //IE
      var scrollTop = document.documentElement.scrollTop;
    }
    else if ( browser.safari ){ //Chrome || Safari
      var scrollTop = document.body.scrollTop;
    }
    else if ( browser.firefox ){ // Firefox || NS
      //var scrollTop = document.body.scrollTop;
      var scrollTop = document.documentElement.scrollTop;
    }
    else if ( browser.opera ){ // Opera
      var scrollTop = document.documentElement.scrollTop;
    }
    else {
    alert("지원하지 않는 브라우져!!");
    }
    return scrollTop;
  }

  function CrossBrowerClientHeight(){
    return (typeof window.innerHeight != "undefined")? window.innerHeight : (document.documentElement)? document.documentElement.clientHeight : document.body.clientHeight;
  }

  function XExcelLoad(src){
    if($("#ExcelIfm").length == 0){$(document.body).append("<iframe id='ExcelIfm' style='position:absolute;display:none;width:500px;height:500px;'></iframe>");}else{}
    $("#ExcelIfm").attr("src",src);
  }


