		function MM_jumpMenu(targ,selObj,restore){ //v3.0
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
			if (restore) selObj.selectedIndex=0;
		}
	function check_searchform(str){
		if (str.value==''){
			alert("Nhập vào nội dung muốn tìm kiếm!");
			str.focus;
			return false;
		}
		return true;
	}
	function checkall(){
		for (var i = 0; i < document.ACTIVE.elements.length; i++) {
			if ( document.ACTIVE.all.checked==true ){
				document.ACTIVE.elements[i].checked = true;
			}
			else{
				document.ACTIVE.elements[i].checked = false;
			}
		}
	}
	
function formatNumber (obj, order_timeuse, decimal, renumber) {
	 //decimal  - the number of decimals after the digit from 0 to 3
	//-- Returns the passed number as a string in the xxx,xxx.xx format.
	   anynum=eval(obj.value)*eval(order_timeuse.value);
	   divider =10;
	   switch(decimal){
			case 0:
				divider =1;
				break;
			case 1:
				divider =10;
				break;
			case 2:
				divider =100;
				break;
			default:  	 //for 3 decimal places
				divider =1000;
		}

	   workNum=Math.abs((Math.round(anynum*divider)/divider));

	   workStr=""+workNum

	   if (workStr.indexOf(".")==-1){workStr+="."}

	   dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0
	   pStr=workStr.substr(workStr.indexOf("."))

	   while (pStr.length-1< decimal){pStr+="0"}

	   if(pStr =='.') pStr ='';

	   //--- Adds a comma in the thousands place.    
	   if (dNum>=1000) {
		  dLen=dStr.length
		  dStr=parseInt(""+(dNum/1000))+","+dStr.substring(dLen-3,dLen)
	   }

	   //-- Adds a comma in the millions place.
	   if (dNum>=1000000) {
		  dLen=dStr.length
		  dStr=parseInt(""+(dNum/1000000))+","+dStr.substring(dLen-7,dLen)
	   }
	   retval = dStr + pStr
	   //-- Put numbers in parentheses if negative.
	   if (anynum<0) {retval="("+retval+")";}

	  
	//You could include a dollar sign in the return value.
	  //retval =  "$"+retval
	  
	  //obj.value = retval;
	  renumber.value = retval+" (vnđ)";
 	}
 	function EnableYes(){
		document.formpreorder.order_dm_yes.disabled=false;
		document.formpreorder.order_dm_no.disabled=true;
		document.formpreorder.order_dm_yes.focus();
		onFocus=document.formpreorder.order_dm_no.value='';
		
		document.getElementById('p_domain_yes').style.display = "";
		document.getElementById('p_domain_no').style.display = "none";
		
	}
	function EnableNo(){
		document.formpreorder.order_dm_no.disabled=false;
		document.formpreorder.order_dm_yes.disabled=true;
		document.formpreorder.order_dm_no.focus();
		onFocus=document.formpreorder.order_dm_yes.value='';
		
		document.getElementById('p_domain_yes').style.display = "none";
		document.getElementById('p_domain_no').style.display = "";
		
	}
	
 	function EnableCanhan(){
		document.getElementById('canhan').style.display = "";
		document.getElementById('congty').style.display = "none";
	}
 	function EnableCoquan(){
		document.getElementById('canhan').style.display = "none";
		document.getElementById('congty').style.display = "";
	}
	
 /***************************************************************************/
 function makeRequest(url,id) {
        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { 
			showresult(http_request,id); 
		};
        http_request.open('GET', url, true);
        http_request.send(null);
    }
    function showresult(http_request,id) {
		document.getElementById(id).innerHTML="<br><p align=\"center\"><img src=\"./hinhanh/loading.gif\">Loading ...</p>";
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
			document.getElementById(id).innerHTML=http_request.responseText;
                //alert(http_request.responseText);
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
	