function isInserted(msg) {


		if(arguments.length > 1) {

			for(i=1; i<arguments.length; i++) {

				if(arguments[i] && arguments[i].value.replace(/ /g, '') == '') {

					if(msg != '') {
						alert(msg + ' ÀÔ·ÂÇÏ¼¼¿ä');

					}

					arguments[i].focus();
		
			return false;
				}
			}
		}
		return true;

	}
	
	
		function xmlhttp(ischekURL){
	
		var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.open("GET", ischekURL, "false");
		xmlhttp.send();
		
		return xmlhttp.responseText;
 
	}
	

var ckflag = false ;


//ÀüÃ¼¼±ÅÃ ÀüÃ¼ ÇØÁ¦
function ChkAll(check) {
	var frm=document.frm;
    for(i = 0; i < frm.elements.length; ++i) {
		var ele=frm.elements[i];
       if(ele.name == 'cklist' && ele.disabled != true){
			ele.checked = check;
		}
    }
}

//*¿£ÅÍ°Ë»ö
function EnterSearch()
{
	if(window.event.keyCode == 13)
	{
		SearchData();
	}
}

//ÅëÇÕ°Ë»ö
function SearchData(){
	frm.action = "/SH/ShMain001.asp"
	frm.submit();
} 
//ÅëÇÕ°Ë»ö
function SearchData2(){
	searchFrm.action = "/SH/ShMain001.asp"
	searchFrm.submit();
} 

//*¿£ÅÍ°Ë»ö
function EnterSearch2()
{
	if(window.event.keyCode == 13)
	{
		SearchData2();
	}
}


function ChkAll2(check) {
	var frm=document.frm;
    for(i = 0; i < frm.elements.length; ++i) {
		var ele=frm.elements[i];
       if(ele.name == 'cklist2' && ele.disabled != true){
			ele.checked = check;
		}
    }
}

function chkNumber(objectX) {
	e = window.event; //À©µµ¿ìÀÇ event¸¦ Àâ´Â°ÍÀÔ´Ï´Ù. ±×³É ½áÁÖ½ÉµË´Ï´ç.

		if(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode == 8 || e.keyCode == 46 || e.keyCode == 9 || e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode == 17 || event.ctrlKey && e.keyCode == 67 || event.ctrlKey && e.keyCode == 86 || event.ctrlKey && e.keyCode == 88 || e.keyCode >= 33 && e.keyCode <= 36) {
		if(e.keyCode == 48 || e.keyCode == 96) {
			 if(objectX.value == "" ) //¾Æ¹«°Íµµ ¾ø´Â»óÅÂ¿¡¼­ 0À» ´­·¶À»°æ¿ì
				e.returnValue=false; //-->ÀÔ·ÂµÇÁö¾Ê´Â´Ù.
			else //´Ù¸¥¼ýÀÚµÚ¿¡¿À´Â 0Àº
				return; //-->ÀÔ·Â½ÃÅ²´Ù.
		}
		else //0ÀÌ ¾Æ´Ñ¼ýÀÚ
			return; //-->ÀÔ·Â½ÃÅ²´Ù.
	}
	else //¼ýÀÚ°¡ ¾Æ´Ï¸é ³ÖÀ»¼ö ¾ø´Ù.
		e.returnValue=false;
}

//ÀüÃ¼¼±ÅÃ
function checkflag() {
	if (!ckflag){
		ckflag = true ;
	} else{
	ckflag = false ;
	}
	ChkAll(ckflag);
}
	
function gfProgressiveBar(psDIV, pbFLAG)
{
 var loBAR  = eval("document.all." + psDIV);
 var loBODY = document.body;

 loBAR.style.width     = 350;
 loBAR.style.height    = 115;
 loBAR.style.position  = "absolute";
 loBAR.style.pixelTop  = (loBODY.scrollTop  + (loBODY.clientHeight / 2) - (parseInt(loBAR.style.height) / 2));
 loBAR.style.pixelLeft = (loBODY.scrollLeft + (loBODY.clientWidth  / 2) - (parseInt(loBAR.style.width)  / 2));
 loBAR.style.display   = pbFLAG ? "block" : "none";
}


function SearchCate(str1, sCateName){	
	if (str1 != ""){
		i_frm.location.href = "/comn/comn_GetSubCategory.asp?subCateName="+sCateName+"&catID=" + str1 + "" ;
	}
	else{
		document.all(sCateName+"TD").innerHTML = "" ;
	}
}

function SearchCateSelect(str1, sCateName, sCateID){	
	if (str1 != ""){
		i_frm.location.href = "/comn/comn_GetSubCategory.asp?subCateName="+sCateName+"&catID=" + str1 + "&catSubID=" + sCateID;
	}
	else{
		document.all(sCateName+"TD").innerHTML = "" ;
	}
}

