﻿
function setObject(id,w,h,classid,codebase){
	var tmp = "";
	tmp += "<OBJECT id="+id+" height="+h+" width="+w+" classid="+classid+" ";
	tmp += "CodeBase="+codebase+" VIEWASTEXT></OBJECT>";
	document.write(tmp);
}

function imgCheck(obj) {
	check = true
	
	pathpoint = obj.lastIndexOf('.');
	filepoint = obj.substring(pathpoint+1,obj.length);
	filetype = filepoint.toLowerCase();

	if (filetype=='jpg' || filetype=='gif') {
		return true;
	} else {
		return false;
	}
}

function GetTextByte(text) {
   str = new String(text);
   var strLen = str.length;
   var strByte = 0;
   for (var i=0; i<strLen; i++) {
       tmp = new String(str.charCodeAt(i));
       strByte++;
       if (tmp.length > 3) {
           strByte++;
       }
   }
   return strByte;
}

function IsNull(nval) {
   for (var i = 0 ; i < nval.length ; i++){
       tst = nval.substring(i,i+1)
       if ((tst != ' ')&&(tst != '\r')&&(tst != '\n')&&(tst != '\t')&&(tst != '\b')&&(tst != '\v')&&(tst != '\f')) {
          return false;
       }
   }
   return true;
}

function chkNum(chk) {
   var comp="0123456789";
   var string = chk.value;
   var len = string.length;

   for (i=0;i<len;i++) {
      if (comp.indexOf(string.substring(i,i+1))<0) {
           alert("숫자로만 입력 가능합니다. 다시 입력해 주십시오");
           chk.value = "";
           chk.focus();
           return;
      }
   }
}

function isAllowStr(str, allowStr) {
   var i;
   var ch;

   for (i=0;i<str.length;i++) {
       ch = str.charAt(i);

       if (allowStr.indexOf(ch) < 0) {
          return false;
       }
   }

   return true;
}

