<!--
/***********************************
¼³¸í : .NET RadioButtonList À¯È¿¼º°Ë»ç : Ã¼Å©¿©ºÎ°Ë»ç
¿¹) getCheck_NetRadioButtonList(objectName, mode) Æû.ÀÌ¸§, ¸Þ¼¼Áö)
¸®ÅÏ) Ã¼Å©¾ÈµÇ¾î ÀÖÀ¸¸é false Ã¼Å©µÇ¾î ÀÖÀ¸¸é ¾Æ´Ï¸é true
 ****************************************/
	var re___chk = false;
	var re___value = "";

	function getCheck_NetRadioButtonList(obj_id)
	{
		re___chk = false;

		recurObj(document.getElementById(obj_id), "check");

		var chked = re___chk;
		re___chk = false;

		return chked;
	}

	function recurObj(obj, mode)
	{
		var cnt = obj.childNodes.length;
		try
		{
			if (obj.tagName.toLowerCase() == "input")
			{
				var tmp = document.getElementById(obj.id);
				if(tmp.checked)
				{
				    switch (mode)
				    {
				        case "check" : re___chk = true; return; break;
				        case "value" : re___value = tmp.value; return; break;
				    }
				}
			}
		}
		
		catch(oEx)
		{
			//error 
		}
		
		if (cnt > 0)
		{
			for(var i = 0; i < cnt; i ++)
			{
				recurObj(obj.childNodes[i], mode);
			}
		}
	}


/***********************************
¼³¸í : .NET RadioButtonList À¯È¿¼º°Ë»ç : Ã¼Å©¿©ºÎ°Ë»ç
¿¹) getCheck_NetRadioButtonList(objectName, mode) Æû.ÀÌ¸§, ¸Þ¼¼Áö)
¸®ÅÏ) Ã¼Å©µÈ value°ª
 ****************************************/

	function getCheck_NetRadioButtonListValue(obj_id)
	{
		recurObj(document.getElementById(obj_id), "value");

		var checkValue = re___value;
		re___value = "";

		return checkValue;
	}

/************* Check Date ***************/

function cf_fmtDate(gubun){
	if((event.keyCode<48)||(event.keyCode>57))return false;
	var em=event.srcElement;	
	if((gubun==1)&&(em.value.length==4)){em.value=em.value+"-";return;}
	if(gubun==1){return;}
	if((em.value.length==4)||(em.value.length==7))em.value=em.value+"-";
}
function cf_chkDate(gubun){
	var val=event.srcElement.value;
	if(val.length==0)return;
	var yyyy=val.substr(0,4);
	var mm=val.substr(5,2)-1;
	var dd=val.substr(8,2);
	if(gubun==1){dd="01";}
	var d=new Date(yyyy,mm,dd);
	if(gubun==1){
		if((val.length!=7)||(d.getFullYear()!= yyyy)||(d.getMonth()!= mm)){
			alert("Invalid Date..");return false;
		}else{return;}
	}
	if((val.length!=10)||(d.getFullYear()!=yyyy)||(d.getMonth()!= mm)||(d.getDate()!= dd)){
		alert("Invalid Date..");return false;
	}
}


/***********************************
¼³¸í : Æû¿¡¼­ °ø¹é Ã¼Å©ÇØ¼­ °ø¹éÀÌ¸é ¸Þ¼¼Áö º¸¿©Áö°í ÇØ´ç Æû°ª¿¡ Æ÷Ä¿½º
¿¹) checkSpace(frm,strMsg) checkSpace(Æû.ÀÌ¸§, ¸Þ¼¼Áö)
¸®ÅÏ) °ø¹éÀÌ¸é false °ø¹éÀÌ ¾Æ´Ï¸é true
 ****************************************/
