/* Transformed JS from: /jslib/currency/expense/reportform_lite.js */
var num_of_load_menu_entries=10;var num_of_params=10;var max_columns=7;var row_number=1;var num_of_rows=3*2;var form_width=800;var matrix_division=100;var matrix_repetition=1;var max_repetitions=1;var max_rows=matrix_division*max_repetitions+1;var setWidth=130;var table_sub_rows=[];var loadMenu=[];var submitArray=[];var selected_currencies_array;var selected_currencies_index;var load_menu=true;var user_name="";var session=false;var deleteMenuOffset=0;var file_view_choice=[];var file_list=[];var row=null;function initMatrix(f){var a=matrix_repetition*matrix_division+1;var g;var e='<table id="main_table'+matrix_repetition+'" width="'+form_width+'" cellspacing="0" cellpadding="0" width="100%" border="1" bordercolor="#CCCCCC">';var h=0;setWidth=130;if(matrix_repetition>1){h=1+matrix_division*(matrix_repetition-1);setWidth=140}for(var d=h;d<a;d++){if(d===0){e+='<tr id="row'+d+'" bgcolor="#DFDFDF" align="center">'}else{e+='<tr style="display:none;" id="row'+d+'" align="center">'}if(d!==0&&(1-d%2)){var b=max_columns-1;g="row"+d+"column0";e+='<td bgcolor="#DFDFDF" id='+g+"></td>";g="row"+d+"column1";e+='<td colspan="'+b+'" id="'+g+'"></td>'}else{for(var c=0;c<max_columns;c++){g="row"+d+"column"+c;if(c===0){e+='<td bgcolor="#DFDFDF" id="'+g+'" width="'+setWidth+'"></td>'}else{e+='<td id="'+g+'"></td>'}}}e+="</tr>"}e+="</table>";document.getElementById(f).innerHTML=e}function createMenu(){var a;a=document.getElementById("row0column0");a.innerHTML="No.";a=document.getElementById("row0column1");a.innerHTML="Expense Type";a=document.getElementById("row0column2");a.innerHTML="<a href=\"#\" onClick=\"return openWindow('description.html#date','description','scrollbars=yes,resizable=yes,width=300,height=300')\">Date&nbsp;of&nbsp;Purchase<br/>(mm/dd/yyyy)</a>";a=document.getElementById("row0column3");a.innerHTML="<a href=\"#\" onClick=\"return openWindow('description.html#amount','description','scrollbars=yes,resizable=yes,width=300,height=300')\">Amount</a>";a=document.getElementById("row0column4");a.innerHTML="Currency of Purchase";a=document.getElementById("row0column5");a.innerHTML="<a href=\"#\" onClick=\"return openWindow('description.html#payment','description','scrollbars=yes,resizable=yes,width=300,height=300')\">Payment Method and Rate</a>";a=document.getElementById("row0column6");a.innerHTML="Exchange Rate"}function createRow(d){var c;var b;b=document.getElementById("row"+d+"column0");document.getElementById("row"+d).style.display="";b.width=setWidth;b.innerHTML="<b>"+(d+1)/2+'</b><img border="0" align=right id="image'+d+'" src="/images/currency/expense/arrowDown.gif" width="7" height="10" class="cursorChange" usemap="#arrow'+d+'"/>';b.innerHTML+='<map id="arrow'+d+'" name="arrow'+d+'"><area coords="1,1,7,10" onClick="deploySubRow('+(d+1)+')"></map>';b=document.getElementById("row"+d+"column1");b.width="160";c='<select id="expen_field_'+d+'" onBlur="this.selectedIndex=checkExpenseType(this.selectedIndex);"><option value=-1 selected>Choose expense type...</option><option value=-1>====TRAVEL====</option><option value="Air Travel">Air Travel</option><option value="Ground Transport">Ground Transport</option><option value="Rental Car">Rental Car</option><option value="Parking/Gas">Parking/Gas</option><option value="Lodging">Lodging</option><option value="Mileage">Mileage</option><option value=-1>====MEALS====</option><option value="Breakfast">Breakfast</option><option value="Lunch">Lunch</option>';c+='<option value="Dinner">Dinner</option><option value=-1>====OTHER====</option><option value="Books/magazines">Books/magazines</option><option value="Dues/Subscription">Dues/Subscriptions</option><option value="Copies">Copies</option><option value="Computer hardware">Computer hardware</option><option value="Computer software">Computer software</option><option value="Employee development">Employee development</option><option value="Entertainment">Entertainment</option><option value="Office supplies">Office supplies</option>';c+='<option value="Postage/shipping">Postage/shipping</option><option value="Seminar/conference">Seminar/conference</option><option value="Telecom">Telecom</option><option value="Cash Advance">Cash Advance</option><option value="Miscellaneous">Miscellaneous</option></select>';b.innerHTML=c;b=document.getElementById("row"+d+"column2");b.innerHTML='<input size=13 id="date_field_'+d+'" type="text" maxLength="10" onBlur="this.value=checkDate(this.value);">';b=document.getElementById("row"+d+"column3");b.innerHTML='<input size=10 id="am_field_'+d+'" type="text" name="Amount_rf" maxLength="255" onBlur= "this.value = checkNumber(this.value, this.name);">';c='<select id="curr_field_'+d+'"><option value=-1 selected>Currency used';c+='<option value="USD">US Dollar . USD<option value="AFA">Afghanistan Afghani . AFA<option value="ALL">Albanian Lek . ALL<option value="DZD">Algerian Dinar . DZD<option value="ADF">Andorran Franc . ADF<option value="ADP">Andorran Peseta . ADP<option value="AOA">Angolan Kwanza . AOA<option value="AON">Angolan New Kwanza . AON<option value="ARS">Argentine Peso . ARS<option value="AMD">Armenian Dram . AMD<option value="AWG">Aruban Florin . AWG<option value="AUD">Australian Dollar . AUD';c+='<option value="ATS">Austrian Schilling . ATS<option value="AZM">Azerbaijan Manat . AZM<option value="AZN">Azerbaijan New Manat . AZN<option value="BSD">Bahamian Dollar . BSD<option value="BHD">Bahraini Dinar . BHD<option value="BDT">Bangladeshi Taka . BDT<option value="BBD">Barbados Dollar . BBD<option value="BYR">Belarusian Ruble . BYR<option value="BEF">Belgian Franc . BEF<option value="BZD">Belize Dollar . BZD<option value="BMD">Bermudian Dollar . BMD<option value="BTN">Bhutan Ngultrum . BTN';c+='<option value="BOB">Bolivian Boliviano . BOB<option value="BAM">Bosnia and Herzegovina Convertible Mark . BAM<option value="BWP">Botswana Pula . BWP<option value="BRL">Brazilian Real . BRL<option value="GBP">British Pound . GBP<option value="BND">Brunei Dollar . BND<option value="BGN">Bulgarian Lev . BGN<option value="BIF">Burundi Franc . BIF<option value="XOF">CFA Franc BCEAO . XOF<option value="XAF">CFA Franc BEAC . XAF<option value="XPF">CFP Franc . XPF<option value="KHR">Cambodian Riel . KHR';c+='<option value="CAD">Canadian Dollar . CAD<option value="CVE">Cape Verde Escudo . CVE<option value="KYD">Cayman Islands Dollar . KYD<option value="CLP">Chilean Peso . CLP<option value="CNY">Chinese Yuan Renminbi . CNY<option value="COP">Colombian Peso . COP<option value="KMF">Comoros Franc . KMF<option value="CDF">Congolese Franc . CDF<option value="CRC">Costa Rican Colon . CRC<option value="HRK">Croatian Kuna . HRK<option value="CUC">Cuban Convertible Peso . CUC<option value="CUP">Cuban Peso . CUP';c+='<option value="CYP">Cyprus Pound . CYP<option value="CZK">Czech Koruna . CZK<option value="DKK">Danish Krone . DKK<option value="DJF">Djibouti Franc . DJF<option value="DOP">Dominican R. Peso . DOP<option value="NLG">Dutch Guilder . NLG<option value="XEU">ECU . XEU<option value="XCD">East Caribbean Dollar . XCD<option value="ECS">Ecuador Sucre . ECS<option value="EGP">Egyptian Pound . EGP<option value="SVC">El Salvador Colon . SVC<option value="EEK">Estonian Kroon . EEK';c+='<option value="ETB">Ethiopian Birr . ETB<option value="EUR">Euro . EUR<option value="FKP">Falkland Islands Pound . FKP<option value="FJD">Fiji Dollar . FJD<option value="FIM">Finnish Markka . FIM<option value="FRF">French Franc . FRF<option value="GMD">Gambian Dalasi . GMD<option value="GEL">Georgian Lari . GEL<option value="DEM">German Mark . DEM<option value="GHC">Ghanaian Cedi . GHC<option value="GIP">Gibraltar Pound . GIP<option value="XAU">Gold (oz.) . XAU<option value="GRD">Greek Drachma . GRD';c+='<option value="GTQ">Guatemalan Quetzal . GTQ<option value="GNF">Guinea Franc . GNF<option value="GYD">Guyanese Dollar . GYD<option value="HTG">Haitian Gourde . HTG<option value="HNL">Honduran Lempira . HNL<option value="HKD">Hong Kong Dollar . HKD<option value="HUF">Hungarian Forint . HUF<option value="ISK">Iceland Krona . ISK<option value="INR">Indian Rupee . INR<option value="IDR">Indonesian Rupiah . IDR<option value="IRR">Iranian Rial . IRR<option value="IQD">Iraqi Dinar . IQD';c+='<option value="IEP">Irish Punt . IEP<option value="ILS">Israeli New Shekel . ILS<option value="ITL">Italian Lira . ITL<option value="JMD">Jamaican Dollar . JMD<option value="JPY">Japanese Yen . JPY<option value="JOD">Jordanian Dinar . JOD<option value="KZT">Kazakhstan Tenge . KZT<option value="KES">Kenyan Shilling . KES<option value="KWD">Kuwaiti Dinar . KWD<option value="KGS">Kyrgyzstanian Som . KGS<option value="LAK">Lao Kip . LAK<option value="LVL">Latvian Lats . LVL';c+='<option value="LBP">Lebanese Pound . LBP<option value="LSL">Lesotho Loti . LSL<option value="LRD">Liberian Dollar . LRD<option value="LYD">Libyan Dinar . LYD<option value="LTL">Lithuanian Litas . LTL<option value="LUF">Luxembourg Franc . LUF<option value="MOP">Macau Pataca . MOP<option value="MKD">Macedonian Denar . MKD<option value="MGA">Malagasy Ariary . MGA<option value="MGF">Malagasy Franc . MGF<option value="MWK">Malawi Kwacha . MWK<option value="MYR">Malaysian Ringgit . MYR';c+='<option value="MVR">Maldive Rufiyaa . MVR<option value="MTL">Maltese Lira . MTL<option value="MRO">Mauritanian Ouguiya . MRO<option value="MUR">Mauritius Rupee . MUR<option value="MXN">Mexican Peso . MXN<option value="MDL">Moldovan Leu . MDL<option value="MNT">Mongolian Tugrik . MNT<option value="MAD">Moroccan Dirham . MAD<option value="MZM">Mozambique Metical . MZM<option value="MMK">Myanmar Kyat . MMK<option value="ANG">NL Antillian Guilder . ANG<option value="NAD">Namibia Dollar . NAD';c+='<option value="NPR">Nepalese Rupee . NPR<option value="NZD">New Zealand Dollar . NZD<option value="NIO">Nicaraguan Cordoba Oro . NIO<option value="NGN">Nigerian Naira . NGN<option value="KPW">North Korean Won . KPW<option value="NOK">Norwegian Kroner . NOK<option value="OMR">Omani Rial . OMR<option value="PKR">Pakistan Rupee . PKR<option value="XPD">Palladium (oz.) . XPD<option value="PAB">Panamanian Balboa . PAB<option value="PGK">Papua New Guinea Kina . PGK<option value="PYG">Paraguay Guarani . PYG';c+='<option value="PEN">Peruvian Nuevo Sol . PEN<option value="PHP">Philippine Peso . PHP<option value="XPT">Platinum (oz.) . XPT<option value="PLN">Polish Zloty . PLN<option value="PTE">Portuguese Escudo . PTE<option value="QAR">Qatari Rial . QAR<option value="ROL">Romanian Lei . ROL<option value="RON">Romanian New Lei . RON<option value="RUB">Russian Rouble . RUB<option value="RWF">Rwandan Franc . RWF<option value="WST">Samoan Tala . WST<option value="STD">Sao Tome/Principe Dobra . STD';c+='<option value="SAR">Saudi Riyal . SAR<option value="RSD">Serbian Dinar . RSD<option value="SCR">Seychelles Rupee . SCR<option value="SLL">Sierra Leone Leone . SLL<option value="XAG">Silver (oz.) . XAG<option value="SGD">Singapore Dollar . SGD<option value="SKK">Slovak Koruna . SKK<option value="SIT">Slovenian Tolar . SIT<option value="SBD">Solomon Islands Dollar . SBD<option value="SOS">Somali Shilling . SOS<option value="ZAR">South African Rand . ZAR<option value="KRW">South-Korean Won . KRW';c+='<option value="ESP">Spanish Peseta . ESP<option value="LKR">Sri Lanka Rupee . LKR<option value="SHP">St. Helena Pound . SHP<option value="SDD">Sudanese Dinar . SDD<option value="SDP">Sudanese Pound . SDP<option value="SRD">Suriname Dollar . SRD<option value="SRG">Suriname Guilder . SRG<option value="SZL">Swaziland Lilangeni . SZL<option value="SEK">Swedish Krona . SEK<option value="CHF">Swiss Franc . CHF<option value="SYP">Syrian Pound . SYP<option value="TWD">Taiwan Dollar . TWD';c+='<option value="TZS">Tanzanian Shilling . TZS<option value="THB">Thai Baht . THB<option value="TOP">Tonga Pa\'anga . TOP<option value="TTD">Trinidad/Tobago Dollar . TTD<option value="TND">Tunisian Dinar . TND<option value="TRL">Turkish Lira . TRL<option value="TRY">Turkish New Lira . TRY<option value="TMM">Turkmenistan Manat . TMM<option value="UGX">Uganda Shilling . UGX<option value="UAH">Ukraine Hryvnia . UAH<option value="UYU">Uruguayan Peso . UYU<option value="AED">Utd. Arab Emir. Dirham . AED';c+='<option value="VUV">Vanuatu Vatu . VUV<option value="VEB">Venezuelan Bolivar . VEB<option value="VEF">Venezuelan Bolivar Fuerte . VEF<option value="VND">Vietnamese Dong . VND<option value="YER">Yemeni Rial . YER<option value="YUN">Yugoslav Dinar . YUN<option value="ZMK">Zambian Kwacha . ZMK<option value="ZWD">Zimbabwe Dollar . ZWD';c+="</select>";b=document.getElementById("row"+d+"column4");b.innerHTML=c;c='<td width="150"><select id="pay_field_'+d+'"><option value=-1 selected>Payment Type</option><option value="Cash / Check">Cash / Check</option><option value="Personal Credit Card">Personal CreditCard</option>';c+='<option value="Corporate Card">Corporate Card</option><option value="Debit Card">Debit Card </option><option value="Trav. Check">Trav. Check</option></select></td>';b=document.getElementById("row"+d+"column5");b.innerHTML=c;b=document.getElementById("row"+d+"column6");b.innerHTML='<input size=8 id="rate_field_'+d+'" type="text" name="Rate" maxLength="255" onBlur="this.value = checkRate(this.value, this.name);">';var a=(d-1)/2;table_sub_rows[a]=["","",""]}function fillMatrix(){createMenu();while(row_number<=num_of_rows){createRow(row_number);file_view_choice[(row_number-1)/2]=0;row_number+=2}}function eliminateRow(d){var b;var a=max_columns-((max_columns-2)*(1-d%2));for(var c=0;c<a;c++){b="row"+d+"column"+c;document.getElementById(b).width=null;document.getElementById(b).innerHTML=""}document.getElementById("row"+d).style.display="none"}function deploySubRow(f){var e;document.getElementById("row"+f).style.display="";document.getElementById("row"+(f-1)+"column0").innerHTML="<b>"+(f)/2+"</b>";var d=document.getElementById("row"+f+"column0");d.innerHTML='<p width="15"></p><img border="0" align=left id="image'+f+'" src="/images/currency/expense/arrowUp.gif" width="7" height="10" class="cursorChange" usemap="#arrow'+f+'"/>';d.innerHTML+='<map id="arrow'+f+'" name="arrow'+f+'"><area borderwidth="0" coords="1,1,7,10" onClick="destroySubRow('+(f-1)+')"></map>';var b=f/2-1;d=document.getElementById("row"+f+"column1");e='<table width="*" border="0"><tr>';e+='</tr><tr ><td valign="top" colspan="2">Comments :';e+='<textarea cols=40 rows=4 id="com_field_'+(f-1)+'" wrap=soft onblur="this.value=checkLength(this.value,65535); setSubRow('+b+',1,this.value);">'+table_sub_rows[b][1]+"</textarea>";e+="Location :";e+='<input size=15 id="loc_field_'+(f-1)+'" type="text" maxLength="255" onBlur="setSubRow('+b+',0,this.value)"></td>';e+="</tr></table>";d.innerHTML=e;var a=document.getElementById("loc_field_"+(f-1));a.value=table_sub_rows[b][0];for(var c=0;c<image_field.length;c++){if(image_field.options[c].value==table_sub_rows[(f-2)/2][2]){image_field.selectedIndex=c}}}function destroySubRow(e){var d;document.getElementById("row"+(e+1)).style.display="none";d=document.getElementById("row"+e+"column0");d.width=setWidth;d.innerHTML="<b>"+(e+1)/2+'</b><img border="0" align=right id="image'+e+'" src="/images/currency/expense/arrowDown.gif" width="7" height="10" class="cursorChange" usemap="#arrow'+e+'"/>';d.innerHTML+='<map id="arrow'+e+'" name="arrow'+e+'"><area coords="1,1,7,10" onClick="deploySubRow('+(e+1)+')"></map>';var a=e+1;document.getElementById("row"+a).size=null;var c=(a/2);for(var b=0;b<2;b++){document.getElementById("row"+a+"column"+b).width=null;document.getElementById("row"+a+"column"+b).innerHTML=""}}function setSubRow(a,b,c){table_sub_rows[a][b]=c}function createNewRow(){if(num_of_rows+2<max_rows){if(row_number>matrix_repetition*matrix_division){matrix_repetition++;initMatrix("form_contents"+(matrix_repetition-1))}createRow(row_number);file_view_choice[(row_number-1)/2]=0;num_of_rows+=2;row_number+=2}else{alert("Cannot create any more rows")}}function createNewRow_check(){createNewRow()}function deleteRow(){if(num_of_rows!==0){row_number-=2;num_of_rows-=2;eliminateRow(row_number);eliminateRow(row_number+1)}table_sub_rows[(row_number-1)/2]=null;if((row_number-2)<(matrix_repetition-1)*matrix_division&&matrix_repetition>1){matrix_repetition--;document.getElementById("form_contents"+matrix_repetition).innerHTML=""}}function deleteRow_check(){deleteRow()}function freshReport(){while(num_of_rows>0){deleteRow()}for(var a=0;a<3;a++){createNewRow()}document.getElementById("report_desc").value=""}function clearReport_check(){if(confirm("This action will erase the current form.\nDo you wish to continue?")){freshReport()}}function getGeneralInfo(){var b="";var a;b+="full_name="+document.getElementById("report_person_name").value+"&";b+="company="+document.getElementById("report_comp_name").value+"&";b+="email="+document.getElementById("report_email").value+"&";a=document.getElementById("homecurrency");b+="curr="+a.options[a.selectedIndex].value+"&";b+="description="+document.getElementById("report_desc").value+"&";return b}function checkRow(a){var d=document.getElementById("expen_field_"+a);var c=document.getElementById("curr_field_"+a);var b=document.getElementById("pay_field_"+a);return(d.options[d.selectedIndex].value+""!="-1"||document.getElementById("date_field_"+a).value+""!==""||document.getElementById("am_field_"+a).value+""!==""||c.options[c.selectedIndex].value+""!="-1"||b.options[b.selectedIndex].value+""!="-1"||document.getElementById("rate_field_"+a).value+""!==""||table_sub_rows[(a-1)/2][0]+""!==""||table_sub_rows[(a-1)/2][1]+""!==""||table_sub_rows[(a-1)/2][2]+""!=="")}function submitRow(m){var a,n,q,j,k;var i,e,h;var l,g,b;var r=m;var d;a=""+((m+1)/2);n=document.getElementById("expen_field_"+m).selectedIndex;q=document.getElementById("date_field_"+m).value;j=document.getElementById("am_field_"+m).value+"";d=document.getElementById("homecurrency");k=d.options[d.selectedIndex].value;d=document.getElementById("curr_field_"+m);i=d.options[d.selectedIndex].value;if(i==-1){i=k}e=document.getElementById("pay_field_"+m).selectedIndex;h=document.getElementById("rate_field_"+m).value+"";m=(m+1)/2-1;l=escape(table_sub_rows[m][0]);g=escape(table_sub_rows[m][1]);b=escape(table_sub_rows[m][2]);var f;if(!session){f="No="+a+"&Expen="+n+"&Date="+q+"&Am="+j+"&Curr="+i+"&Pay="+e+"&Rate="+h+"&Loc="+l+"&Com="+g+"&Image="+b+"&?"}else{f=a+"&"+n+"&"+q+"&"+j+"&"+i+"&"+e+"&"+h+"&"+l+"&"+g+"&"+b+"&?";d=document.getElementById("curr_field_"+r);var c=d.options[d.selectedIndex].value;if(c==-1){c=k}selected_currencies_array[selected_currencies_index++]=c+":"+q}return f}function verifyForm(a){var c="";var d=true;for(var b=1;b<=num_of_rows;){if(checkRow(b)){c+=submitRow(b);d=false}b+=2}if(d){alert("The report is empty.");return""}else{return c}}function getXmlObject(){var a;try{a=new XMLHttpRequest()}catch(c){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){a=false}}}if(!a){try{a=new XMLHttpRequest()}catch(d){a=false}}return a}function requestQuery(d){var c;var a=getXmlObject();if(!a){alert("Failed to initialize XMLHTTP object.  Please update your browser version.")}else{a.open("POST",reportajaxURL,false);try{a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(b){}a.onreadystatechange=function(){if(a.readyState==4){c=a.responseText;if(c.indexOf("?")<0&&c.length>4){alert(c);if(c=="You need to be logged in to use this option.\r\n"){location.href=loginURL}}return c}};a.send(d)}if(a.readyState==4){return a.responseText}}var refreshed_rows;function reloadRow(h){var d;var f;var a=0;var b=[];for(d=0;d<num_of_params&&(a=h.indexOf("&"))>-1;d++){b[d]=h.substring(0,a);h=h.substring((a+1))}if(d!=num_of_params){alert("Incomplete load from server.\n Load action failed.")}else{var g=parseInt(b[0],10);if((g-1)<refreshed_rows.length){refreshed_rows[g-1]=true}while(g>num_of_rows/2){createNewRow()}var c=(2*g-1);var e=c;document.getElementById("expen_field_"+c).selectedIndex=b[1];document.getElementById("date_field_"+c).value=b[2];document.getElementById("am_field_"+c).value=b[3];f=document.getElementById("curr_field_"+c);for(d=0;d<f.length;d++){if(f.options[d].value==b[4]){f.selectedIndex=d}}document.getElementById("pay_field_"+c).selectedIndex=b[5];document.getElementById("rate_field_"+c).value=b[6];c=(c-1)/2;table_sub_rows[c][0]=unescape(b[7]);table_sub_rows[c][1]=unescape(b[8]);table_sub_rows[c][2].selectIndex=3;table_sub_rows[c][2]=unescape(b[9]);f=document.getElementById("row"+e+"column0");f.width=setWidth;f.innerHTML="<b>"+(e+1)/2+'</b><img border="0" align=right id="image'+e+'" src="/images/currency/expense/arrowDown.gif" width="7" height="10" class="cursorChange" usemap="#arrow'+e+'"/>';f.innerHTML+='<map id="arrow'+e+'" name="arrow'+e+'"><area coords="1,1,7,10" onClick="deploySubRow('+(e+1)+')"></map>';e++;for(d=0;d<2;d++){document.getElementById("row"+e+"column"+d).innerHTML=""}}}function clearRow(a){document.getElementById("expen_field_"+a).selectedIndex=0;document.getElementById("date_field_"+a).value="";document.getElementById("am_field_"+a).value="";document.getElementById("curr_field_"+a).selectedIndex=0;document.getElementById("pay_field_"+a).selectedIndex=0;document.getElementById("rate_field_"+a).value="";a=(a-1)/2;table_sub_rows[a][0]="";table_sub_rows[a][1]="";table_sub_rows[a][2]=""}function reloadTable(c){var b;var a=0;refreshed_rows=[];for(b=0;b<(num_of_rows/2);b++){refreshed_rows[b]=false}while((a=c.indexOf("?"))>0){reloadRow(c.substring(0,a));c=c.substring((a+1))}for(b=0;b<refreshed_rows.length;b++){if(refreshed_rows[b]===false){clearRow(2*b+1)}}}function reloadGeneralInfo(e){var c,a;var b=[];for(c=0;c<5&&(a=e.indexOf("&"))>-1;c++){b[c]=e.substring(0,a);e=e.substring((a+1))}if(c!=5){alert("Incomplete load from server.\n Load action failed.")}else{document.getElementById("report_person_name").value=b[0];document.getElementById("report_comp_name").value=b[1];document.getElementById("report_email").value=b[2];var d=document.getElementById("homecurrency");for(c=0;c<d.length;c++){if(d.options[c].value==b[3]){d.selectedIndex=c}}document.getElementById("report_desc").value=b[4]}}function generateReport(){var b="G";var d;b+=escape(document.getElementById("report_person_name").value)+"&";b+=escape(document.getElementById("report_comp_name").value)+"&";b+=escape(document.getElementById("report_desc").value)+"&";d=document.getElementById("homecurrency");b+=d.options[d.selectedIndex].value+"&";b+=escape(document.getElementById("report_email").value)+"&";b+=d.options[d.selectedIndex].value+"&?";session=true;selected_currencies_array=[];selected_currencies_index=0;var c=verifyForm("blank");for(var a=0;a<selected_currencies_array.length;a++){b+=selected_currencies_array[a]+"&"}b+="?";session=false;if(c!==""){requestQuery(b+c);window.location.href=expensereportURL}}function generateSpreadSheet(){var b="G";var d;b+=escape(document.getElementById("report_person_name").value)+"&";b+=escape(document.getElementById("report_comp_name").value)+"&";b+=escape(document.getElementById("report_desc").value)+"&";d=document.getElementById("homecurrency");b+=d.options[d.selectedIndex].value+"&";b+=escape(document.getElementById("report_email").value)+"&";d=document.getElementById("homecurrency");b+=d.options[d.selectedIndex].value+"&?";session=true;selected_currencies_array=[];selected_currencies_index=0;var c=verifyForm("blank");for(var a=0;a<selected_currencies_array.length;a++){b+=selected_currencies_array[a]+"&"}b+="?";session=false;if(c!==""){requestQuery(b+c);window.location.href=reportcsvURL}}function newWindow(b){row=b;var a;if(!a||a.closed){a=window.open("","subWindow","height=200,width=550,resizable")}a.focus();a.location.href=imagesaverURL}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f[0]===" "){f=f.substring(1,f.length)}if(f.indexOf(e)===0){return unescape(f.substring(e.length,f.length))}}return null}function checkStatus(func){if(readCookie("JSESSIONID")!==null){eval(func)}else{alert("I'm sorry, you are not currently signed in; You are now being redirected to the login page.");location.href=loginURL}}function showmouseover(a){window.status=a;return true}function showmouseout(){window.status=null;return true}function openWindow(b,a,c){window.open(b,a,c);return false}function initialize(){var a;initMatrix("form_contents0");fillMatrix();if(complete_report!==""){reloadTable(complete_report)}setPersonal();setHomeCurrencyIndex();getTodaysDate()};
