// ÇÃ·¡½¬(swf) ÆÄÀÏ ¸µÅ©
// ID, width, height, swfÆÄÀÏ¸í, wmode(none, transparent, opaque, ...)
//»ç¿ë¹ý showFlash(154,180,"loading2.swf");

function showFlash(w,h,s) {
  var str="", sID="";
  id="flashid";
  wmode="transparent";
  if (id.length > 0) { sID = " id='"+id+"' name='"+id+"'"; }
  str += "<object "+sID+" classid='clsid:D27CDB6E-AE6D-11cf-96B8";
  str += "-444553540000'";
  str += " codebase='http://download.macromedia.com/pub/shockwave/cabs";
  str += "/flash/swflash.cab#version=6,0,29,0'";
  str += " width='"+w+"' height='"+h+"'>";
  str += "<param name='movie' value='"+s+"'>";
  str += "<param name='quality' value='high'>";
  str += "<param name='wmode' value='"+wmode+"'>";
  str += "<embed "+sID+" src='"+s+"' quality='high' wmode='"+wmode+"'";
  str += " pluginspage='http://www.macromedia.com/go/getflashplayer'";
  str += " type='application/x-shockwave-flash'";
  str += " width='"+w+"' height='"+h+"'></embed>";
  str += "</object>";
  document.write(str);
}
//--±âÅ¸ Ã¢ ¶ç¿ì±â2-->
function openwin(w,h,URL){            			  
                                      var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ="height="+h+",";
                                          settings +="width="+w+",";
                                          settings +="top="+wint+",";
                                          settings +="left="+winl+",";
                                          settings +="scrollbars=yes," ;
                                          settings +="resizable=yes";
                                      win=window.open(URL,'openwin',settings);
                                      win.focus();  
                    }
//--±âÅ¸ Ã¢ ¶ç¿ì±â2-->
function openwin2(w,h,URL){            			  
                                      var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ="height="+h+",";
                                          settings +="width="+w+",";
                                          settings +="top="+wint+",";
                                          settings +="left="+winl+",";
                                          settings +="scrollbars=yes," ;
                                          settings +="resizable=yes";
                                      win2=window.open(URL,'openwin2',settings);
                                      win2.focus();  
                    }
//--±âÅ¸ Ã¢ ¶ç¿ì±â3-->
function openwin3(w,h,URL){            			  
                                      var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ="height="+h+",";
                                          settings +="width="+w+",";
                                          settings +="top="+wint+",";
                                          settings +="left="+winl+",";
                                          settings +="scrollbars=no," ;
                                          settings +="resizable=yes";
                                      win=window.open(URL,'openwin',settings);
                                      win.focus();  
                    }

	//----·Î±×ÀÎ Ã¼Å©----//
function chklogin(m_id, type, width, height,repath){
if(m_id){
	if (type=='up')
	{
	openwin(width, height,repath);       
	} else {
		location.href=repath;
		return;
	}
}else{
	alert('È¸¿ø Àü¿ë ¸Þ´ºÀÔ´Ï´Ù. ·Î±×ÀÎÇØÁÖ¼¼¿ä');
}
	return;
}
//----·¹º§ Ã¼Å©----//
function chklevel(m_level, type, width, height,repath){
if(m_level){
	if (type=='up')
	{
	openwin(width, height,repath);       
	} else {
		location.href=repath;
		return;
	}
}else{
	alert('È¸¿ø Àü¿ë ¸Þ´ºÀÔ´Ï´Ù. ·Î±×ÀÎÇØÁÖ¼¼¿ä');
}
	return;
}
	//----·¹º§ Ã¼Å© ¹é¾÷----//
function chklevel_backup(m_level, type, width, height,repath){
if(m_level){
	if(m_level=='5' ){
		if (type=='up')
		{
		openwin(width, height,repath);       
		} else {
			location.href=repath;
		}
	}else{
		alert('ÃÖ°í °ü¸®ÀÚ¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù');
	}
}else{
	alert('È¸¿ø Àü¿ë ¸Þ´ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎÇØÁÖ¼¼¿ä');
}
	return;
}





