/*
2003.9.25  choiss@namo.com
www.namo.co.kr ÇÏÀ§Æú´õ ¿¡¼­ »ç¿ëÇÏ´Â ÀÚ¹Ù½ºÅ©¸³Æ® 
°í°´ÀÌ¸§ °ü·Ã Âï¾îÁÖ´Â ÇÏÀ§ html 
<script language=JavaScript src="/util.js"></script>
ÇüÅÂ·Î »ç¿ë
2006.10.20 ÆÄÀÏ¾÷·Îµå ÆÄÀÏ¸í Ã¼Å© Ãß°¡ by han1228@namo.co.kr
*/

function setCookie(name, value, expire)
{
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expire)

  	document.cookie = name + "=" + escape(value)

    		+ ((expire == null) ? "" : ("; expires=" + todayDate.toGMTString()))
    		+ "; path=/; domain=.namo.co.kr"
}

function setCookie2(name, value, expire)
{
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expire)

  	document.cookie = name + "=" + value
    		+ ((expire == null) ? "" : ("; expires=" + todayDate.toGMTString()))
    		+ "; path=/; domain=.namo.co.kr"
}
 
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
 
}

function ltrim(str)
{ 
	while(str.charAt(0) == ' ') 
		str = str.substring(1, str.length)

	return str
} 

function rtrim(str)
{ 
	while(str.charAt(str.length-1) == ' ') 
		str = str.substring(0, str.length-1)

	return str
} 

function trim(str)
{
	while(str.charAt(0) == ' ') 
		str = str.substring(1, str.length)
 
	while(str.charAt(str.length-1) == ' ') 
		str = str.substring(0, str.length-1)

	return str
} 

function checkEmail(email)
{
	if (email.indexOf('@') == -1 || email.indexOf('.') == -1)
		return false
	else
		return true

}

function isalphaORnumeric(field) 
{ 
	var valid	= "abcdefghijklmnopqrstuvwxyz0123456789" 
	var alpha	= "abcdefghijklmnopqrstuvwxyz" 
	var ok		= "yes"; 
	var temp; 

	for (var i=0; i<field.value.length; i++) 
	{ 
		temp = "" + field.value.substring(i, i+1); 
		if (i == 0)
		{
			if (alpha.indexOf(temp) == "-1")
			{
				ok = "no"
				break
			}
		}
		if (valid.indexOf(temp) == "-1") ok = "no"; 
	} 

	if (ok == "no") return false

	return true
} 

function isalphaANDnumeric(field) 
{ 
	var valid	= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" 
	var alpha	= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 
	var numeric	= "0123456789"
	var ok		= "yes"; 
	var ok_1	= "no";
	var ok_2	= "no";
	var temp; 

	
	for (var i=0; i<field.value.length; i++) 
	{ 
		temp = "" + field.value.substring(i, i+1); 
		if (valid.indexOf(temp) == "-1") ok = "no"; 
	} 
	if (ok == "no") return false

	
	for (var i=0; i<field.value.length; i++) 
	{ 
		temp = "" + field.value.substring(i, i+1); 
		if (alpha.indexOf(temp) != "-1") ok_1 = "yes"; 
	} 
	
	for (var i=0; i<field.value.length; i++) 
	{ 
		temp = "" + field.value.substring(i, i+1); 
		if (numeric.indexOf(temp) != "-1") ok_2 = "yes"; 
	} 

	if (ok_1 == "no" || ok_2 == "no")
		return false

	return true
} 

function textCounter(field, maxlimit) 
{ 
	if (field.value.length > maxlimit)      
	{ 
		field.value = field.value.substring(0, maxlimit); 
	} 
} 


