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.01
  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 && d.getElementById) x=d.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 getFlashObject(url, width, height) {
	var strObj = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>";
	strObj += "<param name='movie' value='" + url + "'>";
	strObj += "<param name='quality' value='high'>";
	strObj += "<param name='wmode' value='transparent'>";
	strObj += "<embed src='"+url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>";
	strObj += "</object>";

	return strObj;
}
function FlashObject(url, width, height) {
	document.write(getFlashObject(url, width, height));
}

function CharLength(str) {
	var tmpStr;
	var temp = 0;
	var onechar;
	var tcount = 0;

	tmpStr = new String(str);
	temp = tmpStr.length;
	for (var k=0;k<temp;k++) {
		onechar = tmpStr.charAt(k);
		if (escape(onechar).length > 4) {
			tcount += 2;
		}
		else if (onechar!='\r') {
			tcount++;
		}
	}

	return tcount;
}

function ZipCode() {
	open("/common/include/pop_search_post.asp", "zipcode", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=400, height=350");
}
/*
function OnlyNumber(){
	if(((event.keyCode<48)||(57<event.keyCode))&&(45!=event.keyCode)) event.returnValue=false;}
*/
function Validchar(g,str){
	for( var i=0 ; i < g.length; i++ ){
		if( str.indexOf(g.charAt(i)) == -1 ) return g.charAt(i);
	}
	return true;
}

function ChkPhoneLen (ss,len) {
	var val = Object.length;
	alert(ss);

}

function ChkInput(Object,Name) {
	if (typeof(Object)!="undefined") {
		if(Object.value=="") {
			alert(Name);
			eval(Object.focus());
			return false;
		}
	}
}

function ChkSelect(Object,Name) {
	if(!Object.options[Object.selectedIndex].value) {
		alert(Name);
		eval(Object.focus());
		return false;
	}
}

function ChkArray(Object,Name) {
	var Key=0;

	if (Object!=null && isNaN(Object.length)) {
		if (!Object.checked) {
			alert(Name);
			return false;
		}
	} else {

        if(Object!=null) {
    		for(i=0;i<Object.length;i++) if(!Object[i].checked) Key++;
    		if(Key==Object.length){
    			alert(Name);
    			return false;
    		}
    	} else {
    	    alert("자료가 없습니다.");
    	    return false;   
    	}
	}
}

function ChkNumeric(Object,Name) {
	if (typeof(Object)!="undefined") {
		if(isNaN(Object.value) == true) {
			alert(Name);
			eval(Object.focus());
			return false;
		}
	}
}


/* 미디어 공통 사용 */
function MediaObject(URL, Name, width, height) {
	document.write('<object ID="'+Name+'" name="'+Name+'" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"  standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" align="middle" width="'+width+'" height="'+height+'">');
	document.write('  <param name="CurrentPosition" value="1">');
	document.write('  <param name="SetCurrentEntry" value="1">');
	document.write('  <param name="ClickToPlay" value="1">');
	document.write('  <param name="AutoSize" value="0">');
	document.write('  <param name="AutoStart" value="1">');
	document.write('  <param name="ShowControls" value="1">');
	document.write('  <param name="ShowAudioControls" value="1">');
	document.write('  <param name="ShowDisplay" value="0">');
	document.write('  <param name="ShowStatusBar" value="1">');
	document.write('  <param name="EnableContextMenu" value="0">');
	document.write('  <param name="ShowPositionControls" value="0">');
	document.write('  <param name="DisplayBackColor" value="0">');
	document.write('  <param name="ShowTracker" value="1">');
	document.write('  <param name="ShowCaptioning" value="0">');
	document.write('  <param name="AutoRewind" value="0">');
	document.write('  <param name="EnableTracker" value="1">');
	document.write('  <param name="Volume" value="-1">');
	document.write('  <param name="Filename" value="'+URL+'">');
	document.write('</object>');
}

function ShowProgressNew(ProgID) { 
	strAppVersion = navigator.appVersion;
	if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) {
		winstyle = "dialogWidth=385px; dialogHeight:160px; center:yes";
		window.showModelessDialog("/common/inc/progress.asp?Progressid="+ProgID,null,winstyle); 
	}
	else {
		winpos = "left=" + ((window.screen.width-380)/2) + ",top=" + ((window.screen.height-110)/2);
		winstyle="width=380,height=110,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos;
		window.open("/common/inc/progress.asp?Progressid="+ProgID,null,winstyle); 
	}
}

