//=================================================================================================
// Common JavaScript
//=================================================================================================
// FileName : script.js
// Last update : 2004-11-08
//=================================================================================================

//=================================================================================================
// Check Empty Filed & Process That...
//=================================================================================================

function empty_proc(obj, msg)
{
	if(obj.value.trim() == "")
	{
		alert(msg);
		obj.value = "";
		obj.focus();

		return true;
	}

	return false;
}

//=================================================================================================
// 공백을 없애는 함수
//=================================================================================================
String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

function openWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}

//=================================================================================================
/// 특정 개수의 값이 들어오면 포커스 넘겨주기
//=================================================================================================

function sendFocus(source, target, number)
{
	if(source.value.length >= number)
		target.focus();
}

//=================================================================================================
/// 한글 입력 체크
//=================================================================================================

function checkKorean(str)
{
	 var j = 0;
	 var CodeNum;

	for(i = 0; i < str.length; i++)
	{
		CodeNum = str.charCodeAt(i);

		if(CodeNum < 128)
		{
			j = j + 1;				
		}	
	}

	if(j > 0)
		return false;
	else
		return true;
}

//=================================================================================================
/// 알파벳 입력 체크
//=================================================================================================

function isAlphabet(obj)
{ 
	var str = obj.value;
	if(str.length == 0)
		return false;

	str = str.toUpperCase();
	for(var i=0; i < str.length; i++) {
		if(!('A' <= str.charAt(i) && str.charAt(i) <= 'Z'))
			return false;
	}
	return true;
}


//=================================================================================================
/// 해당 필드를 비운다.
//=================================================================================================

function setEmpty(obj)
{
	obj.value = "";
	obj.focus();
}

//=================================================================================================
/// 주민등록번호 체크
//=================================================================================================

function checkResident(resident1, resident2)
{
	var chk =0;

	for (var i = 0; i <=5 ; i++)
	{
		chk = chk + ((i % 8 + 2) * parseInt(resident1.substring(i, i + 1)));
	}

	for (var i = 6; i <= 11 ; i++)
	{
		chk = chk + ((i % 8 + 2) * parseInt(resident2.substring(i-6, i-5)));
	}

	chk = 11 - (chk % 11);
	chk = chk % 10;

	if (chk != resident2.substring(6, 7))
		return false;
	else
		return true;
}

//=================================================================================================
/// Check_Email
//=================================================================================================

function check_email(email)
{
	var atsym = email.indexOf("@");
	var period = email.indexOf(".");
	var space = email.indexOf(" ");
	var length = email.length -1;

    if((atsym < 1)||(period <=atsym+1)|| (period==length)|| (space != -1))
	{
		return false;
	}

	return true;
}

//=================================================================================================
// Check ID
//=================================================================================================

function check_id(obj)
{
	var str = obj.value;

	if(str.length < 4 || str.length > 12) return false;

	str = str.toUpperCase();
	if(!('A' <= str.charAt(i) && str.charAt(i) <= 'Z')) return false;

	for(var i=1; i < str.length; i++)
	{
		if(!(('A' <= str.charAt(i) && str.charAt(i) <= 'Z') || ('0' <= str.charAt(i) && str.charAt(i) <= '9') || (str.charAt(i) == '_')))
			return false;
	}

	return true;
}


//=================================================================================================
/// GetCookie
//=================================================================================================

function getCookie(name)
{
	var nameOfCookie = name + "=";
	var x = 0;

	while (x <= document.cookie.length)
	{
		var y = (x + nameOfCookie.length);

		if (document.cookie.substring(x, y) == nameOfCookie) 
		{
			if((endOfCookie = document.cookie.indexOf(";", y)) == -1)
				endOfCookie = document.cookie.length;
				
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}

		x = document.cookie.indexOf(" ", x) + 1;

		if(x == 0)
			break;
	}

	return "";
}

//=================================================================================================
/// SetCookie
//=================================================================================================

