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 windowopen(openurl,width,height)
{
	var windowwidth;
	var windowheight;
	
	if (parseInt(width)>800)
	{
		windowwidth = 810;
		windowheight = 550;
	}
	else
	{
		windowwidth = parseInt(width)*0.9;
		windowheight = parseInt(height)*0.9;
	}

	var windowleft = parseInt((width - windowwidth)/2);
	var windowtop = parseInt((height - windowheight)/2);
	var pagename = Math.random();
	pagename = pagename.toString();
	pagename = pagename.substr(2);
	window.open(openurl,pagename,'top=' + windowtop + ',left=' + windowleft + ',width='+(windowwidth)+',height= '+ windowheight + ',resizable=0,scrollbars=0,status=no,toolbar=no,location=no,menubar=no,titlebar=no,dependent')
	return false;
}

function add(from,to)
{
	var allbooth = document.all(from);
	var newselect = document.all(to);
	var oNewNode;
	var newoption;
	if(newselect.children.length!=0){
		for(i =0;i<allbooth.children.length;i++)
		{
		if(allbooth.children[i].selected)
			for(j=0;j<newselect.children.length;j++)
				if(allbooth.children[i].value==newselect.children[j].value)
				{	alert(allbooth.children[i].innerText+" have already selected!");
					return false;
				}
		}
	}
	for(i =0;i<allbooth.children.length;i++)
	{
	 	if(allbooth.children[i].selected)
	 	{
	 		newoption = document.createElement("option");
		 	newoption.value=allbooth.children[i].value;
		 	newoption.innerText=allbooth.children[i].innerText;
	   		newselect.appendChild(newoption);
	   		newoption.selected=true;
   		}
   	}
	return false;
}

function remove(removeobj)
{
	var newselect = document.all(removeobj);
	var obj = new Array();
	var k = 0;
	
	for(i =0;i<newselect.childNodes.length;i++){
	 	if(newselect.childNodes[i].selected){
  			obj[k] = newselect.childNodes[i];
  			k++;
	  	}
	  }
  	for(i=0;i<k;i++)
  		newselect.removeChild(obj[i]);
  	
	return false;
}

<!-- ????????????? -->
function openDialog(url, width, height, target, targetID){
    var posLeft=(screen.width-width)/2;
    var posTop=(screen.height-height)/2;
    if (url.indexOf("?")>0) {
        url = url + "&tg="+target+"&tgID="+targetID;
    } else {
        url = url + "?tg="+target+"&tgID="+targetID;
    }
    newwin=window.open(url,"homeWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+ width +",height="+ height +",left="+ posLeft +",top="+ posTop);
}

<!-- ?????? -->
function showDialog(url, width, height, obj)
{  
    //&??????????????????????openWindow??????
    url = url.replace("&","@");
    posLeft=(screen.width-width)/2;
    posTop=(screen.height-height)/2;
    var urls = "page/common/openWindow.jsp?url=" + url;

    var returnValue = showModalDialog(urls, obj, "status:no;dialogHeight: " + height +"px; dialogWidth: " + width +"px;status:no;scroll:no;dialogTop: " + posTop + "px; dialogLeft: " + posLeft + "px'");
    return returnValue;
}

<!-----?????????-------------------------------------------------------------------------------->
function isEmpty (str) 
{
    if (str == null || str == "" || str.length == 0) {
        return true;
    } else {
        return false;
    }
}


<!-------??????(???????????------------------------------------->
function isDigit(theNum) {
    var theMask ='0123456789';
    var temp;
    var flag;
    flag=true;
    if (isEmpty(theNum)) 
        return (false);
    else {
        for (var i=0;i<theNum.length;i++){
            temp=theNum.substring(i,i+1);
            if (theMask.indexOf(temp) == -1) {
                flag=false;
                break;  
            }     
         }
         return(flag);      
    }       
}

<!-- ???????? includeInt:???????includeEmpty?????null??? -->
function isIntPercent(theNum, includeInt, includeEmpty) {

    //???
    if (isEmpty(theNum)) {
        if (includeEmpty == true) {
            return true;
        } else {
            return false;
        }
    }

    //?????
    if (includeInt == true) {
        if (isDigit(theNum))
            return true;
    }
    
    //?????????%
    var num = theNum;
    if (theNum.substr(theNum.length - 1, 1) == "%") {
        num = theNum.substring(0, theNum.length - 1);
        if (isDigit(num)) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
    
    return false;
}

function test() {
    alert("test");
}


function deleteObject(url,objtip){	
	if(confirm(objtip)){
		location=url;
	}
}

