2014年1月31日 星期五

html-return



function function_3ZM0MLGJX()     {
if (window.showModalDialog) {
var returnTarget=window.showModalDialog("solistmc.php",this,
"dialogWidth:600px;dialogHeight:400px;resizable:0;scroll:0;");
} else  {
var returnTarget=window.open ("solistmc.php",this,"height=400px,width=600px,toolbar=no,directories=no, status=no,memubar=no,modal=yes,location=no,resizable=no,menubar=no, scrollbars=no,copyhistory=no");
}

http://stackoverflow.com/questions/16421922/getting-value-from-popup-window-using-only-js-html


parent.html
<input type="text" id="output"/>
<button id="show">Open</button>

<script>
    document.getElementById('show').addEventListener('click', function(){
        window['output'] = document.getElementById('output');
        window.open('map.html')
    });
</script>  
maps.html (I changed the extension!)
<input type="text" id="user_text"/>
<input id="send" type='button' value'send'/>

<script>
    document.getElementById('send').addEventListener('click', function(){
    window.opener['output'].value = document.getElementById('user_text').value;
})
</script>

invoice2.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><script type="text/javascript" src="calendar.js"></script>
<!-- <link rel="stylesheet" href="../html/hongkong2000a.css"  type="text/css" media="screen" /> -->
<link rel="stylesheet" href="../html/jquery.alerts.css"  type="text/css" media="screen" />
<link rel="stylesheet" href="../html/jquery.tooltip.css" />
<link rel="stylesheet" href="../html/jquery.autocomplete.css" /><head>


<script src="../html/calendar.js" type="text/javascript" ></script>
<script src="../html/Event.js" type="text/javascript"></script>
<script src="../html/SortedTable.js" type="text/javascript"></script>
<script src="../html/jquery.js" type="text/javascript"></script>
<!-- script src="../html/jquery.ui.draggable.js" type="text/javascript"></script -->
<script src="../html/ui.base.min.js" type="text/javascript"></script>
<script src="../html/ui.draggable.min.js" type="text/javascript"></script>
<script src="../html/jquery.min.js"></script>
<script src="../html/jquery.alerts.js" type="text/javascript"></script>
<script src="../html/jquery.bgiframe.js" type="text/javascript"></script>
<script src="../html/jquery.dimensions.js" type="text/javascript"></script>
<script src="../html/jquery.tooltip.js" type="text/javascript"></script>
<script src="../html/chili-1.7.pack.js" type="text/javascript" ></script>
<script type="text/javascript" language="javascript" src="../html/ModalDialog.js"></script>
<script type="text/javascript" language="javascript" src="../html/fade.js"></script>
<!-- <script type="text/javascript" language="javascript" src="../html/modal-window.js"></script> -->
<script type="text/javascript" language="javascript" src="../html/jquery.cookie.js"></script>
<script type="text/javascript" language="javascript" src="../html/thickbox-compressed.js"></script>
<script type="text/javascript" language="javascript" src="../html/jquery.ajaxQueue.js"></script>
<script type="text/javascript" language="javascript" src="../html/jquery.bgiframe.min.js"></script>
<script type="text/javascript" language="javascript" src="../html/jquery.autocomplete.js"></script>
<script src="../html/jquery.maskedinput-1.2.2.js" type="text/javascript" ></script>

<script type="text/javascript">onload = function() {var myTable = new SortedTable();}</script>
<script type="text/javascript">
var STATUS_STATUS2_for_INVBODY_uom2011111219_array=new Array();
var nextfield ;
var prevfield ;
var upperfield ;
var lowerfield ;
var thisRowFirstField ;
var _current_row ;
var _current_id="";
var _current_table_id="";
var _last_add_id="";
var _rlock="" ;
var intervalID ;
var _rowno;
var _cellno;
var _session_id;
var _return_value=" ";
var _return_values=new Array();
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var fullVersion  = ''+parseFloat(navigator.appVersion);
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;

/* In MSIE, the true version is after "MSIE" in userAgent*/
if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 browserName = "Microsoft Internet Explorer";
 fullVersion = nAgt.substring(verOffset+5);
}
/* In Opera, the true version is after "Opera" */
else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 browserName = "Opera";
 fullVersion = nAgt.substring(verOffset+6);
}
/*  In Chrome, the true version is after "Chrome"  */
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
 browserName = "Chrome";
 fullVersion = nAgt.substring(verOffset+7);
}
/*  In Safari, the true version is after "Safari"  */
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
 browserName = "Safari";
 fullVersion = nAgt.substring(verOffset+7);
}
/*  In Firefox, the true version is after "Firefox"  */
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
 browserName = "Firefox";
 fullVersion = nAgt.substring(verOffset+8);
}
/*  In most other browsers, "name/version" is at the end of userAgent  */
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) )
{
 browserName = nAgt.substring(nameOffset,verOffset);
 fullVersion = nAgt.substring(verOffset+1);
 if (browserName.toLowerCase()==browserName.toUpperCase()) {
  browserName = navigator.appName;
 }
}
/*  trim the fullVersion string at semicolon/space if present */
if ((ix=fullVersion.indexOf(";"))!=-1) fullVersion=fullVersion.substring(0,ix);
if ((ix=fullVersion.indexOf(" "))!=-1) fullVersion=fullVersion.substring(0,ix);

majorVersion = parseInt(''+fullVersion,10);
if (isNaN(majorVersion)) {
 fullVersion  = ''+parseFloat(navigator.appVersion);
 majorVersion = parseInt(navigator.appVersion,10);
}

/*document.write('Browser name  = '+browserName+'<br>');
document.write('Full version  = '+fullVersion+'<br>');
document.write('Major version = '+majorVersion+'<br>');
document.write('navigator.appName = '+navigator.appName+'<br>');
document.write('navigator.userAgent = '+navigator.userAgent+'<br>');*/



$(function(){
var myTable = new SortedTable();var oForm = document.forms["form1"];oForm.name.onmouseover = myFocus;
$.cookie("example", null);
oForm.name.onfocus = mySelect; createXHR();
if (document.getElementById("retrieval_key")) {
document.getElementById("retrieval_key").focus();}
 getlevel();

session_id(); _refresh("_explorer",browserlevel);
STATUS_STATUS2_for_INVBODY_uom2011111219();
});
function _checked_data(_field_id){if(document.getElementById('_'+_field_id).checked){document.getElementById('_'+_field_id).checked=false}else {document.getElementById('_'+_field_id).checked=true}checked_data();}

function _round(_v,_d){if(isNaN(_v)){r=_v;} else{var v=_v;r=parseFloat(v).toFixed(_d)};return r;}
function checked_data(){
var tbl = document.getElementById("_3ZM0MLENF");
var lastRow = tbl.rows.length - 1;
_return_value="";
var iix;
m_delimited = false ;
for (iix=0; iix<lastRow; iix++) {
if (document.getElementById("_choice_"+iix).checked){
if (m_delimited){_return_value=_return_value+'||'}
m_delimited=true ;
_return_value=_return_value+"<item>"+document.getElementById("item"+iix).title+"</item>";
_return_value=_return_value+"<descript>"+document.getElementById("descript"+iix).title+"</descript>";
_return_value=_return_value+"<qty>"+document.getElementById("qty"+iix).title+"</qty>";
_return_value=_return_value+"<uom>"+document.getElementById("uom"+iix).title+"</uom>";
_return_value=_return_value+"<price>"+document.getElementById("price"+iix).title+"</price>";
_return_value=_return_value+"<sob>"+document.getElementById("sob"+iix).title+"</sob>";
_return_value=_return_value+"<datetimer>"+document.getElementById("datetimer"+iix).title+"</datetimer>";
} /*if*/
} /* for*/
 /* alert(_return_value);*/
  $.cookie("example",_return_value );
 /* alert( $.cookie("example")); */
}


var openMyModal = function(source,afterChoice2)
{
modalWindow.windowId = "myModal";
modalWindow.AfterChoice=afterChoice2;
modalWindow.width = 480;
modalWindow.height = 405;
modalWindow.content = "<iframe id='_1123' style='border:2px inset purple' width='480' height='405' frameborder='0' scrolling='no'  allowtransparency='true' src='" + source + "'>&lt/iframe><INPUT type='submit' value='OK'  onClick=' modalWindow.close();  return false'>";
modalWindow.open();
var cssObj1123 = {      'background-color' : '#ddd',      'color' : 'rgb(0,40,244)' , 'border-radius':'6px' ,'-moz-border-radius':'6px' , '-webkit-border-radius':'6px'   };
 $('#_1123').css(cssObj1123);

};

var modalWindow = {
parent:"body",
windowId:null,
content:null,
width:null,
height:null,
AfterChoice:null,
close:function()
{
$(".modal-window").remove();
$(".modal-overlay").remove();
},
open:function()
{
var modal = "";
modal += "<div class=\"modal-overlay\"></div>";
modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
modal += this.content;
modal += "</div>";
$(this.parent).append(modal);
$(".modal-window").append("<a></a>");
$(".modal-window").append("<a class=\"close-window\"></a>");
$(".close-window").click(function(){modalWindow.close(); eval(modalWindow.AfterChoice);  });  /* After Get Data  After getdata aftergetdata*/
$(".modal-overlay").click(function(){modalWindow.close();});
}
};

window.onerror = function(sMessage, sUrl, sLine){
alert("出錯啦:\n" + sMessage + "\nUrl: " + sUrl + "\n行號: " + sLine);
return true;
};

$(function() {
$('followme *').tooltip({track:true,delay:0,showURL:false,showBody:" - ",extraClass:"pretty",fixPNG:true,left: -120});
$("#FootTip *").tooltip({bodyHandler: function() {return $($(this).attr("href")).html();},showURL: false});
$('#right a').tooltip({ track: true,delay: 0,showURL: false,extraClass: "right"});
$('#right2 a').tooltip({ showURL: false, positionLeft: true });
$('#form1 *').tooltip({ track: true,delay: 300,showURL: false,showBody: " - ",fade: 250});
$("#MultLine, #fancy2").tooltip({track: true,delay: 0, showURL: false, opacity: 1, fixPNG: true,showBody: " - ",extraClass: "pretty fancy", top: -15, left: 5});
$('#pretty').tooltip({track: true, delay: 0,showURL: false,showBody: " - ",extraClass: "pretty",fixPNG: true, opacity: 0.95, left: -120});
});  /* $function() */

upperfield = " ";
lowerfield = " ";
nextfield = "box1"; /* name of first box on page */
netscape = "";
k = 0;
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");
function keyDown(DnEvents) { /* handles keypress */
/* determines whether Netscape or Internet Explorer */
/* alert('hello'); */
k = (netscape) ? DnEvents.which : window.event.keyCode;
if (k==123){$( "#save" ).click();} /*F12 20110125*/
if (k==27){$( "#exit" ).click();} /*Exit 20110125*/
if (k == 13) { /* enter key pressed*/
if (_last_add_id == _current_id) {} /*20110125*/
if (nextfield == '** done **' || nextfield == 'nonextfield') return true; /* submit, we finished all fields */
else { /* we're not ** done ** yet, send focus to next box
document.getElementById(nextfield).focus();
alert(nextfield); */
if (eval('document.form1.' + nextfield)){
eval('document.form1.' + nextfield + '.focus()');}
return false;
      }
   }
 if (k == 40) { /* down arrow 38 for uparrow 27 for exit */
if (lowerfield == '** done **') return true; /* submit, we finished all fields */
else {
if (eval('document.form1.' + lowerfield)){
eval('document.form1.' + lowerfield + '.focus()');}
return false;
      }
}
 
if (k == 38) { /* down arrow 38 for uparrow 27 for exit */
if (lowerfield == '** done **') return true; /* submit, we finished all fields */
else {
if (eval('document.form1.' + upperfield)){
eval('document.form1.' + upperfield + '.focus()');}
return false;
      }
}

if (k == 37) { /* left arrow 37 for uparrow 27 for exit */
if (prevfield == '** done **') return true; /* submit, we finished all fields */
else {
if (eval('document.form1.' + prevfield)){
eval('document.form1.' + prevfield + '.focus()');}
return false;
      }
}

 
}  /* end of function */