function setCookie(name, value, expiredays)
{
	var todayDate = new Date();
	
	todayDate.setTime(todayDate.getTime() + (1000*30*24*60*60));

	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

//=================================================================================================
/// checkRadio
//=================================================================================================

function checkRadio(oRadio, strMessage)
{
	for(var i = 0; i < oRadio.length; i++)
		if(oRadio[i].checked)
			return true;

	alert(strMessage);

	return false;
}

//=================================================================================================
// 체크박스 전체체크, 해제, 반전
//=================================================================================================


function AllChknCancel(field, mode)
{
	var cbox = document.getElementsByName(field);
	var chk = 0;

	if(mode == 'check')
	{
		for(var i=0; i < cbox.length; i++)
			cbox[i].checked = true;
	}

	else if(mode == "cancel")
	{
		for(var i=0; i < cbox.length; i++)
			cbox[i].checked = false;
	}

	else if(mode == "reverse")
	{
		for(var i=0; i < cbox.length; i++)
		{
			if(cbox[i].checked) cbox[i].checked = false;
			else cbox[i].checked = true;
		}
	}
}

//=================================================================================================
// bluring
//=================================================================================================

function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;

function TxtCheck(key, CtlName, TextMask)
{
	if((key > 47&&key < 58)||(key > 95 && key <106)) 
	{
		if(CtlName.value.length < TextMask.length) 
		{ 
			var aa = CtlName.value + String.fromCharCode(key);

			if(key > 47 && key < 58) 
			{
				var zz = aa.charAt(aa.length-1);
			}
			else if(key > 95 && key < 106)
			{	
				switch(key)
				{
					case 96: zz = '0'; break; case 97: zz = '1'; break;
					case 98: zz = '2'; break; case 99: zz = '3'; break;
					case 100: zz = '4'; break; case 101: zz = '5'; break;
					case 102: zz = '6'; break; case 103: zz = '7'; break;
					case 104: zz = '8'; break; case 105: zz = '9'; break;
				}
			}

			if(TextMask.charAt(aa.length-1) == '#') 
				CtlName.value = CtlName.value + zz;
			else 
				CtlName.value = CtlName.value + TextMask.charAt(aa.length-1) +zz;
			
			return false;
		}
	}
	else if(key == 8 || key == 9 || key == 13) 
		return ; 
	
	return false;
}

function onlyNumber1()
{
	if(((event.keyCode < 48) || (event.keyCode > 57)) && (event.keyCode != 45))
		event.returnValue=false;
}

function onlyNumber()
{
	if((event.keyCode < 48) || (event.keyCode > 57))
		event.returnValue=false;
}


//=================================================================================================
// 활성, 비활성 설정
//=================================================================================================

function showObject(Obj,Boolen)
{
	if(Boolen){					//활성화
		Obj.disabled = false;
		Obj.style.background = "#ffffff";
	}
	else{						//비활성화
		Obj.disabled = true;
		Obj.style.background = "#dddddd";
	}
}

//=================================================================================================
// 마우스Over 및 Out
//=================================================================================================

function MOver(obj, color)
{
	obj.style.background = color;
}

function MOut(obj, color)
{
	obj.style.background = color;
}

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) { //v3.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); 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();
}
MM_reloadPage(true);
// -->

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 chkForm(form)
{
	var len = form.elements.length;
	var typenm, tagnm, expstr, ename, e_val, r_ck;
	var file_ck = "N";

	for(var i=0; i < len; i++)
	{
		var obj = form.elements[i];
		ename = obj.name;
		typenm = obj.type.toUpperCase();
		tagnm = obj.tagName.toUpperCase();
		expstr = obj.exp;
		e_val = obj.value;

		if(typeof(expstr) != "undefined" && expstr != "")
		{
			if(typenm == "SELECT-ONE")	//select
			{
				if(e_val == "")
				{
					alert(expstr + " 선택해 주세요.");
					form.elements[i].focus();
					return false;
					break;
				}
			}
			else if(typenm == "RADIO")	//radio
			{
				r_ck = "N";
				for(var j=0; j < eval("form."+ename).length; j++)
				{
					if(eval("form."+ename)[j].checked == true)
					{
						r_ck = "Y";
						break;
					}
				}

				if(r_ck == "N")
				{
					alert(expstr + " 선택해 주세요.");
					eval("form."+ename)[0].focus();
					return false;
					break;
				}
			}
			else if(typenm == "TEXT" || typenm == "PASSWORD" || typenm == "TEXTAREA")
			{
				if(e_val.replace(/^\s*/,'').replace(/\s*$/, '') == "")
				{
					alert(expstr + " 입력해 주세요.");
					form.elements[i].focus();
					return false;
					break;
				}
			}
			else if(typenm == "HIDDEN")
			{
				if(e_val.replace(/^\s*/,'').replace(/\s*$/, '') == "")
				{
					alert(expstr);
					return false;
					break;
				}
			}
			else if(typenm == "FILE")
			{
				if(e_val != "")
				{
					file_ck = "Y";
					if(ImgFileChk(form.elements[i], expstr)){}
					else
					{
						return false;
						break;
					}
				}

				if(file_ck == "N")
				{
					alert("첨부이미지는 한개이상 등록하셔야 합니다.");
					return false;
					break;
				}
			}

		}

		if(obj.getAttribute("chktype") != null && obj.value.length > 0)
		{
			var checkType = obj.getAttribute("chktype");

			if(checkType == "password")
			{
				if(form.pwd.value != form.pwd2.value)
				{
					alert("비밀번호가 맞지 않습니다.");
					form.pwd2.value = "";
					form.pwd2.focus();
				}
			}
			else if(checkType == "email")
			{
				if(!check_email(e_val))
				{
					alert("메일주소형식이 맞지 않습니다.");
					form.elements[i].value = "";
					form.elements[i].focus();
					return false;
					break;
				}
			}
			else if(checkType == "ssn")
			{
				if(!checkResident(form.ssn1.value, form.ssn2.value))
				{
					alert("주민번호 형식이 틀립니다.");
					form.ssn1.value = "";
					form.ssn2.value = "";
					form.ssn1.focus();
					return false;
					break;
				}
			}
			else if(checkType == "alphabet")
			{
				if(!isAlphabet(obj))
				{
					alert("영문 알파벳으로만 입력해 주세요.");
					obj.value = "";
					obj.focus();
					return false;
					break;
				}
			}
			else if(checkType == "passchk" && form.elements[i].value)
			{
				if(!check_pass(form.elements[i]))
				{
					alert("비밀번호는 공백없이 4자이상 12자이내의 영문, 숫자, _, - 만으로 입력해 주세요.");
					form.elements[i].value = "";
					form.elements[i].focus();
					return false;
					break;
				}

			}
			else if(checkType == "number")
			{
				if(!checkNumber(obj.value))
				{
					alert("숫자로만 입력해 주세요.");
					obj.value = "";
					obj.focus();
					return false;
					break;
				}
			}
		}
	}

	return true;
}