function checkSpace(frm,strMsg){
	var str = frm.value
	//if (str.search(/\S/)<0){			//\S °ø¹éÀÌ ¾Æ´Ñ ¹®ÀÚ¸¦ Ã£´Â´Ù.
	if (str.search(/[0-9a-z°¡-ÆR]/ig)<0){
		alert (strMsg);
		frm.value = "";
		frm.focus();
		return false;
	}
	var temp=str.replace(' ','');
	if (temp.length == 0){
		alert (strMsg);
		frm.value = "";
		frm.focus();
		return false;
	}
	return true;
}

	/************************************************************
	¼³¸í : ÁÖ¹Î¹øÈ£ Ã¼Å© ÇÔ¼ö
	¿¹)checkJumin(ÁÖ¹Î¹øÈ£)
	°ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false
	°ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
	************************************************************/
	function checkJumin(it){
		IDtot = 0;
		IDAdd = "234567892345";

		for(i=0; i<12; i++) IDtot = IDtot + parseInt(it.substring(i, i+1)) * parseInt(IDAdd.substring(i, i+1));
		IDtot = 11 - (IDtot%11);
		if (IDtot == 10) IDtot = 0;
		else if (IDtot == 11) IDtot = 1;

		if(parseInt(it.substring(12, 13)) != IDtot) return false;
		else return true;
	}
	
	/************************************************************
	¼³¸í : ÀÔ·ÂÇÑ emailÀÌ ¿µ¹®ÀÚ¿Í @°ªÀÌ Á¤È®ÀÌ µé¾î°¡ ÀÖ´ÂÁö 
	¿¹) checkEmail("test@test.co.kr")
	°á°ú) true
	¸®ÅÏ : ÀÌ¸ÞÀÏÀÌ ¸Â´Ù¸é  True , Æ²¸®´Ù¸é false
	************************************************************/
	function checkEmail(email){
		var str='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
		var flag=0;
		var comma=0;
		for(i=0; i<email.length; i++) {
			for(j=0; j<str.length; j++) {
				if(email.charAt(i)==str.charAt(j)){
					break;
				}
			}
			if(j==str.length) {
				if(email.charAt(i)=='@'){
					flag++;
				}else if(email.charAt(i)=='.'){
					comma++;
				}else{
					return false;
				}
			}
		}
		if(flag!=1){
			return false;
		}else if((comma<1)||(comma>3)){
			return false;
		}else{
			return true;
		}
	}

	/************************************************************
	¼³¸í : ÀÔ·ÂÇÑ idÃ¼Å©
	¿¹) checkID("abc123")
	°á°ú) true
	¸®ÅÏ : ¾ÆÀÌµð°¡ ÆÐÅÏ°ú ¸Â´Ù¸é  True , Æ²¸®´Ù¸é false
	************************************************************/
	function checkID(id)
	{
		var p = /^[a-zA-z0-9\-_]{6,12}$/g;
		return p.test(id);
	}