document.onkeydown = keyDown; /* work together to analyze keystrokes */
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);
function ValidateNumeric(evt) {
  var theEvent = evt || window.event;
  var mv_key = theEvent.keyCode || theEvent.which;
  key = String.fromCharCode(mv_key);
  var regex = /[0-9]|\./;
  if( !regex.test(key) ) {
    theEvent.returnValue = false;
if (theEvent.preventDefault)  
    theEvent.preventDefault();  
  else if (theEvent.cancelBubble)   /* for ie */
    theEvent.cancelBubble = true;
/*    theEvent.preventDefault(); */
  }
}

var browserlevel = -1;
function getlevel() {
if (browserlevel != -1) return browserlevel;
    if(navigator.appName.indexOf("Netscape") != -1 || navigator.appName.indexOf("Mozilla") != -1){
        if (navigator.userAgent.indexOf("Mozilla/2.0") != -1)
            browserlevel = 2;
        else if (navigator.userAgent.indexOf("Mozilla/3.0") != -1)
                browserlevel = 3;
        else if (navigator.userAgent.indexOf("Mozilla/4.") != -1)
                    browserlevel = 4;
                else if (navigator.userAgent.indexOf("Mozilla/5.") != -1)
                        browserlevel = 5;
                    else
                        browserlevel = 1;
        }  else {
                if (navigator.appName.indexOf("Internet Explorer") != -1){
                     if (navigator.userAgent.indexOf("Mozilla/4.") != -1)
                      browserlevel = 4;
                         else
                            browserlevel = 1;
                     } else
                      browserlevel = 1;
               }
return browserlevel;
};

function stopRKey(evt) {
   var evt = (evt) ? evt : ((event) ? event : null);
   var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
   if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
}function setSelectionRange_(input, selectionStart, selectionEnd)

{
if (input.setSelectionRange) {
alert('irefox');
input.focus();
input.setSelectionRange(selectionStart, selectionEnd);
setSelectionRange(input, 0, 0);

}
else if (input.createTextRange) {
alert('ie');
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', selectionEnd);
range.moveStart('character', selectionStart);
range.select();
}
}

function check_date(field){
/* e.g. <INPUT type="text" name=testdat size='10' maxlength="10" onblur="check_date(this)"> */
var checkstr = "0123456789";
var DateField = field;
var Datevalue = "";
var DateTemp = "";
var seperator = "-";
var dateFormat='YYYYMMDD';
var day;
var month;
var year;
var leap = 0;
var err = 0;
var i;
   err = 0;
   DateValue = DateField.value;
   /* Delete all chars except 0..9 */
   for (i = 0; i < DateValue.length; i++) {
 if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
    DateTemp = DateTemp + DateValue.substr(i,1);
 }
   }
   DateValue = DateTemp;
   /* Always change date to 8 digits - string*/
   /* if year is entered as 2-digit / always assume 20xx */
   if (DateValue.length == 6) {
      DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }
   if (DateValue.length != 8) {
      err = 19;}
   /* alert(dateFormat+DateValue); */
   /* year is wrong if year = 0000 */
if(dateFormat='YYYYMMDD') {year=DateValue.substr(0,4);} else {year = DateValue.substr(4,4);}
   /* alert(year); */
   if (year == 0) {
      err = 20;
   }
   /* Validation of month*/
   if(dateFormat='YYYYMMDD'){month = DateValue.substr(4,2);} else {month = DateValue.substr(2,2);}
   if ((month < 1) || (month > 12)) {
      err = 21;
   }
      /* alert(month); */
   /* Validation of day*/
   if(dateFormat='YYYYMMDD'){day = DateValue.substr(6,2);} else {day = DateValue.substr(0,2);}
/*   if(dateFormat='YYYYMMDD'){day = 'testing';}{ day = DateValue.substr(0,2);} */
   if (day < 1) {
     err = 22;
   }
      /* alert(day); */
   /* Validation leap-year / february / day */
   if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
      leap = 1;
   }
   if ((month == 2) && (leap == 1) && (day > 29)) {
      err = 23;
   }
   if ((month == 2) && (leap != 1) && (day > 28)) {
      err = 24;
   }
   /* Validation of other months */
   if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
      err = 25;
   }
   if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
      err = 26;
   }
   /* if 00 ist entered, no error, deleting the entry */
   if ((day == 0) && (month == 0) && (year == 00)) {
      err = 0; day = ""; month = ""; year = ""; seperator = "";
   }
   /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
   if (err == 0) {
  if(dateFormat='YYYYMMDD'){DateField.value = year  + seperator + month + seperator + day;} else
  {DateField.value = day  + seperator + month + seperator + year;}
/*   alert(DateField.value); */
   }
   /* Error-message if err != 0 */
   else {
      alert("Date is incorrect!");
      DateField.select();
 DateField.focus();
   }
 
}function recordlock(zzz_datetimer, session_id){
now = new Date();
v_gettime = now.getTime();
if (_rlock=='Locked'){
if (zzz_datetimer) {
/*20110223hone*/
if (window.XMLHttpRequest) {
xmlHttp0223 = new XMLHttpRequest();
}else if (window.ActiveXObject) {
xmlHttp0223 = new ActiveXObject("Microsoft.XMLHTTP");
}
if (!xmlHttp0223) {
alert('您使用的瀏覽器不支援 XMLHTTP 物件');
return false;
}
/*createXHR();*/
xmlHttp0223.open('GET','invoiceinput2R.php?callfunction=rlock&zzz_datetimer='+zzz_datetimer+'&session_id='+session_id +'&TimeStamp='+v_gettime,true);
xmlHttp0223.onreadystatechange=function()
{
if (xmlHttp0223.readyState==4)
{
if (xmlHttp0223.status == 200)
{
}
}
};
xmlHttp0223.send(null);
} /* empty(zzz_datetimer) */
} /* if (_rlock=='Locked'){ */
}

;
function session_id() {
if (window.XMLHttpRequest) {
xmlHttp_3ZM0NFOHJ = new XMLHttpRequest();
}else if (window.ActiveXObject) {
xmlHttp_3ZM0NFOHJ = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttp_3ZM0NFOHJ.open('GET','invoiceinput2R.php?callfunction=session_id',true);
xmlHttp_3ZM0NFOHJ.onreadystatechange=function()
{
if (xmlHttp_3ZM0NFOHJ.readyState==4)
{
if (xmlHttp_3ZM0NFOHJ.status == 200)
{
var s = xmlHttp_3ZM0NFOHJ.responseXML;
_refresh('_session_id',s.getElementsByTagName('session_id')[0].childNodes[0].nodeValue);
}
}
};
xmlHttp_3ZM0NFOHJ.send(null);
}


function _today(){
var _today;
dateValue = new Date() ;
var M = "" + (dateValue.getMonth()+1);
var MM = "0" + M;
MM = MM.substring(MM.length-2, MM.length);
var D = "" + (dateValue.getDate());
var DD = "0" + D;
DD = DD.substring(DD.length-2, DD.length);
var YYYY = "" + (dateValue.getFullYear());
_today=YYYY+'-'+MM+'-'+DD;
return _today}function createXHR(){
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (!xmlHttp) {
alert('您使用的瀏覽器不支援 XMLHTTP 物件');
return false;
}
}function checkKeycode(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
if(event.keyCode==13)  
{if (window.event.srcElement.type!="submit")
{if (window.event.srcElement.type!="reset")
{if (window.event.srcElement.type!="button")
{event.keyCode=9;   }
var next=x.tabIndex;}}}
}
function maximize() {window.moveTo(0,0) ;  window.resizeTo(screen.availWidth, screen.availHeight);}
function NumericInputFormat(input) {input.className="CSS_Input_Number_Format";}
function LineNumericInputFormat(input) {input.className="CSS_Line_Input_Number_Format";}
function NumericNormalFormat(input) {input.className="CSS_Table_Normal_Number_Format";}
function LineNumericNormalFormat(input) {input.className="CSS_Line_Normal_Number_Format";}
function Focus_Border_Right(input) { input.className="Focus_Border_Right";}
function LostFocus_Border_Right(input) {input.className="CSS_LostFocus_Border_Right";}
function TextNormalFormat(input) {input.className="CSS_Normal_Text_Format";}
function LineTextNormalFormat(input) {input.className="CSS_Line_Normal_Text_Format";}
function _disabled(v_field_,v_mode_){$(v_field_).each(function() {this.disabled=v_mode_;})}function save2() {jConfirm('Are you confirm?', 'Confirmation Dialog', function(r) {if (r){/*20110122*/

if (_lookup("INVHEAD_date")=="")
{jAlert('No : INVHEAD_date.', 'Alert',function(){$('#INVHEAD_date').focus();}); return false;}
else if  (alltrim(_lookup("INVHEAD_custcode"))=="")
{jAlert('No : INVHEAD_custcode.', 'Alert',function(){$('#INVHEAD_custcode').focus();}); return false;}else
{document.form1.submit();}}});}
self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);function setTrClass() {var object=document.getElementsByTagName("tr");
for (var i=0;i<object.length;i++) {object[i].className="row";}}
function _refresh(v_id,v_value,v_enable){if (document.getElementById(v_id)){document.getElementById(v_id).value=v_value;}}
function _lookup(v_id,v_value,v_enable){if(document.getElementById(v_id)){return document.getElementById(v_id).value;}else {return ""}}
function _scan(fv_table, fv_function){
_result=0;
if (document.getElementById(fv_table)){
var _result=0 ; var tbl = document.getElementById(fv_table);var lastRow = tbl.rows.length - 1;
for (iix=1; iix<=lastRow; iix++){eval(fv_function);}}
return _result;
}
function ltrim(str){ return str.replace(/^\s+/,''  ); }
function rtrim(str) { return str.replace(/\s+$/, ''); }
function myFocus(){this.focus();}
function mySelect(){this.select();}
function alltrim(str) { return str.replace(/^\s+|\s+$/g, '');}
function X_readonly (v_field,v_mode){}