/***** img chk (kkang)****************************************************************************/
function ImgFileChk(obj, info)
{
	if(obj.value != "")
	{
		var maxi = obj.value.length;
		var ext = obj.value.substring(maxi-3, maxi);
		ext = ext.toLowerCase();

		if(ext != "gif" && ext != "jpg")
		{
			alert(info + "은(는) gif 또는 jpg 파일만 업로드가능합니다.");
			obj.focus();
			return false;
		}
	}

	return true;
}

/***** Member Password Check --- kkang ***********************************************************/
function check_pass(obj)
{
	var str = obj.value;
	var patten = /^[a-zA-Z0-9_]{4,12}$/;

	if(!patten.test(str))
		return false;
	else
		return true;
}

/***** checkNumber *******************************************************************************/
function checkNumber(nNumber)
{ 
    var anum=/(^\d+$)|(^\d+\.\d+$)/ ;

    if (anum.test(nNumber))
        return true; 
    else 
        return false; 
}

/***** zipcode search --- (kkang)***************************************************************/
function SearchAdr(po)
{
	window.open("../member/search_post.php?po="+po, "zip", "scrollbars=no,width=360,height=250");
}

/***** 이미지 변경 --- (kkang)***************************************************************/
function ChangeImg(id, img)
{

	var obj2 = document.getElementById(id);

	if(navigator.appName == "Microsoft Internet Explorer")
	{
		obj2.filters.blendTrans.apply();
		obj2.src='../upload/gallery/'+img;
		obj2.filters.blendTrans.play();
	}
	else
		obj2.src='../upload/gallery/'+img;

	return;
}

/******** (숫자콤마 입력) *****************************************************************/

function NumberFormat(price, pos)
{
	var str = new Array();
	price = String(price);	//숫자를 스트링으로 변환

	for(var i=1; i <= price.length; i++)
	{
		if(i%pos)
			str[price.length-i] = price.charAt(price.length-i);
		else
			str[price.length-i] = ','+price.charAt(price.length-i);
	}
	
	return str.join('').replace(/^,/,'');
}

/******** (자동 Focus 이동) *****************************************************************/
function sendFocus(source, target, number)
{
	if(source.value.length >= number)
		target.focus();
}

