
function flashview(swf,wid,hei) {

	document.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width='+wid+' height='+hei+' align=middle>');
	document.write('<param name=allowScriptAccess value=sameDomain />');
	document.write('<param name=movie value='+swf+' />');
	document.write('<param name=quality value=high />');
	document.write('<param name=bgcolor value=#ffffff />');
	document.write('<embed src='+swf+' quality=high bgcolor=#ffffff width='+wid+' height='+hei+' align=middle allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />');
	document.write('</object>');

}

function flashmenu(swf,wid,hei) {

	document.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width='+wid+' height='+hei+' align=middle>')
	document.write('<param name=allowScriptAccess value=sameDomain />')
	document.write('<param name=allowFullScreen" value=false />')
	document.write('<param name=movie value='+swf+' />')
	document.write('<param name=quality value=high />')
	document.write('<param name=bgcolor value=#ffffff />')
	document.write('<embed src='+swf+' quality=high bgcolor=#ffffff width='+wid+' height='+hei+' align=middle allowScriptAccess=sameDomain allowFullScreen=false type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />')
	document.write('</object>')

}

function FlashObject(swf, width, height, id)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
        strFlashTag += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width +'" height="' + height + '" align="middle" />';
        strFlashTag += '<param name="allowfullscreen" value="true"/>';
        strFlashTag += '<param name="movie" value="' + swf+ '"/>';
        strFlashTag += '<param name="loop" value="false"/>';
        strFlashTag += '<param name="menu" value="false" />';
        strFlashTag += '<param name="quality" value="high" />';
        strFlashTag += '<param name="scale" value="noscale" />';
        strFlashTag += '<param name="bgcolor" value="#000000" />';
        strFlashTag += '<param name=wmode value=transparent />';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed pluginspage="http://www.macromedia.com/go/getflashplayer" ';
        strFlashTag += 'src="' + swf+ '" squality="best" bgcolor="#000000" ';
        strFlashTag += 'width="' + width + '" height="' + height+ '" align="middle" ';
        strFlashTag += 'allowScriptAccess="sameDomain" allowfullscreen="true" type="application/x-shockwave-flash" />';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}


	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];}
	}


	/************************************************************
¼³¸í : Ã¼Å© ¹Ú½º, ¶óµð¿À ¹öÆ° ¼±ÅÃ Ã¼Å©
¿¹)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;
}


/***************************************************************
¼³¸í : Æû°ªÀÇ È®ÀÎÇÏ´Â ½ºÅ©¸³Æ®
¿¹)Tcheck(Æû¹ë·ù, 'Á¦¾à¹®±¸', Á¦¾àÁ¶°Ç, ÃÖ¼Ò´ÜÀ§, ÃÖ´ë´ÜÀ§)
°á°ú) °ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false, °ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
****************************************************************/
function Tcheck(target, cmt, astr, lmin, lmax){
		var i;
		var t = target.value;
		if (t.length < lmin || t.length > lmax) {
			if (lmin == lmax) alert(cmt + '´Â ' + lmin + ' ÀÚ ÀÌ¾î¾ß ÇÕ´Ï´Ù');
				 else alert(cmt + '´Â ' + lmin + ' ~ ' + lmax + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
			target.focus();
			return true;
		}
		if (astr.length > 1) {
			for (i=0; i < t.length; i++){
				if(astr.indexOf(t.substring(i,i+1))<0) {
					alert(cmt + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
					target.focus();
					return true;
				}
			}
		}
		return false;
	}

/***************************************************************
¼³¸í : Æû°ªÀÇ È®ÀÎÇÏ´Â ½ºÅ©¸³Æ®
¿¹)Tcheck(Æû¹ë·ù, 'Á¦¾à¹®±¸', Á¦¾àÁ¶°Ç, ÃÖ¼Ò´ÜÀ§, ÃÖ´ë´ÜÀ§)
°á°ú) °ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false, °ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
****************************************************************/
	function LoginCheck(){
	
		if (confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?")) {
			location.href='/login/login.asp?rurl=' + encodeURIComponent(document.location);
		}
		else{ }
	}


	function LoginGo(){
	
		location.href='/chocolate/join/login.asp?rurl=' + encodeURIComponent(document.location);

	}


/****************************************/
/**********  Å×ÀÌºíÅ×µÎ¸® ********************/
/****************************************/

function roundTable(objID) {
   var obj = document.getElementById(objID);
   var Parent, objTmp, Table, TBody, TR, TD;
   var bdcolor, bgcolor, Space;
   var trIDX, tdIDX, MAX;
   var styleWidth, styleHeight;

   Parent = obj.parentNode;
   objTmp = document.createElement('SPAN');
   Parent.insertBefore(objTmp, obj);
   Parent.removeChild(obj);

   bdcolor = obj.getAttribute('rborder');
   bgcolor = obj.getAttribute('rbgcolor');
   radius = parseInt(obj.getAttribute('radius'));
   if (radius == null || radius < 1) radius = 1;
   else if (radius > 6) radius = 6;

   MAX = radius * 2 + 1;

   Table = document.createElement('TABLE');
   TBody = document.createElement('TBODY');

   Table.cellSpacing = 0;
   Table.cellPadding = 0;

   for (trIDX=0; trIDX < MAX; trIDX++) {
          TR = document.createElement('TR');
          Space = Math.abs(trIDX - parseInt(radius));
          for (tdIDX=0; tdIDX < MAX; tdIDX++) {
                 TD = document.createElement('TD');
                 
                 styleWidth = '1px'; styleHeight = '1px';
                 if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
                 else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
                 else if (radius > 2) {
                        if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
                        if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
                 }

                 if (styleWidth != null) TD.style.width = styleWidth;
                 if (styleHeight != null) TD.style.height = styleHeight;

                 if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
                 else if (tdIDX > Space && Space < MAX - tdIDX - 1)  TD.style.backgroundColor = bgcolor;
                 
                 if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
                 TR.appendChild(TD);
          }
          TBody.appendChild(TR);
   }
   Table.appendChild(TBody);
   Parent.insertBefore(Table, objTmp);
}	