/************************************************************
¼³¸í : »õÃ¢ ¶ç¿ö¼­ Æ÷Ä¿½º ÁÖ±â
¿¹)windowOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',°¡·Î,¼¼·Î,'±âÅ¸ ¼³Á¤')
,scrollbars=yes ,personalbar=no ,resizable=no ,directories=no ,status=no ,menubar=no
************************************************************/
function windowOpen(pUrl,pName,pW,pH,val){
	var winWidth  = window.screen.width;    //ÇØ»óµµ°¡·Î
	var winHeight  = window.screen.height;     //ÇØ»óµµ¼¼·Î
	
	// XPÀÎ °æ¿ì height 29 Ãß°¡
	//if( window.navigator.userAgent.indexOf("SV1") != -1 ) {
	//	pH += 29;
	//}
	
	var pLeft,pTop;
	pLeft = parseInt((winWidth-pW)/2);
	pTop = parseInt((winHeight-pH)/2);
	
	var newWin=window.open(pUrl,pName,"width="+pW+",height="+pH+",left="+pLeft+",top="+pTop+" "+ val );
	newWin.focus(); 
}



	//ÀÌ¹ÌÁö¸í Ã¼Å©
	function checkImg(obj)
	{
		if(obj.value!=""){		//°ªÀÌ ÀÖ´Ù¸é ÀÌ¹ÌÁö¸í Ã¼Å©
			if (!checkFileName(obj)){
				return false;
			}else{	
				return true;
			}
		}else{	//°ªÀÌ ¾ø´Ù¸é Ã¼Å© ¾ÈÇÑ´Ù.
			return true;
		}		
	}
	
	//ÆÄÀÏ¸í Ã¼Å© ÇÑ±Û ¿Ã¹Ù¸£´Ù¸é true Àß¸ø µÇ¾ú´Ù¸é false
	function checkFileName(el) {
		var _regExp=/\\\w+\.(gif|jpg)/ig;
		var _filter = el.value.match(_regExp);
		var _fileName = null;

		if (_filter == null){
			_fileName = el.value.toUpperCase();
			if (_fileName.indexOf("JPG") == -1 || _fileName.indexOf("GIF") == -1){
				alert("ÆÄÀÏ¸íÀ» [¿µ¹®][¼ýÀÚ]·Î¸¸ ÀÛ¼ºÇØÁÖ½Ã°í,\n\nÀÌ¹ÌÁö Çü½ÄÀº [JPG] ÀÌ°Å³ª [GIF] ÀÌ¾î¾ß ÇÕ´Ï´Ù.");
			}else{
				alert("[ÆÄÀÏ¸í]À» [¿µ¹®][¼ýÀÚ]·Î¸¸ ÀÛ¼ºÇØ ÁÖ½Ê½Ã¿ä.\n\n"
					+"(¿¹) È«±æµ¿_0.gif (X), hong_gil_dong.gif(O)"
				);
			}
			return false;
		}
		return true;
	}

	
	//ÀÌ¹ÌÁö È®´ëº¸±â
	//popImgWin(ÀÌ¹ÌÁö ÁÖ¼Ò)
	function popImgWin(imgSrc){

		var viewSrc;
		var src1,src2;
		if( imgSrc.lastIndexOf("/")>-1 ){
			src1 = imgSrc.substring(0, imgSrc.lastIndexOf("/")+1 );
			src2 = imgSrc.slice(imgSrc.lastIndexOf("/")+1);
		}else{
			src1 = "";
			src2 = imgSrc;
		}
		
		viewSrc = src1+escape(src2);
		
		var strhtml = "";
		
		var w = 100;
		var h = 100;
		
		var pattern = /\.(swf|asx)$/ig;//È®ÀåÀÚ ÇÃ·¡½Ã ÆÐÅÏ
		var imgPattern = /\.(jpg|gif)$/ig;//ÀÌ¹ÌÁö È®ÀåÀÚ ÆÐÅÏ
	
		//¸¸¾à ÇÃ·¡½Ã ÆÄÀÏ ÀÌ¶ó¸é
		if( pattern.test( imgSrc ) ){
			w = 400;
			h = 400;

			strhtml +="<html><head><title>È®´ëº¸±â</title><style>body{margin:0;}</style>";
			strhtml +="</head><body>";
			strhtml +="<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr>";
			strhtml +="<td align='center' valign='center'>";
			strhtml +="<embed src='"+viewSrc+"' width='100%'>";
			strhtml +="</td></tr></table></body></html>";
			
		}else if( imgPattern.test( imgSrc ) ){
		
			strhtml +="<html><head><title>ÀÌ¹ÌÁöÈ®´ëº¸±â</title><style>body{margin:0;}</style>";
			strhtml +="<s"+"cript language=\"JavaScript\">";
			strhtml +="function win_resize(){";
			strhtml +="var imgWidth  = parseInt(document.content_img.offsetWidth);";
			strhtml +="var imgHeight = parseInt(document.content_img.offsetHeight);";
			strhtml +="var winWidth  = window.screen.width;";
			strhtml +="var winHeight  = window.screen.height;";
			strhtml +="var reWidth,reHeight;";
			strhtml +="if(imgWidth>winWidth-100){";
			strhtml +="reWidth  = winWidth-100;";
			strhtml +="}else{";
			strhtml +="reWidth = imgWidth+30;";
			strhtml +="}";
			strhtml +="if(imgHeight>winHeight-100){";
			strhtml +="reHeight = winHeight-100;";
			strhtml +="}else{";
			strhtml +="reHeight = imgHeight+35;";
			//strhtml +="if(window.navigator.userAgent.indexOf(\"SV1\") != -1)reHeight+=29;";
			strhtml +="}";
			strhtml +="window.resizeTo(reWidth,reHeight);";
			strhtml +="window.moveTo(parseInt((winWidth-reWidth)/2),parseInt((winHeight-reHeight)/2));";
			strhtml +="window.focus();";
			strhtml +="}";
			strhtml +="</s"+"cript>";
			strhtml +="</head><body onload='win_resize()'>";
			strhtml +="<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr>";
			strhtml +="<td align='center' valign='center'>";
			strhtml +="<img src='"+viewSrc+"' name='content_img' id='content_img' border=0 onclick='window.close();' style='cursor:hand;'>";
			strhtml +="</td></tr></table></body></html>";
		}else{
			location.href = "/etc/down.aspx?sfname="+viewSrc+"&ofname="+src2;
			return;
		}
		
		var imageWin = window.open('', "imageWin", "width="+ w +", height="+ h +", top=100,left=100,scrollbars=1,resizable=1,toolbar=0,menubar=0,location=0,directories=0,status=0"); 
		imageWin.document.open(); 
		imageWin.document.write(strhtml);
		imageWin.document.close();
		imageWin.focus();
	}

/***********************************************************
ÇÔ¼ö¸í			:newXMLHttpRequest()
Ã³¸®³»¿ë		:¿äÃ»°´Ã¼¸¦ »ý¼ºÈÄ ¹ÝÈ¯
***********************************************************/
// function from http://www-128.ibm.com/developerworks/kr/library/j-ajax1/index.html
function newXMLHttpRequest() {
	var xmlreq = false;
	if (window.XMLHttpRequest) {
		// Create XMLHttpRequest object in non-Microsoft browsers
		xmlreq = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		// Create XMLHttpRequest via MS ActiveX
		try {
			// Try to create XMLHttpRequest in later versions
			// of Internet Explorer
			xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			// Failed to create required ActiveXObject
			try {
				// Try version supported by older versions
				// of Internet Explorer
				xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				// Unable to create an XMLHttpRequest with ActiveX
			}
		}
	}
	return xmlreq;
}