/******** (달력이동) *****************************************************************/
function CalendarMove(year, month, mode)
{
	if(mode == 'pre')
	{
		if(month == '1')
		{
			year--;
			month = 12;
		}
		else
			month--;
	}
	else if(mode == 'next')
	{
		if(month == 12)
		{
			year++;
			month = 1;
		}
		else
			month++;
	}

	location.href = '?year='+year+'&month='+month;
}

function PasswordForm(mode, code, data)
{
	var bwidth = document.body.clientWidth;
	var bheigh = document.body.clientHeight;
	var layerX = (bwidth-300) / 2;
	var layerY = (bheigh-200) / 2;
	var html = '';

	html = "<form name=\"pwdfm\" action=\"/board/check.pwd.php\" method=\"post\" onSubmit=\"return chkForm(this);\" target=\"hifr\">";
	html += "<input type=\"hidden\" name=\"mode\" value=\""+mode+"\" />";
	html += "<input type=\"hidden\" name=\"code\" value=\""+code+"\"/>";
	html += "<input type=\"hidden\" name=\"encData\" value=\""+data+"\"/>";
	html += "<table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
	html += "<tr><td height=\"40\"></td></tr>";
	//html += "<tr align=\"center\"><td style=\"font-size:12px;font-weight:bold;\"><img src=\"/img/icon/icon_plus.gif\" align=\"absmiddle\"/> 비밀번호를 입력해 주세요.</td></tr>";
	html += "<tr align=\"center\"><td height=\"30\"><input type=\"password\" name=\"pwd\" size=\"25\" class=\"lbox\" exp=\"비밀번호를 \"/></td></tr>";
	html += "<tr align=\"center\"><td height=\"30\"><input type=\"image\" src=\"/img/btn/btn_layer_ok.gif\" /></td></tr>";
	html += "<tr align=\"center\"><td height=\"30\"><img src=\"/img/icon/icon_plus.gif\" align=\"absmiddle\"/> 비밀번호를 정확히 입력해 주세요.</td></tr>";
	html += "</table>";
	html += "<div style=\"height:18px;text-align:right;\"><img src=\"/img/btn/layer_x.gif\" class=\"hand\" onClick=\"LayerClose();\"/></div>";
	html += "</form>";

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		//height = "100%";
		//height = document.body.scrollHeight;
		height = document.body.scrollHeight;
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=30)";
		opacity = "0.5";
	}
	obj.id = "LayerBg";
	document.body.appendChild(obj);

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = layerX + document.body.scrollLeft;
		top = layerY + document.body.scrollTop;
		width = 300;
		height = 198;
		//backgroundColor = "#ffffff";
		obj.style.backgroundImage = "url('/img/common/bg_layer_pwd.gif')";
		obj.style.backgroundRepeat = "no-repeat";
		border = "3px solid #000000";
	}
	obj.id = "LayerContent";
	
	document.body.appendChild(obj);


	obj.innerHTML = html;
}

