	function redirect(url){
		window.location = url;
	}	
	
	function is_phone_number(number){
		   var ValidChars = "0123456789";
		   var IsPhone=true;
		   var Char;								
		   var subChar1;
		   var subChar2;
		   if(number.length > 13 || number.length < 9){
			   IsPhone = false;	
		   }else{
			   for (i = 0; i < number.length && IsPhone == true; i++) 
				  { 
				  Char = number .charAt(i); 
				  if (ValidChars.indexOf(Char) == -1) 
					 {
						IsPhone = false;											
					 }
				  }
		   }
		   subChar1 = number.substring(0,1);
		   subChar2 = number.substring(0,2);
		   if(subChar2 != "84" && subChar2 != "01" && subChar2 != "09"){
				if(subChar1 != "9" && subChar1 != "1"){
					IsPhone = false;		
				}
			}
		return IsPhone;	   
	}


	function is_number(number){
	   var ValidChars = "0123456789.";
	   var IsNumber=true;
	   var Char;								
	 
	   for (i = 0; i < number.length && IsNumber == true; i++) 
		  { 
		  Char = number .charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
				IsNumber = false;											
			 }
		  }
	   return IsNumber;
	   
	 }
	function is_email(str)
	{
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z])?)$/i
		if (filter.test(str)){
			return true;
		}else{
			return false
		}
	}

	function check_all(obj, checked) {
			var _checked = (checked == 0) ? false : true;
			
			num_item = (obj).length;
			if (num_item > 1) {
				for (i = 0; i < num_item; i++) {
					obj[i].checked = _checked;
				}
			}
			else {
				obj.checked = _checked;
			}
	}

	
	function do_search() {
			document.frm_list.op.value = 'search';
			document.frm_list.submit();
	}
	
	function do_reset() {
			document.frm_list.op.value = 'reset';
			document.frm_list.submit();
	}
	
	function do_update_orders() {
			document.frm_list.op.value = 'orders';
			document.frm_list.submit();
	}
		
	function do_publish(_id) {			
			document.frm_list.op.value = 'publish';
			document.frm_list.id.value = _id;
			document.frm_list.submit();
	}
	
	function do_publishs() {
			document.frm_list.op.value = 'publishs';
			document.frm_list.submit();
	}
	
	function do_un_publish(_id) {
			document.frm_list.op.value = 'un_publish';
			document.frm_list.id.value = _id;
			document.frm_list.submit();
	}
	
	function do_un_publishs() {
			document.frm_list.op.value = 'un_publishs';
			document.frm_list.submit();
	}
	function do_delete(_id,message) {
		var _confirm = confirm(message);
		if (_confirm) {
			document.frm_list.op.value = 'del';
			document.frm_list.id.value = _id;
			document.frm_list.submit();
		}
	}
	function do_deletes(message) {
		var _confirm = confirm(message);
		if (_confirm) {
			document.frm_list.op.value = 'dels';
			document.frm_list.submit();
		}
	}
	
	function popup(url,width,height)
	 {
	   mywindow = window.open (url,"mywindow","location=0,status=0,scrollbars=1,width=" + width + ",height=" +height);
	   mywindow.moveTo(300,300);
	 } 
	 
	function GetXmlHttpObject(){
		var XMLHttp = null;
		// active x internetexplorer ---------------------------------------------------------
		try	{
			XMLHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0'); // ie7
		}catch (e){
					try	{
						XMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //ie 6
					}catch(e){
					try{
						XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");//ie older versions
					}catch(e){
				
				}	
		}
		}
		// active x internetexplorer ---------------------------------------------------------
		
		if (XMLHttp == null)
		{
			XMLHttp = new XMLHttpRequest();
		}
		return XMLHttp; 
	}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}