function openPopupWin(url, name, width, height) {
	window.open (url, name, 'scrollbars=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, width=' + width + ', height=' + height) ;
}

function getValueById(objId) {
	var resultVal = "";
	var resultObj = document.getElementById(objId);

	if(resultObj!=null)
		resultVal = resultObj.value;

	return resultVal;
}

function ChkLen(obj, len) {
	if(obj.value.length > len) {
		alert(len+"자 제한이 되어 있습니다");
		//obj.value = obj.value.substring(0,len);
		return false;
	}
}


//============================================
//이메일 체크
//============================================
function email_CHK(emailad) 
{ 
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/; 
	var check=/@[\w\-]+\./; 
	var checkend=/\.[a-zA-Z]{2,3}$/; 

   if(((emailad.search(exclude) != -1)||(emailad.search(check)) == -1)||(emailad.search(checkend) == -1))
   { 
	   return false; 
   }else 
   { 
  		return true;
   } 
} 

//============================================
//스페이스 체크 함수
//============================================
function CheckSpaces(strValue) 
{
	var flag=true;

	if (strValue!="") 
	{
		for (var i=0; i < strValue.length; i++) 
		{
			if (strValue.charAt(i) != " ") 
			{
				flag=false;
				break;
			}
		}
	}
	return flag;
}



//============================================
// 필수입력 체크 및 길이 체크 함수 
//		CheckSpaces();
//		성공:true 실패: alert() 띄우고 return false
//============================================
function chk_len(theitem, maxlength, strTitle)
{
	var tmpStr;;
	tmpStr = theitem.value;
	
	if (CheckSpaces(tmpStr))
	{{
		alert(strTitle + '을(를) 입력하세요.');
		theitem.value = '';
		theitem.focus();
		return false;
	}}
	
	return cal_len(theitem, tmpStr, maxlength, strTitle);
	
}

//============================================
// 미필수입력 길이 체크 함수
//============================================
function unfinChk_len(theitem, maxlength, strTitle)
{
	var tmpStr;;
	tmpStr = theitem.value;
	
	return cal_len(theitem, tmpStr, maxlength, strTitle);
}


//============================================
// 길이 체크 함수 
//============================================
function cal_len(theform,str,maxlength, strTitle) 
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;
	 
	tmpStr = new String(str);
	temp = tmpStr.length;

	for (k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);

		if (escape(onechar).length > 4) {
			tcount += 2;
			max_char=maxlength/2; 
		}
		else if (onechar!='\r') {
			tcount++;
			max_char=maxlength; 			
		}
	}

	if(tcount>maxlength) {
		reserve = tcount-maxlength;
		alert(strTitle + "은(는) " + max_char+"자 이상 입력하실 수 없습니다.\n한글은 2자로 계산됩니다."); 
		
		theform.select();
		theform.focus();
		return false;
	}
	return true;
}

//이미지 미리 보기
function ImagePreView(what) { 
	var imgwin = window.open("","WIN","scrollbars=yes,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10,top=0,left=0"); 
	imgwin.focus(); 
	imgwin.document.open(); 
	imgwin.document.write("<html>\n"); 
	imgwin.document.write("<head>\n"); 
	imgwin.document.write("<title>Image</title>\n"); 
	imgwin.document.write("<sc"+"ript>\n"); 
	imgwin.document.write("function resize() {\n"); 
	imgwin.document.write("pic = document.il;\n"); 
	imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
	imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 80; myWidth = eval(pic).width + 30;\n"); 
	imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 
	imgwin.document.write("  clearTimeout();\n"); 
	imgwin.document.write("  var height = screen.height;\n"); 
	imgwin.document.write("  var width = screen.width;\n"); 
	imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
	imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
	imgwin.document.write("  self.resizeTo(myWidth, myHeight);\n"); 
	imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
	imgwin.document.write("</sc"+"ript>\n"); 
	imgwin.document.write("</head>\n"); 
	imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
	imgwin.document.write("<center><a href='javascript:window.close()'><img border=0 src='"+what+"' xwidth=100 xheight=9 name=il onload='resize();'></a>\n");
	imgwin.document.write("</center>");
	imgwin.document.write("</body>\n"); 
	imgwin.document.close(); 
}