//¼³¸í : xmlHttp.open() 
//¿¹Á¦ : open("GET", "http://www.ÁÖ¼Ò.com/ÁÖ¼Ò.htm", true, null, "TEXT", "Ã³¸®ÇÔ¼ö");
//method : "GET" or "POST"
//url : ¼­¹öÁÖ¼Ò
//async : true(ºñµ¿±â), false(µ¿±â)
//content : method°¡ POSTÀÏ¶§ ÆÄ¶ó¹ÌÅÍ°ª ÀÔ·Â, GETÀÏ¶§´Â ÁÖ·Î NULL »ç¿ë
//Request : "XML" or "TEXT"
//Function : °ªÀ» ¹Þ¾Æ Ã³¸®ÇÒ Æã¼Ç ÀÌ¸§ 
function Ajax_open( sMmethod, sUrl, sAsync, sContent, sRequest, sFunction){
	var xmlHttp = newXMLHttpRequest();
	if( !xmlHttp ){
		alert("XMLHTTP Object »ý¼º ¿¡·¯ÀÔ´Ï´Ù.");
		return;
	}
	
	xmlHttp.open(sMmethod, sUrl, sAsync);
	
	if( sMmethod=="POST" ){
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	}

	xmlHttp.onreadystatechange = function() {
    	
	        if(xmlHttp.readyState == 4){ //COMPLETE(4)
	        	
			if( xmlHttp.status == 200 ){

				if( sRequest=="XML" ){
					eval(sFunction+'(xmlHttp.responseXML);');
				}else{
					eval(sFunction+'(xmlHttp.responseText);');
				}
			}else{
				alert("¿À·ù:"+xmlHttp.status);
			}       
		}
	}
	xmlHttp.send(sContent);		
}
	
function Ajax_open2(sMmethod, sUrl, sAsync, errorUrl){
	var xmlHttp = newXMLHttpRequest();
	if( !xmlHttp ){
		alert("ÀÏ½ÃÀûÀÎ ¿À·ùÀÔ´Ï´Ù. ´Ù½Ã ½ÃµµÇØ ÁÖ½Ê½Ã¿À.");
		location.replace = errorUrl;
		return;
	}
	
	xmlHttp.open(sMmethod, sUrl, sAsync);
	
	if( sMmethod=="POST" ){
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	}
    	
	if(xmlHttp.readyState == 4){ //COMPLETE(4)
        	
		if( xmlHttp.status != 200 ){
			alert("ÀÏ½ÃÀûÀÎ ¿À·ùÀÔ´Ï´Ù. ´Ù½Ã ½ÃµµÇØ ÁÖ½Ê½Ã¿À.");
		    location.replace = errorUrl;
		}       
	}

	xmlHttp.send();		
}

	// »ç¿ë¿¹) onkeypress='Numberchk()'
	// ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô ÇÑ´Ù.
	function Numberchk(){
		if ((event.keyCode<48)||(event.keyCode>57)){
			alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
			event.returnValue=false;
		}
	}
	
	function NumOnly(field){ 
		var a = field.value; 
		for (i=0;i<a.length;i++)
		{ 
			if (a.substring(i,i+1) < '0' || a.substring(i,i+1) > '9'){ 
				alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä") 
				field.value = "";
				field.focus();
				return false; 
			} 
		}
	} 
	function NumOnlyEng(field){ 
		var a = field.value; 
		for (i=0;i<a.length;i++)
		{ 
			if (a.substring(i,i+1) < '0' || a.substring(i,i+1) > '9'){ 
				alert("please enter only number.") 
				field.value = "";
				field.focus();
				return false; 
			} 
		}
	} 


	/************************************************************
	  ÇÔ¼ö : checkHangul(hangul)
	  ¸ñÀû : ÀÔ·ÂÇÑ °ªÀÌ ÇÑ±ÛÀÎÁö ¾Æ´ÑÁö¸¦ ÆÇµ¶
	  ¹æ¹ý : hangul (ÇÑ±Û)
	          ¿¹) checkEmail("È«±æµ¿")
	        °á°ú) true
	  ¸®ÅÏ : Âü (True) , °ÅÁþ (false)
	************************************************************/
	function checkHangul(hangul)
	{
		for(i=0;i<hangul.length; i++) {
			if((hangul.charAt(i) < '°¡')||(hangul.charAt(i) > 'Èþ'))
				return false;
		}	
		return true;
	}
	
	/************************************************************
	¼³¸í : Ã¼Å© ¹Ú½º, ¶óµð¿À ¹öÆ° ¼±ÅÃ Ã¼Å©
	¿¹)checkRadio(Æû.ÀÌ¸§)
	°á°ú) Ã¼Å© ÇÑ°Ô ÀÖ´Ù¸é true Ã¼Å©ÇÑ°Ô ¾ø´Ù¸é false
	************************************************************/
	function checkRadio(InputName){
		if(InputName){
			if(!InputName.length) {
				if(InputName.checked) {
					return true;
				}
			} else {
				for(i=0;i<InputName.length;i++) {
					if(InputName[i].checked) {
						return true;
					}
				}
			}
		}
		return false;
	}