function _readonly (v_field,v_mode)
{
$(v_field).each(function() {
  switch(this.type) {
    case 'radio':
    case 'checkbox': if (this.checked) alert(this.value); break;
    case 'text':
     if (v_mode) {
var temp_col={'background-color': '#dcdcdc', 'color':'#000'};
this.onclick = function(event) {return false;};
$(v_field).attr('readonly',true) ;            
$(v_field).attr('onclick',function (){return false;}) ;                          
}
else
{var temp_col={'background-color': 'white', 'color':'black'};
this.readonly=false;
this.onclick = function(event) {return true;};
$(v_field).attr('readonly',false) ;                          
$(v_field).attr('onclick',function (){return true;}) ;
}
$(v_field).css(temp_col);
    break;
    case 'textarea':
     case 'hidden':
    case 'button': _disabled(v_field,v_mode); break;
    case 'select-one': alert(this.value); break;
    default: alert("unhandled type: "+this.type);
  }
});
}

function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
/* *onclick="PopupCenter('http://www.nigraphic.com', 'myPop1',400,400);" */
} function setLineDefaultBackgroundColor( type_,input,cellid,deci_)
{ document.getElementById( cellid ).style.background="RGB(255,255,255)";
document.getElementById( cellid ).style.color="RGB(0,0,0)";
if (type_=='N')
{
if (! input.value)
{
input.value=0;
}
LineNumericNormalFormat(input);
input.value=parseFloat(input.value).toFixed(deci_);
}
else
{
LineTextNormalFormat(input);
}
}  /* function setBackgroundColor */




/*function setDefaultBackgroundColor( type_,deci_,input,cellid,rowid ,tableid){
var number_of_columns =(document.getElementById(tableid).getElementsByTagName('th').length);
for (i=1;i<=number_of_columns;i++){
if(document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0]){
document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0].style.background="RGB(255,255,255)" ;}
document.getElementById( cellid ).style.color="RGB(0,0,0)";
if (type_=='N'){
if (! input.value) {input.value=0;}
input.value=parseFloat(input.value).toFixed(deci_);
NumericNormalFormat(input);}
else {TextNormalFormat(input);
}
}
}*/
function setGridBackgroundColor( type_,input,cellid,rowid ,tableid,inputtype_)
{
var number_of_columns =(document.getElementById(tableid).getElementsByTagName('th').length);
for (i=1;i<=number_of_columns;i++)
{
if(document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0])
{
document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0].style.background="RGB(255,255,180)" ;
document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0].parentNode.style.background="RGB(255,255,180)" ;
} /* if */
document.getElementById( cellid ).style.background="RGB(0,128,192)";
document.getElementById( cellid ).parentNode.style.background="RGB(0,128,192)";
document.getElementById( cellid ).style.color="RGB(255,255,255)";
if (inputtype_=='select'){Focus_Border_Right(input);} else {NumericInputFormat(input); }
document.getElementById( cellid ).focus(); /* cellid.focus();  */
} /* for (document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0]) */
switch(browserlevel)
{
case 4:
setSelectionRange_(cellid, 0, 0);
break ;
case 5 :
setSelectionRange_(cellid, 0, 0);
break ;
default :
/* setSelectionRange_(cellid, 0, 0); */
break ;
}
if (! inputtype_=='select') { SelectAll(cellid);}
/* setSelectionRange(cellid, 0, 0); */
/* SelectAll(cellid);*/
 }  /* function setBackgroundColor */







function setLineBackgroundColor( type_,input,cellid)
{ document.getElementById( cellid ).style.background="RGB(0,128,192)";
document.getElementById( cellid ).style.color="RGB(255,255,255)";
if (type_=='N'){
LineNumericInputFormat(input); }else {LineTextNormalFormat(input)}
document.getElementById( cellid ).focus(); /* cellid.focus();  */
SelectAll(cellid);
}   /* function setBackgroundColor */

/*function setLineBackgroundColor( type_,input,cellid)
{ document.getElementById( cellid ).style.background="RGB(0,128,192)";
document.getElementById( cellid ).style.color="RGB(255,255,255)";
NumericInputFormat(input);
document.getElementById( cellid ).focus();
SelectAll(cellid);
} */  /* function setBackgroundColor */
 function setGridDefaultBackgroundColor( type_,deci_,input,cellid,rowid ,tableid,inputtype_){
var number_of_columns =(document.getElementById(tableid).getElementsByTagName('th').length);
for (i=1;i<=number_of_columns;i++){
if(document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0]){
document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0].style.background="RGB(255,255,255)" ;
document.getElementById(tableid).rows[rowid].cells[i-1*1].childNodes[0].parentNode.style.background="RGB(255,255,255)" ;}
document.getElementById( cellid ).style.color="RGB(0,0,0)";
if (type_=='N'){
if (! input.value) {input.value=0;}
input.value=parseFloat(input.value).toFixed(deci_);
NumericNormalFormat(input);
}
else {
if (inputtype_=='select'){
/*LostFocus_Border_Right(input);*/}
else {
TextNormalFormat(input)
;}
}
}
}
function NumericFormat(input){
var num = input.value.replace(/\,/g,'');
if(!isNaN(num)){
if(num.indexOf('.') > -1){
num = num.split('.');
num[0] = num[0].toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1,').split('').reverse().join('').replace(/^[\,]/,'');
if(num[1].length > 2){
  alert('You may only enter two decimals!');
  num[1] = num[1].substring(0,num[1].length-1);
  }  input.value = num[0]+'.'+num[1];      
}
else{ input.value = num.toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1,').split('').reverse().join('').replace(/^[\,]/,'') };
}
else{ alert('You may enter only numbers in this field!');
input.value = input.value.substring(0,input.value.length-1);}}
     
     


function Validate_Numeric(evt,value) {
if(!isNaN(value)){
/*alert(evt);
alert(isNaN(value));
alert(value);
var num = object.value.replace(/\,/g,''); */
  var theEvent = evt || window.event;
  var key = theEvent.keyCode || theEvent.which;
  key = String.fromCharCode( key );
  var regex = /[0-9]|\./;
  if( !regex.test(key) ) {
    theEvent.returnValue = false;
if (theEvent.preventDefault)  
    theEvent.preventDefault();  
  else if (theEvent.cancelBubble)   /* for ie */
    theEvent.cancelBubble = true;
/*    theEvent.preventDefault(); */
  }}
  else
  {theEvent.returnValue = false;}
}

/* function handleKeyPress(evt) {
  var nbr;
  var nbr = (window.event)?event.keyCode:evt.which;
  alert(nbr);
  return true;
  }  */
function ZapInGrid(tableid)
{var tbl = document.getElementById(tableid);
  var lastRow = tbl.rows.length;
  if (lastRow >=2) tbl.deleteRow(lastRow - 1);}function padleft(input, ch, num) {
var val=input.value;
if (val.length<num) {
   if(val){
    var re = new RegExp(".{" + num + "}$");
var new_num=num*1-val.length;
    var pad = "";
    if (!ch) ch = " ";
       do  {
           pad += ch;
           }while(pad.length < new_num);
input.value=(pad+val);
    }
    }
    }
   
    function cfm() { if (!confirm("确定(Y/N)嗎?")) { window.event.returnValue = false; }}
function winexit(sid) {  $.cookie("example",sid); window.returnValue =sid;window.close();}
function thisrecno(sid) {_refresh("recno",sid*1+1*1);}
function SelectAll(id){if (document.getElementById(id)){_current_id=id; document.getElementById(id).focus();document.getElementById(id).select();}}
function poponload()
{
testwindow= window.open ("", "mywindow",
    "location=0,status=0,scrollbars=0,width=100,height=100");
testwindow.moveTo(0,0);
}function exitpop0()
{my_window= window.open ("",
  "mywindow1","status=1,width=350,height=150");
my_window.document.write('<H1>Popup Test!</H1>');  }

</script>
<script type="text/javascript">
/*initjs*/
$(function(){

_refresh("_browser",browserName);
document.getElementById("retrieval_key").focus();});

$(function(){/*20110330*/
});
$(function(){var tbl = document.getElementById('_3ZM0NFOCL');
var lastRow = tbl.rows.length;
var iteration = lastRow;
_current_row = iteration ;
var NewRow = tbl.insertRow(lastRow);
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'貨品編號[' + iteration+']','貨品編號'+iteration,10,lastRow,0,'grid_header_caption');
NewText.value = '貨品編號';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(0);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'[' + iteration+']',''+iteration,30,lastRow,1,'grid_header_caption');
NewText.value = '';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(1);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'概述[' + iteration+']','概述'+iteration,30,lastRow,2,'grid_header_caption');
NewText.value = '概述';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(2);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'數量[' + iteration+']','數量'+iteration,10,lastRow,3,'grid_header_Rcaption');
NewText.value = '數量';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(3);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'單位[' + iteration+']','單位'+iteration,6,lastRow,4,'grid_header_caption');
NewText.value = '單位';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(4);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'價錢[' + iteration+']','價錢'+iteration,12,lastRow,5,'grid_header_Rcaption');
NewText.value = '價錢';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(5);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'合共[' + iteration+']','合共'+iteration,12,lastRow,6,'grid_header_Rcaption');
NewText.value = '合共';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(6);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'[' + iteration+']',''+iteration,1,lastRow,7,'grid_header_caption');
NewText.value = '';NewText.readOnly = true;NewText.disabled = false ;
var NewColumn = NewRow.insertCell(7);
NewColumn.setAttribute("bgColor","#dcdcdc");
NewColumn.appendChild(NewText);  /* finish a column Define 20110208*/});