//■■■■■■■■■■■■■■■■■■■■■■
//■         레이어 팝업 설정 관련          ■
//■■■■■■■■■■■■■■■■■■■■■■

//============================================
// 레이어 팝업 BG 설정 
//============================================
function OpenPageLayer(popName) {

	var bg = $("BGLayer");

	if(!bg) {
		bg = document.createElement("div");
		bg.setAttribute("id","BGLayer");
		with (bg.style) {
			position = "absolute";
			top = 0;
			left = 0;
			width = "100%";
			height = "100%";
			filter = "Alpha(Opacity=60)";
			opacity = "0.5";
			index = "1000";
			backgroundColor = "#cccccc";
		}
		document.body.appendChild(bg);
	}

	bg.style.display = '';
//	bg.onclick = function(){ClosePageLayer(popName);};

	if ($("wrap")) {
		if ($("BGLayer").getHeight() < $("wrap").getHeight()) $("BGLayer").style.height = $("wrap").getHeight() + "px";
//		if ($("BGLayer").getWidth() < $("wrap").getWidth()) $("BGLayer").style.width = $("wrap").getWidth() + "px";
		if ($("BGLayer").getWidth() < document.body.scrollWidth) $("BGLayer").style.width = document.body.scrollWidth + "px";
 
	}
}
//============================================
// 레이어 팝업 종료(닫기)
//============================================
function ClosePageLayer(popName) {
	var chk = 0;
	var objBg = $("BGLayer");
	var objBody = $("LayerBody");
	var objPop = $(popName);
	var retResult = $("LayerBody").immediateDescendants();
	var objIfrm = $("DivFrame_" + popName)


	retResult.each(function(value, index) {chk ++;});

	if (chk > 1) {
		if (objPop) {
			objIfrm.src = "";
			objPop.remove();
		}
	} else {
		if (objBg) objBg.remove();
		if (objPop) {
			objIfrm.src = "";
			objPop.remove();
		}
		if (objBody) objBody.remove();
	}

	objBg = null;
	objPop = null;
	objBody = null;
	retResult = null;
	objIfrm = null;
}
//============================================
// 레이어 팝업 생성
//============================================
function CreateFrame(popName, url, w, h) {
	var indexnum = 1100;		// 레이어 index 기본값

	//Background 설정
	OpenPageLayer(popName);


	//팝업 레이어 Body 영역 설정
	var LayerBody = $('LayerBody');

	if(!LayerBody) {
		LayerBody = document.createElement('div');
		LayerBody.setAttribute('id','LayerBody');
		with (LayerBody.style) {
			position = 'absolute';
			top = 0;
			left = 0;
			width = '100%';
			height = '100%';
			index = '1001';
		}
		document.body.appendChild(LayerBody);
	}


	//팝업 레이어 Body에 속한 레이어 개수 확인 (인덱스 설정)
	var retResult = $('LayerBody').immediateDescendants();
	retResult.each(function(value, index) {
			indexnum += 100;
		}
	);


	//팝업 레이어 생성
	var objPop = $(popName);
	if (!objPop) {
		objPop = document.createElement("div");
		objPop.setAttribute("id",popName);
		LayerBody.appendChild(objPop);
	}
	with (objPop.style) {
		display = "";
		position = "absolute";

		if (document.body.clientHeight <= document.body.scrollHeight) {
			top = (Position.realOffset($('BGLayer'))[1] + ((document.body.clientHeight) / 2 - parseInt(h) / 2)) + "px";
		} else {
			top = ((document.body.clientHeight) / 2 - parseInt(h) / 2) + "px";
		}

		if (parseInt(top.replace("px","")) < 20) top = "20px";

		left = ((document.body.clientWidth) / 2 - parseInt(w) / 2) + "px";
		width = w + "px";
		height = h + "px";
		index = indexnum;
		borderStyle = "solid";
		borderColor = "#333333";
		borderWidth = "2px";
		backgroundColor = "#ffffff";
	}


	//팝업 레이어에 Move 텝 설정
	var objPopTop = $("DivTop_" + popName);
	if (!objPopTop) {
		objPopTop = document.createElement("div");
		objPopTop.setAttribute("id","DivTop_" + popName);
		objPop.appendChild(objPopTop);
	}
	with (objPopTop.style) {
		display = "";
		position = "absolute";
		top = 0;
		left = 0;
//		textAlign = "right";
//		verticalAlign = "bottom";
//		cursor = "move";
		width = "100%";
		height = "20px";
		index = "200";
		backgroundColor = "#333333";	//#999acb
	}
	objPopTop.innerHTML = "<a href=\"\" onclick=\"ClosePageLayer('"+popName+"'); return false;\" style=\"padding:5px; float:right;\"><img src=\"/images/button/b_s_close.gif\" alt=\"close\" /></a>"; 


	//팝업 레이어에 iframe 및 URL 설정
	var objIfrm = $("DivFrame_" + popName);
	if (!objIfrm) {
		objIfrm = document.createElement("iframe");
		objIfrm.setAttribute("id","DivFrame_" + popName);
		objIfrm.setAttribute("name","DivFrame_" + popName);
		with (objIfrm.style) {
			position = "relative";
			top = "20px";
			width = w + "px";
			height = (parseInt(h)-20) + "px";
		}
		objIfrm.frameBorder = "0";
		objIfrm.scrolling = "no";
		objIfrm.src = url;
		objPop.appendChild(objIfrm);
	}


	//팝업 레이어 드래그 설정
//	new Draggable(popName, {endeffect : false});
}
//============================================
// 레이어 팝업 크기 자동 변경
//============================================
function ResizePageLayer(popName) {
	try {
		if ($("wrap")) {		 			
			parent.$(popName).style.height = ($("wrap").getHeight() + 20) + "px";
			parent.$("DivFrame_" + popName).style.height = $("wrap").getHeight() + "px";
		}
	}
	catch (e) {
	}
}


