
////////////////////////////////////////////////////////////////////////////////
// Corp : inno1
// publisher : Choi Sun-ki
// date : 2011-03-13
////////////////////////////////////////////////////////////////////////////////

  function flashWrite(url,w,h,id,bg,vars,win){ 
  var flashStr= 
  "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle' scale='noScale'>"+ 
  "<param name='allowScriptAccess' value='always' />"+ 
  "<param name='movie' value='"+url+"' />"+ 
  "<param name='FlashVars' value='"+vars+"' />"+ 
  "<param name='wmode' value='"+win+"' />"+ 
  "<param name='menu' value='false' />"+ 
  "<param name='quality' value='high' />"+ 
  "<param name='bgcolor' value='"+bg+"' />"+
  "<param name='scale' value='noScale' />" +
  "<param name='scaleMode' value='noScale' />" +
  "<param name='align' value='TL' />" +
  "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' scale='noScale' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+ 
  "</object>"; 
  document.write(flashStr); 
  }

//  $(document).ready(function(){
    // path
  //	$('path').find('li:last').addClass('true');
//  });

  function viewFlash(source,id,width,height,wmode, otherParam) {
  document.write( "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=allowScriptAccess value=sameDomain><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"https://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+" showmenu=false></embed></object>");
}

// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
  function flashWrite(url,w,h,id,bg,vars,win){

   // 플래시 코드 정의
   var flashStr=
   "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
   "<param name='allowScriptAccess' value='always' />"+
   "<param name='movie' value='"+url+"' />"+
   "<param name='FlashVars' value='"+vars+"' />"+
   "<param name='wmode' value='"+win+"' />"+
   "<param name='menu' value='false' />"+
   "<param name='quality' value='high' />"+
   "<param name='bgcolor' value='"+bg+"' />"+
   "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
   "</object>";

   // 플래시 코드 출력
   document.write(flashStr);

  }
  //동영상
  function aviPlay(src,w,h) {
  document.write('<embed src="'+src+'" width='+w+' height='+h+'>')
  }

  function startEvent() {
    var url = "http://vitaevent.lhsoft.co.kr";
    if ( screen.availWidth < 1024) {
      window.open(url, 'EventMain', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrollbars=no, width=1000, height=700,top=10,left=10');
    } else {

      window.open(url, 'EventMain', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrollbars=no, width=1280, height=870,top=10,left=10');
    }
  }

  //테마여행 팝업
  function themePop(){
    window.open('/enjoy/thema_list.asp','themaPop','menubar=no,scrollbars=1,width=740,height=700,status=1');
  }

  function emailPop(){
    // 8.이메일무단수집거부팝업호출
    window.open('/membership/email.asp','mainEmail','menubar=no,scrollbars=1,width=740,height=700,status=1');
  }
  function usePop(){
    // 9.이용약관팝업업호출
    window.open('/membership/terms.asp','mainTerms','menubar=no,scrollbars=1,width=740,height=700,status=1');
  }
  function perInfoPop(){
    // 10.개인정보취급방침호출
    window.open('/membership/privacy.asp','mainPrivacy','menubar=no,scrollbars=1,width=740,height=700,status=1');
  }

  function memberModifyPop(){
    // 11.회원정보수정
    window.open('/membership/modify.asp','mainModify','menubar=no,scrollbars=1,width=740,height=700,status=1');
  }

  function underStruct(n) {
	if(n==0) alert('3월 31일에 만나요~^^*');
  }


// 관리자 회원정보 보기 팝업 띄우기
  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 ;
  }

//$(document).ready(function(){
//	// 110317 Attach CSK
//	// 뉴스임시 숨김
//	$('.fnews').hide();
//});

  //SNS
  function snsModule(type, dTitle, dMsg, dTags, dImageurl, param, hash){

    var url = con_home_http + param;
    var title = dTitle;
    var msg = dMsg;
    var hash = encodeURIComponent(hash);
    var tags = dTags;
    var imageurl = dImageurl;

    url = encodeURIComponent(url);
    title = encodeURIComponent(title);
    msg = encodeURIComponent(msg);
    tags = encodeURIComponent(tags);

    var twitter = 'http://twitter.com/share?text='+msg+'+'+hash+'&amp;url='+url;
    var facebook = 'http://www.facebook.com/sharer.php?u='+url+'&t='+title;
    var buzz = 'http://www.google.com/buzz/post?url='+url+'&message='+title+"&imageurl="+imageurl;
    var me2day = 'http://me2day.net/posts/new?new_post[body]='+msg+'+"'+title+'":'+url+';new_post[tags]='+tags;

    if(type == "twitter"){
      window.open(twitter, "_blank", "toolbar=0,status=0,width=600,height=400;");
    }else if(type == "facebook"){
      window.open(facebook, "_blank", "toolbar=0,status=0,width=626,height=436;");
    }else if(type == "buzz"){
      window.open(buzz, "_blank", "toolbar=0,status=0,width=690,height=445;");
    }else if(type == "me2day"){
      window.open(me2day, "_blank","");
    }
  }

  $(document).ready(function(){
	var style = '<style type="text/css" media="all">\n';
	var length = 900;
	for (i=1;i<=length ;i++) {style += '.x'+i+'{width:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.y'+i+'{height:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.ml'+i+'{margin-left:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.mr'+i+'{margin-right:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.mt'+i+'{margin-top:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.mb'+i+'{margin-bottom:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.pl'+i+'{padding-left:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.pr'+i+'{padding-right:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.pt'+i+'{padding-top:'+i+'px !important;}\n';}
	for (i=1;i<=length ;i++) {style += '.pb'+i+'{padding-bottom:'+i+'px !important;}\n';}
	style += '</style>'
	$('.tcr').click(function(){
		$('.tview').text(style)
	})
	$('body').append(style);
});

$(document).ready(function(){
	$('body')
	.find('input[type=text]').addClass('itx')
	.end().find('input[type=password]').addClass('pwd')
	.end().find('input[type=radio]').addClass('rdo')
	.end().find('input[type=checkbox]').addClass('chk')
	.end().find('select').addClass('stx');
});

var responseHttpObj;
//아작스 프로토타입. 110316. 김규민.
  Ajax = function() {
  }
  Ajax.Request = function(xurl,parameter) {
        this.xurl = xurl;
        this.parameter = parameter;

        var xmlParam = "";
        this.method = this.parameter.method;
        if (this.method=="post"){
          xmlParam = this.parameter.parameters;
        }
        else {
//          alert(this.parameter.length);
          object = this.parameter.parameters;
          var values = [];
          for (var property in object){
              xmlParam += "&" + property +"="+ object[property];
          }
          xmlParam = xmlParam.substr(1);
        }

        this.onSuccess = this.parameter.onSuccess;
        this.onFailure = this.parameter.onFailure;
        Ajax.onSuccess = this.onSuccess;

        var url = this.xurl+"?"+xmlParam;
        createXHR(); //createXHR()메소드 호출
        responseHttpObj.onreadystatechange = Ajax.ajaxResult; //응답결과를 처리메소드인 resultProcess()메소드 설정
        responseHttpObj.open(this.method, url, "true");//서버의 요청설정 - requestGet.xml페이지를 요청할 준비
        responseHttpObj.send(null);//서버로 요청을 보냄

  };
  Ajax.ajaxResult = function(onSuccess,onFailure){
    if(responseHttpObj.readyState == 4){ //요청객체의 상태가 모든 데이터를 받을 수 있는 상태로 완료된 경우
//      alert('resultProcess:4, status:'+responseHttpObj.status);
	    if(responseHttpObj.status == 200){ //서버로부터 응답받는 HTTP상태가 정상인 경우 수행
//        alert('resultProcess:200');
        Ajax.onSuccess();
		  }
      else{
        Ajax.onFailure();
      }
      
	  }
  }


  function downFile1(file, idx)
  {
	location.href = "/library/common/down_file.asp?Fid=03&file="+file+"&GID=LAPA&IDX="+idx;
  }

  function downFile01(file, idx)
  {
	location.href = "/library/common/down_file.asp?Fid=02&file="+file+"&GID=LATV15&IDX="+idx;
  }
  
  function downFile02(file, idx)
  {
	location.href = "/library/common/down_file.asp?Fid=02&file="+file+"&GID=LATV20&IDX="+idx;
  }
  
  function downFile03(file, idx)
  {
	location.href = "/library/common/down_file.asp?Fid=02&file="+file+"&GID=LATV30&IDX="+idx;
  }

function bluring(){ 
		// 요청사항 링크 테두리 제거
        if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
        document.body.focus(); 
} 
document.onfocusin=bluring;

$(document).ready(function(){
	// ie8 footer 하단 여백 제거
	$('iframe[name="execFrm"]').css({
		'position':'absolute',
		'left':'-3721em'
	})
});

$(document).ready(function(){
	var $family = $('.fgoto');
	$family.css({
		'position':'relative'
	})

	// 기본적으로 사이트 링크는 비노출
	// $family.find('dd').hide();

	// DD의 사이즈 정의
	// DD의 높이는 A의 높이 * 갯수
	var itemLength = $family.find('dl > dd > ul > li').length;
	var itemHeight = $family.find('dl > dd').height();
	$family.find('dl > dd > ul li a').each(function(){
		var ay = $(this).height();
		// $(this).parent().parent().height((ay+3)*itemLength)
	});

	// DD의 위치
	$family.find('dl > dd').css({
		// top:-56
	})

	// DT의 A를 클릭시 사이트 링크 노출
	$family.find('dl > dt > a').toggle(function(){
		// DT의 A를 클릭시 사이트 링크 노출
		// $family.find('dd').show();
		$family.find('dd')
			.show()
			.animate({
			opacity:0,
			top:+itemHeight/2
		},100,function(){
			$family.find('dd').animate({
				opacity:1,
				top:-itemHeight
			},1200)
		})
	},function(){
		// DT의 A를 다시 클릭시 사이트 링크 비노출
		//$family.find('dd').hide();
		$family.find('dd').animate({
			opacity:0,
			top:+itemHeight
		},1200,function(){
			$(this).hide();
		})
	});
});
