function av(){  
window.external.AddFavorite('http://www.samplemiin.co.kr','»ùÇÃ¹ÌÀÎ'); 
}  


function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

function ByInteger()
{
    if((event.keyCode<48)||(event.keyCode>57))
    event.returnValue=false;
}

function Win_Maker(u,t,w,h,s)
{
	window.open(u,t,"width=" +w+ ",height=" +h+ ",resizable=no,scrollbars="+s);
}

function ImgView(Img)
{
	Win_Maker('/Include/ImgView.php?Img='+Img,'',10,10,0);
}

function goMove(p) 
{

	with(frmName())
	{
		Page.value = p;
		action = "?";
		target = "";
		submit();
		return;
	}
}

function RadioCheck(obj) 
{
	for (var i=0; i<obj.length; i++) 
	{
		if (obj[i].checked==true) 
		{
			return true;
		}
	}
	return false ;
}

function TrColor(obj,Color)
{
	obj.style.backgroundColor = Color;
}

String.prototype.trim = function() 
{
    return this.replace(/(^ *)|( *$)/g, "");
}
String.prototype.ltrim = function() 
{
    return this.replace(/(^ *)/g, "");
}
String.prototype.rtrim = function() 
{
    return this.replace(/( *$)/g, "");
}

function UpdateChar(obj,agNum,TxtLmt)
{	
	if (obj.value.length > agNum)
	{
		alert(agNum + "ÀÚ±îÁö¸¸ ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.value = obj.value.substring(0, agNum);
	}		


	eval(TxtLmt).innerText = obj.value.length;
}

function setEmbed() 
{ 
  var obj = new String; 
  var parameter = new String; 
  var embed = new String; 
  var html = new String; 
  var allParameter = new String; 
  var clsid = new String; 
  var codebase = new String; 
  var pluginspace = new String; 
  var embedType = new String; 
  var src = new String; 
  var width = new String; 
  var height = new String; 

    
  this.init = function( getType , s ,w , h ) { 
      
      if ( getType == "flash") 
      { 

        clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";        
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"; 
        pluginspage = "http://www.macromedia.com/go/getflashplayer"; 
        embedType = "application/x-shockwave-flash"; 
      } 
      /* type Ãß°¡ 
      else if ( ) 
      { 
      } 
      */ 
            
      parameter += "<param name='movie' value='"+ s + "'>\n";  
      parameter += "<param name='quality' value='high'>\n";    
      
      src = s; 
      width = w; 
      height = h; 
  } 
  
  this.parameter = function( parm , value ) {      
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";        
      allParameter += " "+parm + "='"+ value+"'"; 
  }  
  
  this.show = function() { 
      if ( clsid ) 
      { 
        obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n"; 
      } 
      
      embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" ></embed>\n"; 
      
      if ( obj ) 
      { 
        embed += "</object>\n"; 
      } 
      
      html = obj + parameter + embed; 
      
      document.write( html );  
  } 
  
}

function MsgScroll() {
    this.name = "MsgScroll";  //½ºÅ©·Ñ ¸í(°´Ã¼)
	this.msgs = new Array(); // ¸Þ¼¼Áö ¹è¿­Á¤ÀÇ
	this.msgcnt =0;  //¸Þ¼¼Áö ¹è¿­¹øÈ£ Á¤ÀÇ
	this.stop = 0; // Á¤Áö À¯¹«
    this.height = 100; // ·¹ÀÌ¾î ³ôÀÌ
	this.width = 100;  //·¹ÀÌ¾î ³ÐÀÌ
	this.speed = 50; // °£°Ý Á¶Á¤(¼Óµµ)
	this.currentSpeed = 0; // ÇöÀç °£°Ý Á¶Á¤(¼Óµµ)	
	this.pauseDelay = 1000; // Á¤Áö ½Ã°£
	this.pauseMouseover = false; //¸¶¿ì½º¸¦ ¿Ã·ÈÀ»¶§ Á¤Áö À¯¹«

    this.add = function(str) {  //¸Þ¼¼Áö Ã·°¡ ¸Þ¼­µå			       
				   this.msgs[this.msgcnt] = str;
				   this.msgcnt = this.msgcnt + 1;
               }

    this.start = function() {
					 this.init();
					 setTimeout(this.name+'.scroll()',this.speed);
				 }
			 
	this.init =function() {
					  document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
					  for(var i = 0; i < this.msgcnt; i++) {
						  document.write('<div id="'+this.name+'msg'+i+'"style="left:0px;width:'+this.width+';position:absolute;top:'+(this.height*i+1)+'px;">');
						  document.write(this.msgs[i]);
						  document.write('</div>');
                      }
				  }
				  
     this.scroll = function() {
		               if (!this.stop) { 
	                       this.speed = this.currentSpeed;
						   for (i = 0; i < this.msgcnt; i++) {
	                           obj = document.getElementById(this.name+'msg'+i).style;
		            		   obj.top = parseInt(obj.top) - 2;							   
			                   if (parseInt(obj.top) <= this.height*(-1)) obj.top = this.height * (this.msgcnt-1);
			                   if (parseInt(obj.top) == 0) this.speed = this.pauseDelay							  							   
		                   } 
		   
	                   }
	                   window.setTimeout(this.name+".scroll()",this.speed);
	                }

      this.onmouseover = function() {
	                         if (this.pauseMouseover) this.stop = true;
						 }
						 
	  this.onmouseout = function() {
	                        if (this.pauseMouseover) this.stop = false;
						 }

}




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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



var select_obj;
function LayerAction(name,status)
{
	var obj=document.all[name];
	var _tmpx,_tmpy, marginx, marginy;
	_tmpx = event.clientX + parseInt(obj.offsetWidth);
	_tmpy = event.clientY + parseInt(obj.offsetHeight);
	_marginx = document.body.clientWidth - _tmpx;
	_marginy = document.body.clientHeight - _tmpy ;
	if(_marginx < 0)
		_tmpx = event.clientX + document.body.scrollLeft + _marginx ;
	else
		_tmpx = event.clientX + document.body.scrollLeft ;
	if(_marginy < 0)
		_tmpy = event.clientY + document.body.scrollTop + _marginy +20;
	else
		_tmpy = event.clientY + document.body.scrollTop ;
	obj.style.posLeft=_tmpx-13;
	obj.style.posTop=_tmpy-12;
	if(status=='visible')
	{
		if(select_obj)
		{
			select_obj.style.visibility='hidden';
			select_obj=null;
		}
		select_obj=obj;
	}
	else
	{
		select_obj=null;
	}
	obj.style.visibility=status;
}

function print_memberlayer(name, member_id)
{
	var printHeight = 0;
	var printMain="";

	if(member_id)
	{
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('/Memo/write.php?member_id="+member_id+"','memo','width=300,height=400,toolbar=no,scrollbars=auto');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=/Images/Web_Img/MyPage/MsIcon.gif border=0 align=absmiddle>&nbsp;&nbsp;ÂÊÁö º¸³»±â&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('http://blog.samplemiin.co.kr/"+member_id+"','_blank','');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=/Images/Web_Img/MyPage/MsIcon.gif border=0 align=absmiddle>&nbsp;&nbsp;ºí·Î±×°¡±â&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;

	}
	var printHeader = "<div id='"+name+"' style='position:absolute; left:10px; top:25px; width:127; height: "+printHeight+"; z-index:1; visibility: hidden' onMousedown=LayerAction('"+name+"','hidden')><table border=0><tr><td colspan=3 onMouseover=LayerAction('"+name+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=LayerAction('"+name+"','hidden') rowspan=2>&nbsp;</td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='black' width=100% height=100%><tr><td valign=top bgcolor=white><table border=0 cellspacing=0 cellpadding=3 width=100% height=100%>";
	var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=LayerAction('"+name+"','hidden')>&nbsp;</td></tr><tr><td colspan=3 height=10 onMouseover=LayerAction('"+name+"','hidden')></td></tr></table></div>";

	document.writeln(printHeader+printMain+printFooter);
}

function print_memberlayer_mreview(name, member_id, mreview_num)
{
	var printHeight = 0;
	var printMain="";

	if(member_id)
	{
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('/Memo/write.php?member_id="+member_id+"','memo','width=300,height=400,toolbar=no,scrollbars=auto');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=/Images/Web_Img/MyPage/MsIcon.gif border=0 align=absmiddle>&nbsp;&nbsp;ÂÊÁö º¸³»±â&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('http://blog.samplemiin.co.kr/MReviewDetail.php?BlogID="+member_id+"&Num="+mreview_num+"','_blank','');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=/Images/Web_Img/MyPage/MsIcon.gif border=0 align=absmiddle>&nbsp;&nbsp;ºí·Î±×°¡±â&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;

	}
	var printHeader = "<div id='"+name+"' style='position:absolute; left:10px; top:25px; width:127; height: "+printHeight+"; z-index:1; visibility: hidden' onMousedown=LayerAction('"+name+"','hidden')><table border=0><tr><td colspan=3 onMouseover=LayerAction('"+name+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=LayerAction('"+name+"','hidden') rowspan=2>&nbsp;</td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='black' width=100% height=100%><tr><td valign=top bgcolor=white><table border=0 cellspacing=0 cellpadding=3 width=100% height=100%>";
	var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=LayerAction('"+name+"','hidden')>&nbsp;</td></tr><tr><td colspan=3 height=10 onMouseover=LayerAction('"+name+"','hidden')></td></tr></table></div>";

	document.writeln(printHeader+printMain+printFooter);
}

function print_memberlayer_preview(name, member_id, preview_num)
{
	var printHeight = 0;
	var printMain="";

	if(member_id)
	{
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('/Memo/write.php?member_id="+member_id+"','memo','width=300,height=400,toolbar=no,scrollbars=auto');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=/Images/Web_Img/MyPage/MsIcon.gif border=0 align=absmiddle>&nbsp;&nbsp;ÂÊÁö º¸³»±â&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('http://blog.samplemiin.co.kr/PhotoReviewDetail.php?BlogID="+member_id+"&Num="+preview_num+"','_blank','');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=/Images/Web_Img/MyPage/MsIcon.gif border=0 align=absmiddle>&nbsp;&nbsp;ºí·Î±×°¡±â&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;

	}
	var printHeader = "<div id='"+name+"' style='position:absolute; left:10px; top:25px; width:127; height: "+printHeight+"; z-index:1; visibility: hidden' onMousedown=LayerAction('"+name+"','hidden')><table border=0><tr><td colspan=3 onMouseover=LayerAction('"+name+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=LayerAction('"+name+"','hidden') rowspan=2>&nbsp;</td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='black' width=100% height=100%><tr><td valign=top bgcolor=white><table border=0 cellspacing=0 cellpadding=3 width=100% height=100%>";
	var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=LayerAction('"+name+"','hidden')>&nbsp;</td></tr><tr><td colspan=3 height=10 onMouseover=LayerAction('"+name+"','hidden')></td></tr></table></div>";

	document.writeln(printHeader+printMain+printFooter);
}