function clock(){
/*var WinNetwork = new ActiveXObject("WScript.Network"); */
/*WinNetwork.userName+' '*/
now = new Date();
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
timeValue = hours+':'+((minutes < 10) ? "0":"") + minutes + ":"+((seconds < 10) ? "0":"") + seconds ;
$('#_lock_status').each(function() {this.style.color=(_rlock=='Locked') ? "RGB(0,0,0)":"RGB(255,0,0)";});
_refresh("clock",timeValue);



customer_customer_for_INVHEAD_custcode(_lookup("INVHEAD_custcode"),document.getElementById('INVHEAD_customer_customer'));
customer_address1_for_INVHEAD_custcode(_lookup("INVHEAD_custcode"),document.getElementById('INVHEAD_customer_address1'));
customer_address2_for_INVHEAD_custcode(_lookup("INVHEAD_custcode"),document.getElementById('INVHEAD_customer_address2'));
recordlock(_lookup("INVHEAD_datetimer"), _lookup("_session_id")); /*20110224*/            
_disabled("#save",_rlock=="Unlocked");
_disabled("#Add",_rlock=="Unlocked");
_disabled("#Remove",_rlock=="Unlocked");
setTimeout("clock()",1000);}
clock();

 function function_3ZM0NFO7K()     {
if (window.showModalDialog) {
var returnTarget=window.showModalDialog("solistmc.php",this,
"dialogWidth:600px;dialogHeight:400px;resizable:0;scroll:0;");
} else  {
var returnTarget=window.open("solistmc.php",this,"height=400px,width=600px,toolbar=no,directories=no,status=no,memubar=no,modal=yes,location=no,resizable=no,menubar=no,scrollbars=no,copyhistory=no");
}




cookiefunction_3ZM0NFO7K()}
function cookiefunction_3ZM0NFO7K(){
returnTarget=$.cookie("example");
$.cookie("example", null);
 if(returnTarget != undefined && returnTarget.length > 1)
 {
var temp0218 = new Array();
temp0218 = returnTarget.split('||');
/* alert(temp0218.length); */
for (i0218=0;i0218<temp0218.length;i0218++){
/* alert(i0218); */
addRowToTable__3ZM0MLENF();
strend=temp0218[i0218].indexOf("</partno>");
strbegin=temp0218[i0218].indexOf("<partno>")+8*1;
document.getElementById('INVBODY_item' + _current_row).value =temp0218[i0218].substr(strbegin,strend-strbegin);
partmstr_descript_for_INVBODY_item(document.getElementById('INVBODY_item' + _current_row).value,document.getElementById('INVBODY_partmstr_descript' +_current_row));
strend=temp0218[i0218].indexOf("</datetimer>");
strbegin=temp0218[i0218].indexOf("<datetimer>")+11*1;
document.getElementById('INVBODY_sob' + _current_row).value =temp0218[i0218].substr(strbegin,strend-strbegin);
/* alert(temp0218[i]);*/
}
/* working */
 }}
 function function_3ZM0NFO7L()     {
if (window.showModalDialog) {
var returnTarget=window.showModalDialog("Customer_List.php",this,
"dialogWidth:600px;dialogHeight:400px;resizable:0;scroll:0;");
} else  {
var returnTarget=window.open("Customer_List.php",this,"height=400px,width=600px,toolbar=no,directories=no,status=no,memubar=no,modal=yes,location=no,resizable=no,menubar=no,scrollbars=no,copyhistory=no");
}




cookiefunction_3ZM0NFO7L()}
function cookiefunction_3ZM0NFO7L(){
returnTarget=$.cookie("example");
$.cookie("example", null);
 if(returnTarget != undefined && returnTarget.length > 1)
 {
/* working */
 }}
 function function_3ZM0NFO7M()     {
if (window.showModalDialog) {
var returnTarget=window.showModalDialog("InvoiceList.php",this,
"dialogWidth:600px;dialogHeight:400px;resizable:0;scroll:0;");
} else  {
var returnTarget=window.open("InvoiceList.php",this,"height=400px,width=600px,toolbar=no,directories=no,status=no,memubar=no,modal=yes,location=no,resizable=no,menubar=no,scrollbars=no,copyhistory=no");
}




cookiefunction_3ZM0NFO7M()}
function cookiefunction_3ZM0NFO7M(){
returnTarget=$.cookie("example");
$.cookie("example", null);
 if(returnTarget != undefined && returnTarget.length > 1)
 {
/* working */
var strend=returnTarget.indexOf("</invoice>");
var strbegin=returnTarget.indexOf("<invoice>")+9*1;
 document.getElementById('retrieval_key').value=returnTarget.substr(strbegin,strend-strbegin);
 sendRequest(document.getElementById('retrieval_key').value);
 }}

function retrieval() {
if (xmlHttp.readyState==4){
if (xmlHttp.status == 200) {
/* alert(xmlHttp.responseText); */
var s = xmlHttp.responseXML;
var _seek = s.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
_rlock = s.getElementsByTagName("rlock")[0].childNodes[0].nodeValue ;
if (_seek=='FALSE'){jAlert('No this Record','Retrieval Header',function(){_refresh('retrieval_key','');$('#retrieval_key').focus(); } );} else {
session_id=_lookup('_session_id');
zzz_datetimer= s.getElementsByTagName("INVHEAD_datetimer")[0].childNodes[0].nodeValue;
_result=recordlock(zzz_datetimer, session_id);
var fields = ["INVHEAD_datetimer C 18 0","INVHEAD_customer C 30 0 ","INVHEAD_date D 10 0 ","INVHEAD_duedate D 10 0 ","INVHEAD_custcode C 10   ","INVHEAD_customerdt C 10   ","INVHEAD_custcode C 50   ","INVHEAD_custcode C 50   "];;
for (i=0;i<fields.length;i++){
var obj_field=document.getElementById(fields[i].split(" ")[0]);
if (s.getElementsByTagName(fields[i].split(" ")[0])[0].childNodes[0].nodeType=="3") {
if (obj_field) {
if (obj_field.type=='checkbox') { yn=s.getElementsByTagName(fields[i].split(" ")[0])[0].childNodes[0].nodeValue; if( yn=='Y'){obj_field.checked=true;} else {obj_field.checked=false;} }else
{obj_field.value=s.getElementsByTagName(fields[i].split(" ")[0])[0].childNodes[0].nodeValue;}
} /*20110211 18:28*/
var eee=fields[i].split(" ")[0];
if(eval("document.form1."+eee+"_radio"))
{eval("document.form1."+eee+"_radio[(obj_field.value)*1-1].checked=true");}
}
if (fields[i].split(" ")[1]=="N"){
if (! obj_field.value) {obj_field.value=0}
obj_field.value=parseFloat(obj_field.value).toFixed(fields[i].split(" ")[3]);
}
document.getElementById('_lock_status').value=_rlock;
} /* 201102111840*/



var _reccount = s.getElementsByTagName("reccount_0")[0].childNodes[0].nodeValue ;
for (iix=0; iix<=_reccount-1; iix++) {addRowToTable__3ZM0MLENF()}
var fields = ["INVBODY_item C 10 0 ","INVBODY_partmstr_descript C 0 0 ","INVBODY_descript C 30 0 ","INVBODY_qty N 10 0 ","INVBODY_uom C 4 0 ","INVBODY_price N 12 2 ","INVBODY_sob C 18   ","INVBODY_datetimer C 18   "];;
for (iix=0; iix<=_reccount-1; iix++){var _row=iix+1 ;
for (i=0;i<fields.length;i++){
var obj_field=document.getElementById(fields[i].split(" ")[0]+_row);
if (s.getElementsByTagName(fields[i].split(" ")[0])[iix].childNodes[0].nodeType=="3") {
obj_field.value=s.getElementsByTagName(fields[i].split(" ")[0])[iix].childNodes[0].nodeValue ;
}
if (fields[i].split(" ")[1]=="N"){
if (! obj_field.value) {obj_field.value=0}
obj_field.value=parseFloat(obj_field.value).toFixed(fields[i].split(" ")[3]);
}
if(obj_field){
if (document.getElementById('_lock_status').value=='Locked') {obj_field.disabled=false;} else {obj_field.disabled=true;}
} /* if(obj_field) */
}} /* endofdata */
invbody__total_for_invbody__3ZM0NFO6E();




var s = xmlHttp.responseXML;
rlock=_rlock;
_refresh('_lock_status',rlock);/*20110313*/
/*document.getElementById('_lock_status').value=rlock;*/

if (rlock=="Unlocked") {jAlert("some one using it");}}
}
}

}





/*Html_lib.lib.jQueryGet*/
function customer_customer_for_INVHEAD_custcode(thisvalue,returnobject)
{if(thisvalue){ $.ajax
({
data: { callfunction: "customer_customer_for_INVHEAD_custcode" ,custcode:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('customer')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ; /*MakeCookie*/}}
 else
{_refresh('INVHEAD_custcode','');document.getElementById('INVHEAD_custcode').focus();returnobject.value=""; }
} /*if ...seek */
} /*success:function*/  
})
}}






/*Html_lib.lib.jQueryGet*/
function customer_customer_for_INVHEAD_custcode_dt(thisvalue,returnobject)
{if(thisvalue){ $.ajax
({
data: { callfunction: "customer_customer_for_INVHEAD_custcode" ,custcode:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('datetimer')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ; /*MakeCookie*/}}
 else
{_refresh('INVHEAD_custcode','');document.getElementById('INVHEAD_custcode').focus();returnobject.value=""; }
} /*if ...seek */
} /*success:function*/  
})
}}






/*Html_lib.lib.jQueryGet*/
function customer_address1_for_INVHEAD_custcode(thisvalue,returnobject)
{if(thisvalue){ $.ajax
({
data: { callfunction: "customer_address1_for_INVHEAD_custcode" ,custcode:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('address1')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ; /*MakeCookie*/}}
 else
{_refresh('INVHEAD_custcode','');document.getElementById('INVHEAD_custcode').focus();returnobject.value=""; }
} /*if ...seek */
} /*success:function*/  
})
}}






/*Html_lib.lib.jQueryGet*/
function customer_address1_for_INVHEAD_custcode_dt(thisvalue,returnobject)
{if(thisvalue){ $.ajax
({
data: { callfunction: "customer_address1_for_INVHEAD_custcode" ,custcode:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('datetimer')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ; /*MakeCookie*/}}
 else
{_refresh('INVHEAD_custcode','');document.getElementById('INVHEAD_custcode').focus();returnobject.value=""; }
} /*if ...seek */
} /*success:function*/  
})
}}






/*Html_lib.lib.jQueryGet*/
function customer_address2_for_INVHEAD_custcode(thisvalue,returnobject)
{if(thisvalue){ $.ajax
({
data: { callfunction: "customer_address2_for_INVHEAD_custcode" ,custcode:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('address2')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ; /*MakeCookie*/}}
 else
{_refresh('INVHEAD_custcode','');document.getElementById('INVHEAD_custcode').focus();returnobject.value=""; }
} /*if ...seek */
} /*success:function*/  
})
}}






/*Html_lib.lib.jQueryGet*/
function customer_address2_for_INVHEAD_custcode_dt(thisvalue,returnobject)
{if(thisvalue){ $.ajax
({
data: { callfunction: "customer_address2_for_INVHEAD_custcode" ,custcode:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('datetimer')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ; /*MakeCookie*/}}
 else
{_refresh('INVHEAD_custcode','');document.getElementById('INVHEAD_custcode').focus();returnobject.value=""; }
} /*if ...seek */
} /*success:function*/  
})
}}