function cngUseFlag(tb, fd, idx, val) {
	if (val == 'Y') {
		comment = "³ëÃâ"
	}
	else {
		comment = "³ëÃâ¾ÈÇÔ"
	}

	if (confirm("ÇöÀç »óÅÂ¸¦ " + comment + "À¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?")) {
		i_frm.location = "/comn/ChangeUseFlag.asp?tableName="+tb+"&fieldName="+fd+"&idx=" + idx + "&val=" + val;		
	}
}

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 swf(src,w,h){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="menu" value="false">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

//ÇÁ·Î±×·¥ ÅÛÇÃ¸´ ÆäÀÌÁö ÀÌµ¿
function gfrmMenu(bcID){
location.href= "/pg/PgRect001.asp?bcID=" + bcID + "" ;
} 

function File_Down(File){
	location.href="/Comn/download_file.asp?FilePath="+File 
}


//¾ÆÀÌÇÁ·¡ÀÓ»çÀÌÁî Á¶Àý
function resizeFrame(ifr_id, re) {
    //°¡·Î±æÀÌ´Â À¯µ¿ÀûÀÎ °æ¿ì°¡ µå¹°±â ¶§¹®¿¡ ÁÖ¼®Ã³¸®! 
    var ifr = document.getElementById(ifr_id);
    var innerBody = ifr.contentWindow.document.body;
    var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
    //var innerWidth = document.body.scrollWidth + (document.body.offsetWidth - document.body.clientWidth); 

    if (ifr.style.height != innerHeight) //ÁÖ¼®Á¦°Å½Ã ´ÙÀ½ ±¸¹®À¸·Î ±³Ã¼ -> if (ifr.style.height != innerHeight || ifr.style.width != innerWidth) 
    {
        ifr.style.height = innerHeight;
        //ifr.style.width = innerWidth; 
    }

    if (!re) {
        try {
            //innerBody.attachEvent('onclick', parent.do_resize);
            //innerBody.attachEvent('onkeyup', parent.do_resize);
            //±ÛÀÛ¼º »óÈ²¿¡¼­ Å¬¸¯¾øÀÌ Å¸ÀÌÇÎÇÏ¸é¼­ Ã¢ÀÌ ´Ã¾î³ª´Â »óÈ²ÀÌ¸é À­ÁÙ ÁÖ¼®Á¦°Å 
        } catch (e) {

        }
    }
}

function copyit(theField) {
//alert("ss");
var IE=(document.all)?true:false;
if (IE) {
	if(confirm("º¹»çÇÏ½Ã°Ú½À´Ï±î?")){
		var tempval=eval("document."+theField);
			therange=tempval.value;
			//alert(therange);
			window.clipboardData.setData("Text", therange);	
				
		}
	}
			
}
 
//iframe ReSize
function resizeIFrame(name) {
	  var the_height = document.getElementById(name).contentWindow.document.body.scrollHeight;
	  document.getElementById(name).height= the_height;
}


//¿Â¿¡¾î ÇÃ·¹ÀÌ¾î ÆË¾÷
function OnAirPlayer(cvID){
	alert(cvID+"ÁØºñÁßÀÔ´Ï´Ù.")
}

//ÂòÇÏ±â
function func_Zzim(prgId){ 
	execFrame.location.href="/Comn/Common_Zzim.asp?flg=A&pgmID="+prgId+"";
}

function func_Zzim_VOD(cvID){ 
	execFrame.location.href="/Comn/Common_Zzim.asp?flg=B&pgmID="+cvID+"";
}

function func_Zzim_Edu(evID){ 
	execFrame.location.href="/Comn/Common_Zzim.asp?flg=C&pgmID="+evID+"";
}



// ajax°´Ã¼»ý¼º
function createHttpRequest()
{
	if(window.ActiveXObject) {
		// Win e4,e5,e6 ¿ë
		try {
			return new ActiveXObject("Msxml2.XMLHTTP") ;
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP") ;
			} catch (e2) {
				return null;
			}
		}
	} else if(window.XMLHttpRequest) {
		// Win ,Mac ,linux ¿ë
		return new XMLHttpRequest() ;
	} else {
		return null;
	}
}

//ajax¸®ÅÏ°ª¹Þ±â
function sendRequest(url)
{
	var oj = createHttpRequest();
	oj.open("GET",url,false);
	oj.send();
	return oj.responseText;
}	


function newWin(f,w,h){
	window.open(f,'popup',"width="+w+",height="+h+"")
}

	
function newWinS(f,w,h){
	window.open(f,'popup',"width="+w+",height="+h+",scrollbars=yes")
}

function openPopup(v_cookieName, v_popName, v_url, v_width, v_height, v_top, v_left) 
{ 
	var noticeCookie=getCookie(v_cookieName);  // ÄíÅ°³×ÀÓ ÁöÁ¤(¾Æ¹«°Å³ª ¿µ¾î·Î)
	if (noticeCookie != "no") 
	window.open(v_url,v_popName,'width='+v_width+',height='+v_height+',top='+v_top+',left='+v_left); 
} 

//ID/PWÃ£±â
function memberPop() {
	var winWidth = 1000;
	var winHeight = 700;
	var winPosLeft = (screen.width - winWidth) / 2;
	var winPosTop = (screen.height - winHeight) / 2;

	window.open('https://members.cjenminfra.com/Lmember/forgotIdPwd.on?siteId=SID016', 'popup','width=1000,height=700,left='+winPosLeft+',top='+winPosTop+',scrollbars=yes').focus();
}

//È¸¿ø°¡ÀÔ
function memberRegister() {
	var winWidth = 1000;
	var winHeight = 700;
	var winPosLeft = (screen.width - winWidth) / 2;
	var winPosTop = (screen.height - winHeight) / 2;

	window.open('https://members.cjenminfra.com/Ljoin/joinIntro.on?siteId=SID016', 'popup','width=1000,height=700,left='+winPosLeft+',top='+winPosTop+',scrollbars=yes').focus();
}

//È¸¿øÁ¤º¸¼öÁ¤ - ºñ¹Ð¹øÈ£ º¯°æ, È¸¿ø Å»Åð Æ÷ÇÔ
function memberModify() {
	var winWidth = 1000;
	var winHeight = 700;
	var winPosLeft = (screen.width - winWidth) / 2;
	var winPosTop = (screen.height - winHeight) / 2;

	window.open('https://members.cjenminfra.com/mypage/modifyInfoFormStep1.on?siteId=SID016', 'popup','width=1000,height=700,left='+winPosLeft+',top='+winPosTop+',scrollbars=yes').focus();
}