//³¯Â¥°ª Ã¼Å© ¿¹) 2006-04-05 ÀÌ·± Çü½Ä 
//¸Â´Ù¸é true Æ²¸®¸é false
function checkDateStr(str) 
{
	var pattern = /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/;
	if (!pattern.test(str)) return(false);
	else return(true);
}

//¼ýÀÚ Ã¼Å© 
//¼ýÀÚ ¸Â´Ù¸é true Æ²¸®¸é false
function check_isnumber(str) 
{
	var pattern = /^[0-9]+$/;
	return(pattern.test(str));
}


//ÀÌ¹ÌÁö ÀÚµ¿ ¸®»çÀÌÁî Ã³¸®
var arrObjImg = new Array(); //ÀÌ¹ÌÁö°´Ã¼ ´ãÀ» ¹è¿­

function set_onload_resize(img,resizeWidth){
	var imgLen = arrObjImg.length;
	arrObjImg[imgLen] = new imgClass(img, resizeWidth);
	resize_img(imgLen);
}

function imgClass(img,resizeWidth){
	this.img = img;
	this.resizeWidth = resizeWidth;
}

function resize_img(idx){
	var objImg = arrObjImg[idx].img;
	var resizeWidth = arrObjImg[idx].resizeWidth;
	if(objImg){
		if(objImg.complete == false){//ÀÌ¹ÌÁö°¡ ·Îµå µÇÁö ¾Ê¾Ò´Ù¸é
			setTimeout("resize_img("+idx+")",100);
		}else{
			if(objImg.width>resizeWidth){
				objImg.height = parseInt((resizeWidth * objImg.height) / objImg.width);
				objImg.width = resizeWidth;
				objImg.onclick=function(){window.open(objImg.src);}
			}
		}
			
	}
}

/*
javascript·Î ±¸ÇöÇÑ Request
´ë¼Ò¹®ÀÚ ±¸ºÐ¾øÀÌ
ÇØ´ç°ªÀÌ ¾øÀ»¶§ "" °ø¹é ¸®ÅÏ
*/
function Request(valuename){
	var rtnval = "";
	var nowAddress = unescape(location.href);
	var parameters = (nowAddress.slice(nowAddress.indexOf("?")+1,nowAddress.length)).split("&");
    
	for(var i = 0 ; i < parameters.length ; i++){
		var varName = parameters[i].split("=")[0];
		if(varName.toUpperCase() == valuename.toUpperCase())
		{
			rtnval = parameters[i].split("=")[1];
			break;
		}
	}
	return rtnval;
}

//¾²±â document.write 
function dw(str){
	document.write(str); 
}


