//¹ÙÀÌÆ®¼öÃ¼Å©
function GetByteLen(s)
{
	var l=0;
	for(var i=0;i<s.length; i++) 
		if(escape(s.charAt(i)).length>3) l+=2; else l++;
 	return l;
}
// Trim ÇÔ¼ö
String.prototype.trim = function() 
{
    return this.replace(/(^ *)|( *$)/g, "");
}

//ºó¹®ÀÚ¿­Ã¼Å©
function checkBlank(checkValue)
{
	return /[^\s]/g.test(checkValue);
}
//°ø¹éÁ¦°ÅÇÏ±â
function removeBlank(strText)
{
	var r, re;
	re = /\s/g;
	r = strText.replace(re, "");
	return(r);
}
//ÀÌ¹ÌÁöÅ©°Ôº¸±â
function view_image(img_path, img_width, img_height, img_title)
{
	var isOver = false;
	
	if(img_width > screen.width - 100)
	{
		img_width = screen.width - 100;
		isOver = true;
	}
	if(img_height > screen.height - 100)
	{
		img_height = screen.height - 100;
		isOver = true;
	}
	
	var fileName = '/common/view_image.asp?img_path='+img_path+'&img_title='+img_title
	var window_property = 'width='+img_width+', height='+img_height+', left='+(screen.width-img_width)/2+', top='+(screen.height-img_height)/2
	
	if(!isOver)
	{
		window.open(fileName, 'img_window', window_property);
	}
	else
	{
		window.open(fileName, 'img_window', window_property+',scrollbars=1');
	}
}
//¸ÞÀÏº¸³»´ÂÃ¢¿­±â
function mailForm(objID)
{
	window.open("/Mail/Send_Mail_Form.asp?objID="+objID,"sendMail","width=500,height=420,noresize");
}
//¸ÞÀÏº¸³»±â
function sendIt()
{
	if(document.mailForm.SendAddr.value=="")
	{
		window.alert("º¸³»´Â »ç¶÷ ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù.");
		document.mailForm.SendAddr.focus();
		return;
	}
	
	if(document.mailForm.Title.value=="")
	{
		window.alert("Á¦¸ñÀ» ½áÁÖ½Ê½Ã¿À.");
		document.mailForm.Title.focus();
		return;
	}
	
	if(document.mailForm.Content.value=="")
	{
		window.alert("³»¿ëÀ» ½áÁÖ½Ê½Ã¿À.");
		document.mailForm.Content.focus();
		return;
	}
	
	document.mailForm.action = "Send_Mail.asp";
	document.mailForm.submit();
}

function viewVOD_GU()
{
	//window.open('http://www.terastreaming.com/boarderszone/channel.php', 'VOD_PLAYER', 'width=682, height=505, scrollbars=1, left=10, top=10');	//w=678
	win = window.open('/gu_soft/vod_player_gu.asp', 'VOD_PLAYER', 'width=682, height=505, scrollbars=1, left=10, top=10');	//w=678
	win.focus();
}

function viewVOD_Shopping()
{
	//var win = window.open('http://www.terastreaming.com/boarderszone/channel.php?URL=www.boarderszone.com/gu_soft/shopping_player.asp', 'SHOPPING_PLAYER', 'width=682, height=505, scrollbars=1, left=10, top=10');	//w=678
	var win = window.open('/gu_soft/shopping_player.asp', 'SHOPPING_PLAYER', 'width=682, height=505, scrollbars=1, left=10, top=10');	//w=678
	win.focus();
}

function createCellWithText(text ,align, forecolor, backcolor)
{
	var cell = document.createElement("td");
	var textNode = document.createTextNode(text);
	cell.appendChild(textNode);
	if(align && isExist(align))
		cell.align = align;
	if(forecolor && isExist(forecolor))
		cell.style.Color = forecolor;
	if(backcolor && isExist(backcolor))
		cell.style.backgroundColor = backcolor;

	return cell;
}
	
function createCellWithHtml(html, align, forecolor, backcolor)
{
	var cell = document.createElement("td");
	cell.innerHTML = html;
	if(align && isExist(align))
		cell.align = align;
	if(forecolor && isExist(forecolor))
		cell.style.Color = forecolor;
	if(backcolor && isExist(backcolor))
		cell.style.backgroundColor = backcolor;
		
	return cell;
}

function clearElement(id)
{
	if(document.getElementById(id))
	{
		var clearElement = document.getElementById(id);
		while(clearElement.childNodes.length > 0)
		{
			clearElement.removeChild(clearElement.childNodes[0]);
		}
	}
}

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_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_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_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_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

/*
document.write("<div id='LeftBanner01' style='position:absolute; Z-INDEX: 0; WIDTH: 100%; TOP: 69px; LEFT:0px;'>");
document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
document.write("	<tr>");
document.write("		<td align='center'>");
document.write("			<table width='1150' border='0' cellspacing='0' cellpadding='0' align='center'>");
document.write("				<tr>");
document.write("					<td width='90'><img src='/banner/rentalshop3.gif' border='0' usemap='#Map_r'></td>");
document.write("					<td width='10'>&nbsp;</td>");
document.write("					<td width='950'>&nbsp;</td>");
document.write("					<td width='10'>&nbsp;</td>");
document.write("					<td width='90' valign='top'>");
document.write("						<table border='0' cellspacing='0' cellpadding='0'>");
document.write("							<tr>");
document.write("								<td valign='top' align='center'>&nbsp;<a href='http://shop.boarderszone.com/goods/goods_detail.asp?S_BRAND=190&GdsIdx=3354' onfocus='this.blur();' target='_blank'><img src='/banner/urbanus.gif' border='0'></a></td>");
document.write("							</tr>");
document.write("							<tr>");
document.write("								<td height='3'></td>");
document.write("							</tr>");
document.write("							<tr>");
document.write("								<td valign='top' align='center'>&nbsp;<img src='/banner/gboard.gif' border='0' style='CURSOR:hand' onclick='window.open(\"/banner/Gboard_poster.gif\", \"newwin\" , \"toolbar=0, location=0, status=0, menubar=0, scrollbars=0, resizable=0, top=0, left=0, width=973, height=1188\");'></td>");
document.write("							</tr>");
document.write("						</table>");
document.write("					</td>");
document.write("				</tr>");
document.write("			</table>");
document.write("		</td>");
document.write("	</tr>");
document.write("</table>");
document.write("<map name='Map_r'>");
document.write("	<area shape='rect' coords='2,2,88,115' href='/01_News/News_Detail.asp?NewsCatID=5&NewsID=9186' onfocus='this.blur();'>");
document.write("	<area shape='rect' coords='5,118,85,197' href='http://www.muchsnow.com/js_main.php' target='_blank' onfocus='this.blur();'>");
document.write("	<area shape='rect' coords='5,202,85,281' href='http://www.muchsnow.com/hn_main.php' target='_blank' onfocus='this.blur();'>");
document.write("	<area shape='rect' coords='5,286,85,365' href='http://www.muchsnow.com/kc_main.php' target='_blank' onfocus='this.blur();'>");
document.write("	<area shape='rect' coords='4,370,85,459' href='http://www.k2skiclub.co.kr' target='_blank' onfocus='this.blur();'>");
document.write("	<area shape='rect' coords='7,462,84,550' href='http://www.igloorental.co.kr' target='_blank' onfocus='this.blur();'>");
document.write("	<area shape='rect' coords='6,556,84,637' href='http://www.pnxski.com' target='_blank' onfocus='this.blur();'>");
document.write("</map>");
document.write("</div>");*/