//■■■■■■■■■■■■■■■■■■■■■■
//■            Ajax Request 관련           ■
//■■■■■■■■■■■■■■■■■■■■■■

//============================================
// Object 초기화
//============================================
function clearObject(obj_name, obj_TextNode) {
	var obj = $(obj_name);
	if (obj) {
		while (obj.childNodes.length > 0) obj.removeChild(obj.firstChild);

		opt = document.createElement("option");
		opt.value = "";
		opt.appendChild(document.createTextNode(obj_TextNode));
		obj.appendChild(opt);
	}
}

var fnm, fp1, fp2, fa1, fa2;
function popSearchPost(form, po1, po2, ad1, ad2) {
	fnm = form;
	fp1 = po1;
	fp2 = po2;
	fa1 = ad1;
	fa2 = ad2;

	var url = "/common/inc/pop_search_post.asp?popName=searchPost";
	CreateFrame("searchPost", url, "400", "400");
}

function ImgResize(obj, w, h) {
	var iw = obj.width;
	var ih = obj.height;

	if (w != 0 || h != 0) {
		if (w == 0) {
			if(obj.height > h) obj.height = h;
		} else if (h == 0) {
			if(obj.width > w) obj.width = w;
		} else {
			if (iw/w > ih/h) {
				if(obj.width > w) obj.width = w;
			} else {
				if(obj.height > h) obj.height = h;
			}
		}
	}
}

//업로드 파일명 체크
function FileCheck(file,imgchk){

	//파일명만 추출하자..
	var str = file.value;
	var pos = str.lastIndexOf("\\");
	var ln = str.lastIndexOf(".");
	var filename = str.substring(pos + 1, ln);
	var extname = str.substring(ln + 1);
	extname = extname.toLowerCase();
	
	/*
	var regexp = /^[a-zA-Z0-9_]*$/i;

	if(!regexp.test(filename)) {    
		alert("파일명은 영문과 숫자만 사용하실 수 있습니다.");
		return 0;
	}
	*/
	
	if (imgchk == "Y") {
		if (extname != "jpg" && extname != "jpeg" && extname != "png" && extname != "gif" && extname != "bmp") {    
			alert("이미지파일만 업로드 가능합니다.");
			return 0;
		}
	}

	return 1;
}