function CmtPassForm(pobj, code, num)
{
	var obj = document.getElementById('CmtPwdLayer');
	if(obj != null) obj.parentNode.removeChild(obj);
	var html = "";
	html = "<form name=\"cmtform\" action=\"/board/board.act.php\" method=\"post\" onSubmit=\"return chkForm(this);\" target=\"hifr\">";
	html += "<input type=\"hidden\" name=\"num\" value=\""+num+"\" />";
	html += "<input type=\"hidden\" name=\"mode\" value=\"chkpwd\" />";
	html += "<input type=\"hidden\" name=\"code\" value=\""+code+"\"/>";
	html += "<input type=\"hidden\" name=\"act\" value=\"cmtd\" />";
	html += "<input type=\"password\" id=\"pwd\" name=\"pwd\" class=\"lbox\" align=\"absmiddle\" exp=\"비밀번호를 \"/> ";
	html += "<input type=\"image\" src=\"/img/btn/btn_boa_ok.gif\" title=\"확인\" align=\"absmiddle\" /> ";
	html += "<img src=\"/img/btn/btn_boa_cancel.gif\" alt=\"취소\" align=\"absmiddle\" class=\"hand\" onClick=\"javascript:document.getElementById('CmtPwdLayer').parentNode.removeChild(document.getElementById('CmtPwdLayer'));\" />";
	html += "</form>";


	obj = document.createElement("span");
	obj.id = "CmtPwdLayer";
	obj.style.width = "250px";
	obj.style.border = "#dddddd 1px solid";
	obj.style.padding = "3px";
	obj.style.backgroundColor = "#ffffff";
	obj.style.position = "absolute";

	if(pobj.innerHTML.toLowerCase().indexOf('img') != -1)
	{
		obj.style.marginTop = "0px";
		obj.style.marginLeft = "-250px";
	}

	obj.innerHTML = html;
	pobj.parentNode.insertBefore(obj, pobj.previousSibling);
	document.getElementById('pwd').focus();
}
/*
function PasswordForm(mode, code, data)
{
	var bwidth = document.body.clientWidth;
	var bheigh = document.body.clientHeight;
	var layerX = (bwidth-300) / 2;
	var layerY = (bheigh-200) / 2;
	var html = '';

	html = "<form name=\"pwdfm\" action=\"/board/check.pwd.php\" method=\"post\" onSubmit=\"return chkForm(this);\" target=\"hifr\">";
	html += "<input type=\"hidden\" name=\"mode\" value=\""+mode+"\" />";
	html += "<input type=\"hidden\" name=\"code\" value=\""+code+"\"/>";
	html += "<input type=\"hidden\" name=\"encData\" value=\""+data+"\"/>";
	html += "<table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
	html += "<tr align=\"center\"><td style=\"font-size:12px;font-weight:bold;\"><img src=\"/img/icon/icon_plus.gif\" align=\"absmiddle\"/> 비밀번호를 입력해 주세요.</td></tr>";
	html += "<tr align=\"center\"><td><input type=\"password\" name=\"pwd\" size=\"25\" class=\"lbox\" exp=\"비밀번호를 \"/></td></tr>";
	html += "<tr align=\"center\"><td><input type=\"image\" src=\"/img/btn/btn_save.gif\" /></td></tr>";
	html += "</table>";
	html += "<div style=\"height:18px;text-align:right;\"><img src=\"/img/btn/layer_x.gif\" class=\"hand\" onClick=\"LayerClose();\"/></div>";
	html += "</form>";

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		//height = "100%";
		//height = document.body.clientHeight;
		height = document.body.scrollHeight;
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=30)";
		opacity = "0.5";
	}
	obj.id = "LayerBg";
	document.body.appendChild(obj);

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = layerX + document.body.scrollLeft;
		top = layerY + document.body.scrollTop;
		width = 300;
		height = 200;
		backgroundColor = "#ffffff";
		border = "3px solid #000000";
	}
	obj.id = "LayerContent";
	document.body.appendChild(obj);


	obj.innerHTML = html;
}

function CmtPassForm(pobj, code, num)
{
	var obj = document.getElementById('CmtPwdLayer');
	if(obj != null) obj.parentNode.removeChild(obj);
	var html = "";
	html = "<form name=\"cmtform\" action=\"/board/board.act.php\" method=\"post\" onSubmit=\"return chkForm(this);\" target=\"hifr\">";
	html += "<input type=\"hidden\" name=\"num\" value=\""+num+"\" />";
	html += "<input type=\"hidden\" name=\"mode\" value=\"chkpwd\" />";
	html += "<input type=\"hidden\" name=\"code\" value=\""+code+"\"/>";
	html += "<input type=\"hidden\" name=\"act\" value=\"cmtd\" />";
	html += "<input type=\"password\" id=\"pwd\" name=\"pwd\" class=\"lbox\" align=\"absmiddle\" exp=\"비밀번호를 \"/>";
	html += "<input type=\"submit\" value=\"확인\" />";
	html += "<input type=\"button\" value=\"취소\" onClick=\"javascript:document.getElementById('CmtPwdLayer').parentNode.removeChild(document.getElementById('CmtPwdLayer'));\" />";
	html += "</form>";


	obj = document.createElement("span");
	obj.id = "CmtPwdLayer";
	obj.style.width = "220px";
	obj.style.border = "#dddddd 1px solid";
	obj.style.padding = "3px";
	obj.style.backgroundColor = "#ffffff";
	obj.style.position = "absolute";

	if(pobj.innerHTML.toLowerCase().indexOf('img') != -1)
	{
		obj.style.marginTop = "0px";
		obj.style.marginLeft = "-220px";
	}

	obj.innerHTML = html;
	pobj.parentNode.insertBefore(obj, pobj.previousSibling);
	document.getElementById('pwd').focus();
}
*/

function LayerClose()
{
	//document.getElementById('LayerBg').style.display = "none";
	//document.getElementById('LayerContent').style.display = "none";

	document.getElementById('LayerBg').parentNode.removeChild(document.getElementById('LayerBg'));
	document.getElementById('LayerContent').parentNode.removeChild(document.getElementById('LayerContent'));
}