function checkEmail(ctrl) {
   str = ctrl.value;

   if (isAllowStr(str, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@.-_") == false) {
       alert("유효한 Email이 아닙니다!");
       ctrl.value="";
       ctrl.focus();
       ctrl.select();
       return false;
   }

   var atCnt = 0;
   var dotCnt = 0;

   for (i = 0; i < str.length ; i++) { 
       ch = str.charAt(i);

       if (ch == "@") {
          atCnt++;
       }

       if (ch == ".") {
          dotCnt++;
       }
   }

   if (atCnt != 1 || dotCnt < 1) {
      alert("유효한 Email이 아닙니다.");
      ctrl.value="";
      ctrl.focus();
      ctrl.select();
      return false;
   }

   var atIndex = 0;
   atIndex = str.indexOf("@");

   if (atIndex <= 0) {
      alert("유효한 Email이 아닙니다.");
      ctrl.value="";
      ctrl.focus();
      ctrl.select();
      return false;
   }

   return true;
}

function GetCookie(sName) {
  var aCookie = document.cookie.split("; ");

  for (var i=0; i < aCookie.length; i++) {
    var aCrumb = aCookie[i].split("=");

    if (sName == aCrumb[0]) {
        return unescape(aCrumb[1]);
    }
  }
  return null;
}

function setCookie(name, value, expiredays) {
   var todayDate = new Date();
   todayDate.setDate( todayDate.getDate() + expiredays );
   document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function CheckID(ctrl) {
	str = ctrl.value;	

    if (isAllowStr(str, "1234567890abcdefghijklmnopqrstuvwxyz") == false) {
        alert ("허가되지 않은 문자열이 포함되어 있습니다!");
        ctrl.focus();
        ctrl.select();
        return false;
    }
   
	// 특수한 이름은 id로 사용할 수 없다
	if (!checkSpecialID(str,"admin")) {
	    return false;
	} else if (!checkSpecialID(str,"admins")) {
	    return false;	
	} else if (!checkSpecialID(str,"master")) {
	    return false;	
	} else if (!checkSpecialID(str,"root")) {
	    return false;		
	} else if (!checkSpecialID(str,"webmaster")) {
	    return false;		
	} else if (!checkSpecialID(str,"lotte")) {
	    return false;	
	} else if (!checkSpecialID(str,"lotteapt")) {
	    return false;	
	} else {
        return true;
	}
}

function checkSpecialID(a,b) {	
	if (a.toUpperCase() == b.toUpperCase()) {
		alert("ID로 " + b + "을(를) 사용하실 수 없습니다.");
		return false;
	}
	return true;
}

function CheckString(ctrl) {
	str = ctrl.value;	

    if (isAllowStr(str, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") == false) {
        ctrl.value="";
        ctrl.focus();
        ctrl.select();
        return false;
    }
   
    return true;
}

//길이 체크 스크립트
function apg_length_chk(target, want_length)
{ 
   var len = 0; 
   if (target.value == null ) return 0; 
   for(var i=0;i<target.value.length;i++){ 
      var c = escape(target.value.charAt(i)); 
      if ( c.length == 1 ) len ++; 
      else if ( c.indexOf("%u") != -1 ) len += 2; 
      else if ( c.indexOf("%") != -1 ) len += c.length/3; 
   } 
   if (len > want_length)
  {
		kwant_length = want_length / 2
		alert("영문 "+want_length+"자, 한글 "+kwant_length+"자 안에서 입력하여주세요.");
		target.value = "";
		target.focus();
		return false;
	}
	return true;
}
//리스트에서 리플깊이에
function apg_title_length(title_content, title_step, title_len)
{ 
	var len = 0; 
	var title_result = ""
	if ( title_content == null ) return 0;
	if (title_step != 0)
		title_contentgth = (title_len -3) - title_step* 2;
	else
		title_contentgth = title_len;
	for(var i=0;i<title_content.length;i++)
	{ 
		if(len < title_contentgth)
		{
			var c = escape(title_content.charAt(i));
			title_result = title_result + title_content.charAt(i)
			if ( c.length == 1 ) len ++; 
			else if ( c.indexOf("%u") != -1 ) len += 2; 
			else if ( c.indexOf("%") != -1 ) len += c.length/3;
		}
		else
		{
			title_result = title_result + "...";
			break;
		}
	} 
	return title_result
} 
//문자열에서 해당하지 않는 값이 들어있는지 체크하기
function apg_value_chk(contents, target)
{
	var i;
	var ch;   
	for (i=0;i<contents.length;i++) 
	{       
		ch = contents.charAt(i) ;       
		if (target.indexOf(ch) < 0) 
		{
			return false;
		}
	}
	return true;
}

//주민등록 번호 체크
function CheckSSN(jumin1,jumin2) {
	var today = new Date();
	var chkYear1 = today.getYear();
	var chkYear2 = 0;

	if (chkYear1 < 2000) {
		chkYear1 += 1900;
	}

	var chk = 0;
	var chk2 = 0;
	var chk3 = 0;
	var yy = jumin1.substring(0,2);
	var mm = jumin1.substring(2,4);
	var dd = jumin1.substring(4,6);
    var chkSex = jumin2.substring(0,1);	

	if ((jumin1.length != 6) || (mm<1 || mm>12 || dd<1 || dd>31 )) {
		return false;
	}

	if ((chkSex != 1 && chkSex !=2 && chkSex !=3 && chkSex !=4) || (jumin2.length != 7)) {
		return false;
	}

	chkYear2 = parseInt(yy,10);

	if (chkSex <=2) {
		chkYear2 += 1900;
    } else {
		chkYear2 += 2000;
    }
	
	//if ((chkYear1 - chkYear2) < 12) { 
	//	return false;
	//} 

	// 주민등록번호 validation check
	for (var i = 0; i <=5 ; i++) { 
		chk = chk + ((i%8+2) * parseInt(jumin1.substring(i,i+1)))
	}

	for (var i = 6; i <=11 ; i++) { 
		chk = chk + ((i%8+2) * parseInt(jumin2.substring(i-6,i-5)))
	}

	chk = 11 - (chk %11)
	chk = chk % 10

	if (chk != jumin2.substring(6,7)) {
		return false;
	}  

	return true;
} 

function nextJumin(obj){
  	if(obj.MEM_SSN_1.value.length == 6){
		obj.MEM_SSN_2.focus();
	}
}

function IsNumeric(oFrm){
	for(var i=0; i<oFrm.length;i++){
		if(oFrm.substring(i,i+1) < "0" || oFrm.substring(i,i+1) > "9"){
			return false;
		}
	 }
	return true;
}

function setMailList() {
	window.showModalDialog('/Includes/Mail_List.asp', "",  "status:no; help:no; dialogTop:10px; dialogLeft:10px; dialogWidth:606px; dialogHeight:366px;"); 
}

function post_find(seq, zip1, zip2, addr1, addr2) {
  window.open('/common/postcode.asp?seq='+seq+'&zip1='+zip1+'&zip2='+zip2+'&addr1='+addr1+'&addr2='+addr2,'postcode','resizable=no,scrollbars=yes, width=366,height=274'); 
}

function winPop(url, name ,sWidth, sHight, isScroll, isResize, isTool, isMenu) {
  window.open(url,name,'scrollbars='+isScroll+',resizable='+isResize+',toolbar='+isTool+',menubar='+isMenu+',location=no, width='+sWidth+',height='+sHight);
}

//숫자만 입력 받는 스크립트
function checkNum(obj){
	for(var i=0; i<obj.value.length;i++){
		if(obj.value.substring(i,i+1) < "0" || obj.value.substring(i,i+1) > "9"){
			alert("이 필드는 숫자만 입력 가능합니다.");
			obj.value = "";
			obj.focus();
		return false;
		}
	 }
	return true;
}

function FormatPrice(Price) {
	Price = new String(Price)
	Price = Price.replace(/,/gi,"")
	
	fl=""
	if(isNaN(Price)) 
	{ 
		alert("문자는 사용할 수 없습니다.");
		return 0;
	}
	if(Price == 0) 
	{
		return Price;
	}
	
	if (Price < 0)
	{ 
		Price = Price * (-1);
		fl = "-";
	}
	else
	{
		Price = Price * 1 //처음 입력값이 0부터 시작할때 이것을 제거한다.
	}
	Price = new String(Price);
	temp = "";
	co = 3;
	Price_len = Price.length;
	while (Price_len>0)
	{
		Price_len = Price_len - co;
		if(Price_len<0)
		{
			co = Price_len + co;
			Price_len = 0;
		}
		temp = "," + Price.substr(Price_len,co) + temp
	}

	return fl + temp.substr(1)
}



// 주민등록번호 체크 로직
    function check_ResidentNO(str_f_num,str_l_num){  
        var i3=0
        for (var i=0;i<str_f_num.length;i++){
         var ch1 = str_f_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i3=i3+1;
        }
        if ((str_f_num == '') || ( i3 != 0 )) return false;
        var i4=0;
        for (var i=0;i<str_l_num.length;i++){
            var ch1 = str_l_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i4=i4+1; 
        }
        if ((str_l_num == '') || ( i4 != 0 )) return false;
        if(str_f_num.substring(0,1) < 4) return false;
        if(str_l_num.substring(0,1) > 2) return false;
        if((str_f_num.length > 7) || (str_l_num.length > 8)) return false;
        if ((str_f_num == '72') || ( str_l_num == '18'))  return false;
                
        var f1=str_f_num.substring(0,1)
        var f2=str_f_num.substring(1,2)
        var f3=str_f_num.substring(2,3)
        var f4=str_f_num.substring(3,4)
        var f5=str_f_num.substring(4,5)
        var f6=str_f_num.substring(5,6)
        var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
        var l1=str_l_num.substring(0,1)
        var l2=str_l_num.substring(1,2)
        var l3=str_l_num.substring(2,3)
        var l4=str_l_num.substring(3,4)
        var l5=str_l_num.substring(4,5)
        var l6=str_l_num.substring(5,6)
        var l7=str_l_num.substring(6,7)
        hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
        hap=hap%11
        hap=11-hap
        hap=hap%10
        if (hap != l7) return false;
        return true; 
    }


	function hanCheck(x) {
		for(i=0;i<x.value.length;i++) {
		var a=x.value.charCodeAt(i);
			if (a > 128) {
			
			}else{
				alert('한글 이외에 입력 금지');
				x.value="";
				x.focus();
				return;
			}
		}
	}



//common.js에서 옮긴
function openPopup(popup_name,url,width,height) {
	var winPop = window.open(url, popup_name, 'scrollbars=no,resizable=no,toolbar=no,menubar=no,top=10,left=10,location=no,width='+width+',height='+height);
	winPop.focus();
}


var imgObj = new Image();

function showImgWin(imgName) {
  imgObj.src = imgName;
  setTimeout("createImgWin(imgObj)", 3000);
}
function createImgWin(imgObj) {
  if (! imgObj.complete) {
    setTimeout("createImgWin(imgObj)", 3000);
    return;
  }
  var temp_width;
  var temp_height;
//alert(imgObj.width+","+imgObj.height);
  if(imgObj.width>1000){temp_width = 1000;}else{temp_width = imgObj.width;}
  if(imgObj.height>700){temp_height = 700;}else{temp_height = imgObj.height;}

  if(imgObj.width<2){temp_width = 1;}else{temp_width = imgObj.width;}
  if(imgObj.height<2){temp_height = 1;}else{temp_height = imgObj.height;}

  imageWin = window.open("", "imageWin","scrollbars=no,toolbar=no,location=no,directories=no,width="+temp_width+",height=" +temp_height+",resizable=yes,mebar=no,left=10,top=10");
  imageWin.document.write("<html><body style='margin:0' onload='this.focus();'>");
  imageWin.document.write("<img src='" + imgObj.src + "'>");
  imageWin.document.write("</body><html>");
  imageWin.document.title = "이미지보기";
}


// 바이트 체크
function fc_chk_byte(aro_name,ari_max){

		var ls_str = aro_name.value; // 이벤트가 일어난 컨트롤의 value 값
		var li_str_len = ls_str.length; // 전체길이

		// 변수초기화
		var li_max = ari_max; // 제한할 글자수 크기
		var i = 0; // for문에 사용
		var li_byte = 0; // 한글일경우는 2 그밗에는 1을 더함
		var li_len = 0; // substring하기 위해서 사용
		var ls_one_char = ""; // 한글자씩 검사한다
		var ls_str2 = ""; // 글자수를 초과하면 제한할수 글자전까지만 보여준다.

		for(i=0; i< li_str_len; i++) {
			// 한글자추출
			ls_one_char = ls_str.charAt(i);

			// 한글이면 2를 더한다.
			if (escape(ls_one_char).length > 4)	{
				li_byte += 2;
			}
			// 그밗의 경우는 1을 더한다.
			else {
				li_byte++;
			}

			// 전체 크기가 li_max를 넘지않으면
			if(li_byte <= li_max){
				li_len = i + 1;
			}
		}

		// 전체길이를 초과하면
		if(li_byte > li_max) {
			alert( "영문 " + li_max + " 글자, 한글 " + li_max/2 + " 글자를 초과 입력할수 없습니다. \n 초과된 내용은 자동으로 삭제 됩니다. ");
			ls_str2 = ls_str.substr(0, li_len);
			aro_name.value = ls_str2;
		}
		aro_name.focus(); 
	}

//메일팝업
  function go_category(sLink,self){		
	 var win = window.open(sLink, self,  "status='no',top=10,left=10, width=400, height=316");
	win.focus();
  }

//메일팝업
/*
function go_category(){		
	var str1 = "";
	var str2 = "";
	var winArgs = new Array(str1,str2);
	winArgs = window.showModalDialog('/includes/Mail_List.asp', "",  "status:no; help:no; dialogTop:10px; dialogLeft:10px; dialogWidth:400px; dialogHeight:316px;");
	if(winArgs == null){}
	else{	
		if(document.MainForm.sMailName.value.length > 0){
			document.MainForm.sMailName.value += ",";
			//document.MainForm.sMailName.value += ",";
		}
		document.MainForm.sMailName.value += winArgs[0];
		//document.MainForm.sMailName.value += winArgs[0];
		document.MainForm.sMailName.focus();
	}
}
*/
//**************************************
// 드림위버에서 제공하는 함수라이브러리
//**************************************

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

MM_reloadPage(true);

/*
##### 아이프레임 관련 스크립트
*/
function setFrameAllSize() {
	var nIFrames = 0;
	var sFrame;
	var nHeight;

	nIFrames = document.frames.length;

	for (var i = 0; i < nIFrames; i++) {
		sFrame = document.frames[i].name;

		nHeight = document.frames[i].document.body.scrollHeight;
		if (nHeight > 0) {
			document.all[sFrame].style.height = nHeight;
		}
	}
}

function setFrameSize(sFrm) {
	var nIFrames = 0;
	var sFrame;
	var nHeight;

	nIFrames = document.frames.length;

	for (var i = 0; i < nIFrames; i++) {
		sFrame = document.frames[i].name;

		if (sFrame.indexOf(sFrm) >= 0) {
			nHeight = document.frames[i].document.body.scrollHeight;
			if (nHeight > 0) {
				document.all[sFrame].style.height = nHeight;
			}
		}
	}
}

function setFramePartSize(sFrm) {
	var sFrm = sFrm.split(":");
	
	for (var i = 0; i < sFrm.length; i++) {
		setFrameSize(sFrm[i]);
	}
}


/*
##### Quick Menu 관련 스크립트
*/
function initMoving(target, topPosition, topLimit, btmLimit) {
	/* 브라우져 이름 체크 */
	var isIE5 = navigator.appVersion.indexOf("MSIE 5")>0;
	var isIE6 = navigator.appVersion.indexOf("MSIE 6")>0;


	if (!target)
		return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;


	if(isIE6){
		obj.bottomLimit = document.getElementById("mainbody").scrollHeight - btmLimit;	
	}else{
		obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;		
	}



	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";


	obj.getTop = function() {
		if(isIE6){
			if (document.getElementById("mainbody").scrollTop) {
				return document.getElementById("mainbody").scrollTop;
			} else if (window.pageYOffset) {
				return window.pageYOffset;
			} else {
				return 0;
			}
		}else{
			if (document.documentElement.scrollTop) {
				return document.documentElement.scrollTop;
			} else if (window.pageYOffset) {
				return window.pageYOffset;
			} else {
				return 0;
			}
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 620;
		}
	}
	obj.move = setInterval(function() {

		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 5;
		if(obj.top <= 500){
		obj.style.top = topPosition+"px";
		}else{
		obj.style.top = obj.top-335 + "px";		
		}
	}, 30)
}



//ActiveX 플래시
function setFlash(src, w, h, id, vars) {
	var Flash_html = "";
	Flash_html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="'+id+'" width="'+w+'" height="'+h+'">';
	Flash_html += '<param name="movie" value="'+src+'">';
	Flash_html += '<param name="quality" value="high">';
	Flash_html += '<param name="wmode" value="transparent">';
	Flash_html += '<param name="FlashVars" value="'+vars+'">';
	Flash_html += '<param name="swliveconnect" value="true">';
	Flash_html += '<embed src="'+src+'" quality=high wmode="transparent" FlashVars="'+vars+'" width="'+w+'" height="'+h+'" swliveconnect="true" id="'+id+'" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	Flash_html += '</object>';
	document.write(Flash_html);
}



//########################
//## 아파트관심단지 등록
//#########################
function aptInfoDanji_Trans(idx){
	var frm = document.AptForm;
      if(confirm("아파트 관심단지를 등록 하시겠습니까?")){
		 frm.aptCode.value = idx;
         frm.action = "/CM/MY/MM_PRD009_Trans.asp";
		 frm.submit();
     }else{
         return;
      }
}


/*###############################
## 관심단지 리로드
###############################*/
function callExternalInterface(){
 thisMovie("quickMenu").addimg();
}
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

/*###############################
## 위치보기 팝업스크립트
###############################*/
function onAptMapInfo(urlIdx){
	if(urlIdx != ""){
		window.open("http://www.mapid.net/"+urlIdx,"_blank");	
	}else{
		alert('해당 위치정보는 준비중 입니다.');
	}
}


//개인정보정책 팝업창 
function goWebInfo(){
	var url = "/FT/FT_PRD001.asp";
	var winl = (screen.width - 600)/2;
	var wint = (screen.height - 320)/2;
	var wnd = window.open(url, "webInfo", "width=600, height=320, top=" + wint + ", left=" + winl + "', scrollbars=no");
}



//###################################################
//## 플래쉬 연동 플래쉬 모음
//###################################################
function onFootMenu001(idx){
	if (idx == 'open')	{
		document.getElementById('footLayer01').style.display = "block";
	}else if(idx == 'close'){
		document.getElementById('footLayer01').style.display = "none";	
	}
}

function onFootMenu002(idx){
	if (idx == 'open')	{
		document.getElementById('footLayer02').style.display = "block";
	}else if(idx == 'close'){
		document.getElementById('footLayer02').style.display = "none";	
	}
}

function onAllMainView(idx){
	document.getElementById('AllMainView').style.top = "100";
	document.getElementById('AllMainView').style.left = "200";

	if(idx == 'close'){
		document.getElementById('AllMainView').style.display = "none";	
	}else{
		document.getElementById('AllMainView').style.display = "block";	
	}

}

function resizeIframe(fr) {
	document.recalc(true);
}


function initMoving(target, topPosition, topLimit, btmLimit) {
	/* 브라우져 이름 체크 */
	var isIE5 = navigator.appVersion.indexOf("MSIE 5")>-1;
	var isIE6 = navigator.appVersion.indexOf("MSIE 6")>-1;
	
	
	if (!target)
		return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;


	if(isIE6){
		obj.bottomLimit = document.documentElement("mainbody").scrollHeight - btmLimit;	
	}else{
		obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;		
	}



	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";



	obj.getTop = function() {
		if(isIE6){
			if (document.getElementById("mainbody").scrollTop) {
				return document.getElementById("mainbody").scrollTop;
			} else if (window.pageYOffset) {
				return window.pageYOffset;
			} else {
				return 0;
			}
		}else{
			if (document.documentElement.scrollTop) {
				return document.documentElement.scrollTop;
			} else if (window.pageYOffset) {
				return window.pageYOffset;
			} else {
				return 0;
			}
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 620;
		}
	}
	obj.move = setInterval(function() {

		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 5;
		obj.style.top = obj.top + "px";
	}, 30)
}




//ActiveX 동영상
function setMedia(src, Ow, Oh, Pw, Ph) { //object width, height, param width, height  //동영상파일
	var Media_html = "";
	Media_html += '<OBJECT id=MPlay1 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 ';
    Media_html += '    type=application/x-oleobject height='+Oh+'';
    Media_html += '    standby="Loading Microsoft Windows Media Player components..." width='+Ow+' ';
    Media_html += '    classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95>';
    Media_html += '   <PARAM NAME="Width" VALUE="'+Pw+'">';
    Media_html += '   <PARAM NAME="Height" VALUE="'+Ph+'">';
    Media_html += '   <PARAM NAME="FileName" VALUE="'+src+'">';
    Media_html += '   <PARAM NAME="Volume" VALUE="10">';
    Media_html += '   <PARAM NAME="AnimationatStart" VALUE="1">';
    Media_html += '   <PARAM NAME="AutoSize" VALUE="0">';
	Media_html += '   <PARAM NAME="TransparentatStart" VALUE="1">';
    Media_html += '   <PARAM NAME="ControlType" VALUE="1">';
	Media_html += '   <PARAM NAME="EnableContextMenu" VALUE="0">';
    Media_html += '   <PARAM NAME="EnablePositionControls" VALUE="0">';
    Media_html += '   <PARAM NAME="ShowTracker" VALUE="1">';
    Media_html += '   <PARAM NAME="AutoStart" VALUE="1">';
    Media_html += '   <PARAM NAME="ShowControls" VALUE="1">';
    Media_html += '   <PARAM NAME="ClickToPlay" VALUE="1">';
    Media_html += '   </OBJECT>';
	document.write(Media_html);
}




function goConPage(){
	var winl = (screen.width - 900)/2;
	var wint = (screen.height - 550)/2;
	var wnd = window.open("http://www.lottecon.co.kr/lotte50/m50.html", "ppConLotte", "width=900, height=550, top=" + wint + ", left=" + winl + "', scrollbars=no");	
}

function goCyberTour(){
	window.open('/HC_NEW2/index.html','cyber_tour','width=852, height=668, left=200, top=20, resizable=yes, scrollbars=yes');
}