//인풋박스에 번호만 넣는 함수
function OnlyNumber( Ev ){ 

    var evCode = ( window.netscape ) ? Ev.which : event.keyCode ; 
	
    /* FF일 경우 Ev.which 값을, 
        IE을 경우 event.keyCode 값을 evCode에 대입 */ 
    if ( ! ( evCode == 0 || evCode == 8 || ( evCode > 47 && evCode < 58 ) ) ) { 
    /* 눌러진 키 코드가 숫자가 아닌 경우 
        ( '0'은 FF에서 Tab 키, 
          '8'은 FF에서 BackSpace가 먹히지 않아 삽입)    */ 
        if ( window.netscape ) {        // FF일 경우 
            Ev.preventDefault() ;        // 이벤트 무효화 
        } else {                                // IE일 경우 
            event.returnValue=false;    // 이벤트 무효화 
        } 
    } 
}

function callModalWindow(tempkey, idx, datagubun) {
	var style = "dialogWidth:420px;dialogHeight:270px;center:1status:0;";
	window.showModalDialog("/common/inc/pop_upfile.asp?tempkey="+tempkey+"&idx="+idx+"&datagubun="+datagubun, window, style);
}

function callModalWindow2(type, gubun) {
	var style = "dialogWidth:420px;dialogHeight:270px;center:1status:0;";
	window.showModalDialog("/common/inc/pop_file.asp?type="+type+"&gubun="+gubun, window, style);
}

function callModalWindow3(tempkey, idx, datagubun) {
	var style = "dialogWidth:420px;dialogHeight:270px;center:1status:0;";
	window.showModalDialog("/common/inc/pop_upfile2.asp?tempkey="+tempkey+"&idx="+idx+"&datagubun="+datagubun, window, style);
}


// 스킨이 여러개 일 경우 사용합니다.
//var g_tdupload_skinSwfFile = "";

// 창이 뜰 때 자동으로 읽어올 파일을 지정합니다.
// 여러개이면 세미콜론(;)으로 구분한다. ex)"image-url;image-url"
//var g_tdupload_editImageUrl = "image-url";

// 이미지 편집기 open 함수입니다.
function onShowTdUpload() {
	var url = "/common/tdupload/tdupload.html";
	var width = 800;
	var height = 600;
	var features = 'width=' + width + ',height=' + height + 'toolbar=no,menubar=no,resizable=yes,scrollbars=no,scrolling=no,location=no';
	window.open(url, "ImgMultiUpload", features);
}

// 업로드가 정상적으로 완료되면 호출합니다.
// 이 함수의 내용은 업로드 처리 내용을 다루는 예제입니다.
// 처리해야되는 내용에 맞게 수정해야 됩니다.
// response: 업로드를 처리하고 서버페이지에서 반환한 문자열

function tduploadClose(response) {	
	if (response.substr(0,2) == 'OK') {
		var files = null;
		var html = "";

		try {
			files = eval("[" + response.substr(3) + "]"); //substr(3):반환받은 문자에서 필요없는 문자("OK,")를 잘라낸다.
		}
		catch (e) {
			alert(e.message);
		}
	
		if (files != null) {
			for (var i = 0; i < files.length; i++) {	
				html = html + '<p><img src="' + files[i].storageUrl + '" style="float:' + files[i].align + '; clear:both;" /></p>'				
				/*
				Editor.modify ({			
					"content": '<p><img src="' + files[i].storageUrl + '" style="float:' + files[i].align + '; clear:both;" /></p>' + Editor.getContent()
					processor
				});					
				*/				
			}

			//Editor.getCanvas().pasteContent(html, true, { 'style': { 'textAlign': 'left' } });
			Editor.getCanvas().pasteContent(html, false, '');
		}
	}
	else {
		Editor.modify({			
			"content": Editor.getContent() + '<p>IMG Fail</p>'
		});	
	}
}	

function ImgResize(size, div_name) {
	// DivContents 영역에서 이미지가 maxsize 보다 크면 자동 리사이즈 시켜줌
	var maxsize = size; // 가로사이즈 ( 다른값으로 지정하면됨)
	var content = document.getElementById(div_name);
	var img = content.getElementsByTagName("img");
	for(i=0; i<img.length; i++) {
//		alert( eval('img[' + i + '].width'));
		if ( eval('img[' + i + '].width > maxsize') ) {
			var heightSize = ( eval('img[' + i + '].height')*maxsize )/eval('img[' + i + '].width') ;
			eval('img[' + i + '].width = maxsize') ;
			eval('img[' + i + '].height = heightSize') ;
		}
	}
}