function UploadFileCheck(Img_Url,obj,kind){
  //(´ë»ó value, ´ë»ó name, 1:ÀÌ¹ÌÁö 2:ÀÏ¹ÝÆÄÀÏ)
  if (Img_Url){
	Char_Tmp = Img_Url.split('\\');
	Char_ext = Char_Tmp[eval(Char_Tmp.length-1)];
	Char_name = Char_ext.substring(0,Char_ext.indexOf("."));
	filter1=/[^a-zA-Z0-9_]/;
	
	//ÆÄÀÏ¸íÀÌ ¿µ¹®°ú¼ýÀÚ ±×¸®°í '_'±âÈ£¸¸ »ç¿ëÇß´ÂÁö Ã¼Å©
	if (filter1.test(Char_name)){
	  alert("ÆÄÀÏ¸íÀº ¿µ¹®,¼ýÀÚ,'_'±âÈ£¸¸ »ç¿ëÇØ ÁÖ¼¼¿ä.. ");
	  obj.value = "";
	  return;
	}

	if (kind == "1"){
		Img_Tmp = Img_Url.split(".");
		Img_ext = Img_Tmp[eval(Img_Tmp.length-1)];
		Img_ext = Img_ext.toUpperCase();
		
		if (Img_ext == "GIF" || Img_ext == "JPG"){
		  //
		}else{
		  alert("ÀÌ¹ÌÁö µî·ÏÀº gif , jpg ÆÄÀÏ¸¸ °¡´ÉÇÕ´Ï´Ù..");
		  obj.value = "";
		  return;
		}
	}
  }
}
 
 
var str_logoff_search = ""
+ "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"609\" height=\"60\">"
+ "    <tr>"
+ "        <td width=\"428\" height=\"60\"><img src=\"/product/images/spacer1.gif\" width=\"428\" height=\"60\" border=\"0\"></td>"
+ "        <td width=\"181\" height=\"60\" valign=\"top\"><a target=\"_top\" href=\"/support/register/loginpage.php3\" OnMouseOut=\"na_restore_img_src('image1', 'document')\" OnMouseOver=\"na_change_img_src('image1', 'document', '/product/images/button_top_login_on.gif', true);\"><img src=\"/product/images/button_top_login.gif\" width=\"56\" height=\"36\" border=\"0\" name=\"image1\"></a><a target=\"_top\" href=\"/support/help/help_serial.html\" OnMouseOut=\"na_restore_img_src('image2', 'document')\" OnMouseOver=\"na_change_img_src('image2', 'document', '/product/images/button_top_register_on.gif', true);\"><img src=\"/product/images/button_top_register.gif\" width=\"61\" height=\"36\" border=\"0\" name=\"image2\"></a><a target=\"_top\" href=\"/sitemap/sitemap.html\" OnMouseOut=\"na_restore_img_src('image3', 'document')\" OnMouseOver=\"na_change_img_src('image3', 'document', '/product/images/button_top_sitemap_on.gif', true);\"><img src=\"/product/images/button_top_sitemap.gif\" width=\"64\" height=\"36\" border=\"0\" name=\"image3\"></a></td>"
+ "    </tr>"
+ "</table>";

var str_login_search = ""
+ "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"609\" height=\"60\">"
+ "    <tr>"
+ "        <td width=\"428\" height=\"60\"><img src=\"/product/images/spacer1.gif\" width=\"428\" height=\"60\" border=\"0\"></td>"
+ "        <td width=\"181\" height=\"60\" valign=\"top\"><a target=\"_top\" href=\"/logoff.php3\" OnMouseOut=\"na_restore_img_src('image1', 'document')\" OnMouseOver=\"na_change_img_src('image1', 'document', '/product/images/button_top_logout_on.gif', true);\"><img src=\"/product/images/button_top_logout.gif\" width=\"56\" height=\"36\" border=\"0\" name=\"image1\"></a><a target=\"_top\" href=\"/support/help/help_serial.html\" OnMouseOut=\"na_restore_img_src('image2', 'document')\" OnMouseOver=\"na_change_img_src('image2', 'document', '/product/images/button_top_register_on.gif', true);\"><img src=\"/product/images/button_top_register.gif\" width=\"61\" height=\"36\" border=\"0\" name=\"image2\"></a><a target=\"_top\" href=\"/sitemap/sitemap.html\" OnMouseOut=\"na_restore_img_src('image3', 'document')\" OnMouseOver=\"na_change_img_src('image3', 'document', '/product/images/button_top_sitemap_on.gif', true);\"><img src=\"/product/images/button_top_sitemap.gif\" width=\"64\" height=\"36\" border=\"0\" name=\"image3\"></a></td>"
+ "    </tr>"
+ "</table>";



