You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/04/04 23:43:57 UTC
DO NOT REPLY [Bug 7749] New: -
ArrayIndexOutOfBoundsException in 2.3.1
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7749
ArrayIndexOutOfBoundsException in 2.3.1
Summary: ArrayIndexOutOfBoundsException in 2.3.1
Product: XalanJ2
Version: 2.3
Platform: PC
OS/Version: Other
Status: NEW
Severity: Blocker
Priority: Other
Component: Xalan-Xsltc
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: rdeepak@covansys.com
I seem to be getting
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
at java.util.Vector.removeElementAt(Vector.java:503)
at org.apache.xalan.xsltc.runtime.AbstractTranslet.popVarFrame(AbstractT
ranslet.java:264)
at locatenewvehicle.VehicleOptions()
at locatenewvehicle.applyTemplates()
at locatenewvehicle.applyTemplates()
at locatenewvehicle.transform()
at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTra
nslet.java:547)
at XsltApp.doTransform(XsltApp.java:151)
at XsltApp.run(XsltApp.java:48)
at XsltApp.main(XsltApp.java:25)
on running a transform using xsltc . The same transform goes through using Xalan
or Saxon . I queried the bug database and found some similar entries marked as
fixed . I'm using the latest release build and sill get this exception . Could
someone please help me out? The reason we are eager to use xsltc is because we
spend a lot of cpu time in transform and would like a faster transform
Thanks In Advance
P.S Sorry for occupying a lot of space in attaching the files inline . I am
only attaching the files to assist in debug and not for any xsl help .
The xml file is ...
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Milind (Covansys) -->
<newVehicleLocateRequest>
<vehicleSpecification>
<year>2002</year>
</vehicleSpecification>
<searchType>
<postalCodeProximitySearch selected="TRUE">
<postalCode>48335</postalCode>
<proximity unitOfMeasure="MILES">50</proximity>
</postalCodeProximitySearch>
<singleVendorSearch selected="TRUE"
includePoolingPartnersInventory="TRUE">
<vendorId vendorType="BAC">115859</vendorId>
</singleVendorSearch>
<tradingPartnersSearch selected="FALSE"/>
<multipleVendorSearch selected="FALSE"/>
<cityProximitySearch selected="FALSE">
<regionCode>FL</regionCode>
<proximity unitOfMeasure="MILES">50</proximity>
</cityProximitySearch>
<postalStateSearch selected="FALSE">
<regionCode>AL</regionCode>
<regionCode>CA</regionCode>
</postalStateSearch>
</searchType>
<filter>
<earliestEventCode>3100</earliestEventCode>
</filter>
<vehicleSpecsData>
<modelYears>
<modelYear>2003</modelYear>
<modelYear>2002</modelYear>
<modelYear>2001</modelYear>
</modelYears>
<earliestEvents default="5000">
<earliestEvent earliestEventCode="3100">Available to
sequence</earliestEvent>
<earliestEvent earliestEventCode="3300">Scheduled for
Production</earliestEvent>
<earliestEvent earliestEventCode="3400">Broadcast to
Plant</earliestEvent>
<earliestEvent earliestEventCode="3800">Completed
vehicle available for shipment</earliestEvent>
<earliestEvent
earliestEventCode="4000">Invoiced</earliestEvent>
<earliestEvent earliestEventCode="4150">Vehicle shipped
from source plant</earliestEvent>
<earliestEvent earliestEventCode="4200">Vehicle
received at an intermediate shipping plant</earliestEvent>
<earliestEvent earliestEventCode="4300">Landed
Stock</earliestEvent>
<earliestEvent earliestEventCode="4800">Vehicle
received at sales organization compound</earliestEvent>
<earliestEvent earliestEventCode="5000">Vehicle
delivered to dealer</earliestEvent>
</earliestEvents>
<maximumCounts default="5">
<maximumCount>5</maximumCount>
<maximumCount>10</maximumCount>
<maximumCount>15</maximumCount>
<maximumCount>20</maximumCount>
</maximumCounts>
<specMakes>
<makes makeCode="004" sourceCode="11">Buick</makes>
<makes makeCode="006" sourceCode="12">Cadillac</makes>
<makes makeCode="001" sourceCode="13">Chevrolet</makes>
<makes makeCode="012" sourceCode="48">GMC</makes>
<makes makeCode="003" sourceCode="15">Oldsmobile</makes>
<makes makeCode="002" sourceCode="16">Pontiac</makes>
</specMakes>
</vehicleSpecsData>
<us-states>
<state>
<name>Alabama</name>
<abbr>AL</abbr>
</state>
<state>
<name>Alaska</name>
<abbr>AK</abbr>
</state>
<state>
<name>Arizona</name>
<abbr>AZ</abbr>
</state>
<state>
<name>Arkansas</name>
<abbr>AR</abbr>
</state>
<state>
<name>California</name>
<abbr>CA</abbr>
</state>
<state>
<name>Colorado</name>
<abbr>CO</abbr>
</state>
<state>
<name>Connecticut</name>
<abbr>CT</abbr>
</state>
<state>
<name>Delaware</name>
<abbr>DE</abbr>
</state>
<state>
<name>Florida</name>
<abbr>FL</abbr>
</state>
<state>
<name>Georgia</name>
<abbr>GA</abbr>
</state>
<state>
<name>Hawaii</name>
<abbr>HI</abbr>
</state>
<state>
<name>Idaho</name>
<abbr>ID</abbr>
</state>
<state>
<name>Illinois</name>
<abbr>IL</abbr>
</state>
<state>
<name>Indiana</name>
<abbr>IN</abbr>
</state>
<state>
<name>Iowa</name>
<abbr>IA</abbr>
</state>
<state>
<name>Kansas</name>
<abbr>KS</abbr>
</state>
<state>
<name>Kentucky</name>
<abbr>KY</abbr>
</state>
<state>
<name>Louisiana</name>
<abbr>LA</abbr>
</state>
<state>
<name>Maine</name>
<abbr>ME</abbr>
</state>
<state>
<name>Maryland</name>
<abbr>MD</abbr>
</state>
<state>
<name>Massachusetts</name>
<abbr>MA</abbr>
</state>
<state>
<name>Michigan</name>
<abbr>MI</abbr>
</state>
<state>
<name>Minnesota</name>
<abbr>MN</abbr>
</state>
<state>
<name>Mississippi</name>
<abbr>MS</abbr>
</state>
<state>
<name>Missouri</name>
<abbr>MO</abbr>
</state>
<state>
<name>Montana</name>
<abbr>MT</abbr>
</state>
<state>
<name>Nebraska</name>
<abbr>NE</abbr>
</state>
<state>
<name>Nevada</name>
<abbr>NV</abbr>
</state>
<state>
<name>New Hampshire</name>
<abbr>NH</abbr>
</state>
<state>
<name>New Jersey</name>
<abbr>NJ</abbr>
</state>
<state>
<name>New Mexico</name>
<abbr>NM</abbr>
</state>
<state>
<name>New York</name>
<abbr>NY</abbr>
</state>
<state>
<name>North Carolina</name>
<abbr>NC</abbr>
</state>
<state>
<name>North Dakota</name>
<abbr>ND</abbr>
</state>
<state>
<name>Ohio</name>
<abbr>OH</abbr>
</state>
<state>
<name>Oklahoma</name>
<abbr>OK</abbr>
</state>
<state>
<name>Oregon</name>
<abbr>OR</abbr>
</state>
<state>
<name>Pennsylvania</name>
<abbr>PA</abbr>
</state>
<state>
<name>Rhode Island</name>
<abbr>RI</abbr>
</state>
<state>
<name>South Carolina</name>
<abbr>SC</abbr>
</state>
<state>
<name>South Dakota</name>
<abbr>SD</abbr>
</state>
<state>
<name>Tennessee</name>
<abbr>TN</abbr>
</state>
<state>
<name>Texas</name>
<abbr>TX</abbr>
</state>
<state>
<name>Utah</name>
<abbr>UT</abbr>
</state>
<state>
<name>Vermont</name>
<abbr>VT</abbr>
</state>
<state>
<name>Virginia</name>
<abbr>VA</abbr>
</state>
<state>
<name>Washington</name>
<abbr>WA</abbr>
</state>
<state>
<name>West Virginia</name>
<abbr>WV</abbr>
</state>
<state>
<name>Wisconsin</name>
<abbr>WI</abbr>
</state>
<state>
<name>Wyoming</name>
<abbr>WY</abbr>
</state>
</us-states>
</newVehicleLocateRequest>
and the xsl is
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="eInventoryHeader.xsl"/>
<xsl:import href="eInventoryFooter.xsl"/>
<xsl:import href="globalVariables.xsl"/>
<xsl:param name="errorMessages"/>
<xsl:template match="newVehicleLocateRequest">
<html>
<head>
<title>e-Inventory</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" href="{$gmCSS}"
type="text/css"/>
</head>
<SCRIPT LANGUAGE="JavaScript1.2" type="text/javascript"
src="{$functionsJS}"/>
<script language="javascript">
//This part is for the options
var arrImgMenuOn = new Array(7);
var arrImgMenu = new Array(7);
var arrOptions = new Array();
var nItems = 7;
var arrMustHaveMaxOptions = new Array();
var arrDontWantMaxOptions = new Array();
var arrOptionsType = new Array();
var sItem1MustHave;
var sOtherMustHave;
var sDontWantOptions;
//arrMustHaveMaxOptions - maximum number of options
allowed in MustHave box
arrMustHaveMaxOptions[0] = 3
arrMustHaveMaxOptions[1] = 1;
arrMustHaveMaxOptions[2] = 1;
arrMustHaveMaxOptions[3] = 1;
arrMustHaveMaxOptions[4] = 1;
arrMustHaveMaxOptions[5] = 1;
arrMustHaveMaxOptions[6] = 300;
arrOptionsType[0] = 0;
arrOptionsType[1] = 0;
arrOptionsType[2] = 0;
arrOptionsType[3] = 0;
arrOptionsType[4] = 0;
arrOptionsType[5] = 0;
arrOptionsType[6] = 0;
// when implementing, build the foll. statements
dynamically
// use maximum number of options in each item minus 1
as default
//arrDontWantMaxOptions - maximum number of options
allowed in DontWant box
arrDontWantMaxOptions[0] = 1;
arrDontWantMaxOptions[1] = 1;
arrDontWantMaxOptions[2] = 1;
arrDontWantMaxOptions[3] = 1;
arrDontWantMaxOptions[4] = 1;
arrDontWantMaxOptions[5] = 1;
arrDontWantMaxOptions[6] = 300;
// when implementing, build the foll. statements
dynamically
// use assignment statements only where values exist
<xsl:if test="count(//option
[parent::optionFamily/@description='Color1Option']) > 0">
arrOptions[0] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='Color1Option'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='Color1Option']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info0">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
arrOptions[0][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info0"/>";
</xsl:for-each>
<xsl:if test="count(//option
[parent::optionFamily/@description='Color2Option']) > 0">
arrOptions[1] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='Color2Option'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='Color2Option']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info1">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
arrOptions[1][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info1"/>";
</xsl:for-each>
<xsl:if test="count(//option
[parent::optionFamily/@description='TrimOption']) > 0">
arrOptions[2] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='TrimOption'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='TrimOption']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info2">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
arrOptions[2][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info2"/>";
</xsl:for-each>
<!-- arrOptions[3] = new
Array(5); -->
<xsl:if test="count(//option
[parent::optionFamily/@description='PackageOption']) > 0">
arrOptions[3] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='PackageOption'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='PackageOption']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info3">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
arrOptions[3][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info3"/>";
</xsl:for-each>
<xsl:if test="count(//option
[parent::optionFamily/@description='EngineOption']) > 0">
arrOptions[4] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='EngineOption'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='EngineOption']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info4">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
arrOptions[4][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info4"/>";
</xsl:for-each>
<xsl:if test="count(//option
[parent::optionFamily/@description='TransOption']) > 0">
arrOptions[5] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='TransOption'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='TransOption']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info5">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
arrOptions[5][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info5"/>";
</xsl:for-each>
<!--
<xsl:if test="count(//option
[parent::optionFamily/@description='Other']) > 0">
arrOptions[6] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='Other'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='Other']">
arrOptions[6][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="."/>";
</xsl:for-each>
-->
<xsl:if test="count(//option
[parent::optionFamily/@description='Other']) > 0">
arrOptions[6] = new Array(<xsl:number
value="count(//option[parent::optionFamily/@description='Other'])"/>);
</xsl:if>
<xsl:for-each select="//option
[parent::optionFamily/@description='Other']">
<xsl:sort select="@optionCode"
order="ascending"/>
<xsl:variable name="info6">
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="."/>
</xsl:call-template>
</xsl:variable>
<!--arrOptions[6][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="."/>"; -->
arrOptions[6][<xsl:number value="position()-
1"/>]="<xsl:value-of select="@optionCode"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$info6"/>";
</xsl:for-each>
//function to show the options for the item selected
function showOptionsForItem(nItem)
{
var frm = document.vehicleSpecs;
var box = frm.boxSelectFrom;
var boxMustHaveBox = frm.boxMustHave;
var boxDontWantBox = frm.boxDontWant;
var newOption;
frm.txtCurrentItem.value = nItem;
var nTemp = box.length;
if (nTemp > 0) {
for (i=nTemp-1; i >= 0; i--)
{
box.options[i]= null;
}
}
//check if options exist in either MustHave or
DontWant boxes
//if not, add new list options
k = 0;
i = 0;
if ( arrOptions[nItem] != null) {
while (i < arrOptions[nItem].length)
{
bFound = false;
for (j=0; j < boxMustHaveBox.length;
j++)
{
//get value of each option in
box
//get prefixed ID for item
strTemp = boxMustHaveBox.options
[j].value;
strTemp = strTemp.substring
(strTemp.indexOf(";")+1,strTemp.length);
if (strTemp == arrOptions[nItem]
[i])
{
bFound = true;
}
}
if (!bFound)
{
for (j=0; j <
boxDontWantBox.length; j++)
{
//get value of
each option in box
//get postfixed
value for option
strTemp =
boxDontWantBox.options[j].value;
strTemp =
strTemp.substring(strTemp.indexOf(";")+1,strTemp.length);
if (strTemp ==
arrOptions[nItem][i])
{
bFound = true;
}
}
}
if (!bFound)
{
box.options[k] = new Option
(arrOptions[nItem][i], arrOptions[nItem][i]);
k++;
}
i++;
}
}
if (box.length > 0) {
box.options[0].selected = true;
}
var rowImage = null;
for (i=0; i < nItems; i++)
{
rowImage = document.images
["rowimg" + i];
if (rowImage == null){
continue;
}
rowImage.src = arrImgMenu[i].src;
}
rowImage = document.images["rowimg" + nItem];
if (rowImage != null){
rowImage.src = arrImgMenuOn[nItem].src;
}
return true;
}
//function to select options
// boxTo - box to where the options should go
// arrMaxOptions - array that stores maximum number
for selected options for each item
function selectOption(boxTo, arrMaxOptions)
{
var frm = document.vehicleSpecs;
var boxStart = frm.boxSelectFrom;
var nCurItem = frm.txtCurrentItem.value;
var boxMustHaveBox = frm.boxMustHave;
var boxDontWantBox = frm.boxDontWant;
nSelIndex = boxStart.selectedIndex;
if (nSelIndex == -1)
{
alert("Please select an item from
list!");
return false;
}
//check the other box to see if a selection of
the current item has already been made
//get the other box
if (boxTo.name == boxMustHaveBox.name)
{
checkWhichBox = boxDontWantBox;
} else {
checkWhichBox = boxMustHaveBox;
}
//loop through the options in the other box to
see if any options of the current item
//exist in the other box. If it does, exit with
error.
for (i=0; i < checkWhichBox.length; i++)
{
//get value of each option in box
//get prefixed ID for item
strTemp = checkWhichBox.options
[i].value;
strTemp = strTemp.substring
(0,strTemp.indexOf(";"));
//check to see if selection has been
made into the other box
if ((strTemp == nCurItem) &&
(arrOptionsType[nCurItem] == 0))
{
alert("You have already
selected options into the other box. Cannot make this selection!");
return true;
}
}
nMax = boxTo.length;
// count number of options selected so far
nCount = 0;
for (i=0; i < nMax; i++)
{
//get value of each option in box
//get prefixed ID for item
strTemp = boxTo.options[i].value;
strTemp = strTemp.substring
(0,strTemp.indexOf(";"));
//count number of options selected for
current item
if (strTemp == nCurItem)
{
nCount++;
}
}
//check maximum allowed options for item
if (nCount == arrMaxOptions[nCurItem])
{
alert("You have already selected
maximum number of options allowed. You may not select any more.");
return true;
}
//add option to box
//we use the Item ID as prefix for the value of
the options
//this is used in the preceding statements
boxTo.options[nMax] = new Option
(boxStart.options[nSelIndex].text, nCurItem + ";" + boxStart.options
[nSelIndex].value);
//remove option from SelectFrom
boxStart.options[nSelIndex] = null;
if (nSelIndex != 0) {
boxStart.options[0].selected = true;
}
return true;
}
function deselectOptions(boxStart)
{
var frm = document.vehicleSpecs;
var boxTo = frm.boxSelectFrom;
var nCurItem = frm.txtCurrentItem.value;
nSelIndex = boxStart.selectedIndex;
strTextArray = "";
strValueArray = "";
nTemp = boxStart.length;
if (nTemp == 0)
{
alert("No options to remove!")
return true;
}
if (nSelIndex == -1)
{
alert("Please select an option from
list!");
return true;
}
//get all multiple selected items
for (i=0; i < nTemp; i++)
{
if (boxStart.options[i].selected)
{
//check to see if selected item
should be removed from main list
strTemp = boxStart.options
[i].value;
strTemp1 = strTemp.substring
(0,strTemp.indexOf(";"));
strTemp2 = strTemp.substring
(strTemp.indexOf(";")+1,strTemp.length);
if (strTemp1 == nCurItem)
{
//add item to
main list
nMax =
boxTo.length;
boxTo.options[nMax] =
new Option(strTemp2, strTemp2);
}
} else {
//build strings for unselected items to
build an array
//this will be used later
strTextArray = strTextArray +
boxStart.options[i].text + "|" ;
strValueArray = strValueArray +
boxStart.options[i].value + "|" ;
}
}
//cannot remove selected items directly since
//each deletion will compress the options array
and all options
//will be reindexed.
//so we will delete all options in the list
//and add unselected items back into the list
//remove all items
for (i=nTemp-1; i >= 0; i--)
{
boxStart.options[i] = null;
}
//strip last comma and build arrays
strTextArray = strTextArray.substring
(0,strTextArray.length-1);
strValueArray = strValueArray.substring
(0,strValueArray.length-1);
if (strTextArray.length!=0)
{
arrTextArray = strTextArray.split("|");
arrValueArray = strValueArray.split
("|");
for (i=0; i < arrTextArray.length;
i++)
{
boxStart.options[i] = new Option
(arrTextArray[i], arrValueArray[i]);
}
}
var n =
document.vehicleSpecs.boxSelectFrom.length ;
for (i=0; i < n-1; i++)
{
for (j=i+1; j < n; j++)
{
if (
document.vehicleSpecs.boxSelectFrom[i].text >
document.vehicleSpecs.boxSelectFrom[j].text ) {
tempText =
document.vehicleSpecs.boxSelectFrom[i].text;
tempValue =
document.vehicleSpecs.boxSelectFrom[i].value;
document.vehicleSpecs.boxSelectFrom[i].text =
document.vehicleSpecs.boxSelectFrom[j].text;
document.vehicleSpecs.boxSelectFrom[i].value =
document.vehicleSpecs.boxSelectFrom[j].value;
document.vehicleSpecs.boxSelectFrom[j].text = tempText;
document.vehicleSpecs.boxSelectFrom[j].value = tempValue ;
}
}
}
return true;
}
function submitForm()
{
var frm = document.vehicleSpecs;
var boxMustHaveBox = frm.boxMustHave;
var boxDontWantBox = frm.boxDontWant;
var el = frm.elements["selectedStates"];
strItem1MustHave = "";
strOtherMustHave = "";
strDontWant = "";
for (i=0; i < boxMustHaveBox.length; i++)
{
strTemp = boxMustHaveBox.options[i].value;
strTemp1 = strTemp.substring(0,strTemp.indexOf(";"));
strTemp2 = strTemp.substring(strTemp.indexOf(";")+1,strTemp.length);
strTemp3 = strTemp2.substring(0,strTemp2.indexOf("-"));
var flag = 0;
while (flag == 0)
{
for (j=0; j < arrOptions[0].length;j++)
{
if ((boxMustHaveBox.options[i].text == arrOptions[0]
[j]) && (flag == 0))
{
strItem1MustHave = strItem1MustHave + strTemp3
+ ",";
flag = 1;
}
}
if (flag == 0)
{
strOtherMustHave = strOtherMustHave + strTemp3 + ",";
flag = 1;
}
}
}
for (i=0; i < boxDontWantBox.length; i++)
{
strTemp = boxDontWantBox.options[i].value;
strTemp1 = strTemp.substring(0,strTemp.indexOf(";"));
strTemp2 = strTemp.substring(strTemp.indexOf(";")+1,strTemp.length);
strTemp3 = strTemp2.substring(0,strTemp2.indexOf("-"));
strDontWant = strDontWant + strTemp3 + ",";
}
strItem1MustHave = strItem1MustHave.substring(0,strItem1MustHave.length-1);
strOtherMustHave = strOtherMustHave.substring(0,strOtherMustHave.length-1);
strDontWant = strDontWant.substring(0,strDontWant.length-1);
frm.Color1MustHaveOptions.value = strItem1MustHave;
frm.OtherMustHaveOptions.value = strOtherMustHave;
frm.DontWantOptions.value = strDontWant;
// States
strTemp ="";
for (var i = 0; i < el.length; i++) {
strTemp = strTemp + el[i].value;
if ( i != el.length - 1) {
strTemp = strTemp + ",";
}
}
frm.postalStateSearchText.value=strTemp;
}
//function to select options
function selectState(btn)
{
var frm = document.vehicleSpecs;
var boxToText = new Array();
var boxFromText = new Array();
var arrayLookup = new Array();
if (btn.value == " >> ")
{
boxFrom = frm.states;
boxTo = frm.selectedStates;
if (boxTo.length == 5) {
alert("You have already selected maximum number of states allowed. You may
not select any more.");
return false;
}
else {
frm.postalStateSearch.checked = true;
uncheckLocationCriteria(frm.postalStateSearch);
}
} else {
boxFrom = frm.selectedStates ;
boxTo = frm.states ;
}
if (boxFrom.selectedIndex == -1)
{
alert("Please select an item from the list!");
return false;
}
//first add to new list then delete to avoid reorder of index when deleting
items from list
nMax = boxTo.length;
for (i=0; i < boxFrom.length; i++)
{
if (boxFrom.options[i].selected)
{
boxTo.options[nMax] = new Option(boxFrom.options[i].text, boxFrom.options
[i].value);
nMax = nMax + 1;
}
}
for(i=0; i < nMax; i++) {
arrayLookup[boxTo.options[i].text] = boxTo.options[i].value;
boxToText[i] = boxTo.options[i].text;
}
boxToText.sort();
for (i=0; i < nMax; i++) {
boxTo.options[i].value = arrayLookup[boxToText[i]];
boxTo.options[i].text = boxToText[i];
}
var fMax = boxFrom.length;
for(i=0; i < fMax; i++) {
arrayLookup[boxFrom.options[i].text] = boxFrom.options[i].value;
boxFromText[i] = boxFrom.options[i].text;
}
boxFromText.sort();
for (i=0; i < fMax; i++) {
boxFrom.options[i].value = arrayLookup[boxFromText[i]];
boxFrom.options[i].text = boxFromText[i];
}
for (i=boxFrom.length-1; i >= 0 ; i--)
{
if (boxFrom.options[i].selected)
{
boxFrom.options[i] = null;
}
}
if ( boxFrom.length > 0 )
boxFrom.options[0].selected = true;
return false;
}
function preloadImages(){
var img = document.images;
// if(document.images){
arrImgMenu[0] = new Image();
arrImgMenu[0].src = "<xsl:value-of select="$imagesURL"/>/color1.gif";
document.images["rowimg0"].src = "<xsl:value-of
select="$imagesURL"/>/color1.gif";
arrImgMenuOn[0] = new Image();
arrImgMenuOn[0].src = "<xsl:value-of select="$imagesURL"/>/color1_f2.gif";
arrImgMenu[1] = new Image();
arrImgMenu[1].src = "<xsl:value-of select="$imagesURL"/>/color2.gif";
document.images["rowimg1"].src = "<xsl:value-of
select="$imagesURL"/>/color2.gif";
arrImgMenuOn[1] = new Image();
arrImgMenuOn[1].src = "<xsl:value-of select="$imagesURL"/>/color2_f2.gif";
arrImgMenu[2] = new Image();
arrImgMenu[2].src = "<xsl:value-of select="$imagesURL"/>/trim.gif";
document.images["rowimg2"].src = "<xsl:value-of
select="$imagesURL"/>/trim.gif";
arrImgMenuOn[2] = new Image();
arrImgMenuOn[2].src = "<xsl:value-of select="$imagesURL"/>/trim_f2.gif";
arrImgMenu[3] = new Image();
arrImgMenu[3].src = "<xsl:value-of select="$imagesURL"/>/package.gif";
document.images["rowimg3"].src = "<xsl:value-of
select="$imagesURL"/>/package.gif";
arrImgMenuOn[3] = new Image();
arrImgMenuOn[3].src = "<xsl:value-of select="$imagesURL"/>/package_f2.gif";
arrImgMenu[4] = new Image();
arrImgMenu[4].src = "<xsl:value-of select="$imagesURL"/>/engine.gif";
document.images["rowimg4"].src = "<xsl:value-of
select="$imagesURL"/>/engine.gif";
arrImgMenuOn[4] = new Image();
arrImgMenuOn[4].src = "<xsl:value-of select="$imagesURL"/>/engine_f2.gif";
arrImgMenu[5] = new Image();
arrImgMenu[5].src = "<xsl:value-of select="$imagesURL"/>/trans.gif";
document.images["rowimg5"].src = "<xsl:value-of
select="$imagesURL"/>/trans.gif";
arrImgMenuOn[5] = new Image();
arrImgMenuOn[5].src = "<xsl:value-of select="$imagesURL"/>/trans_f2.gif";
<!--
arrImgMenu[6] = new Image();
arrImgMenu[6].src = "<xsl:value-of select="$imagesURL"/>/options.gif";
document.images["rowimg6"].src = "<xsl:value-of
select="$imagesURL"/>/options.gif";
arrImgMenuOn[6] = new Image();
arrImgMenuOn[6].src = "<xsl:value-of select="$imagesURL"/>/options_f2.gif";
-->
arrImgMenu[6] = new Image();
arrImgMenu[6].src = "<xsl:value-of select="$imagesURL"/>/options.gif";
document.images["rowimg6"].src = "<xsl:value-of
select="$imagesURL"/>/options.gif";
arrImgMenuOn[6] = new Image();
arrImgMenuOn[6].src = "<xsl:value-of select="$imagesURL"/>/options_f2.gif";
preload = true;
//}
}
//options end
function makeChanged() {
var makeCode = document.vehicleSpecs.makeCode.options
[document.vehicleSpecs.makeCode.selectedIndex].value;
if ( isWhitespace( makeCode )) {
alert("Please select a make");
return false;
}
submitForm();
document.vehicleSpecs.ActionTag.value
= "makeChangeAction";
document.vehicleSpecs.submit();
return false;
}
function yearChanged() {
var year = document.vehicleSpecs.year.options
[document.vehicleSpecs.year.selectedIndex].value;
if ( isWhitespace( year )) {
alert("Please select a year");
return false;
}
submitForm();
document.vehicleSpecs.ActionTag.value
= "yearChangeAction";
document.vehicleSpecs.submit();
return false;
}
function clearOptions() {
var makeCode = document.vehicleSpecs.makeCode.options
[document.vehicleSpecs.makeCode.selectedIndex].value;
//var make = document.vehicleSpecs.model.options
[document.vehicleSpecs.model.selectedIndex].value;
if ( isWhitespace( makeCode )) {
return false;
}
submitForm();
document.vehicleSpecs.ActionTag.value
= "makeChangeAction";
//document.vehicleSpecs.ActionTag.value
= "modelChangeAction";
document.vehicleSpecs.submit();
return false;
}
function modelChanged() {
var model =
document.vehicleSpecs.merchandisingModelDesignator.options
[document.vehicleSpecs.merchandisingModelDesignator.selectedIndex].value;
if ( isWhitespace( model )) {
alert("Please select a model");
return false;
}
submitForm();
document.vehicleSpecs.ActionTag.value
= "modelChangeAction";
document.vehicleSpecs.submit();
return false;
}
function earliestEventChanged() {
var earliestEventText =
document.vehicleSpecs.earliestEventCode.options
[document.vehicleSpecs.earliestEventCode.selectedIndex].text;
var Tv = document.vehicleSpecs.earliestEvent;
Tv.value = earliestEventText;
return false;
}
function validateVehicleSpecs() {
var makeCode =
document.vehicleSpecs.makeCode.options
[document.vehicleSpecs.makeCode.selectedIndex].value;
var year = document.vehicleSpecs.year.options
[document.vehicleSpecs.year.selectedIndex].value;
var model =
document.vehicleSpecs.merchandisingModelDesignator.options
[document.vehicleSpecs.merchandisingModelDesignator.selectedIndex].value
;
if ( isWhitespace( year )) {
alert("Please select a year");
return false;
}
if ( isWhitespace( makeCode )) {
alert("Please select a make");
return false;
}
if ( isWhitespace( model )) {
alert("Please select a model");
return false;
}
return true;
}
function saveButtonPressed() {
if ( !validateLocationCriteria() ) {
return false;
}
submitForm() ;
document.vehicleSpecs.ActionTag.value
= "saveAction";
document.vehicleSpecs.submit();
return false;
}
function restoreButtonPressed() {
//alert("restore button pressed");
submitForm() ;
document.vehicleSpecs.ActionTag.value
= "restoreAction";
document.vehicleSpecs.submit();
return false;
}
function locateClicked() {
if ( !validateForm() ){
return false;
}
submitForm();
//alert("locate button pressed");
document.vehicleSpecs.ActionTag.value
= "locateAction";
document.vehicleSpecs.vinSearch.value = "";
document.vehicleSpecs.submit();
return false;
}
function locateVINClicked() {
if ( isWhitespace(
document.vehicleSpecs.vinSearch.value)) {
alert("Please enter a valid VIN");
return false;
}
if ( !isAlphanumeric(
document.vehicleSpecs.vinSearch.value)) {
alert("Invalid characters in VIN");
return false;
}
submitForm();
//alert("locate button pressed");
document.vehicleSpecs.ActionTag.value
= "locateAction";
document.vehicleSpecs.submit();
return false;
}
function validateForm() {
if ( !validateVehicleSpecs() ) {
return false;
}
if ( !validateLocationCriteria() ) {
return false;
}
if (! isWhitespace(
document.vehicleSpecs.maxMRSP.value)) {
if (!validateAmount()) {
return false;
}
}
return true;
}
function validateLocationCriteria( ) {
if ( !isLocationCriteriaSelected() ) {
return false;
}
if ( !validateZipSearch() ) {
return false;
}
if ( !validateCityStateSearch() ) {
return false;
}
if ( !validateBACSearch() ) {
return false;
}
if ( !validateStateSearch() ) {
return false;
}
return true;
}
function isLocationCriteriaSelected() {
var locationCriteriaCount = 0;
if (
document.vehicleSpecs.tradingPartnersSearch.checked ) {
locationCriteriaCount += 1;
}
if (
document.vehicleSpecs.postalCodeProximitySearch.checked ) {
locationCriteriaCount += 1;
}
if (
document.vehicleSpecs.cityProximitySearch.checked ) {
locationCriteriaCount += 1;
}
if (
document.vehicleSpecs.multipleVendorSearch.checked ) {
locationCriteriaCount += 1;
}
if (
document.vehicleSpecs.postalStateSearch.checked ) {
locationCriteriaCount += 1;
}
if ( !
document.vehicleSpecs.singleVendorSearch.checked &&
locationCriteriaCount == 0 ) {
alert("Please select atleast one
location criteria");
return false;
}
if ( locationCriteriaCount > 1 ) {
alert("Only one additional location
criteria can be selected.");
return false;
}
return true;
}
function checkLocationCriteria( fieldChanged ,
locationBox ) {
var fieldVal = null;
if ( fieldChanged.type == 'text' ) {
fieldVal = fieldChanged.value;
}
//if ( fieldChanged.type == 'select' ) {
//fieldVal = fieldChanged.options
[fieldChanged.selectedIndex].value;
//}
if ( ! isWhitespace(fieldVal ) ){
locationBox.checked = true;
uncheckLocationCriteria(locationBox);
}
}
function uncheckLocationCriteria(clickedCheckBox) {
if ( clickedCheckBox.checked ) {
var checkboxGroup = clickedCheckBox.form;
for (var c = 0; c < checkboxGroup.elements.length;
c++) {
if (checkboxGroup[c].type == 'checkbox' &&
checkboxGroup[c].name != clickedCheckBox.name && ( checkboxGroup
[c].name == 'tradingPartnersSearch' || checkboxGroup[c].name
== 'postalCodeProximitySearch' || checkboxGroup[c].name
== 'cityProximitySearch' || checkboxGroup[c].name == 'multipleVendorSearch'
|| checkboxGroup[c].name == 'postalStateSearch' ) ) {
checkboxGroup[c].checked = false;
}
}
}
}
function validateZipSearch() {
if (
document.vehicleSpecs.postalCodeProximitySearch.checked ) {
if ( isWhitespace(
document.vehicleSpecs.postalCode.value)) {
alert("Please enter a valid ZIP
code");
return false;
}
if ( isWhitespace(
document.vehicleSpecs.postalCodeProximitySearchProximity.value)) {
alert("Please enter radius in
miles");
return false;
}
else {
if (!isInteger
(document.vehicleSpecs.postalCodeProximitySearchProximity.value))
{
alert("Please enter radius in
miles");
return false;
}
}
}
return true;
}
function validateCityStateSearch() {
if (
document.vehicleSpecs.cityProximitySearch.checked ) {
if ( isWhitespace(
document.vehicleSpecs.city.value)) {
alert("Please enter a valid
city name");
return false;
}
if (
document.vehicleSpecs.cityRegionCode.selectedIndex == 0) {
alert("Please select a state");
return false;
}
if ( isWhitespace(
document.vehicleSpecs.cityProximitySearchProximity.value)) {
alert("Please enter radius in
miles");
return false;
}
else {
if (!isInteger
(document.vehicleSpecs.cityProximitySearchProximity.value))
{
alert("Please enter radius in
miles");
return false;
}
}
}
return true;
}
function validateBACSearch() {
var vendorCount = 0;
var i = 0;
if (
document.vehicleSpecs.multipleVendorSearch.checked ) {
for ( i = 0 ; i <
document.vehicleSpecs.multipleVendorSearchText.length ; i++) {
if ( !isWhitespace(
document.vehicleSpecs.multipleVendorSearchText[i].value)) {
vendorCount = 1;
}
}
if ( vendorCount == 0) {
alert("Please enter a valid
dealer BAC");
return false;
}
}
for ( i = 0 ; i <
document.vehicleSpecs.multipleVendorSearchText.length ; i++) {
for ( j = 0 ; j <
document.vehicleSpecs.multipleVendorSearchText.length ; j++) {
if ( i != j ) {
if ( !
isWhitespace( document.vehicleSpecs.multipleVendorSearchText[i].value)) {
if ( document.vehicleSpecs.multipleVendorSearchText[i].value ==
document.vehicleSpecs.multipleVendorSearchText[j].value ) {
alert("Duplicate dealer BAC code, for search by BAC");
return false;
}
}
}
}
}
for ( i = 0 ; i <
document.vehicleSpecs.multipleVendorSearchText.length ; i++) {
if ( !isWhitespace(
document.vehicleSpecs.multipleVendorSearchText[i].value)) {
if (!isNum
(document.vehicleSpecs.multipleVendorSearchText[i].value)) {
alert("Dealer's
BAC can only be numeric");
return false;
}
if
(document.vehicleSpecs.multipleVendorSearchText[i].value.length != 6) {
alert("Dealer's
BAC can only be 6 digits");
return false;
}
}
}
return true;
}
function validateStateSearch() {
if (
document.vehicleSpecs.postalStateSearch.checked ) {
if (
document.vehicleSpecs.selectedStates.length == 0) {
alert("Please select the states
to search");
return false;
}
}
return true;
}
function validateAmount() {
if (!isMoneyFormat
(vehicleSpecs.maxMRSP.value,false) ) {
alert('Invalid MSRP. Valid formats are
$23,000, $23000, 23,000 or 23000');
return false ;
}
return true;
}
function isMoneyFormat(str,eur) {
if(!str) return false;
str = "" + str; // force string
for (var i=0; i < str.length;i++) {
var ch = str.charAt(i);
var ch0 = str.charAt(0);
if (!isNum(ch) && ch != ','
&& ch0!= '$') return false;
}
var currencyChar = '';
if (str.length > 1) {
currencyChar = str.substring(0,1);
if (currencyChar == '$' ) {
str = str.substring(1);
}
}
var decimalPoint = '.';
var thDelim = ',';
if (eur) {
decimalPoint = ','
thDelim = '.';
}
test1 = str.split(decimalPoint);
if (test1[0] == '') test1[0] = 0;
if (test1[0] && test1[0].indexOf
(thDelim) != -1) {
test2 = test1[0].split(thDelim);
if (test2.length >= 2) { // thousands
found
var thError = false;
for (var i=0;i <test2.length;i++) {
if (test2[i].length < 3
&& i != 0) { thError = true; break; } // all thousands exept the first.
if (!isNum(test2[i])) { thError =
true; break; } // all numbers
}
if (thError) return false;
}
}
return true;
}
function isNum(str) {
if(!str) return false;
for(var i=0; i < str.length; i++){
var ch=str.charAt(i);
if ("0123456789".indexOf(ch) ==-1) return
false;
}
return true;
}
function openHelpWindow() {
var win = window.open('','help');
win.focus();
return false;
}
function init() {
<xsl:choose>
<xsl:when
test="/newVehicleLocateRequest/filter/earliestEventCode
and /newVehicleLocateRequest/filter/earliestEventCode!=''">
var earliestEventText = "<xsl:apply-
templates select="vehicleSpecsData/earliestEvents/earliestEvent
[@earliestEventCode=/newVehicleLocateRequest/filter/earliestEventCode] "/>";
</xsl:when>
<xsl:otherwise>
var earliestEventText = "<xsl:apply-
templates select="vehicleSpecsData/earliestEvents/earliestEvent
[@earliestEventCode=../@default]"/>";
</xsl:otherwise>
</xsl:choose>
document.vehicleSpecs.earliestEvent.value = earliestEventText;
}
</script>
<body bgcolor="#FFFFFF" text="#000000" marginwidth="0"
marginheight="0" topmargin="0" leftmargin="0" onLoad="javascript:preloadImages
();showOptionsForItem(0);init();">
<table width="760" border="0" cellspacing="0"
cellpadding="3">
<tr>
<td width="100%" valign="top"
class="title">
<form
name="vehicleSpecs" action="{$postURL}">
<input
type="hidden" name="ScreenID" value="vehicleSpecs"/>
<input
type="hidden" name="ActionTag" value="viewAction"/>
<input
type="hidden" name="Color1MustHaveOptions" value=""/>
<input
type="hidden" name="OtherMustHaveOptions" value=""/>
<input
type="hidden" name="DontWantOptions" value=""/>
<table
width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="title" height="21"> Locate New Vehicle</td>
<td align="right">
<a href="{$helpURL}##p1" target="help"
onclick="javascript:openHelpWindow();">
<img src="{$imagesURL}/questionMark.gif" border="0"/>
</a>
</td>
</tr>
<tr
bgcolor="#FFFFFF">
<td colspan="4">
<xsl:choose>
<xsl:when test="$errorMessages!=''">
<p class="error">
<xsl:value-of select="$errorMessages"/>
</p>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr
bgcolor="#FFFFFF">
<td class="formLabel" colspan="4">
<span class="formValue"> OPTION 1:</span> Locate by Vehicle
Specifications (<a href="#Step1">Step1</a>
<img src="{$imagesURL}/arrow.gif" width="5" height="9"/>) and Location
Criteria (<a href="#Step2">Step 2</a>
<img src="{$imagesURL}/arrow.gif" width="5" height="9"/>)
</td>
</tr>
<tr
bgcolor="#BFCBE6">
<td class="formGroupLabel" colspan="4">   Step 1<a
name="Step1"/>:
<span class="formLabel">Vehicle Specifications</span>
</td>
</tr>
<tr>
<td class="formGroupLabel" colspan="4">    Required
Filters</td>
</tr>
<tr>
<td class="formLabel" bgcolor="#EFEFEF">
<div align="left">ModelYear <font color="#D41F00"/>
</div>
</td>
<td class="formLabel" bgcolor="#EFEFEF">
<select name="year" size="1" width="100" style="width:100px"
onchange="javascript:yearChanged();">
<xsl:variable name="select" select="vehicleSpecification/year"/>
<xsl:for-each select="vehicleSpecsData/modelYears/modelYear">
<xsl:sort select="." order="descending"/>
<xsl:choose>
<xsl:when test="text()=$select">
<option selected="true" value="{text
()}">
<xsl:value-of select="."/>
</option>
</xsl:when>
<xsl:otherwise>
<option value="{text()}">
<xsl:value-of select="."/>
</option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</td>
<td class="formLabel" bgcolor="#EFEFEF">Make <font color="#D41F00"/>
</td>
<td class="formLabel" bgcolor="#EFEFEF">
<select name="makeCode" size="1" width="100" style="width:100px"
onchange="javascript:makeChanged();">
<option value="">Select</option>
<xsl:variable name="select">
<xsl:value-of select="vehicleSpecification/makeCode"/>
</xsl:variable>
<xsl:for-each select="vehicleSpecsData/specMakes/makes">
<xsl:variable name="make">
<xsl:value-of select="@makeCode"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$select=$make">
<option selected="true"
value="{@makeCode}">
<xsl:value-of select="."/>
</option>
</xsl:when>
<xsl:otherwise>
<option value="{@makeCode}">
<xsl:value-of select="."/>
</option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</td>
</tr>
<tr>
<td class="formLabel" bgcolor="#EFEFEF">Model <font color="#D41F00"/>
</td>
<td class="formLabel" colspan="3" bgcolor="#EFEFEF">
<select name="merchandisingModelDesignator" size="1" width="350"
style="width:350px" onchange="javascript:modelChanged();">
<xsl:variable name="model"
select="//vehicleSpecification/merchandisingModelDesignator"/>
<option value="">Select</option>
<xsl:for-each select="//vehicleSpecsData//model">
<xsl:variable name="modelDes">
<xsl:value-of
select="merchandisingModelDesignator"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="sellingSourceCode"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="vehicleProduct"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($modelDes,$model) and
$model!=''">
<option selected="true"
value="{$modelDes}">
<xsl:value-of
select="merchandisingModelName"/>
</option>
</xsl:when>
<xsl:otherwise>
<option value="{$modelDes}">
<xsl:value-of
select="merchandisingModelName"/>
</option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</td>
</tr>
</table>
<hr
noshade="noshade" size="1"/>
<xsl:call-
template name="VehicleOptions"/>
<!--
********************************** -->
<table
width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="6" class="articleHeaderLabel"> </td>
</tr>
<tr>
<td colspan="6" class="articleHeaderLabel">
<input type="button" name="clearOptions1"
onclick="javascript:clearOptions();" value="Clear Options and Model"/>
</td>
</tr>
<tr>
<td colspan="6" class="articleHeaderLabel">
<hr noshade="noshade" size="1"/>
</td>
</tr>
<tr>
<td colspan="6" class="articleHeaderLabel">   Filters-
Optional</td>
</tr>
<tr
bgcolor="#EFEFEF">
<td class="formLabel" width="0%"> 
<div align="center"/>
</td>
<td class="formLabel" width="16%" nowrap="nowrap">
<div align="right"> Max MSRP  </div>
</td>
<td class="formLabel" width="10%">
<div align="left">
<input type="text" name="maxMRSP"
value="{additionalVehicleSpecification/msrp}" size="8"/>
</div>
</td>
<td class="formLabel" width="65%" nowrap="nowrap"
align="right">  Earliest Event Code  </td>
<td>
<select name="earliestEventCode" size="1" width="400"
style="width:400px" onchange="javascript:earliestEventChanged();">
<xsl:variable name="selectedItem"
select="filter/earliestEventCode[text()!=''] | //earliestEvents/@default[not
(/newVehicleLocateRequest/filter/earliestEventCode)
or /newVehicleLocateRequest/filter/earliestEventCode='']"/>
<xsl:for-each
select="vehicleSpecsData/earliestEvents/earliestEvent">
<xsl:sort select="earliestEventCode" order="ascending"/>
<xsl:choose>
<xsl:when
test="@earliestEventCode=$selectedItem">
<option value="{@earliestEventCode}"
selected="selected">
<xsl:value-of
select="@earliestEventCode"/>
<xsl:text>  </xsl:text>
<xsl:value-of select="."/>
</option>
</xsl:when>
<xsl:otherwise>
<option value="{@earliestEventCode}">
<xsl:value-of
select="@earliestEventCode"/>
<xsl:text>  </xsl:text>
<xsl:value-of select="."/>
</option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</td>
<td class="formLabel" width="9%">
<div align="right"> </div>
</td>
</tr>
<tr
bgcolor="#FFFFFF">
<td class="formLabel" colspan="6">
<hr noshade="noshade" size="1"/>
</td>
</tr>
<tr
bgcolor="#EFEFEF">
<td class="formLabel" colspan="6">
<div align="left">
<b>   Location Criteria: </b>
<xsl:call-template name="SearchInfo"/>
</div>
</td>
<td class="formLabel" width="25%">
<div align="right"/>
</td>
</tr>
<tr
bgcolor="#EFEFEF">
<td
colspan="6">
<table
width="100%" border="0">
<tr >
<td class="formLabel" width="33%">
<div align="left"> </div>
</td>
<td class="formLabel" width="34%">
<div align="center">Location Criteria (<a href="#Step2">Step 2</a>
<img src="{$imagesURL}/arrow.gif" width="5" height="9"/>)</div>
</td>
<td class="formLabel" width="33%">
<div align="right">
<input type="button" name="locateNew" value=" Locate "
onclick="javascript:locateClicked()"/>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr
bgcolor="#FFFFFF">
<td class="formLabel" colspan="6"> </td>
</tr>
<tr
bgcolor="#BFCBE6">
<td class="formLabel" colspan="6">
<span class="formValue">  Step
2<a name="Step2"/>:</span> Location Criteria</td>
</tr>
<tr
bgcolor="#FFFFFF">
<td class="formLabel" colspan="6">
<!-- ############################# -->
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<!-- <tr>
<td colspan="7" class="articleHeaderLabel">
 Select My
Inventory OR My Inventory and ONE Additional Location
Criteria</td>
</tr>-->
<tr>
<td colspan="7" class="articleHeaderLabel">  Select
one of:<br/>     - My
Inventory<br/>     - My Inventory
and ONE other set of location criteria<br/>     - Only
ONE other set of location criteria</td>
</tr>
<tr bgcolor="#EFEFEF">
<td class="formLabel" width="6%">
<xsl:choose>
<xsl:when
test="searchType/singleVendorSearch/@selected='TRUE'">
<input type="checkbox"
name="singleVendorSearch" value="yes" checked="checked"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="singleVendorSearch" value="yes"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel" colspan="6">My Inventory</td>
<!-- Include Pooling partners
<td class="formLabel" width="18%">My Inventory</td>
<td class="formLabel" colspan="5">
<xsl:choose>
<xsl:when
test="searchType/singleVendorSearch/@includePoolingPartnersInventory='TRUE'">
<input type="checkbox"
name="includePoolingPartnersInventory" value="yes" checked="checked"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="includePoolingPartnersInventory" value="yes"/>
</xsl:otherwise>
</xsl:choose>
Include Pooling Partners </td> -->
</tr>
<tr bgcolor="#EFEFEF">
<td class="formLabel" width="6%">
<xsl:choose>
<xsl:when
test="searchType/tradingPartnersSearch/@selected='TRUE'">
<input type="checkbox"
name="tradingPartnersSearch" value="yes" checked="checked"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="tradingPartnersSearch" value="yes"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel" width="18%">Trading Partners</td>
<td class="formLabel" colspan="5">  </td>
</tr>
<tr bgcolor="#EFEFEF">
<td class="formLabel" valign="bottom" width="6%">
<xsl:choose>
<xsl:when
test="//postalCodeProximitySearch/@selected='TRUE'">
<input type="checkbox"
name="postalCodeProximitySearch" value="yes" checked="checked"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="postalCodeProximitySearch" value="yes"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel" colspan="6">ZIP Code
<input type="text" name="postalCode" size="11"
maxlength="10" onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.postalCodeProximitySearch)"
value="{searchType/postalCodeProximitySearch/postalCode}"/>
Radius
<xsl:choose>
<xsl:when
test="searchType/postalCodeProximitySearch/proximity">
<input type="text"
name="postalCodeProximitySearchProximity" size="5" maxlength="3"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.postalCodeProximitySearch)"
value="{searchType/postalCodeProximitySearch/proximity}"/>
</xsl:when>
<xsl:otherwise>
<input type="text"
name="postalCodeProximitySearchProximity" size="5" maxlength="3"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.postalCodeProximitySearch)" value="50"/>
</xsl:otherwise>
</xsl:choose>
(miles)
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td class="formLabel" width="6%">
<xsl:choose>
<xsl:when
test="searchType/cityProximitySearch/@selected='TRUE'">
<input type="checkbox"
name="cityProximitySearch" value="yes" checked="checked"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="cityProximitySearch" value="yes"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel" colspan="6">
<table border="0" width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td width="5%"
class="formLabel" align="left">City</td>
<td class="formLabel">
<input type="text"
name="city" size="18" value="{searchType/cityProximitySearch/city}"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.cityProximitySearch)"/>
</td>
<td class="formLabel"
align="right">State </td>
<td class="formLabel">
<select
name="cityRegionCode" size="1" width="150" style="width:150px">
<option
selected="selected" value="">Select</option>
<xsl:for-each
select="us-states/state">
<xsl:choose>
<xsl:when
test="abbr=/newVehicleLocateRequest/searchType/cityProximitySearch/regionCode">
<option value="{abbr}" selected="selected">
<xsl:value-of select="name"/>
</option>
</xsl:when>
<xsl:otherwise>
<option value="{abbr}">
<xsl:value-of select="name"/>
</option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</td>
<td class="formLabel"
align="right"> Radius   </td>
<td class="formLabel">
<xsl:choose>
<xsl:when
test="searchType/cityProximitySearch/proximity">
<input
type="text" name="cityProximitySearchProximity" size="5" maxlength="3"
value="{searchType/cityProximitySearch/proximity}"/>
</xsl:when>
<xsl:otherwise>
<input
type="text" name="cityProximitySearchProximity" size="5" maxlength="3"
value="50"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel"> (miles)
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td class="formLabel" width="6%">
<xsl:choose>
<xsl:when
test="searchType/multipleVendorSearch/@selected='TRUE'">
<input type="checkbox"
name="multipleVendorSearch" value="yes" checked="checked"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="multipleVendorSearch" value="yes"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel" colspan="6">Dealer(s) by
BAC:<font size="1">
Max 5 </font>
<input type="text"
name="multipleVendorSearchText" maxlength="6" size="6"
value="{searchType/multipleVendorSearch/vendorId[1]}"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.multipleVendorSearch)"/>
<input type="text"
name="multipleVendorSearchText" maxlength="6" size="6"
value="{searchType/multipleVendorSearch/vendorId[2]}"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.multipleVendorSearch)"/>
<input type="text"
name="multipleVendorSearchText" maxlength="6" size="6"
value="{searchType/multipleVendorSearch/vendorId[3]}"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.multipleVendorSearch)"/>
<input type="text"
name="multipleVendorSearchText" maxlength="6" size="6"
value="{searchType/multipleVendorSearch/vendorId[4]}"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.multipleVendorSearch)"/>
<input type="text"
name="multipleVendorSearchText" maxlength="6" size="6"
value="{searchType/multipleVendorSearch/vendorId[5]}"
onblur="javascript:checkLocationCriteria
(this,document.vehicleSpecs.multipleVendorSearch)"/>
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td class="formLabel" valign="top" width="6%">
<xsl:choose>
<xsl:when
test="searchType/postalStateSearch/@selected='TRUE'">
<input type="checkbox"
name="postalStateSearch" value="yes" checked="checked"
onclick="javascript:uncheckLocationCriteria(this)"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox"
name="postalStateSearch" value="yes" onclick="javascript:uncheckLocationCriteria
(this)"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="formLabel" colspan="6" valign="top"
width="25%">
<table border="0" width="100%">
<tr>
<td class="formLabel">States
(Max 5)</td>
<td> </td>
<td class="formLabel">Selected
States</td>
</tr>
<tr>
<td width="20%">
<input type="hidden"
name="postalStateSearchText" value=""/>
<select name="states"
size="5" width="150" style="width:150px"
ondblclick="javascript:document.vehicleSpecs.stateRight.click();">
<xsl:for-each
select="us-states/state[not
(abbr=/newVehicleLocateRequest/searchType/postalStateSearch/regionCode)]">
<option
value="{abbr}">
<xsl:value-of select="name"/>
</option>
</xsl:for-each>
</select>
</td>
<td class="formLabel"
valign="middle" width="20%">
<div align="center">
<p>
<input
type="button" name="stateRight" onclick="return selectState(this);" value="
>> "/>
<br/>
<br/>
<input
type="button" name="stateLeft" onclick="return selectState(this);" value="
<< "/>
<br/>
</p>
</div>
</td>
<td class="formLabel"
valign="top" width="60%">
<select
name="selectedStates" width="150" style="width:150px" size="5"
ondblclick="javascript:document.vehicleSpecs.stateLeft.click();">
<xsl:for-each
select="us-states/state
[(abbr=/newVehicleLocateRequest/searchType/postalStateSearch/regionCode)]">
<option
value="{abbr}">
<xsl:value-of select="name"/>
</option>
</xsl:for-each>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ############################## -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#EFEFEF">
<td colspan="3">
<table border="0" width="100%">
<tr>
<td width="20%" align="left"
class="formLabel" nowrap="nowrap">
Earliest Event
Code
</td>
<td width="35%" nowrap="nowrap">
<!--<div align="center"
class="formLabel">-->
<xsl:variable
name="earliestEvent">
<xsl:apply-templates
select="vehicleSpecsData/earliestEvents/earliestEvent
[@earliestEventCode=/newVehicleLocateRequest/filter/eventCriteria/earliestEvent]
"/>
</xsl:variable>
<input
type="text" name="earliestEvent" onfocus="javascript:blur();" size="33"/>
</td>
<td width="35%"
class="formLabel" align="right">
Max # to Return
per Search
</td>
<td width="10%">
<select
name="maximumCount" size="1" width="80" style="width:80px">
<xsl:for-each
select="//maximumCounts/maximumCount">
<xsl:sort select="." order="ascending"/>
<xsl:choose>
<!--maximumCount's value 5 is defined in dtd file-->
<xsl:when test="not(/newVehicleLocateRequest/@maximumCount)
or /newVehicleLocateRequest/@maximumCount=''">
<xsl:call-template name="maximumOption">
<xsl:with-param name="selectedItem">
<xsl:value-of
select="/newVehicleLocateRequest/vehicleSpecsData/maximumCounts/@default"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="maximumOption">
<xsl:with-param name="selectedItem">
<xsl:value-of
select="/newVehicleLocateRequest/@maximumCount"/>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2"> </td>
<td>  </td>
</tr>
<tr bgcolor="#EFEFEF">
<td>
<div align="left">
<input
onclick="javascript:restoreButtonPressed()" type="button" name="Submit7"
value="Restore Saved Preferences"/>
</div>
</td>
<td>
<input onclick="javascript:saveButtonPressed()"
type="button" name="Submit5" value="Save Preferences"/>
</td>
<td>
<div align="right">
<input type="button" name="locateNew"
value=" Locate " onclick="javascript:locateClicked()"/>
</div>
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td colspan="2"> </td>
<td> </td>
</tr>
<tr bgcolor="#BFCBE6">
<td colspan="3"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td class="articleHeaderLabel" nowrap="nowrap"
width="10%">
<p align="left" class="formLabel">
<span class="formValue"> OPTION 2:
</span> Locate by VIN   </p>
</td>
<td width="40%" class="articleHeaderLabel">
<xsl:variable name="arg2">
<xsl:text>abcdefghijklmnopqrstuvwxyz</xsl:text>
</xsl:variable>
<xsl:variable name="arg3">
<xsl:text>ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:text>
</xsl:variable>
<input type="text" name="vinSearch"
value="{translate(searchType/vinSearch, $arg2, $arg3)}"/>
</td>
<td class="articleHeaderLabel" width="50%">
<div align="right">
<input type="button" name="locateNew"
value=" Locate by VIN" onclick="javascript:locateVINClicked()"/>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--
########################### -->
<p
align="center"> </p>
</form>
<p> </p>
</td>
</tr>
</table>
<xsl:call-template name="eInventoryCopyright"/>
<p> </p>
</body>
</html>
</xsl:template>
<xsl:template name="VehicleOptions">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#EFEFEF">
<td class="articleHeaderLabel" colspan="3"
height="15" width="52%">   Available
Options</td>
<td class="articleHeaderLabel" width="8%"
height="15"> </td>
<td class="articleHeaderLabel" width="40%"
height="15">"Must
Have" Options <font color="#D41F00"/>
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td rowspan="3" width="10%" align="right">
<div align="right">
<!--img
src="{$imagesURL}/vtabs.gif" width="64" height="139"/-->
<table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td
align="right">
<a
href="javascript:void(0);" onClick="javascript:showOptionsForItem(0);">
<img border="0" src="{$imagesURL}/color1.gif" name="rowimg0"/>
</a>
</td>
</tr>
<tr>
<td
align="right">
<!--
rd<a href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(1);">
<img border="0" src="{$imagesURL}/color2.gif" name="rowimg1"/>
</a>-->
</td>
</tr>
<tr>
<td
align="right">
<a
href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(2);">
<img border="0" src="{$imagesURL}/trim.gif" name="rowimg2"/>
</a>
</td>
</tr>
<tr>
<td
align="right">
<a
href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(3);">
<img border="0" src="{$imagesURL}/package.gif" name="rowimg3"/>
</a>
</td>
</tr>
<tr>
<td
align="right">
<a
href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(4);">
<img border="0" src="{$imagesURL}/engine.gif" name="rowimg4"/>
</a>
</td>
</tr>
<tr>
<td
align="right">
<a
href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(5);">
<img border="0" src="{$imagesURL}/trans.gif" name="rowimg5"/>
</a>
</td>
</tr>
<!--
<tr>
<td
align="right">
<a
href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(6);">
<img border="0" src="{$imagesURL}/options.gif" name="rowimg6"/>
</a>
</td>
</tr>-->
<tr>
<td
align="right">
<a
href="javascript:void(0);" onfocus="this.blur()"
onClick="javascript:showOptionsForItem(6);">
<img border="0" src="{$imagesURL}/trans.gif" name="rowimg6"/>
</a>
</td>
</tr>
</table>
</div>
</td>
<td rowspan="3" width="1%" bgcolor="#4A51A5">
<!--<img src="{$imagesURL}/spacer.gif"
width="3" height="100"/>-->
 
</td>
<td rowspan="3" width="30%" align="left">
<table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#4A51A5">
<table
width="100%" border="0" cellspacing="3" cellpadding="0">
<input
type="hidden" Name="txtCurrentItem" Value="1"/>
<tr>
<td bgcolor="#FFFFFF">
<select name="boxSelectFrom" size="9" width="350" style="width:350px"
multiple="multiple"
ondblclick="javascript:document.vehicleSpecs.boxMustHaveRight.click();"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="9%">
<table border="0" cellpadding="2"
cellspacing="0" width="100%">
<tr>
<td align="center">
<input
type="button" name="boxMustHaveRight" value=">"
onClick="javascript:selectOption(boxMustHave, arrMustHaveMaxOptions);"/>
</td>
</tr>
<tr>
<td align="center">
<input
type="button" name="boxMustHaveLeft" value="<"
onClick="javascript:deselectOptions(boxMustHave);"/>
</td>
</tr>
</table>
</td>
<td width="50%">
<select name="boxMustHave" size="3"
multiple="multiple" width="250" style="width:250px"
ondblclick="javascript:document.vehicleSpecs.boxMustHaveLeft.click();">
<xsl:for-each
select="vehicleSpecification/optionPreference">
<xsl:if
test="priority/@weighting='MUST_HAVE' or (priority/text())">
<xsl:variable
name="opCd">
<xsl:value-of select="optionCode"/>
</xsl:variable>
<xsl:apply-
templates
select="/newVehicleLocateRequest/vehicleSpecsData/options/optionFamily/option
[@optionCode=$opCd]" mode="optionBox"/>
</xsl:if>
</xsl:for-each>
</select>
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="8%">  </td>
<td class="articleHeaderLabel"
width="40%">"Don't Want"
Options</td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="8%">
<table border="0" cellpadding="2"
cellspacing="0" width="100%">
<tr>
<td align="center">
<input
type="button" name="Button" value=">" onClick="javascript:selectOption
(boxDontWant, arrDontWantMaxOptions);"/>
</td>
</tr>
<tr>
<td align="center">
<input
type="button" name="boxDontWantLeft" value="<"
onClick="javascript:deselectOptions(boxDontWant);"/>
</td>
</tr>
</table>
</td>
<td width="40%">
<select name="boxDontWant" size="3"
multiple="multiple" width="250" style="width:250px"
ondblclick="javascript:document.vehicleSpecs.boxDontWantLeft.click();">
<xsl:for-each
select="vehicleSpecification/optionPreference">
<xsl:if
test="(./priority/@weighting='DONT_WANT')">
<xsl:variable
name="opCd">
<xsl:value-of select="optionCode"/>
</xsl:variable>
<xsl:apply-
templates
select="/newVehicleLocateRequest/vehicleSpecsData/options/optionFamily/option
[@optionCode=$opCd]" mode="optionBox"/>
</xsl:if>
</xsl:for-each>
</select>
</td>
</tr>
</table>
</xsl:template>
<xsl:template name="SearchInfo">
<xsl:apply-templates
select="/newVehicleLocateRequest/searchType/singleVendorSearch
[@selected='TRUE']"/>
<xsl:apply-templates
select="/newVehicleLocateRequest/searchType/tradingPartnersSearch
[@selected='TRUE']"/>
<xsl:apply-templates
select="/newVehicleLocateRequest/searchType/multipleVendorSearch
[@selected='TRUE']"/>
<xsl:apply-templates
select="/newVehicleLocateRequest/searchType/postalCodeProximitySearch
[@selected='TRUE']"/>
<xsl:apply-templates
select="/newVehicleLocateRequest/searchType/cityProximitySearch
[@selected='TRUE']"/>
<xsl:apply-templates
select="/newVehicleLocateRequest/searchType/postalStateSearch
[@selected='TRUE']"/>
</xsl:template>
<xsl:template match="singleVendorSearch">
<xsl:text>My Inventory</xsl:text>
<xsl:if test="@includePoolingPartnersInventory='TRUE'">
<xsl:text> (</xsl:text>
<xsl:text>include pooling partners</xsl:text>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="tradingPartnersSearch">
<xsl:if test="following-
sibling::singleVendorSearch/@selected='TRUE' or preceding-
sibling::singleVendorSearch/@selected='TRUE'">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>Trading Partners</xsl:text>
</xsl:template>
<xsl:template match="multipleVendorSearch">
<xsl:if test="following-
sibling::singleVendorSearch/@selected='TRUE' or preceding-
sibling::singleVendorSearch/@selected='TRUE'">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>Dealers by BAC</xsl:text>
<xsl:text> (</xsl:text>
<xsl:for-each select="vendorId">
<xsl:value-of select="."/>
<xsl:if test="position()!=last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:template match="postalCodeProximitySearch">
<xsl:if test="following-
sibling::singleVendorSearch/@selected='TRUE' or preceding-
sibling::singleVendorSearch/@selected='TRUE'">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>ZIP</xsl:text>
<xsl:text> </xsl:text>
<xsl:text>(</xsl:text>
<xsl:value-of select="postalCode"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="proximity"/>
<xsl:text> miles radius)</xsl:text>
</xsl:template>
<xsl:template match="cityProximitySearch">
<xsl:if test="following-
sibling::singleVendorSearch/@selected='TRUE' or preceding-
sibling::singleVendorSearch/@selected='TRUE'">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>City/State</xsl:text>
<xsl:text> (</xsl:text>
<xsl:value-of select="city"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="regionCode"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="proximity"/>
<xsl:text> miles radius)</xsl:text>
</xsl:template>
<xsl:template match="postalStateSearch">
<xsl:if test="following-
sibling::singleVendorSearch/@selected='TRUE' or preceding-
sibling::singleVendorSearch/@selected='TRUE'">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>State(s)</xsl:text>
<xsl:text> (</xsl:text>
<xsl:for-each select="regionCode">
<xsl:value-of select="."/>
<xsl:if test="position()!=last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:template name="maximumOption">
<xsl:param name="selectedItem"/>
<xsl:choose>
<xsl:when test="text()=$selectedItem">
<option selected="true" value="{$selectedItem}">
<xsl:value-of select="."/>
</option>
</xsl:when>
<xsl:otherwise>
<option value="{text()}">
<xsl:value-of select="."/>
</option>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="earliestEvent">
<xsl:value-of select="@earliestEventCode"/>
<xsl:text>  </xsl:text>
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="option" mode="optionBox">
<xsl:variable name="opCd" select="@optionCode"/>
<xsl:variable name="opDesc" select="."/>
<xsl:variable name="group">
<xsl:apply-templates select="parent::optionFamily"
mode="optionGroup"/>
</xsl:variable>
<xsl:variable name="opValue">
<xsl:value-of select="$group"/>
<xsl:text>;</xsl:text>
<xsl:value-of select="$opCd"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$opDesc"/>
</xsl:variable>
<xsl:variable name="opText">
<xsl:value-of select="$opCd"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$opDesc"/>
</xsl:variable>
<option value="{$opValue}">
<xsl:value-of select="$opText"/>
</option>
</xsl:template>
<xsl:template match="optionFamily" mode="optionGroup">
<xsl:if test="@description='Color1Option'">
<xsl:text>0</xsl:text>
</xsl:if>
<xsl:if test="@description='Color2Option'">
<xsl:text>1</xsl:text>
</xsl:if>
<xsl:if test="@description='TrimOption'">
<xsl:text>2</xsl:text>
</xsl:if>
<xsl:if test="@description='PackageOption'">
<xsl:text>3</xsl:text>
</xsl:if>
<xsl:if test="@description='EngineOption'">
<xsl:text>4</xsl:text>
</xsl:if>
<xsl:if test="@description='TransOption'">
<xsl:text>5</xsl:text>
</xsl:if>
<xsl:if test="@description='Other'">
<xsl:text>6</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="fixQuotes">
<xsl:param name="string"/>
<xsl:choose>
<xsl:when test="contains($string, '"')">
<xsl:value-of select="substring-before
($string, '"')"/>
<xsl:text>\'</xsl:text>
<xsl:call-template name="fixQuotes">
<xsl:with-param name="string"
select="substring-after($string, '"')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>