PageRenderTime 21ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/beta/Inquiry/include_JS_for_Inquiries.asp

http://github.com/khaneh/Orders
ASP | 506 lines | 450 code | 56 blank | 0 comment | 79 complexity | b668c6600600c98714fdc04e98e9d406 MD5 | raw file
  1<script language="JavaScript">
  2<!--
  3function setCurrentRow(rowNo){
  4	if (rowNo == -1) rowNo=0;
  5	invTable=document.getElementById("InquiryLines");
  6	theTD=invTable.getElementsByTagName("tr")[currentRow].getElementsByTagName("td")[0];
  7	theTD.setAttribute("bgColor", '#F0F0F0');
  8
  9	currentRow=rowNo;
 10	invTable=document.getElementById("InquiryLines");
 11	theTD=invTable.getElementsByTagName("tr")[currentRow].getElementsByTagName("td")[0];
 12	theTD.setAttribute("bgColor", '#FFB0B0');
 13}
 14function delRow(rowNo){
 15	invTable=document.getElementById("InquiryLines");
 16	theRow=invTable.getElementsByTagName("tr")[rowNo];
 17	invTable.removeChild(theRow);
 18
 19	rowsCount=document.getElementsByName("Items").length;
 20	for (rowNo=0; rowNo < rowsCount ; rowNo++){
 21		tempTD=invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[0]
 22		tempTD.bgColor= '#F0F0F0';
 23		tempTD.innerText= rowNo+1;
 24	}
 25}
 26function addRow(){
 27	rowNo = currentRow
 28	invTable=document.getElementById("InquiryLines");
 29	theRow=invTable.getElementsByTagName("tr")[rowNo];
 30	newRow=document.createElement("tr");
 31	newRow.setAttribute("bgColor", '#f0f0f0');
 32	newRow.setAttribute("onclick", theRow.getAttribute("onclick"));
 33
 34	tempTD=document.createElement("td");
 35	tempTD.innerHTML=rowNo+1
 36	tempTD.setAttribute("align", 'center');
 37	tempTD.setAttribute("width", '25');
 38	newRow.appendChild(tempTD);
 39
 40	tempTD=document.createElement("td");
 41	tempTD.setAttribute("dir", 'LTR');
 42	tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Items' size='3' Maxlength='6' onKeyPress='return mask(this);' onChange='return check(this);' onfocus='setCurrentRow(this.parentNode.parentNode.rowIndex);'><INPUT TYPE='hidden' name='type' value=0><INPUT TYPE='hidden' name='fee' value=0><INPUT type='hidden' name='hasVat' value=0>"
 43
 44	newRow.appendChild(tempTD);
 45
 46	tempTD=document.createElement("td");
 47	tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Descriptions' size='30'>"
 48	newRow.appendChild(tempTD);
 49
 50	tempTD=document.createElement("td");
 51	tempTD.setAttribute("dir", 'LTR');
 52	tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Lengths' size='2' onBlur='setFeeQtty(this);'>"
 53	newRow.appendChild(tempTD);
 54
 55	tempTD=document.createElement("td");
 56	tempTD.setAttribute("dir", 'LTR');
 57	tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Widths' size='2' onBlur='setFeeQtty(this);'>"
 58	newRow.appendChild(tempTD);
 59
 60	tempTD=document.createElement("td");
 61	tempTD.setAttribute("dir", 'LTR');
 62	tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Qttys' size='3' onBlur='setFeeQtty(this);'>"
 63	newRow.appendChild(tempTD);
 64
 65	tempTD=document.createElement("td");
 66	tempTD.setAttribute("dir", 'LTR');
 67	tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Sets' size='2' onBlur='setFeeQtty(this);'>"
 68	newRow.appendChild(tempTD);
 69
 70	tempTD=document.createElement("td");
 71	tempTD.setAttribute("dir", 'LTR');
 72	tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='AppQttys' size='6' onBlur='setPrice(this);'>"
 73	newRow.appendChild(tempTD);
 74
 75	tempTD=document.createElement("td");
 76	tempTD.setAttribute("dir", 'LTR');
 77	tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Fees' size='7' onBlur='setPrice(this);'>"	
 78	newRow.appendChild(tempTD);
 79
 80	tempTD=document.createElement("td");
 81	tempTD.setAttribute("dir", 'LTR');
 82	tempTD.innerHTML="<INPUT  tabIndex='9999' class='InvRowInput' TYPE='text' NAME='Prices' size='9'>"
 83	newRow.appendChild(tempTD);
 84
 85	tempTD=document.createElement("td");
 86	tempTD.setAttribute("dir", 'LTR');
 87	tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Discounts' size='7' onBlur='setPrice(this);'>"
 88	newRow.appendChild(tempTD);
 89
 90	tempTD=document.createElement("td");
 91	tempTD.setAttribute("dir", 'LTR');
 92	tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Reverses' size='5' onBlur='setPrice(this);' onfocus='setCurrentRow(this.parentNode.parentNode.rowIndex);'>"
 93	newRow.appendChild(tempTD);
 94
 95	// S A M
 96	tempTD=document.createElement("td");
 97	tempTD.setAttribute("dir", 'LTR');
 98	tempTD.innerHTML="<INPUT tabIndex='9998' class='InvRowInput' TYPE='text' NAME='Vat' size='6' readonly>"
 99	//tempTD.appendChild(tempTD);
100	newRow.appendChild(tempTD);
101
102	tempTD=document.createElement("td");
103	tempTD.setAttribute("dir", 'LTR');
104	tempTD.innerHTML="<INPUT  tabIndex='9999' class='InvRowInput2' TYPE='text' NAME='AppPrices' size='9'>"
105	newRow.appendChild(tempTD);
106
107	invTable.insertBefore(newRow,theRow);
108	
109	rowsCount=document.getElementsByName("Items").length;
110	for (rowNo=0; rowNo < rowsCount ; rowNo++){
111		tempTD=invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[0]
112		tempTD.bgColor= '#F0F0F0';
113		tempTD.innerText= rowNo+1;
114	}
115
116	invTable.getElementsByTagName("tr")[currentRow].getElementsByTagName("td")[1].getElementsByTagName("Input")[0].focus();
117}
118//--------------------------------------------------------------------------------------------------------------------------------------------------
119function setPrice(src){
120//	alert(src.name);
121	if (src.name=="Discounts" || src.name=="Reverses"){
122		if (src.value.substr(src.value.length-1)=='%'){
123			src.value=val2txt(txt2val(src.value));
124			rowNo=src.parentNode.parentNode.rowIndex;
125			src.value=val2txt(parseInt(txt2val(document.getElementsByName("Prices")[rowNo].value) * txt2val(src.value) / 100))
126		}
127		else{
128			src.value=val2txt(txt2val(src.value));
129		}
130	}
131	else{
132		src.value=val2txt(txt2val(src.value));
133	}
134	isA = document.getElementsByName("IsA")[0].checked;
135	//alert(isA);
136	rowNo=src.parentNode.parentNode.rowIndex;
137	tmpFee=txt2val(document.getElementsByName("Fees")[rowNo].value);
138	tmpAppQtty=txt2val(document.getElementsByName("AppQttys")[rowNo].value);
139	tmpDiscount=txt2val(document.getElementsByName("Discounts")[rowNo].value);
140	tmpReverse=txt2val(document.getElementsByName("Reverses")[rowNo].value);
141	tmpPrice= tmpFee * tmpAppQtty;
142	tmpAppPrice=tmpPrice - tmpDiscount - tmpReverse;
143	// S A M
144	if (txt2val(document.getElementsByName("hasVat")[rowNo].value) == 1 && isA)
145		tmpVat = tmpAppPrice * .03;
146	else 
147		tmpVat = 0;
148	tmpAppPrice += tmpVat;
149	document.getElementsByName("Prices")[rowNo].value = val2txt(parseInt(tmpPrice));
150	document.getElementsByName("AppPrices")[rowNo].value = val2txt(parseInt(tmpAppPrice));
151	document.getElementsByName("Vat")[rowNo].value = val2txt(parseInt(tmpVat));
152	
153	var totalPrice = 0;
154	var totalDiscount = 0;
155	var totalReverse = 0;
156	var totalAppPrice = 0;
157	var payable = 0;
158	var totalVat = 0;
159	for (rowNo=0; rowNo < document.getElementsByName("Fees").length; rowNo++){
160		totalPrice += parseInt(txt2val(document.getElementsByName("Prices")[rowNo].value));
161		totalDiscount += parseInt(txt2val(document.getElementsByName("Discounts")[rowNo].value));
162		totalReverse += parseInt(txt2val(document.getElementsByName("Reverses")[rowNo].value));
163		totalAppPrice += parseInt(txt2val(document.getElementsByName("AppPrices")[rowNo].value));
164		if (isA) {
165			totalVat += parseInt(txt2val(document.getElementsByName("Vat")[rowNo].value));}
166	}
167	payable = Math.floor(totalAppPrice/1000) * 1000;
168	document.all.TotalPrice.value = val2txt(totalPrice);
169	document.all.TotalDiscount.value = val2txt(totalDiscount);
170	document.all.TotalReverse.value = val2txt(totalReverse);
171	document.all.Payable.value = val2txt(payable);
172	document.all.TotalVat.value = val2txt(totalVat);
173
174	if (totalPrice==0){
175		document.all.TPDiscount.value = "- "+'%�����';
176		document.all.TPReverse.value = "- "+'%�ѐ��';
177	}
178	else{
179		document.all.TPDiscount.value = Math.round(totalDiscount/totalPrice * 100)+'%�����';
180		document.all.TPReverse.value = Math.round(totalReverse/totalPrice * 100)+'%�ѐ��';
181	}
182}
183function checkIsA(){
184	isA = document.getElementsByName("IsA")[0].checked;
185	var totalPrice = 0;
186	var totalDiscount = 0;
187	var totalReverse = 0;
188	var totalAppPrice = 0;
189	var payable = 0;
190	var totalVat = 0;
191	for (rowNo=0; rowNo < document.getElementsByName("Fees").length; rowNo++){
192		tmpFee=txt2val(document.getElementsByName("Fees")[rowNo].value);
193		tmpAppQtty=txt2val(document.getElementsByName("AppQttys")[rowNo].value);
194		tmpDiscount=txt2val(document.getElementsByName("Discounts")[rowNo].value);
195		tmpReverse=txt2val(document.getElementsByName("Reverses")[rowNo].value);
196		tmpPrice= tmpFee * tmpAppQtty;
197		tmpAppPrice=tmpPrice - tmpDiscount - tmpReverse;
198		// S A M
199		if (txt2val(document.getElementsByName("hasVat")[rowNo].value) == 1 && isA)
200			tmpVat = tmpAppPrice * .03;
201		else 
202			tmpVat = 0;
203		tmpAppPrice += tmpVat;
204		document.getElementsByName("Prices")[rowNo].value = val2txt(parseInt(tmpPrice));
205		document.getElementsByName("AppPrices")[rowNo].value = val2txt(parseInt(tmpAppPrice));
206		document.getElementsByName("Vat")[rowNo].value = val2txt(parseInt(tmpVat));
207		
208		// ---------------------------------------------
209		totalPrice += parseInt(txt2val(document.getElementsByName("Prices")[rowNo].value));
210		totalDiscount += parseInt(txt2val(document.getElementsByName("Discounts")[rowNo].value));
211		totalReverse += parseInt(txt2val(document.getElementsByName("Reverses")[rowNo].value));
212		totalAppPrice += parseInt(txt2val(document.getElementsByName("AppPrices")[rowNo].value));
213		if (isA) {
214			totalVat += parseInt(txt2val(document.getElementsByName("Vat")[rowNo].value));}
215	}
216	payable = Math.floor(totalAppPrice/1000) * 1000;
217	document.all.TotalPrice.value = val2txt(totalPrice);
218	document.all.TotalDiscount.value = val2txt(totalDiscount);
219	document.all.TotalReverse.value = val2txt(totalReverse);
220	document.all.Payable.value = val2txt(payable);
221	document.all.TotalVat.value = val2txt(totalVat);
222
223	if (totalPrice==0){
224		document.all.TPDiscount.value = "- "+'%�����';
225		document.all.TPReverse.value = "- "+'%�ѐ��';
226	}
227	else{
228		document.all.TPDiscount.value = Math.round(totalDiscount/totalPrice * 100)+'%�����';
229		document.all.TPReverse.value = Math.round(totalReverse/totalPrice * 100)+'%�ѐ��';
230	}
231}
232//--------------------------------------------------------------------------------------------------------------------------------------------------
233
234var dialogActive=false;
235var badCode = false;
236
237var A				= 90		// DuplexFee Add-in
238var ProofSimplex	= 3000
239var ProofDuplex		= 4500
240			  Qtt	= Array (	0 ,	 		1,		50,		150,	300 )
241/*SimplexFee*/  SF	= Array (	ProofSimplex,	200,	144,	112,	100 )
242/*DuplexFee*/	DF	= Array (	ProofDuplex,	SF[1]+A,	SF[2]+A,	SF[3]+A,	SF[4]+A)
243
244//-----------------------------------------------------------------------------------------------------------------------------------------
245function setFeeQtty(src){
246	rowNo=src.parentNode.parentNode.rowIndex;
247	itemType=parseInt(txt2val(document.getElementsByName("type")[rowNo].value));
248	itemFee=document.getElementsByName("fee")[rowNo].value;
249	
250	if (!document.getElementsByName("Qttys")[rowNo].value == "")
251	document.getElementsByName("Qttys")[rowNo].value = parseInt(document.getElementsByName("Qttys")[rowNo].value);
252
253	if (!document.getElementsByName("Sets")[rowNo].value == "")
254	document.getElementsByName("Sets")[rowNo].value = parseInt(document.getElementsByName("Sets")[rowNo].value);
255
256	//////////////// Type =1  --->  General  //////////////////
257	if (itemType==1 || itemType==5){   
258		document.getElementsByName("AppQttys")[rowNo].value = parseInt(txt2val(document.getElementsByName("Qttys")[rowNo].value)) * parseInt(txt2val(document.getElementsByName("Sets")[rowNo].value)); 
259
260		document.getElementsByName("Fees")[rowNo].value =  parseInt(txt2val(itemFee)) 
261	
262		if (''+document.getElementsByName("AppQttys")[rowNo].value=='NaN')
263			document.getElementsByName("AppQttys")[rowNo].value = 0
264	}
265
266	//////////////// Type =2  --->  Digital  //////////////////
267	if (itemType==2 && itemFee!="0"){   
268		PF		= parseInt(txt2val(itemFee.substr(1)));
269		tmp		= itemFee.substr(0,1);
270		if (tmp == "s" ) 
271			SoD = false 
272		else 
273			SoD = true
274		Tirag	= Math.round(parseInt(txt2val(document.getElementsByName("Qttys")[rowNo].value)));
275		h		= parseInt(txt2val(document.getElementsByName("Lengths")[rowNo].value));
276		Price	= 0
277		i		= 1
278		document.getElementsByName("Widths")[rowNo].value = 30	
279		if (h ==0 ) 
280			{
281			document.getElementsByName("Lengths")[rowNo].value=21
282			h=21
283			}
284
285		/*while ( Tirag >= Qtt[ i -1] ) 
286			{
287			a1 = Tirag - Qtt[ i - 1 ]
288			a2 = Tirag - Qtt[ i ]
289			if (a2>0)	
290				a3 = a1 - a2 
291			else 
292				a3 = a1
293			if ( SoD == false ) 
294				Price += ( SF[ i-1 ] + PF ) * a3
295			else
296				Price += ( DF[ i-1 ] + PF ) * a3
297
298			i++
299			}
300		*/
301		Price = ( 200 + PF ) * Tirag
302		if ( SoD == false ) 
303			Price = Price * 1
304		else
305			Price = Price * 2
306
307			
308		Price = Math.round(Price / 21 * h) 
309		unitPrice = Math.round(Price / Tirag) * 10
310		document.getElementsByName("Fees")[rowNo].value = unitPrice 
311		
312		document.getElementsByName("AppQttys")[rowNo].value = parseInt(txt2val(document.getElementsByName("Qttys")[rowNo].value)) * parseInt(txt2val(document.getElementsByName("Sets")[rowNo].value)); 
313	
314		if (''+document.getElementsByName("AppQttys")[rowNo].value=='NaN')
315			document.getElementsByName("AppQttys")[rowNo].value = 0
316		
317		if (''+document.getElementsByName("Fees")[rowNo].value=='NaN')
318			document.getElementsByName("Fees")[rowNo].value = 0
319	}
320
321	//////////////// Type =3  --->  Film  /////////////////////
322	if (itemType==3){   
323		h	= txt2val(document.getElementsByName("Lengths")[rowNo].value);
324		w	= txt2val(document.getElementsByName("Widths")[rowNo].value);
325		document.getElementsByName("Fees")[rowNo].value =  parseInt(txt2val(itemFee)) 
326		document.getElementsByName("AppQttys")[rowNo].value =  val2txt(txt2val(document.getElementsByName("Qttys")[rowNo].value) * txt2val(document.getElementsByName("Sets")[rowNo].value) * h * w);
327	}
328
329	//////////////// Type =4  --->  Piramon  //////////////////
330	if (itemType==4){   
331		document.getElementsByName("Fees")[rowNo].value =  parseInt(txt2val(itemFee)) 
332		//document.getElementsByName("AppQttys")[rowNo].focus();
333		//document.getElementsByName("AppQttys")[rowNo].select();
334	}
335
336	setPrice(document.getElementsByName("Fees")[rowNo]);
337}
338
339//--------------------------------------------------------------------------------------------------------------------------------------------------
340
341function mask(src){ 
342	var theKey=event.keyCode;
343
344	rowNo=src.parentNode.parentNode.rowIndex;
345	invTable=document.getElementById("InquiryLines");
346	theRow=invTable.getElementsByTagName("tr")[rowNo];
347
348	if (src.name=="Items"){
349		if (theKey==13){
350			event.keyCode=9
351			dialogActive=true
352			document.all.tmpDlgArg.value="#"
353			document.all.tmpDlgTxt.value="��� ����� �� �� �� ������ ����� ���� ���� ����:"
354			var myTinyWindow = window.showModalDialog('dialog_FindInvItem.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
355			if (document.all.tmpDlgTxt.value !="") {
356				var myTinyWindow = window.showModalDialog('dialog_inquiryItems.asp?act=select&name='+escape(document.all.tmpDlgTxt.value),document.all.tmpDlgArg,'dialogHeight:500px; dialogWidth:380px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
357				if (document.all.tmpDlgArg.value!="#"){
358					Arguments=document.all.tmpDlgArg.value.split("#")
359					src.value=Arguments[0];
360					invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0].value=Arguments[1];
361					invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[1].value=Arguments[2];
362					invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[2].value=Arguments[3];
363					if (Arguments[4] == "����") // VAT
364						invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 1;
365					else 
366						invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 0;
367				}
368				//setFeeQtty(invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0])
369
370				a=invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0];
371
372				if (a){
373					setFeeQtty(a)
374					a.focus();
375				}
376			}
377			dialogActive=false
378		}
379		else if (theKey >= 48 && theKey <= 57 ) { 
380			//alert(theKey)
381			//src.value=''
382			return true;
383		}
384		else { 
385			return false;
386		}
387	}
388}
389
390//--------------------------------------------------------------------------------------------------------------------------------------------------
391
392function check(src){ 
393	if (src.name=="Items"){
394		rowNo=src.parentNode.parentNode.rowIndex;
395		rowsCount=document.getElementsByName("Items").length;
396		if (!dialogActive){
397			if (src.value=='0'){
398				if (confirm("��� ����� ����� �� �� ������ ��� ��� �� ��� ���Ͽ")){
399					delRow(rowNo);
400					if (rowNo != rowsCount ){
401						invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[0].focus();
402					}else{
403						invTable.getElementsByTagName("tr")[rowNo-1].getElementsByTagName("td")[1].getElementsByTagName("Input")[0].focus();
404					}
405					return false;
406				}
407				else{
408					src.focus();
409				}
410			}
411			else {
412				badCode = false;
413				if (window.XMLHttpRequest) {
414				var objHTTP=new XMLHttpRequest();
415			} else if (window.ActiveXObject) {
416				var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
417			}
418				objHTTP.open('GET','xml2.asp?id='+src.value,false)
419				objHTTP.send()
420				tmpStr = unescape( objHTTP.responseText)
421				ar = tmpStr.split("#")
422
423				if (ar[0]=="�� ���� ��� ���")
424				{
425					//src.value="";
426					//src.focus();
427					alert("�� ���� ��� ���");
428					return false;
429				}
430				else{
431					//document.all['A1'].innerText= objHTTP.status
432					//document.all['A2'].innerText= objHTTP.statusText
433					//document.all['A3'].innerText= objHTTP.responseText
434					invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0].value = ar[0];
435					invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[1].value = ar[1];
436					invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[2].value = ar[2];
437					// VAT
438					if (ar[3] == "True")
439						invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 1;
440					else 
441						invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 0;
442
443					setFeeQtty(invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0]);
444				}
445
446			}
447		}
448	}
449}
450
451
452function js_Link2Trace(num){
453	return "<A HREF='../order/orderEdit.asp?e=n&radif="+ num + "' target='_balnk'>"+ num + "</A>"
454}
455function selectOrder(){
456	theSpan=document.getElementById("orders");
457	document.all.tmpDlgArg.value="";
458	window.showModalDialog('Orders.asp?act=select&customer='+document.all.customerID.value,document.all.tmpDlgArg,'dialogHeight:500px; dialogWidth:380px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
459	if (document.all.tmpDlgArg.value!="[Esc]"){
460		theSpan.innerHTML="";
461		Arguments=document.all.tmpDlgArg.value.split("#")
462		tempWriteAnd=""
463		for (i=1;i<=Arguments[0];i++){
464			theSpan.innerHTML += "<input type='hidden' name='selectedOrders' value='"+Arguments[i]+"'>" + tempWriteAnd + js_Link2Trace(Arguments[i])
465			tempWriteAnd=" � "
466		}
467	}
468}
469function selectCustomer(){
470	document.all.tmpDlgArg.value="#"
471	document.all.tmpDlgTxt.value="��� ����� �� �� �� ������ ����� ���� ���� ����:"
472	window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
473	if (document.all.tmpDlgTxt.value !="") {
474		window.showModalDialog('../AR/dialog_SelectAccount.asp?act=select&search='+escape(document.all.tmpDlgTxt.value), document.all.tmpDlgArg, 'dialogWidth:780px; dialogHeight:500px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
475		if (document.all.tmpDlgArg.value!="#"){
476			Arguments=document.all.tmpDlgArg.value.split("#")
477			theSpan=document.getElementById("customer");
478			theSpan.getElementsByTagName("input")[0].value=Arguments[0];
479			theSpan.getElementsByTagName("span")[0].innerText=Arguments[1];
480		}
481	}
482}
483function submitOperations(){
484	setCurrentRow(0);
485	var okGo=true;
486	for (rowNo=0; rowNo < document.getElementsByName("Items").length; rowNo++){
487		if (document.getElementsByName('Items')[rowNo].value==''){
488			delRow(rowNo);			
489			rowNo=rowNo-1;
490			okGo=false;
491		}
492	}
493	if (okGo && document.getElementsByName('Items')[0]) {
494		checkIsA();
495		document.forms[0].submit();
496	}
497	else{
498		alert(".��� ��� ���� ���� ���� �� ��� ����\n\n .���� ����� ���� � ����� ���� ����� �� �����")
499		currentRow=0;
500		setCurrentRow(0);
501		if (document.getElementsByName('Items')[0])
502			document.getElementsByName('Items')[0].focus();
503	}
504}
505//-->
506</script>