//ÀÍ½ºÇÃ·Î·¯ ÆÐÄ¡¿¡ µû¸¥ ÇÃ·¡½Ã ½ºÅ©¸³·Î write Ã³¸®
//(ÇÃ·¡½ÃÁÖ¼Ò,³ÐÀÌ,³ôÀÌ,³Ñ°Ü¹ÞÀº°ª,¾ÆÀÌµð,ÀÌ¸§,¹è°æ»ö)
function flashWrite(swfUrl,swfWidth,swfHeight,bgColor,swfName,access,flashVars){
	var strFlash;
	
    /*
    strFlash ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="280" height="501" align="middle" >'
    strFlash +='<param name="allowScriptAccess" value="always" />'
    strFlash +='<param name="movie" value="'+fSrc+'" />'
    strFlash +='<param name="quality" value="high" />'
    strFlash +='<param name="bgcolor" value="#ffffff" />'
    strFlash +='<embed src="'+fSrc+'" quality="high" bgcolor="#ffffff" width="280" height="501" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	strFlash +='</object>'

    strFlash ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="280" height="501" id="left_navi_temp" align="middle">'
    strFlash +='<param name="allowScriptAccess" value="always" />'
    strFlash +='<param name="movie" value="'+fSrc+'" />'
    strFlash +='<param name="quality" value="high" />'
    strFlash +='<param name="bgcolor" value="#ffffff" />'
    strFlash +='<embed src="'+fSrc+'" quality="high" bgcolor="#ffffff" width="280" height="501" name="left_navi_temp" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	strFlash +='</object>'	
    */
    
    var strHref = document.location.href;
    
    var strHttps = "";
    if(strHref.substring(0,5)=="https") strHttps ="s";
    
	strFlash ="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http"+strHttps+"://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+swfWidth+"' height='"+swfHeight+"' align='middle' id='"+swfName+"' name='"+swfName+"' />"
	strFlash +="<param name='allowScriptAccess' value='always' />"
	strFlash +="<param name='movie' value='"+swfUrl+"' />"
	strFlash +="<param name='FlashVars' value='"+flashVars+"' />"
	strFlash +="<param name='loop' value='false' />"
	strFlash +="<param name='menu' value='true' />"
	strFlash +="<param name='quality' value='high' />"
    strFlash +="<param name='scale' value='noscale' />"
	strFlash +="<param name='bgcolor' value='"+bgColor+"' />"
	strFlash +="<param name='wmode' value='transparent' />"
	strFlash +="<embed src='"+swfUrl+"' FlashVars='"+flashVars+"' wmode='transparent'  quality='best' bgcolor='#EEF8FF' width='"+swfWidth+"' height='"+swfHeight+"' id='"+swfName+"' name='"+swfName+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
	strFlash +="</object>"

	document.write(strFlash);
}
//ÀÍ½ºÇÃ·Î·¯ ÆÐÄ¡¿¡ µû¸¥ ÇÃ·¡½Ã ½ºÅ©¸³·Î write Ã³¸®
//(ÇÃ·¡½ÃÁÖ¼Ò,³ÐÀÌ,³ôÀÌ,³Ñ°Ü¹ÞÀº°ª,¾ÆÀÌµð,ÀÌ¸§,¹è°æ»ö)
function flashWrite1(fSrc,sWidth,sHeight,fVars,fId,fName,fBgcolor){
	
	var strFlash;
	
    var strHref = document.location.href;
    
    var strHttps = "";
    if(strHref.substring(0,5)=="https") strHttps ="s";	
	
	strFlash ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http"+strHttps+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
	strFlash += ' id="'+fId+'" name="'+fName+'"';
	strFlash += ' width="'+sWidth+'" height="'+sHeight+'">';  
	strFlash += '<param name=flashVars value="'+fVars+'">';        
	strFlash += '<param name="movie" value="'+fSrc+'">';
	strFlash += '<param name="wmode" value="transparent">';
	strFlash += '<param name=bgcolor value="'+fBgcolor+'">';   
	strFlash += '<param name="quality" value="high">';
	strFlash += '<param name="menu" value="false">';
	strFlash += '<embed src="'+fSrc+'" quality="high" wmode="transparent" swLiveConnect=true pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"';
	strFlash += ' id="'+fId+'" name="'+fName+'"';	
	strFlash += ' width="'+sWidth+'" height="'+sHeight+'">';
	strFlash += '</embed></object>';
	
	document.write(strFlash);
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function FSCommand_Script(command, args) {
	goMenu(command,args);
}

// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub left_menu_temp_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call FSCommand_Script(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

//¹ÙÀÌÆ® °è»ê
function getBytes(instr) {
    var len = 0;
    for(i=0; i<instr.length; i++) {
        var chr = instr.charAt(i);
        if (escape(chr).length > 4) {
                len += 2;
        }
        else if(escape(chr) !='%0D') {
                len++;
        }
    }
    return len;
}

/*
setCookie( "Notice", "done" , 1);
(ÀÌ¸§,°ª,³¯Â¥)  ÇÏ·çµ¿¾È ÄíÅ° ÀúÀå
*/
function setCookie( name, value, expiredays ){ 
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
}

/*
getCookie(ÄíÅ°ÀÌ¸§)
*/
function getCookie(name){
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1)
		return "";
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function Trim( value ) {
	var len = value.length;
	if (len == 0) return('');
	
	var value1 = RTrim(value);
	var value2 = LTrim(value1);	
	return(value2);
}	
// String LTrim( arg )
// 		String arg ¿ÞÂÊ³¡ÀÇ °ø¹é ¹®ÀÚ(blank, tap, new-line)¸¦ Á¦°ÅÇÑ
//      ³ª¸ÓÁö ¹®ÀÚ¿­À» ¸®ÅÏÇÑ´Ù.
function LTrim( arg ) {
	var len = arg.length;
	if (len == 0) return('');
	
	var i = 0;
	for (; i < arg.length; i++) {
		var ch = arg.charAt(i);
		if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') {
			continue;
		}	
		else
			break;
	}
	return(arg.substr(i));
}