var str_login= ""
+ " <tr> "
+ " <td width='629' height='33' align='right' class='body1'>" + getCookie('UserNameJS') + " ´Ô ¿À´Ãµµ ÁÁÀº ÇÏ·ç µÇ¼¼¿ä. [<a href='/webeditor/members/'><font color='black'><u>MY°ø°£</u></font></a>] [<a href='/logout.php?url=/webeditor/'><font color='black'><u>·Î±×¾Æ¿ô</u></font></a>]"
+ "	<td width='1' height='33'><img src='/webeditor/images/spacer.gif' width='1' height='1' border='0'></td> "
+ "</tr>";
 
var str_logoff= ""
+ " <tr> "
+ " <td width='629' height='33' align='right' class='body1'>¼¼Áß ³ª¸ð¿¡ ¿À½Å °ÍÀ» È¯¿µÇÕ´Ï´Ù. "
+ " [<a href='/webeditor/members/'><font color='black'><u>MY°ø°£</u></font></a>] [<a href='/webeditor/members/adduser.html'><u><font color='black'>È¸¿ø°¡ÀÔ</font></u></a>]</td> "
+ "	<td width='1' height='33'><img src='/webeditor/images/spacer.gif' width='1' height='1' border='0'></td> "
+ "</tr>";


<!-- ¸ÞÀÎ ÆäÀÌÁö ·Î±×ÀÎ ¾È³» -->
var main_login= ""
+ " <tr> "
+ " <td width='629' height='33' align='right' class='body1'>" + getCookie('UserNameJS') + " ´Ô ¿À´Ãµµ ÁÁÀº ÇÏ·ç µÇ¼¼¿ä. [<a href='/webeditor/members/'><font color='black'><u>MY°ø°£</u></font></a>] [<a href='/logout.php?url=/'><font color='black'><u>·Î±×¾Æ¿ô</u></font></a>]"
+ "	<td width='1' height='33'><img src='/webeditor/images/spacer.gif' width='1' height='1' border='0'></td> "
+ "</tr>";
 
var main_logoff= ""
+ "<form method='post' action='/webeditor/members/login.php'>"
+ "<td align='right' width='629' height='21'><img src='images/title_id.gif' align='absmiddle'  border='0' >"
+ "<input type='text' name='userid'   size='11' style='font-family:±¼¸²,sans-serif; font-size:9pt; background-color:rgb(242,242,242); border-width:1px; border-color:rgb(198,198,198); border-style:solid;'>"
+ "<img src='images/title_password.gif' align='absmiddle'  border='0' >"
+ "<input type='password' name='userpass' maxlength='11' size='11' style='font-family:±¼¸²,sans-serif; font-size:9pt; background-color:rgb(242,242,242); border-width:1px; border-color:rgb(198,198,198); border-style:solid;'>"
+ "<input type=hidden name=logincheck value='yes'><input type=hidden name=url value='/'>"
+ "<input type='image' src='images/button_login.gif' align='absmiddle' border='0' alt='·Î±×ÀÎ'>"
+ "<a href='/webeditor/members/adduser.html'><img src='images/button_new.gif' align='absmiddle' border='0' alt='È¸¿ø°¡ÀÔ'></a>"
+ "</td></form> ";

<!-- ¸ÞÀÎ ÆäÀÌÁö ·Î±×ÀÎ ¾È³» -->
