/*
1) ÆÄÀÏ ´Ù¿î·Îµå download(fname,dname) ( ÆÄÀÏ¸í, Æú´õ¸í)
*/
//var file_url = "http://www.whisky.co.kr"
var file_url = "http://www.diageo.co.kr"

// ¾ÕµÚ °ø¹é¹®ÀÚ ¾ø¾Ö±â

String.prototype.trim = function()

{

	return this.replace(/(^\s*)|(\s*$)/g, "");

}


 
//1) ÆÄÀÏ ´Ù¿î·Îµå
/*
	1.ÀÛÀº Ã¢ÀÌ °è¼ÓÀûÀ¸·Î ¶°ÀÖ´Â °æ¿ì ÀÖÀ½
	2. iframeÀÎ °æ¿ì Ã¢ÀÌ ³ªÅ¸³ªÁö ¾ÊÀ»°æ¿ì°¡ ÀÖÀ½
	3. Á÷Á¢ ¸µÅ© °É °æ¿ì nav.js¸¦ ÀÎ½Ä ÇÏÁö ¸øÇØ¼­ ´Ù¸¥ °æ·Î·Î ÀÌµ¿ÀÌ ºÒ°¡ ÇÔ
	4. ÇØ°áÃ¥Àº ´Ù¿î·ÎµåÃ¢(µðÀÚÀÎµÇ¾î ÀÖ´Â°Í) ¶ç¿îÈÄ ´Ý±â´Â »ç¿ëÀÚ ¼±ÅÃ
	5. ´Ù¸¥ »çÀÌÆ® Ã³·³ ´Ù¸¥ Ã¢À¸·Î targetÀ» ÁÖ¾î¼­ ±×³É ¸µÅ© °É±â °í¹ÎÇØºÁ¾ß ÇÔ

*/
function download(fname,dname,sname){
//	window.open("/common/download.asp?file="+fname+"&folder="+dname,"filedownload","width=1,height=1,top=100000,left=100000");
	window.open("/common/pop_down.asp?file="+fname+"&folder="+dname+"&subfolder="+sname,"filedownload","width=394,height=212");
}
/*
	ÆÄÀÏ ¾÷·Îµå
*/
function File_Upload(temp_dir,temp_input,temp_form,file_seq){
		window.open("/common/upload.asp?dir="+temp_dir+"&inputname="+temp_input+"&Func=setFname&form_name="+temp_form+"&file_seq="+file_seq,'upf','scrollbars=no,resizable=no,status=no,width=395,height=200,left=0,top=0');
	}	
	function upload_recruit_img(temp_dir,temp_input,temp_form,file_seq){
		window.open("/company/online_photo_pop.asp?dir="+temp_dir+"&inputname="+temp_input+"&Func=setMyImg&form_name="+temp_form+"&file_seq="+file_seq,'upf','scrollbars=no,resizable=no,status=no,width=400,height=370,left=0,top=0');
	}


	function isBlank(strName,strMsg,useFocus){
		if (strName.value.trim()){
			return false; 
		}else{
			alert(strMsg);
			if(useFocus == 'Y' ){
				cmd_focus(strName);
			}
			return true;
		}
	}

	function cmd_focus(strName){
		strName.value = '';
		strName.focus();
	}


	function isLengthInt ( theField, s, Length){
		if (theField.value == "" || theField.value == null ){
			theField.focus();
			//theField.value="";  //ÆûÃ¢¿¡ NULL°ª ¸®ÅÏ		
			alert( s + "¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
			return(false);
		}
		
		if( isNaN (theField.value) ){
			//theField.value="";  //ÆûÃ¢¿¡ NULL°ª ¸®ÅÏ
			theField.focus();
			theField.select();
			alert( s +"¿¡ ¼ýÀÚ°¡ ¾Æ´Ñ¼ö°¡ ÀÖ½À´Ï´Ù.");
			return(false);
		}
		if(Length){
			if (theField.value.length != Length){
				//theField.value="";  //ÆûÃ¢¿¡ NULL°ª ¸®ÅÏ
				theField.focus();
				theField.select();
				alert( s +"´Â "+Length+"±ÛÀÚ ÀÌ¾î¾ß ÇÕ´Ï´Ù.");
				return(false);
			}
		}
		return(true);
	}

/*
	±ÛÀÚ¼ö ¸®ÅÏ
	objform  ¿¹) form1.contents
*/
	function CheckLen(objform){
		var temp;
		var memocount;
		memocount = 0;
		len = objform.value.length;

		for(k=0;k<len;k++){
			temp = objform.value.charAt(k);
			if(escape(temp).length > 4)
				memocount += 2;
			else
				memocount++;
			}
		return memocount/2;
	}

/* byte ¼ö¸¦ ±¸ÇÔ */
function getByte(s)
{
	var len = 0;
	if ( s == null ) return 0;
	for(var i=0;i<s.length;i++)
	{
		var c = escape(s.charAt(i));
		if ( c.length == 1 ) len ++;
		else if ( c.indexOf("%u") != -1 ) len += 2;
		else if ( c.indexOf("%") != -1 ) len += c.length/3;
	}
	return len;
}



/**************************************************************************
»ç¿ë¹ý :  isEmail(ÀÌ¸ÞÀÏÁÖ¼Ò)
¸®ÅÏ : ¸ÂÀ¸¸é true , Æ²¸®¸é false
**************************************************************************/
function isEmail(s)
{
        if ( s == "" || s == null)
        { alert("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.");

            return false;
        }
        else
        {
                var i = 1;
                var sLength = s.length;

                while ((i < sLength) && (s.charAt(i) != "@"))
                {
                        i++
                }

                if ((i >= sLength) || (s.charAt(i) != "@"))
                {
                    alert("ÀÌ¸ÞÀÏÀÌ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
                    return false;
                }
                else i += 2;

                while ((i < sLength) && (s.charAt(i) != "."))
                {
                        i++
                }

                if ((i >= sLength - 1) || (s.charAt(i) != "."))
                {
                    alert("ÀÌ¸ÞÀÏÀÌ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
                    return false;
                }
                else return true;
        }
}



function setFname(fname, inputname, form_name){
		frmtarget = eval("document."+form_name+"." + inputname);
		frmtarget.value = fname;
  }

//°ü¸®ÀÚ ÆäÀÌÁö¿¡¼­ ¸¶¿ì½º ¿À¹öµÆÀ»°æ¿ì ÀÌ¹ÌÁö º¸¿©ÁÖ´Â ÇÔ¼ö
function showMSG(img,view,msg,wid){
	if(img) sMSG.innerHTML="<table border=0 cellpadding=2 cellspacing=0 width="+wid+"><tr><td><img src='"+img+"' width="+wid+" border=0><td></tr><tr><td>"+msg+"</td></tr></table>";
	else sMSG.innerHTML="";

	sMSG.style.pixelLeft=event.clientX+15;
	sMSG.style.pixelTop=event.clientY+15+document.body.scrollTop;

	if(view) sMSG.style.display="block";
	else sMSG.style.display="none";
}

function moveMSG(){
	sMSG.style.pixelLeft=event.clientX+15;
	sMSG.style.pixelTop=event.clientY+15+document.body.scrollTop;
}


/*
	* 2005-11-22
	* ÀÌÈ£ÁØ
	* ÀÌ¹ÌÁö ¿øº» »çÀÌÁî·Î º¸¿©ÁÖ±â
*/
function popView(file_path){
	window.open("/common/pop_img.asp?file_path="+file_url+file_path,"asdasdsad","scrollbars=yes,resizable=yes,width=500,height=500");
}

/*
	* 2009-06-26
	* ÀÌÀçÈÆ
	* ÀÌ¹ÌÁö ¿øº» »çÀÌÁî·Î º¸¿©ÁÖ±â file_url »èÁ¦
*/

function popView1(file_path){
	window.open("/common/pop_img.asp?file_path="+file_path,"asdasdsad","scrollbars=yes,resizable=yes,width=500,height=500");
}
/*
* 2005-11-28
* seungjin
* ½ºÅ©·¦ ÆË¾÷
*/
function scrapPage(){
	pop('/common/pop_scrap.asp','',450,250)
}

function copyPageBlog(strPage){
//	var a = "Å¬¸³º¸µå¿¡ º¹»çÇÒ ³»¿ë";
	window.clipboardData.setData('Text',strPage);
	alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.");
}
