function openimg(url,win_width,win_height,win_scroll) {
  var me_width;
  var me_height;

  me_width = (window.screen.width/2) - (win_width/2);
  me_height = (window.screen.height/2) - (win_height/2);
  me_height = me_height - 30;

  var win2 = window.open(url,'win2','height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars='+win_scroll+','+',location=no,status=no');
  win2.focus();
}

function Iopenimg(url,win_width,win_height,win_scroll) {
  var me_width;
  var me_height;

  me_width = (window.screen.width/2) - (win_width/2);
  me_height = (window.screen.height/2) - (win_height/2);
  me_height = me_height - 130;

  var win2 = window.open(url,'HHI','height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars='+win_scroll+','+',location=no,status=no');
  win2.focus();
}


function Open_Input_Select() {
    url = "";
	leftPos=300;
	topPos=200;
	if(screen) {
		leftPos = ( screen.width - 500 ) / 2;
		topPos = ( screen.height - 400 ) / 2;
	}
	for (i=0;i<7 ;i++) 
	{
	   if (document.order_frm.form_gubun[i].checked == true) 
	   {
	      url = "record.php?auth="+document.order_frm.form_gubun[i].value;
		  wWin = window.open(url,'wwin','statusbar=no,menubar=0,scrollbars=yes,resizable=1,width=482,height=550,left='+leftPos+',top='+topPos+'');
	   }
	}
}

function addPhoto() {
	document.form.action='register.php';
	document.form.submit();
}
function doButtons(picimage) {
eval("document['picture'].src = " + picimage + ".src");
}

var noTh = 0;
var maXnoTh = 20;

function addItem() {
        if(maXnoTh <= noTh)        {
                alert('´õÀÌ»ó Ãß°¡ÇÏ½Ç¼ö ¾ø½À´Ï´Ù.');
                return;
        }
        noTh = noTh + 1;
        layer1.innerHTML=layer1.innerHTML
                +'<table cellpadding=1 cellspacing=0 border=0 width=500>'
                +'        <tr><INPUT TYPE=hidden name=ro value='+noTh+'>'
                +'                <td width=100><input class="input" size=\"40\" type=\"file\" name=\"NewPhotofile'+noTh+'\"></td>'
                +'        </tr>';
                +'</table>';
        layer1.style.display = "";
}

var alertcolor="red"
var formobj
var styleobj
function getnames(formname,fieldname) {
	if (document.all) {
		var frmname=formname
		var fldname=fieldname
		formobj=eval("document."+formname+"."+fieldname)
		styleobj=eval("document.all."+fieldname+".style")
		checkcolor()
	}
}
function checkcolor() {
	if((formobj.value == null ) || (formobj.value.length < formobj.maxLength)) { 
		styleobj.backgroundColor="white"
        join = 1;
	}
	if(formobj.value.length >= formobj.maxLength) { 
        styleobj.backgroundColor=alertcolor;
        if(join){
            alert('ÀÔ·ÂÇ×¸ñÀÇ Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n \n¼ýÀÚ¸¸ ³ÖÀ¸¼¼¿ä..!');
            join = 0;
        }
	}
	var timer=setTimeout("checkcolor()",500)
}
function delete_data (tt,url) {
	if (confirm (tt)) {
		location = url
	}
}

function ffnOpen(Yrl) {

  var me_width;
  var me_height;

  win_height = "10";
  win_width  = "410";
  win_scroll = "";
  Yrl = "/player/Msound.asp?URL="+Yrl

  me_width = (window.screen.width/2) - (win_width/2);
  me_height = (window.screen.height/2) - (win_height/2);
  me_height = me_height - 130;

  var win2 = window.open(Yrl,'HHI','height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars='+win_scroll+','+',location=no,status=no');
  win2.focus();
}



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.0
  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 && document.getElementById) x=document.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];}
}