/**
 * @author ysfl
 * @since 11.05.09
 * @deprecated zipcode 필드2개일 경우 저장할 필드 선택
 * @param str - 1. zipcode 넣은 필드명, 2. addr 넣을 필드명
 * @return 검색후 반환된 우편번호와 주소
 */
function ZipCode2(zipin, addrin) {
	open("/common/inc/zipcode_search2.asp?zipin="+zipin+"&addrin="+addrin, "zipcode", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=420, height=350");
}

/**
 * @author ysfl
 * @since 11.05.09
 * @deprecated ID, NICK 중복체크
 * @param str - 1. Gu ID인지 NICK인지 구분, 2. val 데이터, 3. 체크 return 필드, 4. 데이터 return 필드
 * @return 검색후 반환된 카운트수
 */
function ID_Nick_Check(key, val, check, item) {
	open("/common/inc/ID_Nick_Check.asp?key="+key+"&val="+val+"&che="+check+"&item="+item, "duplication", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=420, height=200");
}

/**
 * @author ysfl
 * @since 11.05.09
 * @deprecated 필요문자 검사
 * @param str - 
 * @return 포함된 글자 체크 후 사용여부 반환
 */
function CheckChar(str, startnum, endnum, allowStr, YN) {
	var str = str;
	var startnum = startnum;
	var endnum = endnum;
	var allowStr = allowStr;
	var YN = YN;

    var i;
    var char;
	
	if (startnum != 0 && endnum != 0) {
		if (str.length < startnum || str.length > endnum) {return false;}
	}

    for (i = 0; i < str.length; i++) {
        char = str.charAt(i);
		// 포함 해야할것
		if (YN == "Y") {
			if (allowStr.indexOf(char) < 0) {
				return false;
			}
		} 
		// 포함해선 안될것
		else if (YN == "N") {
			if (allowStr.indexOf(char) != -1) {
				return false;
			}
		}
	}
    return true;
}

/**
 * @author ysfl
 * @since 11.05.09
 * @deprecated 첫글자 검사
 * @param str - 
 * @return 첫번째 필요한 문자 검사
 */
function firstCheckChar(str, allowStr) {
	var str = str;
	var allowStr = allowStr;

	if (allowStr.indexOf(str.substr(0,1)) < 0) {
		return false;
	}

    return true;
}


/**
 * @author ysfl
 * @since 11.05.09
 * @deprecated 숫자만 입력가능.
 * @param str - 
 * @return 숫자말고는 안눌림
 * @description onKeyPress 이벤트 사용할것..!!
 */
function check_num()	 {
	if (((event.keyCode < 48) || (event.keyCode > 57)) && (event.keyCode != 13))
	{
		event.returnValue = false;	
		return false;
	}
	return false;
}

function trim(value) {  
	return value.replace(/^\s+|\s+$/g,"");  
}  


		
// SNS 연동 자바스크립트 //
function pstCLog(link,title,thumbnail,summary,writer) {
	var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
	var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
	/*
	if ( a ) {
		a.focus();
	}
	return;
	*/
}
function pstTwitter(msg,url) {
	var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
	var a = window.open(href, 'twitter', '');
	return;
}
function pstMe2Day(msg,url,tag) {
	var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
	var a = window.open(href, 'me2Day', '');
	return;
}
function pstFaceBook(msg,url) {
	var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
	var a = window.open(href, 'facebook', '');
	return;
}

function pstYozmDaum(link,prefix,parameter) {
	var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "&parameter=" + encodeURIComponent(parameter);
	var a = window.open(href, 'yozm', 'width=466, height=356');
	
	return;
}

function PopupPDF(ref) {
	open(ref, "PDF", "toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=800, height=700");
}

function PopupMobile(ref) {
	open(ref, "PDF", "toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=817, height=700");
}
function PopupPoint(ref) {
	open(ref, "PDF", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=520, height=500");
}

function PopupRing(ref) {
	open(ref, "PDF", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=352, height=450");
}


