function selectCategory(A){if(document.forms["stockList"].selectedVehicleCategory!=undefined){if(document.forms["stockList"].selectedVehicleCategory.length!=undefined){for(i=0;i<document.forms["stockList"].selectedVehicleCategory.length;i++){if(document.forms["stockList"].selectedVehicleCategory[i].value==A){document.forms["stockList"].selectedVehicleCategory[i].checked=true;
break;}}}else{if(document.forms["stockList"].selectedVehicleCategory[i].value==A){document.forms["stockList"].selectedVehicleCategory[i].checked=true;}}}}function enableStockListButton(){var A=false;var B=false;if(document.forms["stockList"].selectedVehicleCategory!=undefined){if(document.forms["stockList"].selectedVehicleCategory.length!=undefined){for(i=0;
i<document.forms["stockList"].selectedVehicleCategory.length;i++){if(document.forms["stockList"].selectedVehicleCategory[i].checked==true){A=true;break;}}}else{if(document.forms["stockList"].selectedVehicleCategory.checked==true){A=true;}}}if(document.forms["stockList"].selectedState!=undefined){if(document.forms["stockList"].selectedState.length!=undefined){for(i=0;
i<document.forms["stockList"].selectedState.length;i++){if(document.forms["stockList"].selectedState[i].checked==true){B=true;break;}}}else{if(document.forms["stockList"].selectedState.checked==true){B=true;}}}if(A&&B){$("generateB").enable();}else{$("generateB").disable();}}function generateStockList(){if(document.getElementById("tradeStockList").value=="2"){document.getElementById("changeStockList").value="2";
path="TradeStockListReports.action?"+buildParams(document.forms["stockList"],"generate");}else{document.getElementById("changeStockList").value="1";path="StockListReports.action?"+buildParams(document.forms["stockList"],"generate");}window.open("/"+contextName+"/"+path);}function OLcmdExSL(){return overlib(OLresponseAJAX,CAPTION,"Stock List Print Preview",WIDTH,990,HEIGHT,500,WRAP,STICKY,SHADOW,SHADOWCOLOR,"#6699cc",CLOSECLICK,PRINT,PRINTJOB,"myPrintJob(OLresponseAJAX)",TEXTPADDING,0,CAPTIONPADDING,4,CAPTIONFONTCLASS,"olcap",PRINTFONTCLASS,"olcap",CLOSEFONTCLASS,"olcap",MIDX,0,RELY,10,FADEIN,0,FADEOUT,0,HAUTO,VAUTO,FGCLASS,"stocklist_fg",TEXTFONTCLASS,"stocklist_txt",BGCLASS,"stocklist_bg");
}function cancelStockList(){document.forms["cancel"].submit();}function myPrintJob(A){PrJob=window.open("","printjob","resizable=1,width=690,height=480,status=0,location=0,toolbar=0,menubar=0,scrollbars=1,screenX=50,left=50,screenY=20,top=20");PrJob.document.write(A);PrJob.document.close();return ;}function PrintAndClose(){if(window.print){self.print();
setTimeout("self.close()",2);}else{actionFailedError("Use Control-P to print, then close this window.","Message",false,"","M");}return false;}function onChangeStockListOption(){if(document.getElementById("tradeStockList").value=="2"){document.getElementById("changeStockList").value="2";document.forms["stockList"].action="/"+contextName+"/TradeStockListReports.action";
document.forms["stockList"].submit();}else{document.getElementById("changeStockList").value="1";document.forms["stockList"].submit();}}