var reccount__3ZM0MLENF;
function GridColOnClick__3ZM0MLENF(m_rowno)
{thisrecno(m_rowno*1-1*1);_current_table_id=_3ZM0MLENF; _refresh("table","invbody"); _refresh("reccount",reccount__3ZM0MLENF);};
function deleteRow(i) { document.getElementById('_3ZM0MLENF').deleteRow(i)}
function __3ZM0MLENFc()
{
_return_value="";
_return_value=_return_value+"<INVBODY_item>"+_lookup("INVBODY_item"+_lookup("recno"))+"</INVBODY_item>";
_return_value=_return_value+"<INVBODY_partmstr_descript>"+_lookup("INVBODY_partmstr_descript"+_lookup("recno"))+"</INVBODY_partmstr_descript>";
_return_value=_return_value+"<INVBODY_descript>"+_lookup("INVBODY_descript"+_lookup("recno"))+"</INVBODY_descript>";
_return_value=_return_value+"<INVBODY_qty>"+_lookup("INVBODY_qty"+_lookup("recno"))+"</INVBODY_qty>";
_return_value=_return_value+"<INVBODY_uom>"+_lookup("INVBODY_uom"+_lookup("recno"))+"</INVBODY_uom>";
_return_value=_return_value+"<INVBODY_price>"+_lookup("INVBODY_price"+_lookup("recno"))+"</INVBODY_price>";
_return_value=_return_value+"<INVBODY_sob>"+_lookup("INVBODY_sob"+_lookup("recno"))+"</INVBODY_sob>";
_return_value=_return_value+"<INVBODY_datetimer>"+_lookup("INVBODY_datetimer"+_lookup("recno"))+"</INVBODY_datetimer>";
_return_value=_return_value+"<INVBODY__total>"+_lookup("INVBODY__total"+_lookup("recno"))+"</INVBODY__total>";
$.cookie('sample',_return_value);
} /*20111028*/
function DetailToTable__3ZM0MLENF(){
var _lineinf = ' ';
var v_INVBODY_item=_lookup('INVBODY_item'+_lookup('recno'));
var v_INVBODY_descript=_lookup('INVBODY_descript'+_lookup('recno'));
var v_INVBODY_qty=_lookup('INVBODY_qty'+_lookup('recno'));
var v_INVBODY_uom=_lookup('INVBODY_uom'+_lookup('recno'));
var v_INVBODY_price=_lookup('INVBODY_price'+_lookup('recno'));
var v_INVBODY_sob=_lookup('INVBODY_sob'+_lookup('recno'));
var v_INVBODY_datetimer=_lookup('INVBODY_datetimer'+_lookup('recno'));
var v_INVBODY__total=_lookup('INVBODY__total'+_lookup('recno'));
if (window.showModalDialog) {
var returnTarget=window.showModalDialog( " invoiceinput2_grid_page0.html?para1="+_lineinf+"&v_INVBODY_item="+v_INVBODY_item+"&v_INVBODY_descript="+v_INVBODY_descript+"&v_INVBODY_qty="+v_INVBODY_qty+"&v_INVBODY_uom="+v_INVBODY_uom+"&v_INVBODY_price="+v_INVBODY_price+"&v_INVBODY_sob="+v_INVBODY_sob+"&v_INVBODY_datetimer="+v_INVBODY_datetimer+"&v_INVBODY__total="+v_INVBODY__total,this,
"dialogWidth:600px;dialogHeight:400px;resizable:0;scroll:0;");
} else  {
var returnTarget=window.open( " invoiceinput2_grid_page0.html?para1="+_lineinf+"&v_INVBODY_item="+v_INVBODY_item+"&v_INVBODY_descript="+v_INVBODY_descript+"&v_INVBODY_qty="+v_INVBODY_qty+"&v_INVBODY_uom="+v_INVBODY_uom+"&v_INVBODY_price="+v_INVBODY_price+"&v_INVBODY_sob="+v_INVBODY_sob+"&v_INVBODY_datetimer="+v_INVBODY_datetimer+"&v_INVBODY__total="+v_INVBODY__total,this,"height=400px,width=600px,toolbar=no,directories=no,status=no,memubar=no,modal=yes,location=no,resizable=no,menubar=no,scrollbars=no,copyhistory=no");
}




 if(returnTarget != undefined && returnTarget.length > 1)
 {
var temp0218 = new Array();/*31033*/
temp0218 = returnTarget;
strend=temp0218.indexOf("</INVBODY_item>");
strbegin=temp0218.indexOf("<INVBODY_item>")+14*1;
_refresh('INVBODY_item'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_descript>");
strbegin=temp0218.indexOf("<INVBODY_descript>")+18*1;
_refresh('INVBODY_descript'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_qty>");
strbegin=temp0218.indexOf("<INVBODY_qty>")+13*1;
_refresh('INVBODY_qty'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_uom>");
strbegin=temp0218.indexOf("<INVBODY_uom>")+13*1;
_refresh('INVBODY_uom'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_price>");
strbegin=temp0218.indexOf("<INVBODY_price>")+15*1;
_refresh('INVBODY_price'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin),"2"));

strend=temp0218.indexOf("</INVBODY_sob>");
strbegin=temp0218.indexOf("<INVBODY_sob>")+13*1;
_refresh('INVBODY_sob'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin)," "));

strend=temp0218.indexOf("</INVBODY_datetimer>");
strbegin=temp0218.indexOf("<INVBODY_datetimer>")+19*1;
_refresh('INVBODY_datetimer'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin)," "));

