function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function detail() {}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function view() {}

function ltrim (s){
return s.replace( /^\s*/, "" );
}

function rtrim (s){
return s.replace( /\s*$/, "" );
}

function trim (s){
return rtrim(ltrim(s));
}

function isValid(Obj, isInteger){// isInteger : true - Integer, false - Double Precision.
var allowed;
if (isInteger == true)
  allowed = '0123456789';
else
  allowed = '0123456789.';

var string = Obj.value;
for (var i=0; i< string.length; i++) {
  if (allowed.indexOf(string.charAt(i)) == -1) {
if (isInteger == true)
alert('Invalid Interger Format');
else
alert('Invalid Double Precision Format');
Obj.select();
return false;
  }
}
return true;
}

function ValidForm(f) {
if (trim(f.quantity.value) == "") {
alert("ใส่จำนวนสินค้า");
f.quantity.select();
return false;
}
if (!isValid(f.quantity, true)) {
return false;
}
if (f.hprice.value <= 0) {
alert("สินค้าหมดชั่วคราว");
return false;
}
return true;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
/*
var messages = new Array();
VAR_TOOLTIP_MESSAGES*/

//-->