function rTrim(word) {
	var wordLeng = word.length;
	var i;
	var pos, first, last;

	for(i = wordLeng-1; i >= 0; i--) {
		if(word.charAt(i) != " ") break;
	}
	pos = i;
	first = 0;
	last = pos + 1;
	word = word.substring(first,last);
	return word;
}
function lTrim(word) {
	var wordLeng = word.length;
	var i;
	var pos, first, last;

	for(i = 0; i < wordLeng; i++) {
		if(word.charAt(i) != " ") break;
	}
	pos = i;
	first = pos;
	last = wordLeng;
	word = word.substring(first,last);
	return word;
}

function trim(word) {
	word = lTrim(word);
	word = rTrim(word);
	return word;
}

function trimAll(word) {
	var wordLeng = word.length;
	var i;

	for(i=0; i<wordLeng; i++) {
		word = word.replace(' ','');
	}
	return word;
}

//--±âÅ¸ Ã¢ ¶ç¿ì±â-->
function popupyes(w,h,URL){            			  
                                      var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ='height='+h+',';
                                          settings +='width='+w+',';
                                          settings +='top='+wint+',';
                                          settings +='left='+winl+',';
                                          settings +='scrollbars=yes,';
                                          settings +='resizable=yes,';
                                          settings +='status=yes';
                                      win=window.open(URL,'openwin',settings);
                                      win.focus();  
                    }
//--±âÅ¸ Ã¢ ¶ç¿ì±â-->

function popupfull(w,h,URL){            			  
                                      var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ='height='+h+',';
                                          settings +='width='+w+',';
                                          settings +='top='+wint+',';
                                          settings +='left='+winl+',';
                                          settings +='scrollbars=yes,';
                                          settings +='resizable=yes,';
                                          settings +='menubar=yes,';
                                          settings +='toolbar=yes,';
                                          settings +='location=yes,';
                                          settings +='status=yes';
                                      win=window.open(URL,'openwin',settings);
                                      win.focus();  
                    }

function popupnos(w,h,URL,name){            			  
									if ( name.value='')
									{
										name='openwin';
									}								
                                      var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ='height='+h+',';
                                          settings +='width='+w+',';
                                          settings +='top='+wint+',';
                                          settings +='left='+winl+',';
                                          settings +='scrollbars=no,';
                                          settings +='resizable=no';
                                      win=window.open(URL,name,settings);
                                      win.focus();  
                    }

//ÀÌ¹ÌÁö Å©°Ôº¸±âÃ¢
		function imgview(filename, width, height) {
                                      var w=width;
                                      var h=height;
									 var winl =(screen.width-w)/2;
                                      var wint =(screen.height-h)/2;
                                      var settings  ='height='+h+',';
                                          settings +='width='+w+',';
                                          settings +='top='+wint+',';
                                          settings +='left='+winl+',';
                                          settings +='scrollbars=yes,';
                                          settings +='resizable=yes';
		   var nW=window.open('','imgview',settings);
			with (nW.document) {
				open();
				write ("<html><head><title>ÀÌ¹ÌÁö º¸±â</title>");
				write ("<meta http-equiv='Content-Type' content='text/html;charset=euc-kr'></head>");
				write ("<body bgcolor=#ffffff onclick='self.close();' topmargin=0 leftmargin=0>");
				write ("<div align=center><img style='cursor:hand;' alt='Ã¢´Ý±â' src='"+filename+"' width='"+width+"' height='"+height+"'></div>");
				write ("</body></html>");
				close();
			}
		}
	function imgPop(src) {
	var imgObj = new Image();
	imgObj.src = src;
     var w=imgObj.width;
     var h=imgObj.height;
	 //var winl =(screen.width-w)/2;
     //var wint =(screen.height-h)/2;

	var wopt = "scrollbars=no,status=no,resizable=no";
	wopt += ",width=" + imgObj.width;
	wopt += ",height=" + imgObj.height;
     wopt +=',top=50';
     wopt +=',left=50';
	//wbody += "moveTo('"+winl+"', '"+wint+"');";
	var wbody = "<head><title>ÀÌ¹ÌÁöº¸±â</title>";
	wbody += "<script language='javascript'>";
	wbody += "function finalResize(){";
	wbody += "  var oBody=document.body;";
	wbody += "  var oImg=document.images[0];";
	wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	wbody += "  window.resizeBy(xdiff,ydiff);";
	wbody += "}";

	wbody += "</"+"script>";
	wbody += "</head>";
	wbody += "<body onLoad='finalResize()' style='margin:0'>";
	wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
	wbody += "</body>";
	winResult = window.open("about:blank","",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
}