strend=temp0218.indexOf("</INVBODY__total>");
strbegin=temp0218.indexOf("<INVBODY__total>")+16*1;
_refresh('INVBODY__total'-_lookup('recno'),_round(temp0218.substr(strbegin,strend-strbegin),"2"));

}
}
function __3ZM0MLENFf(){
var temp0218 = new Array();/*20111106c*/
temp0218 = $.cookie("sample");
strend=temp0218.indexOf("</INVBODY_item>");
strbegin=temp0218.indexOf("<INVBODY_item>")+14*1;
_refresh('INVBODY_item'+_lookup('recno')                                      ,_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_partmstr_descript>");
strbegin=temp0218.indexOf("<INVBODY_partmstr_descript>")+27*1;
_refresh('INVBODY_partmstr_descript'+_lookup('recno')                         ,_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_descript>");
strbegin=temp0218.indexOf("<INVBODY_descript>")+18*1;
_refresh('INVBODY_descript'+_lookup('recno')                                  ,_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_qty>");
strbegin=temp0218.indexOf("<INVBODY_qty>")+13*1;
_refresh('INVBODY_qty'+_lookup('recno')                                       ,_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_uom>");
strbegin=temp0218.indexOf("<INVBODY_uom>")+13*1;
_refresh('INVBODY_uom'+_lookup('recno')                                       ,_round(temp0218.substr(strbegin,strend-strbegin),"0"));

strend=temp0218.indexOf("</INVBODY_price>");
strbegin=temp0218.indexOf("<INVBODY_price>")+15*1;
_refresh('INVBODY_price'+_lookup('recno')                                     ,_round(temp0218.substr(strbegin,strend-strbegin),"2"));

strend=temp0218.indexOf("</INVBODY_sob>");
strbegin=temp0218.indexOf("<INVBODY_sob>")+13*1;
_refresh('INVBODY_sob'+_lookup('recno')                                       ,_round(temp0218.substr(strbegin,strend-strbegin)," "));

strend=temp0218.indexOf("</INVBODY_datetimer>");
strbegin=temp0218.indexOf("<INVBODY_datetimer>")+19*1;
_refresh('INVBODY_datetimer'+_lookup('recno')                                 ,_round(temp0218.substr(strbegin,strend-strbegin)," "));

strend=temp0218.indexOf("</INVBODY__total>");
strbegin=temp0218.indexOf("<INVBODY__total>")+16*1;
_refresh('INVBODY__total'+_lookup('recno')                                    ,_round(temp0218.substr(strbegin,strend-strbegin),"2"));

invbody__total_for_invbody__3ZM0NFO6E();/*20111106b*/

}
/*Html_lib.lib.jQueryGet2*/
function partmstr_descript_for_INVBODY_item(thisvalue,returnobject,thisid)
{ $.ajax
({
data: { callfunction: "partmstr_descript_for_INVBODY_item" ,doc_no:thisvalue },  
type: "GET",
url: "invoiceinput2R.php",
dataType: "xml",
success: function(data)
{if (data.getElementsByTagName("seek")[0])
{
var _seek = data.getElementsByTagName("seek")[0].childNodes[0].nodeValue ;
if (_seek=='TRUE')
{var _reccount = data.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++)
{return_data=data.getElementsByTagName('descript')[iix].childNodes[0].nodeValue ;
returnobject.value = return_data ;}}
 else
 if (thisid){
{_refresh(thisid,'');document.getElementById(thisid).focus();returnobject.value=""; }}
} /*if ...seek */
} /*success:function*/  
})
}






function STATUS_STATUS2_for_INVBODY_uom2011111219()
{
if (window.XMLHttpRequest) {
xmlHttp_3ZM0NFOC6 = new XMLHttpRequest();
}else if (window.ActiveXObject) {
xmlHttp_3ZM0NFOC6 = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttp_3ZM0NFOC6.open('GET','invoiceinput2R.php?get_MODULE=UOM&callfunction=STATUS_STATUS2_for_INVBODY_uom2011111219                                                            ',true);
xmlHttp_3ZM0NFOC6.onreadystatechange=function()
{
if (xmlHttp_3ZM0NFOC6.readyState==4)
{
if (xmlHttp_3ZM0NFOC6.status == 200)
{
var status_cur = xmlHttp_3ZM0NFOC6.responseXML;
var obj_field=document.getElementById('INVBODY_uom');
var return_data='';
var s = xmlHttp_3ZM0NFOC6.responseXML;
var _reccount = s.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++) {return_data=s.getElementsByTagName('STATUS2')[iix].childNodes[0].nodeValue ;
var option = new Option(return_data,return_data);
STATUS_STATUS2_for_INVBODY_uom2011111219_array[iix]=return_data;
}
}
}
};
xmlHttp_3ZM0NFOC6.send(null);
}/*2011111219*/
function invbody__total_for_invbody__3ZM0NFO6E(thisvalue,returnobject)/*20111106*/
{
var v_INVHEAD_fc_amt=0;
var tbl = document.getElementById('_3ZM0MLENF');
var lastRow = tbl.rows.length;
 for (iix=1; iix<lastRow; iix++) {
if(_lookup('INVBODY_RecStatus'+iix) !=='D') { /*20110127*/
 var obj_qty =document.getElementById("INVBODY_qty"+iix);
 if ( isNaN(obj_qty.value)) {obj_qty.value=0;}
 var obj_price =document.getElementById("INVBODY_price"+iix);
 if ( isNaN(obj_price.value)) {obj_price.value=0;}
 var obj__total =document.getElementById("INVBODY__total"+iix);
 if ( isNaN(obj__total.value)) {obj__total.value=0;}
obj__total.value=(obj_qty.value*obj_price.value).toFixed(2);
v_INVHEAD_fc_amt=((v_INVHEAD_fc_amt)*1+(obj__total.value)*1).toFixed(2);
 }
 }

_refresh('INVHEAD_fc_amt',v_INVHEAD_fc_amt);
_refresh('say_INVHEAD_fc_amt',v_INVHEAD_fc_amt);
}
function removeRowFromTable__3ZM0MLENF()
{
var dbf="INVBODY";
var tbl = document.getElementById('_3ZM0MLENF');
var rows = tbl.getElementsByTagName('tr');
rows[document.getElementById('recno').value].style.display = 'none';
var obj='INVBODY_RecStatus'+document.getElementById('recno').value;
if (document.getElementById(obj)) {document.getElementById(obj).value='D';}
thisrecno(document.getElementById('recno').value-2*1) ;
invbody__total_for_invbody__3ZM0NFO6E();                                                              
field_setfocus='INVBODY_item' +document.getElementById('recno').value  ;
if (document.getElementById(field_setfocus)){document.getElementById(field_setfocus).focus();}
}
function _add_column(_object,_type,_height,_name,_id,_size,_rowno,_cellno,_className)
{
_object.type=_type; _object.height=_height;_object.name=_name;_object.id=_id;
_object.height=_height;_object.size=_size;_object._rowno=_rowno;_object._cellno=_cellno;_object.className=_className;
}
function addRowToTable__3ZM0MLENF()
{
var tbl = document.getElementById('_3ZM0MLENF');
var lastRow = tbl.rows.length;
var iteration = lastRow;
_current_row = iteration ;
var NewRow = tbl.insertRow(lastRow);
reccount__3ZM0MLENF=lastRow;
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'INVBODY_item[' + iteration+']','INVBODY_item'+iteration,10,lastRow,0,'GridInputClass_INVBODY_item');/*20110208*/
field_setfocus='INVBODY_item' + iteration;
NewText.onclick = function(event) {SelectAll(this.id); GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);  setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onfocus = function(event) {SelectAll(this.id); nextfield='INVBODY_descript' + iteration; thisRowFirstField='INVBODY_item' + iteration; prevfield='INVBODY_price' + iteration; upperfield='INVBODY_item' + ((iteration*1)-1); lowerfield='INVBODY_item' +((iteration*1)+1) ;  GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex); setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) { setGridDefaultBackgroundColor("C","0", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");partmstr_descript_for_INVBODY_item(this.value,document.getElementById('INVBODY_partmstr_descript' +iteration))   ;};
var NewColumn = NewRow.insertCell(0); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
NewText._rowno = lastRow ;
NewText._cellno = 1;
NewText.type = 'text';
NewText.name = 'INVBODY_partmstr__descript[' + iteration+']';
NewText.id = 'INVBODY_partmstr_descript' + iteration;
NewText.height = '20';
NewText.size = '30';
NewText.readOnly = true;
NewText.disabled = false ;
NewText.className='GridInputClass_INVBODY_item';
NewText.onclick = function(event) {return GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);};
NewText.onfocus = function(event) {return setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) {return setGridDefaultBackgroundColor("C","0", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
var NewColumn = NewRow.insertCell(1);
NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'INVBODY_descript[' + iteration+']','INVBODY_descript'+iteration,30,lastRow,2,'GridInputClass_INVBODY_descript');/*20110208*/
NewText.onclick = function(event) {SelectAll(this.id); GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);  setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onfocus = function(event) {SelectAll(this.id); nextfield='INVBODY_qty' + iteration; thisRowFirstField='INVBODY_item' + iteration; prevfield='INVBODY_item' + iteration; upperfield='INVBODY_descript' + ((iteration*1)-1); lowerfield='INVBODY_descript' +((iteration*1)+1) ;  GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex); setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) {setGridDefaultBackgroundColor("C","0", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF"); ;
};
var NewColumn = NewRow.insertCell(2); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'INVBODY_qty[' + iteration+']','INVBODY_qty'+iteration,10,lastRow,3,"CSS_Table_Normal_Number_Format"
);/*20110208*/
NewText.onclick = function(event) {SelectAll(this.id); GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);  setGridBackgroundColor("N", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onfocus = function(event) {SelectAll(this.id); nextfield='INVBODY_uom' + iteration; thisRowFirstField='INVBODY_item' + iteration; prevfield='INVBODY_descript' + iteration; upperfield='INVBODY_qty' + ((iteration*1)-1); lowerfield='INVBODY_qty' +((iteration*1)+1) ;  GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex); setGridBackgroundColor("N", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) {setGridDefaultBackgroundColor("N","0", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");invbody__total_for_invbody__3ZM0NFO6E() ;
};
NewText.onkeypress=function(event) {return Validate_Numeric(event,this.value);};
var NewColumn = NewRow.insertCell(3); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.appendChild(NewText);
var sel = document.createElement('select');
sel._rowno = lastRow ; sel._cellno = 4;
sel.id = 'INVBODY_uom' + iteration;
 sel.width = '6';
sel.name = 'INVBODY_uom[' + iteration+']';
   for (iix_3ZM0NFOCG=0; iix_3ZM0NFOCG<STATUS_STATUS2_for_INVBODY_uom2011111219_array.length;iix_3ZM0NFOCG++){sel.options[iix_3ZM0NFOCG] = new Option(STATUS_STATUS2_for_INVBODY_uom2011111219_array[iix_3ZM0NFOCG],STATUS_STATUS2_for_INVBODY_uom2011111219_array[iix_3ZM0NFOCG]); };
var NewColumn = NewRow.insertCell(4);
sel.onfocus = function(event) {nextfield='INVBODY_price' + iteration; prevfield='INVBODY_qty' + iteration;  setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF","select");};
sel.onblur = function(event) {setGridDefaultBackgroundColor("C","0", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF","select" ); ;
};
NewColumn.appendChild(sel);  
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'INVBODY_price[' + iteration+']','INVBODY_price'+iteration,12,lastRow,5,"CSS_Table_Normal_Number_Format"
);/*20110208*/
NewText.onclick = function(event) {SelectAll(this.id); GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);  setGridBackgroundColor("N", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onfocus = function(event) {SelectAll(this.id); nextfield='INVBODY_item' + iteration; thisRowFirstField='INVBODY_item' + iteration; prevfield='INVBODY_uom' + iteration; upperfield='INVBODY_price' + ((iteration*1)-1); lowerfield='INVBODY_price' +((iteration*1)+1) ;  GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex); setGridBackgroundColor("N", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) {setGridDefaultBackgroundColor("N","2", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");invbody__total_for_invbody__3ZM0NFO6E() ;
};
NewText.onkeypress=function(event) {return Validate_Numeric(event,this.value);};
var NewColumn = NewRow.insertCell(5); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
_add_column(NewText,'hidden',20,'INVBODY_sob[' + iteration+']','INVBODY_sob'+iteration,18,lastRow,6,'GridInputClass_INVBODY_sob');/*20110208*/
NewText.onclick = function(event) {SelectAll(this.id); GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);  setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onfocus = function(event) {SelectAll(this.id); nextfield='' + iteration; thisRowFirstField='INVBODY_item' + iteration; prevfield='' + iteration; upperfield='INVBODY_sob' + ((iteration*1)-1); lowerfield='INVBODY_sob' +((iteration*1)+1) ;  GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex); setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) {setGridDefaultBackgroundColor("C"," ", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");
partmstr_descript_for_INVBODY_item(this.value,document.getElementById('INVBODY_item' +iteration),this.id)/*20110121*/ ; ;
};
var NewColumn = NewRow.insertCell(6); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.className='CSS_Invisible_Border';
NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
_add_column(NewText,'hidden',20,'INVBODY_datetimer[' + iteration+']','INVBODY_datetimer'+iteration,18,lastRow,7,'GridInputClass_INVBODY_datetimer');/*20110208*/
NewText.onclick = function(event) {SelectAll(this.id); GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex);  setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onfocus = function(event) {SelectAll(this.id); nextfield='' + iteration; thisRowFirstField='INVBODY_item' + iteration; prevfield='' + iteration; upperfield='INVBODY_datetimer' + ((iteration*1)-1); lowerfield='INVBODY_datetimer' +((iteration*1)+1) ;  GridColOnClick__3ZM0MLENF(this.parentNode.parentNode.rowIndex); setGridBackgroundColor("C", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF");};
NewText.onblur = function(event) {setGridDefaultBackgroundColor("C"," ", this,this.id,this.parentNode.parentNode.rowIndex,"_3ZM0MLENF"); ;
};
var NewColumn = NewRow.insertCell(7); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.className='CSS_Invisible_Border';
NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
_add_column(NewText,'text',20,'INVBODY__total[' + iteration+']','INVBODY__total'+iteration,12,lastRow,8,"CSS_Disable_Number_Format"
);/*20110208*/
NewText.readOnly = true;
NewText.onfocus = function(event) {return false};
NewText.onclick = function(event) {return false};
NewText.tabIndex = -1 ;  /*20110124*/
var NewColumn = NewRow.insertCell(8); /* finish a column Define */
NewColumn.setAttribute("bgColor","#dcdcdc"); NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
NewText.type = 'hidden';
NewText.name = 'datetimer[' + iteration+']';
NewText.id = 'datetimer' + iteration;
NewText.height = '20';
var NewColumn = NewRow.insertCell(9);
NewColumn.className='CSS_Invisible_Border';
NewColumn.appendChild(NewText);
var NewText = document.createElement('input');
NewText.type = 'hidden';
NewText.name = ' INVBODY_RecStatus[' + iteration+']';
NewText.id = 'INVBODY_RecStatus' + iteration;
NewText.height = '20';
NewText.size = '2';
var NewColumn = NewRow.insertCell(10);
NewColumn.className='CSS_Invisible_Border';
NewColumn.appendChild(NewText);


thisrecno(_current_row-1*1) ;
document.getElementById('INVBODY_footer').scrollIntoView(true);
document.getElementById(field_setfocus).focus();
$(field_setfocus).click();
}
function _pagechange(_para1)
{
};

function sendRequest(para1){
if (para1) {
blank();
createXHR();
xmlHttp.onreadystatechange=function(){retrieval(para1)};
_sessionid=_lookup('_session_id');
xmlHttp.open('GET','invoiceinput2R.php?callfunction=retrieval&key='+para1+'&session_id='+_sessionid+'&timeStamp='+new Date().getTime() ,true);
xmlHttp.send(null);}};

function blank(){
_refresh('_lock_status','');
_refresh('table','');
_refresh('recno','');
_refresh('reccount','');
document.getElementById("INVHEAD_datetimer").value="";
_rlock="";var tbl = document.getElementById('_3ZM0MLENF');
var lastRow = tbl.rows.length;
for (iix=2; iix<=lastRow; iix++){ZapInGrid('_3ZM0MLENF');}
var object_temp=document.getElementById("say_INVHEAD_fc_amt");if(object_temp){object_temp.value='0.00';};
var object_temp=document.getElementById("INVHEAD_fc_amt");if(object_temp){object_temp.value='0.00';};

};
</script>
<style type="text/css"><!--
body {
margin-left: 1px;
margin-top: 1px;
margin-right: 1px;
margin-bottom: 1px;
font-size:13px;
/* text-align:center; */ /* center all the text */
}

/*table { font-family: "細明體"; font-size: 9pt; line-height: 20px; color: #000000} */

/* html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
} */

fieldset {
border: 1px solid black; padding: 8px; margin: 8px 0;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}



h1, h2 { font-family: 'trebuchet ms', verdana, arial; padding: 10px; margin: 0 }
h1 { font-size: large }
#main { padding: 1em; }
#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc;
    background: url(bg.gif) repeat-x; text-align: center }
#banner a { color: white; }
legend { font-weight: bold; }

button { padding: 0 6px; margin: 0; }

pre, code { white-space: pre; font-family: "Courier New"; }
pre { margin: 8px 0; }
h3 {
font-size: 110%;
font-weight: bold;
margin: .2em 0 .5em 0;
}
p { margin: 1em 0; }
strong { font-weight: bolder; }
em { font-style: italic; }

.jscom, .mix htcom   { color: #4040c2; }
.com      { color: green; }
.regexp   { color: maroon; }
.string   { color: teal; }
.keywords { color: blue; }
.global   { color: #008; }
.numbers  { color: #880; }
.comm     { color: green; }
.tag      { color: blue; }
.entity   { color: blue; }
.string   { color: teal; }
.aname    { color: maroon; }
.avalue   { color: maroon; }
.jquery   { color: #00a; }
.plugin   { color: red; }

#tooltip.pretty {
font-family: Arial;
border: none;
width: 210px;
padding:20px;
height: 135px;
opacity: 0.8;
background: url('shadow.png');
}
#tooltip.pretty h3 {
margin-bottom: 0.75em;
font-size: 12pt;
width: 220px;
text-align: center;
}
#tooltip.pretty div { width: 220px; text-align: left; }

#tooltip.fancy {
background: url('shadow2.png');
padding-top: 5em;
height: 100px;
}
#tooltip.fancy.viewport-right {
background: url('shadow2-reverse.png');
}

#extended { margin: 2em 0; }
#extended label { text-decoration: underline; }
#yahoo { width: 7em; }
#right, #right2 { text-align: right; }
#tooltip.right { width: 250px; }
#fancy2 { float: right; }p{
color:#000000;
margin:0px;
padding-top:0px;
padding-left:5px;
padding-right:5px;
line-height:20px;
}

input.btn{
color: #00008B;
background-color: #ADD8E6;
border: 1px outset #00008B;
padding: 1px 2px 1px 2px;
}

input.txt{
border: 1px inset #00008B;
background-color: #ADD8E6;
}


input {FONT-SIZE: 13px; vertical-align:middle;  FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif}
select {FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif}
textarea {FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif}
form{
padding:0px;
margin:0px;
font:14px Arial;
}

BODY,
HTML {
padding: 0px;
margin: 0px;
}
BODY {
font-size: 12px;
}

H1 {
font-size: 20px;
font-weight: normal;
}

H2 {
font-size: 16px;
font-weight: normal;
}

FIELDSET {
border: solid 1px #CCC;
-moz-border-radius: 16px;
-webkit-border-radius: 16px;
border-radius: 16px;
padding: 1em 2em;
margin: 1em 0em;
}

LEGEND {
color: #666;
font-size: 16px;
padding: 0em .5em;
}

PRE {
font-size: 11px;
color: #666;
background: #F8F8F8;
padding: 1em;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}

/* Custom dialog styles */
#popup_container.style_1 {
font-family: Georgia, serif;
color: #A4C6E2;
background: #005294;
border-color: #113F66;
}

#popup_container.style_1 #popup_title {
color: #FFF;
font-weight: normal;
text-align: left;
background: #76A5CC;
border: solid 1px #005294;
padding-left: 1em;
}

#popup_container.style_1 #popup_content {
background: none;
}

#popup_container.style_1 #popup_message {
padding-left: 0em;
}

#popup_container.style_1 INPUT[type='button'] {
border: outset 2px #76A5CC;
color: #A4C6E2;
background: #3778AE;
}



        /**

        * Modal Dialog

        */

        .modalBg {

            position: absolute;

            top: 0px;

            left: 0px;

            filter: Alpha(Opacity=50);

            -moz-opacity: 0.5;

            background-color: #aad;

            visibility: hidden;

            width: expression(document.body.clientWidth);

            height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight);

            z-index: 100;

        }



        .modalDialog {
            position: absolute;
            top: 111px;
            left: 0px;
            height : 480px;  /* set the Dialog main body height  */
            visibility: hidden;
            z-index: 101;
            background-color: white;
            top: 111;
            height : 480px;  /* set the Dialog main body height  */
            left: 0;
   top: expression(document.body.clientHeight / 2 - this.offsetHeight / 2);
            left: expression(document.body.clientWidth / 2 - this.offsetWidth / 2);
            border: 1px solid #777;
            border-top: 0;
            padding: 20px;
        }

        .modalDialog .modalDialogHeader {
            margin:0;
            padding: 0px;
            color: #333;
            font-weight: bold;
            background-color: #ccc;
            border: 1px solid #989898;
            position: absolute;
            top: 0px;
            left: -1px;
            height: 7px;
        }

        .modalShadow {
            position: absolute;
            background-color: black;
            top: 0px;
            left: 0px;
            z-index: 99;
/*         left: expression(document.getElementById('frediko').style.left);
            top: expression(document.getElementById('frediko').style.top);  */
        }
.CSS_Invisible_Border {border-style: none;}
.CSS_Line_Normal_Number_Format {text-align: right; background-color: white;}
.CSS_Line_Input_Number_Format {text-align: left; background-color: white;}
.CSS_Line_Normal_Text_Format {text-align:left; background-color: white;}
.CSS_Disable_Number_Format {border-style:none; cursor: default; background-color: #dcdcdc; color:#000 ; text-align:right; margin-top:0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px;  cellspacing:0; cellpadding:0;}
.CSS_Table_Normal_Number_Format {valign:center; border-style: none; text-align: right;margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style: hidden;background-color: white;}
.CSS_Input_Number_Format {border-style: none; text-align: left;margin: 0px; border-style: hidden;background-color: white;}
.CSS_Focus_Border_Right {text-align: right; margin: 0px; background-color: white;}
.CSS_LostFocus_Border_Right{text-align:right; margin: 0px; background-color: white;}
.CSS_Normal_Text_Format {border-style:none;border-style:hidden;text-align:left; margin: 0px; background-color: white;}
.CSS_Disable_Text_Format {cursor: default; background-color: #dcdcdc; color:#000 ; text-align:left; margin:0px;  cellspacing:0; cellpadding:0;}
.tableBoxOuter {
width:100%; height:25em; // adjust size of table
background: #FFFFFF;
}

.scrolltable td, th {
font-size: 12px;
margin:0em;
padding-top: 4px;
padding-bottom: 4px;
padding-right: 4px;
padding-left: 4px;
table-layout: automatic;
white-space: nowrap;
}

  .tableBoxOuterx {
width:100%; height:auto; // adjust size of table
background: #FFFFFF;
}

input.btn {color:#050; boarder-size:0px; boarder-style:normal; background:inherit; font: bold 84% 'trebuchet ms',helvetica,sans-serif; color:blue; cursor:hand; cursor:pointer;  padding:0px;  vbackground-color:#fed; border: 0px magin:0 px; solid; border-color: #696 #363 #363 #696; filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#ffeeddaa'); }
input.btnhov {border-tyle:inset; background-color: #FFFF99; border-color: #c63 #930 #930 #c63; }

#form1 label {display: block;text-align:right; width:60px;float: left; font-size: 0.875em;}
.highlight_title {color: #FFF;background-color: #693;font-size: 18px;}
table {border-collapse:collapse}
table#s {float:left; border:0;padding:0;margin:0 0 1em;border-left:1px solid #336;border-top:1px solid #336;clear:left; margin-left:10px;margin-top:10px;}
table#d {border:0; padding:0; margin:0 0 1em;border-left:1px solid #336;border-top:1px solid #336; margin-top:10px; }
table#s tr,table#d tr {border:0;padding:2px 6px;margin:0;border-right:1px solid #336;border-bottom:1px solid #336;background-color:#EAEEF3;}
table#s th,table#d th {white-space:no-wrap;background-color:#B4C4D1;padding:2px 20px;}
table#s td:hover, table#d td:hover {background-color:#ADE5EB;}
.selrow td {background-color:#879AB7;}
p {clear:both;}
[readonly=readonly] {background-color: #dcdcdc; color:#000 ; }
td[axis='number'], td[axis='date'],input[axis='number'], input[axis='date'] {text-align:right;}
/* for sorttabled */
.odd td {background-color:#E8ECF1;}
.even td {background-color:#DDE5EB;}
.hover td {background-color:#A5B3C9;}
.sortedminus {background-color:#ecc;}
.sortedplus {background-color:#cec;}
.disclaimer {border-top:1px solid #ccc;color:#879AB7;padding-top:.5em;font-size:.9em;}
dl {margin:0 1em;padding:0;}
dl {float:left;}
li {padding:.1em 0;}
.text_line{clear:both;margin-bottom:0px;}
hr {clear:both;width:100%;background:#fff;height:0;border:0;border-bottom:1px solid #fff;margin:0 0 1em;padding:0;}
input[class=grid_header_caption]{vertical-align: middle; margin: 0px; border-style: none ; background-color: #399; cellspacing:0; cellpadding:0;}

input[class=grid_header_Rcaption]{vertical-align: middle; margin: 0px; border-style: none ; background-color: #399; cellspacing:0; cellpadding:0; text-align:right;}

table td{height:20px;}

.php_enquiry_table_margin{margin-top: 0px; margin-left:0px; margin-right:0px; }
.row {height:20px;}

.modal-overlay  /* the parent screen */
{
position:fixed;
top:0;
right:0;
bottom:0;
left:0;
height:100%;
width:100%;
margin:0;
padding:0;
background:#fff;
opacity:.51;
filter: alpha(opacity=51);
-moz-opacity: 0.51;
z-index:101;
}
* html .modal-overlay
{  
position: absolute;
height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
.modal-window
{
position:fixed;
top:50%;
left:50%;
margin:0;
padding:0;
z-index:102;
}
* html .modal-window { position:absolute;}
.close-window  /* close button */
{
position:absolute;
width:52px;
height:52px;
right:1px;
top:30px;
border:1px;
/* background:transparent url('../html/close-button.png') no-repeat scroll right top; */
background:transparent url('../html/checker.bmp') no-repeat scroll right top;
text-indent:-99999px;
overflow:hidden;
cursor:pointer;
opacity:.5;
filter: alpha(opacity=50);
-moz-opacity: 0.5;
}
.close-window:hover
{
opacity:.99;
filter: alpha(opacity=99);
-moz-opacity: 0.99;
}
#retrieval {  margin-left: 10px; }

.line_box {border-style: hidden; }input[class=GridInputClass_INVBODY_item] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_item]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY_descript] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_descript]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY_qty] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_qty]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY_uom] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_uom]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY_price] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_price]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY_sob] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_sob]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY_datetimer] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY_datetimer]:hover {background-color: #FF9;}
input[class=GridInputClass_INVBODY__total] {margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border-style:none ; background-color:white; cellspacing:0; cellpadding:0;}
input[class=GridInputClass_INVBODY__total]:hover {background-color: #FF9;}
div.tableContainer{clear: both;border: 1px solid #963;height: 285px; overflow-y:scroll; overflow-x:auto ;}#outertable{ margin-top: 0px; margin-left: 0px; margin-right:0px;}
table{ border-collapse: collapse }
#statusline{ margin-top: 20px; margin-left: 10px; margin-right:10px;}
/* table styles */
#top_button {border:0;padding:0;margin:0 0 1em;border-left:10px solid #336;border-top:1px solid #336;float:right;clear:left;}
#table_button {border:0;padding:0;margin:0 0 1em;border-left:1px solid #336;border-top:1px solid #336;float:left;clear:left;}
#table_status {border:0;padding:0;margin:0 0 1em;border-left:1px solid #336;border-top:1px solid #336;float:left;clear:left;}
tr {border:0;padding:0;margin:0;}
td, th {border:0;padding:0px 0px;margin:0;border-right:1px solid #336;border-bottom:1px solid #336;}
td[axis='number'], td[axis='date'] {text-align:right;}
tfoot td {border-top:1px solid #003;}
#outertable_0{margin-top: 0px; margin-left:10px; margin-right:0px; }

--></style>
</head>
<body  onmouseup="return false" >
<form id="form1" name="form1" method="post" action="invoiceinput2S.php">
<table class="rootbox" width="100%" border="1" cellspacing="0" cellpadding="0"  style="table-layout:fixed">
<tr><td class="highlight_title">Invoice Input 2                                   </td></tr>
<tr><td>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td id="topbutton" align="right"  cellspacing="0" cellpadding="0"  style="list-style-type: none ; margin : 0px , padding : 0px"><input type="button" onClick="ModalDialog_Show(&#39;_3ZM0MLENFd&#39;, 700); "  value='Invoice' />
<input type="button" onClick="ModalDialog_Show(&#39;_3ZM0NFOHQ&#39;, 700); "  value='solist' />
<input type="button" onClick="ModalDialog_Show(&#39;_3ZM0NFOHR&#39;, 700); "  value='Cusetomer' />
<input type="button" onClick="ModalDialog_Show(&#39;_3ZM0NFOHS&#39;, 700); "  value='Invoice' />
<input  type="button" class="top_button" value="print" onclick="removerowfromtable();" style="padding:0px; "  />

<input type="button"  class="top_button" value="blank" onclick="blank(); document.getElementById('retrieval_key').value=''; form1.retrieval_key.focus();"   style="padding:0px; "  />

<input type="submit" class="top_button" value="test" style="display:none;"><input type="button" class="top_button" id="save" value="SAVE" onclick="save2();" style="padding:0px; "   />
<input type="button" class="top_button" value="exit" id="exit"onclick="jConfirm( 'LEAVE ?' , 'box' , function(r) {if(r){self.close();}} )" style="padding:0px; "  /></td>
 </tr>
</table>
<div id="_FormBody" height="600px" >
<div id="retrieval">
<p><input type="button" name="0000000003" id="0000000003" value="Invoice" onClick="function_3ZM0NFO7M();"><input type="text"  value=""  nextfield ='INVHEAD_customer';" name="retrieval_key"  tabindex=-1  size="10px"  onClick="SelectAll(this.id);" onblur="padleft(this,'0',10);sendRequest(this.value);" id="retrieval_key" />
<input type="text" value="" name="INVHEAD_datetimer" id="INVHEAD_datetimer"/>
</div>
<span class="line_box" align="right" valign="top" ></span>
<p class="line_box" ></p>
<p class="line_box" style=" "></p>
<label for="INVHEAD_customer" >客戶</label>

<input
axis="string"
type="text"
size="30px"
maxlength="10"
name="INVHEAD_customer"
id="INVHEAD_customer"
onclick="$(this).select();"




onFocus=" SelectAll(this.id); nextfield ='INVHEAD_date';  prevfield ='_';
setLineBackgroundColor('C', this,this.id);"
onBlur=" setLineDefaultBackgroundColor('C', this,this.id,'0' );"
style=" font-size: 13px; margin-left: 10px;display:display;  float: left; "
title="TEST 85"
/>

<p class="line_box" ></p>
<p class="line_box" style=" "></p>
<label for="INVHEAD_date" >日期</label>

<input
axis="string"
type="text"
size="10px"
maxlength="10"
name="INVHEAD_date"
id="INVHEAD_date"
onclick="$(this).select();"
ondblclick="SelectDate(this, 'yyyy-MM-dd');"


onkeypress="ValidateNumeric(event); "
onFocus=" SelectAll(this.id); nextfield ='INVHEAD_duedate';  prevfield ='INVHEAD_customer';
setLineBackgroundColor('D', this,this.id);"
onBlur=" setLineDefaultBackgroundColor('D', this,this.id,'0' );"
style=" font-size: 13px; margin-left: 10px;display:display;  float: left; "
title="TEST 87"
/>

<label for="INVHEAD_duedate" style="float:left;width:50px">到期</label>

<input
axis="string"
type="text"
size="10px"
maxlength="10"
name="INVHEAD_duedate"
id="INVHEAD_duedate"
onclick="$(this).select();"
ondblclick="SelectDate(this, 'yyyy-MM-dd');"


onkeypress="ValidateNumeric(event); "
onFocus=" SelectAll(this.id); nextfield ='INVHEAD_custcode';  prevfield ='INVHEAD_date';
setLineBackgroundColor('D', this,this.id);"
onBlur=" setLineDefaultBackgroundColor('D', this,this.id,'0' );"
style=" font-size: 13px; margin-left: 10px;display:display;  float: left; "
title="TEST 88"
/>

<p class="line_box" ></p>
<p class="line_box" style=" "></p>
<p class="line_box" ></p>
<p class="line_box" style=" "></p>
<p class="line_box" ></p>
<p><label for="INVHEAD_custcode" >客戶編號</label>

<input
axis="string"
type="text"
size="10px"
maxlength="10"
name="INVHEAD_custcode"
id="INVHEAD_custcode"
onclick="$(this).select();"




onFocus=" SelectAll(this.id); nextfield ='INVHEAD_fc_amt';  prevfield ='INVHEAD_duedate';
setLineBackgroundColor('C', this,this.id);"
onBlur=" padleft(this,'0',10);customer_customer_for_INVHEAD_custcode(this.value,document.getElementById('INVHEAD_customer_customer'));  setLineDefaultBackgroundColor('C', this,this.id,'' );"
style=" font-size: 13px; margin-left: 10px;display:display;  float: left; "
title="TEST 169"
/>
<input  id="INVHEAD_customer_customer" >
</p><p class="line_box" ></p>
<p><label for="INVHEAD_custcode" >地址</label>

<input
axis="string"
type="text"
size="50px"
maxlength="10"
name="INVHEAD_custcode"
id="INVHEAD_custcode"
onclick="$(this).select();"




onFocus=" SelectAll(this.id); nextfield ='INVHEAD_fc_amt';  prevfield ='INVHEAD_custcode';
setLineBackgroundColor('C', this,this.id);"
onBlur="customer_address1_for_INVHEAD_custcode(this.value,document.getElementById('INVHEAD_customer_address1'));  setLineDefaultBackgroundColor('C', this,this.id,'' );"
style=" font-size: 13px; margin-left: 10px;display:none;  float: left; "
title=""
/>
<input  id="INVHEAD_customer_address1" >
</p><p class="line_box" ></p>
<p><label for="INVHEAD_custcode" style="visibility:hidden;">地址</label>

<input
axis="string"
type="text"
size="50px"
maxlength="10"
name="INVHEAD_custcode"
id="INVHEAD_custcode"
onclick="$(this).select();"




onFocus=" SelectAll(this.id); nextfield ='INVHEAD_fc_amt';  prevfield ='INVHEAD_custcode';
setLineBackgroundColor('C', this,this.id);"
onBlur="customer_address2_for_INVHEAD_custcode(this.value,document.getElementById('INVHEAD_customer_address2'));  setLineDefaultBackgroundColor('C', this,this.id,'' );"
style=" font-size: 13px; margin-left: 10px;display:none;  float: left; "
title=""
/>
<input  id="INVHEAD_customer_address2" >
</p></p></div>
<div id="outertable_0">
<table id="table_button"  style="margin-top: 0px;  border=0px; cellspacing=0px; cellpadding=0px; ">
<tr><td align="right"><input type="button" id="Detail" value="_Detail" onclick="DetailToTable__3ZM0MLENF();"/><input type="button" id="Detail" value="_Detail2" onclick="__3ZM0MLENFc();document.getElementById('__3ZM0MLENFf').contentDocument.location.reload(true);ModalDialog_Show(&#39;_3ZM0MLENFd&#39;, 700); "/><input type="button" id="Add" value="Add.." onclick="if (_lookup('INVHEAD_date')=='')
{jAlert('No : INVHEAD_date.', 'Alert',function(){$('#INVHEAD_date').focus();}); return false;}else if  (alltrim(_lookup('INVHEAD_custcode'))=='')
{jAlert('No : INVHEAD_custcode.', 'Alert',function(){$('#INVHEAD_custcode').focus();}); return false;}else
{addRowToTable__3ZM0MLENF();}"/><input type="button" value="ReMove" id="Remove" onclick="removeRowFromTable__3ZM0MLENF();" /></td></tr>
<tr><td><table border="1" id=_3ZM0NFOCL></table></td></tr>
<tr><td>  <!--  table_button     --><div class="tableContainer" >
<table  id="_3ZM0MLENF" >
<thead><tr><th id="item"></th><th id="descript"></th><th id="qty"></th><th id="uom"></th><th id="price"></th><th id="sob"></th><th id="datetimer"></th><th id="_total"></th></tr></thead>
<tbody class="scrollContent">
 </tbody>
</table>
 <div id=INVBODY_footer></div>
 </div><!-- tablecontainer-->
 </td>
 </tr>
 <tr><td id="Footer" align="right">total<input type="text" align="right" class="CSS_Disable_Number_Format" tabIndex=-1 readonly="readonly" style="display:none; " onfocus="return false;" onclick="return false;" name="INVHEAD_fc_amt" id="INVHEAD_fc_amt"/>
<input type="text" class="CSS_Disable_Number_Format" align="right" tabIndex=-1 readonly="readonly" onfocus="return false;" onclick="return false;" name="say_INVHEAD_fc_amt" id="say_INVHEAD_fc_amt"/> </td></tr>
</table>
</div><!-- outertable-->



</td></tr>
<p></p><tr><td> <input type="text" disabled="disabled" value=""  name="clock" id="clock"style="margin-right: 5px; " />
Table : <input name="table" type="text"  disabled="disabled" size="10" id="table" value=""  ;/>
Recno <input name="recno" type="text"  disabled="disabled" size="3" id="recno" value=""  ;/>
/<input name="reccount" type="text"  disabled="disabled" size="3" id="reccount" value=""  ;/>
<input type="text"  disabled="disabled" size="5" value="" name="_lock_status" id="_lock_status"/>
Session : <input type="text" disabled="disabled" size="20" value="" name="_session_id" id="_session_id"/>
 <input type="text" disabled="disabled" value="" size="1" name="_explorer" id="_explorer"/>
 <input type="text" disabled="disabled" value="" size="10" name="_browser" id="_browser"/>
</td></tr></table>
</form>
<DIV id="_3ZM0MLENFd" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); __3ZM0MLENFf(); return false"><iframe src="invoiceinput2_grid_page0.html" id="__3ZM0MLENFf" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0MLH00" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); cookiefunction_3ZM0MLGJX(); return false"><iframe src="solistmc.php" id="FrameID" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0MLH01" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); cookiefunction_3ZM0MLGJY(); return false"><iframe src="Customer_List.php" id="FrameID" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0MLH02" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); cookiefunction_3ZM0MLGJZ(); return false"><iframe src="InvoiceList.php" id="FrameID" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0MLENFd" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); __3ZM0MLENFf(); return false"><iframe src="invoiceinput2_grid_page0.html" id="__3ZM0MLENFf" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0NFOHQ" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); cookiefunction_3ZM0NFO7K(); return false"><iframe src="solistmc.php" id="FrameID" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0NFOHR" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); cookiefunction_3ZM0NFO7L(); return false"><iframe src="Customer_List.php" id="FrameID" style="width: 100%; height: 91%;"></iframe></DIV><DIV id="_3ZM0NFOHS" style="display: none;" >  <!--  class="modalDialog"  --><INPUT type="submit" value="OK" style="float: right;" onClick="ModalDialog_Close(); cookiefunction_3ZM0NFO7M(); return false"><iframe src="InvoiceList.php" id="FrameID" style="width: 100%; height: 91%;"></iframe></DIV>
</body>
<script type="text/javascript">$("#frediko").addClass("modalDialog");

_readonly('#INVHEAD_customer_customer',true);
_readonly('#INVHEAD_customer_address1',true);
_readonly('#INVHEAD_customer_address2',true);
$("#_3ZM0MLENFd").addClass("modalDialog");
$("#_3ZM0NFOHQ").addClass("modalDialog");
$("#_3ZM0NFOHR").addClass("modalDialog");
$("#_3ZM0NFOHS").addClass("modalDialog");
$("#retrieval_key").width(88);$('#clock').width(60);
var cssObj1123 = {'float' : 'right'};$('#clock').css(cssObj1123);
</script></html>