// String RTrim( arg )
// 		String arg ¿À¸¥ÂÊ³¡ÀÇ °ø¹é ¹®ÀÚ(blank, tap, new-line)¸¦ Á¦°ÅÇÑ
//      ³ª¸ÓÁö ¹®ÀÚ¿­À» ¸®ÅÏÇÑ´Ù.
function RTrim( arg ) {
	var len = arg.length;
	if (len == 0) return('');
		
	var i = len - 1;
	for (; i >= 0; i--) {
		var ch = arg.charAt(i);
		if (ch == ' ' || ch == '\t' || ch == '\n') 
			continue;
		else
			break;
	}
	return(arg.substring(0, i+1));					
}


//-------------------------------------------------
//½ºÆäÀÌ½º ÀÌµ¿
//motoSpace(À¯Àú¾ÆÀÌµð);
function motoSpace(id){
    alert("Áö±Ý±îÁö »ç¿ëÇØÁÖ½Å ¸ðÅä½ºÆäÀÌ½º°¡ 5¿ùºÎÅÍ´Â »õ·Î¿î ¸Þ´º·Î ¿ÀÇÂµË´Ï´Ù.\n°ü·ÃµÈ ÀÚ¼¼ÇÑ »çÇ×Àº <°øÁö»çÇ×>À» ²À È®ÀÎÇØÁÖ¼¼¿ä!");
    /*
    if(typeof(id)=="undefined") id="";
    Ajax_open("GET", "/myhome/MyhBridge.aspx?ajax=Y&id="+id , true, null, "TEXT", "motoResult");
    */    
}

var motoSpaceWin;
function motoResult(str){

    if(str=="no_id"){
        alert("¾ÆÀÌµð °ªÀÌ ¾ø½À´Ï´Ù.");
    }else if(str=="no_moto"){
        alert("¸ðÅä ½ºÆäÀÌ½º Á¤º¸°¡ ¾ø½À´Ï´Ù.");
    }else if(str=="no_show"){
        alert("ºñ°ø°³ ¸ðÅä ½ºÆäÀÌ½º ÀÔ´Ï´Ù.");
    }else if(str=="go_login"){
	    
	    motoSpaceWin=window.open('/myhome/MyhLogin.aspx?rturl=/myhome/MyhBridge.aspx','motoSpace',"width=900,height=600,left="+parseInt((window.screen.width-900)/2)+",top="+parseInt((window.screen.height-600)/2)+",scrollbars=no ,resizable=yes");
	    motoSpaceWin.document.location.reload();
	    motoSpaceWin.focus();
   
    }else if(str=="ok"){
    
        var main_src = "MyhMain.aspx";
        if(getCookie("moto_visit")!="Y"){
            main_src = "MyhLogin.aspx";
            setCookie("moto_visit", "Y" , 1);        
        }

        if(window.name=="motoSpace"){
            document.location.replace("/myhome/MyhMain.aspx");
        }else{
            motoSpaceWin=window.open('/myhome/'+main_src,'motoSpace',"width=900,height=600,left="+parseInt((window.screen.width-900)/2)+",top="+parseInt((window.screen.height-600)/2)+",scrollbars=no ,resizable=yes");
            motoSpaceWin.document.location.replace("/myhome/"+main_src);
            motoSpaceWin.focus();            
        }
        
        	    	       
    }else{
        alert("Error");
    }
}

function motoSpaceClose(){
    if (motoSpaceWin && motoSpaceWin.open && !motoSpaceWin.closed){
        motoSpaceWin.close(); 
    }
}
		
//°ü½É¸â¹ö µî·Ï
function member_interest(id){
    Ajax_open("GET", "/myhome/MyhBridge.aspx?interest=Y&id="+id, true, null, "TEXT", "interestResult");
}

function interestResult(str){
    if(str=="no_id"){
        alert("¾ÆÀÌµð °ªÀÌ ¾ø½À´Ï´Ù.");
    }else if(str=="no_login"){
        alert("·Î±×ÀÎ ÇÏ¼Å¾ß ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.");
    }else if(str=="no_reg"){
        alert("ÀÚ±â ÀÚ½ÅÀ» µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù.");
    }else if(str=="no_rr"){
        alert("ÀÌ¹Ì µî·ÏµÈ °ü½É¸â¹ö ÀÔ´Ï´Ù.");            
    }else if(str=="no_moto_id"){
        alert("µî·ÏÇÏ·Á´Â ¸â¹öÀÇ ¸ðÅä ½ºÆäÀÌ½º°¡ ¾ø½À´Ï´Ù.");  
    }else if(str=="no_moto_login"){
        alert("È¸¿ø´ÔÀÇ ¸ðÅä ½ºÆäÀÌ½º°¡ ¾ø½À´Ï´Ù.");  
    }else if(str=="ok"){
        alert("µî·Ï µÇ¾ú½À´Ï´Ù.");	       
    }else{
        alert("Error");
    }
}


