<!--
//°¡ÀÔ Æû°Ë»ç °ü·Ã ÄÚµå/////////////////////////////////////////////////////
function fncRegCheckModuleEmail(objForm, blnValid)//ÀÌ¸ÞÀÏ °Ë»ç
{
	//blnValid´Â ÀÔ·ÂÇß´ÂÁö ¾Æ´ÑÁö °Ë»ç°¡ ÇÊ¼öÀÏ ¶§(°¡ÀÔ½Ã¿¡) TrueÀÌ´Ù
	var rgExpEmail=/^([A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*)@((\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(\.[a-z]{2})?)$/i

	if (!blnValid&&objForm.email.value.length==0)
	{
		return true;
	}
	if (!fncRegCheckTypeRegExp(objForm.email, "ÀÌ¸ÞÀÏ", rgExpEmail))//Á¤±Ô½Ä ÀÔ·Â °Ë»ç
	{
		return false;
	}
	return true;
}

///////////////////////////////////////////////////////////////////////////////
function fncRegCheckTypeValid(objInput,strInputName)
{
	var strInputValue = trim(objInput.value);
	objInput.value = strInputValue;
	if (strInputValue.length == 0)  {
		alert(strInputName+"À»(¸¦) ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		objInput.focus();
		return false;
	}
	return true;
}



function fncRegCheckTypeRegExp(objInput,strInputName,strRegExp)
{
	var strInputValue = trim(objInput.value);
	objInput.value = strInputValue;
	if (!strRegExp.test(strInputValue)){
		alert(strInputName+"ÀÌ(°¡) Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù. Çü½Ä¿¡ ¸Â°Ô ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		objInput.focus();
		return false;
	}
	return true;
}

function fncRegCheckTypeChkBox(objInput,strInputName)
{
	if (objInput != '[object]')
	{
		alert(strInputName+"ÀÌ(°¡) Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
		return false;
	}
	else if (isNaN(objInput.length))
	{
		if (objInput.checked)
		{
			return true;
		}
	}
	else {
		for (var i=0; i<objInput.length; i++) {
			if (objInput[i].checked)
			{
				return true;
			}
		}
	}

	alert(strInputName+"À»(¸¦) ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
	return false;
}

//³¯Â¥ °ü·Ã ÄÚµå/////////////////////////////////////////////////////
//trim ¸Þ¼Òµå
function ltrim(str)
{
        var s = new String(str);

        if (s.substr(0,1) == " ")
                return ltrim(s.substr(1));
        else
                return s;
}

function rtrim(str)
{
        var s = new String(str);
        if(s.substr(s.length-1,1) == " ")
                return rtrim(s.substring(0, s.length-1))
        else
                return s;
}

function trim(str)
{
        return ltrim(rtrim(str));
}


//ÀÏ¹Ý ÄÚµå/////////////////////////////////////////////////////
//ÆË¾÷ Á¾·ù
function adjustImage(target_img, maxWidth, maxHeight)
{
	var newHeight, newWidth;
	var newImg;

	newImg = new Image();
	newImg.src = target_img.src;
	imgw = newImg.width;
	imgh = newImg.height;

	if (imgw > maxWidth || imgh > maxHeight)
	{
		if(imgw > maxWidth)
			newWidth = maxWidth;
		else
			newWidth = imgw;

		if(imgh > maxHeight)
			newHeight = maxHeight;
		else
			newHeight = imgh;

		newWidth = Math.min(newWidth, Math.round((imgw*newHeight)/imgh));
		newHeight = Math.min(Math.round((imgh*newWidth)/imgw), newHeight);
	}
	else
	{
		newWidth = imgw;
		newHeight = imgh;
	}

	target_img.onload = null;
	target_img.src = newImg.src;
	target_img.width = newWidth;
	target_img.height = newHeight;
}

function adjustImageWidth(target_img, maxWidth)
{
	var newHeight, newWidth;
	var newImg;

	newImg = new Image();
	newImg.src = target_img.src;
	imgw = newImg.width;
	imgh = newImg.height;

	if (imgw > maxWidth)
	{
		newWidth = maxWidth;
		newHeight = imgh;

		newWidth = Math.min(newWidth, Math.round((imgw*newHeight)/imgh));
		newHeight = Math.min(Math.round((imgh*newWidth)/imgw), newHeight);

		target_img.width = newWidth;
		target_img.height = newHeight;
	}
}

function fncImagePopup(image)
{
	var winImagePopup = window.open("", "winImagePopup","location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no")
	winImagePopup.focus();
	winImagePopup.document.open();
	winImagePopup.document.write("<HTML><HEAD>");
	winImagePopup.document.write("<TITLE>ÀÌ¹ÌÁöº¸±â</TITLE>");
	winImagePopup.document.write("</HEAD><BODY topmargin=\"0\" leftmargin=\"0\">");
	winImagePopup.document.write("<img src=\"" + encodeURI(decodeURI(image)) + "\" id=\"ImagePopup\" onLoad=\"window.resizeBy(Math.min(this.width,screen.availWidth-70)-document.body.clientWidth,Math.min(document.body.scrollHeight,screen.availHeight-70)-document.body.clientHeight);window.resizeBy(0,Math.min(document.body.scrollHeight,screen.availHeight-70)-document.body.clientHeight);window.moveBy(Math.min(0,screen.availWidth-(window.screenLeft+document.body.clientWidth+30)),Math.min(0,screen.availHeight-(window.screenTop+document.body.clientHeight+30)));\" onClick=\"window.close()\">");
	winImagePopup.document.write("</BODY></HTML>");
	winImagePopup.document.close();
}

function fncPrint(id,width,height)
{
	var winPrint = window.open("", "winPrint","width="+width+",height="+height+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no")
	winPrint.focus();
	winPrint.document.open();
	winPrint.document.write("<HTML><HEAD>");
	winPrint.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/include/css/style.css\">");
	winPrint.document.write("<TITLE>ÀÎ¼âÇÏ±â</TITLE>");
	winPrint.document.write("</HEAD><BODY topmargin=\"0\" leftmargin=\"0\" onLoad=\"window.print();\">");
	winPrint.document.write(id.innerHTML);
	winPrint.document.write("</BODY></HTML>");
	winPrint.document.close();
}

function fncZipFind()
{
	var winname, url;
	url='/register/pop_zip.asp';
	winname = window.open(url,'zipcode','width=460,height=360,top=200,left=200,resizable=no,scrollbars=yes,status=no,menu=no');
	winname.focus();
}

function fncFetchEmailDomain(emailDomain,arg)
{
	var winname, url;
	if (emailDomain.options[arg].value =="Á÷Á¢ÀÔ·Â")
	{
		url='/common/popup/email.asp';
		winname = window.open(url,'email','scrollbars=no,width=395,height=191,top=200,left=200');
		winname.focus();
	}
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	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() + "; domain=mintpass.co.kr"
}

var oPopup = window.createPopup();

var oPopupHeader = "<div style=\"position:absolute; top:0; left:0; background:#ffffff; border:1px solid #6699cc; width:90; height:50px; font-family:verdana; font-size:9pt; border:1px solid black;   z-index:3 ;\">"
var oPopupBlog1 = "<div style=\"padding:5px;color:#999999\" onMouseOver=\"this.style.backgroundColor='#bbbbbb'\" onMouseOut=\"this.style.backgroundColor=''\">ºí·Î±×°¡±â</div>"
var oPopupFooter = "</div>"

function goPop(uid,name,BlogID)
{
  name = escape(name);
  var oPopupBody = oPopup.document.body;
  var oHeight, PopupHtml

  PopupHtml = oPopupHeader;
  PopupHtml = PopupHtml + "<div style=\"cursor:hand;padding:5px;\" onMouseOver=\"this.style.backgroundColor='#dddddd'\" onMouseOut=\"this.style.backgroundColor=''\" onClick=\"parent.location.href='/common/memo/write.asp?Page=1&UserType=received&ReceivedCount=0&UID="+uid+"&NAME="+name+"'\">ÂÊÁöº¸³»±â</div>";
  if(BlogID)
	PopupHtml = PopupHtml + "<div style=\"cursor:hand;padding:5px;\" onMouseOver=\"this.style.backgroundColor='#dddddd'\" onMouseOut=\"this.style.backgroundColor=''\" onClick=\"parent.location.href='http://blog.mintpass.co.kr/"+BlogID+"'\">ºí·Î±×°¡±â</div>";
  else
	PopupHtml = PopupHtml + oPopupBlog1;
  PopupHtml = PopupHtml + oPopupFooter;

  oPopupBody.innerHTML = PopupHtml;
//  oPopup.show(event.clientX+5, event.clientY+5, 90, 50, document.body);
//  document.body.onmouseup = closePopup;
  oPopup.show(50, 5, 90, 50, event.srcElement);
//  event.srcElement.onmouseout = closePopup;
}

function closePopup()
{
  oPopup.hide();
}

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 chkKeydown()
{
	if(event.keyCode ==13)//enter
	{
		searchFrm();
	}    
}

function checkAll(frmIndex){
	var totalCount=document.forms[frmIndex].chkID.length;	
		
	if(totalCount>1){
		if(document.forms[frmIndex].chkID[0].checked){
			for(i=0;i<totalCount;i++){
				document.forms[frmIndex].chkID[i].checked=false;
			}
		}else{
			for(i=0;i<totalCount;i++){
				document.forms[frmIndex].chkID[i].checked=true;
			}
		}
	}else{
		if(document.forms[frmIndex].chkID.checked)
			document.forms[frmIndex].chkID.checked=false;
		else
			document.forms[frmIndex].chkID.checked=true;
	}
	return;
}

function fCheckAll(chkItem,chkSrc){
	var totalCount=chkItem.length;	
	if(totalCount>1){
		for(i=0;i<totalCount;i++){
			chkItem[i].checked=chkSrc.checked;
		}
	}else{
		chkItem.checked=chkSrc.checked;
	}
	return;
}

function goFocus(obj) {
	var frm = eval(obj);
	frm.focus();
	return;
}

	function URLEncode (clearString) {
	  var output = '';
	  var x = 0;
	  clearString = clearString.toString();
	  var regex = /(^[a-zA-Z0-9_.]*)/;
	  while (x < clearString.length) {
		var match = regex.exec(clearString.substr(x));
		if (match != null && match.length > 1 && match[1] != '') {
			output += match[1];
		  x += match[1].length;
		} else {
		  if (clearString[x] == ' ')
			output += '+';
		  else {
			var charCode = clearString.charCodeAt(x);
			var hexVal = charCode.toString(16);
			output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
		  }
		  x++;
		}
	  }
	  return output;
	}


//Å¬¸³º¸µå º¹»ç °ü·Ã ÄÚµå/////////////////////////////////////////////////////
function copyUrl(str) {
	if(copyclipboard(str)) {
		alert('Å¬¸³º¸µå¿¡ ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.');
	}
}

function copyclipboard(intext) {
	if (window.clipboardData) {
		window.clipboardData.setData("Text", intext);
			return true;
	}
	else if (window.netscape) {
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

			var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);

			if (!clip)
				return;

			var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);

			if (!trans)
				return;

			trans.addDataFlavor('text/unicode');

			var str = new Object();
			var len = new Object();

			var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

			var copytext=intext;

			str.data=copytext;

			trans.setTransferData("text/unicode",str,copytext.length*2);

			var clipid=Components.interfaces.nsIClipboard;

			if (!clip)
				return false;

			clip.setData(trans,null,clipid.kGlobalClipboard);
			return true;
		} catch(e) {
		}
	}
	return false;
}



//¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â °ü·Ã ÄÚµå/////////////////////////////////////////////////////
function onlyNumeric(){
	if(event.keyCode==8||event.keyCode==46||event.keyCode==9){	//¹é½ºÆäÀÌ½º,DELETE,TAB Çã¿ë
	}else if((event.keyCode >= 48) && (event.keyCode <= 57)){
	}else if((event.keyCode >= 65) && (event.keyCode <= 90)){
	}else{
		event.returnValue=false;
	}
}