// ¸ðÅä ÄÃÃ³
function motoCulture(tp){
    if(tp){
        if(tp=="F"){
	        windowOpen("/culture/CulFactoryList.aspx?Type=B","motoCulture",950,675,"");
	    }	    
	}else{
	    windowOpen("/culture/CulMain.aspx","motoCulture",950,675,"");
	}
}


//-------------------------------------------------




/*
function getFlashLoginCheck()
{
	var cook = {};
	cook.id = "ecj2000";
	cook.name = "¾öÃ¶Áø";
	cook.login = "true";
	return cook;
}
*/

    document.write('<script language=\"vbscript\">\n');
	document.write('		Public Function URLDecode(byVal pURL)\n');
	document.write('			Dim vPos, result, tempHex, i\n');
	document.write('			pURL = Replace(pURL, "+", " ")\n');
	document.write('			result = ""\n');
	document.write('			for i = 1 to len(pURL)\n');
	document.write('				If Mid(pURL, i, 1) = "%" Then\n');
	document.write('					If LCase(Mid(pURL, i + 1, 1)) = "u" Then\n');
	document.write('						result = result & Chr(CLng("&H" & Mid(pURL, i + 2, 4)))\n');
	document.write('						i = i + 5\n');
	document.write('					Else\n');
	document.write('						If Mid(pURL, i + 3, 1) = "%" then\n');
	document.write('							tempHex = CLng("&H" & Mid(pURL, i + 1, 2))\n');
	document.write('							If tempHex > 127 Then\n');
	document.write('								result = result & _\n');
	document.write('								Chr(CLng("&H" & Mid(pURL, i + 1, 2)) * &H100 + CLng("&H" & Mid(pURL, i + 4, 2)))\n');
	document.write('								i = i + 5\n');
	document.write('							Else\n');
	document.write('								result = result & Chr(CLng("&H" & Mid(pURL, i + 1, 2)))\n');
	document.write('								i = i + 2\n');
	document.write('							End If\n');
	document.write('						Else\n');
	document.write('							tempHex = CLng("&H" & Mid(pURL, i + 1, 2))\n');
	document.write('							If tempHex > 127 Then\n');
	document.write('								result = result & Chr("&H" & Mid(pURL, i + 1, 2) & Cstr(Hex(Asc(Mid(pURL, i + 3, 1)))))\n');
	document.write('								i = i + 3\n');
	document.write('							Else\n');
	document.write('								result = result & Chr(CLng("&H" & Mid(pURL, i + 1, 2)))\n');
	document.write('								i = i + 2\n');
	document.write('							End If\n');
	document.write('						End If\n');
	document.write('					End If\n');
	document.write('				Else\n');
	document.write('					result = result & Mid(pURL, i, 1)\n');
	document.write('				End If\n');
	document.write('			next\n');
	document.write('			URLDecode = result\n');
	document.write('		End Function\n');
	document.write('</SCRIPT>			\n');

	
	// Á¦Ç° °Ë»ö 
	function SetModCode(m_code)
	{
		//alert(m_code);
		window.location.href = "/product/PrdInfo.aspx?id=" + m_code;
		
	}

function ReplaceStr(inStr,No,Yes)
{
	var new_inStr = '';
	for( i=0;i<inStr.length;i++)
	{
		if ( No != inStr.substr(i,1) )
			new_inStr = new_inStr + inStr.substr(i,1);
		else
			new_inStr = new_inStr + Yes;
	}
	return new_inStr;
}

function DisplayYN(objName){
    if(document.getElementById(objName)){
        if(document.getElementById(objName).style.display=="none"){
            document.getElementById(objName).style.display=""
        }else{
            document.getElementById(objName).style.display="none"
        }
    }else{
        alert("ÇØ´ç ÀÚ·á°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
    }
}	




//-----------------------------------------------------------------------------
// ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô ÇÑ´Ù.
// @return : null
// ex) (text-field).onkeyup = onlyKorEngNum;
//-----------------------------------------------------------------------------
function onlyKorEngNum() {
	var oElement = (arguments[0] != null) ? arguments[0] : this;
	var charChk;

	for(var i=0; i<oElement.value.length; i++){
		charChk = oElement.value.charCodeAt(i);

		if( ((charChk < 65 || charChk > 90) && (charChk < 97 || charChk > 122)) && (charChk > 57 || charChk < 48) && (charChk > 31 && charChk < 127) ){
			alert("ÇÑ±Û, ¿µ¹®, ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			oElement.value = oElement.value.substring(0, i);
			oElement.focus();
			return;
		}
	}
}

//-->




