// JavaScript Document

//var CollapsiblePanel3 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel3", {contentIsOpen:false});
//var CollapsiblePanel4 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel4", {contentIsOpen:false});

//javascript:initialAssignDateless();			  

function ChangeSearchType(strSearchType,strSearchSubtype){
	//alert(strSearchType+" : "+strSearchSubtype);	
	//document.getElementById("ViewMoreLikeThese").style.display="none";
  //document.getElementById("ViewMoreLikeTheseProgress").style.display="";
	}


function GetResults(strSearchType,strSearchSubtype,intResultsPerPage,intPage,ColumnsOfResults,DisplayNavigation,strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer,strAnchor,bitHideDatelessGuide)
{
	//if(document.getElementById("DatelessAdvancedSearchOptions").style.display == "")
	//{
	//	DatelessAdvancedSearchOptionsClick(SearchType)
	//}
	if (bitHideDatelessGuide=1)
		{
		HideDatelessGuide();
		}
	//alert(strSearchType);
	//alert(strSearchSubtype);
	document.forms['AdvancedOptionsForm'].TempSearchType.value = strSearchType;
	document.forms['AdvancedOptionsForm'].TempSearchSubtype.value = strSearchSubtype;
	
	strCurrentSearchForReordering="GetResults('"+strSearchType+"','"+strSearchSubtype+"',"+intResultsPerPage+",1,"+ColumnsOfResults+","+DisplayNavigation+",'"+strTargetDisplayArea+"','"+strNavigationContainer+"','"+strOrderResultsContainer+"','"+strNoResultsContainer+"','SearchResults',1)"; ///note when reordering results we always go to the first page. Therefore using 1 instead of intPage in the string
	//alert(strCurrentSearchForReordering);
	document.getElementById("TempCurrentSearch").value = strCurrentSearchForReordering;

	

	
	
	//alert("debug1");
	//alert(strSearchType+":"+strSearchSubtype+":"+ColumnsOfResults+":"+DisplayNavigation+":"+strTargetDisplayArea+":"+strNavigationContainer+":"+strOrderResultsContainer+":"+strNoResultsContainer)

 // alert(strSearchType+" : "+strSearchSubtype);
	//alert(intResultsPerPage);
	//alert(intPage)
	var bitDoSearch=false;
	var parameters;
	var strSIP;
	var strMaximumPrice;
	
	
	strAutoGeneratedURL = "http://www.plates4less.co.uk/plates/search-dateless-number-plates.asp?ST="+strSearchSubtype+"&page="+intPage
	

	
	switch(strSearchType)
		{
		case 'dateless':
			switch(strSearchSubtype)
				{
				case 'LNExact':
					strPrefix1=document.forms['ExactSearchLNForm'].prefix1.value;
					strPrefix2=document.forms['ExactSearchLNForm'].prefix2.value;
					strPrefix3=document.forms['ExactSearchLNForm'].prefix3.value;
					strNumbers=document.forms['ExactSearchLNForm'].numbers.value;
					
					
					for(i=0;i<document.forms['ExactSearchLNForm'].ExactNumber.length;i++)
						{
						if(document.forms['ExactSearchLNForm'].ExactNumber[i].checked)
							{
							strExactNumber=document.forms['ExactSearchLNForm'].ExactNumber[i].value;
							}
						}
					strAutoGeneratedURL+="&p1="+strPrefix1+"&p2="+strPrefix2+"&p3="+strPrefix3+"&n="+strNumbers+"&en="+strExactNumber
					parameters="prefix1="+strPrefix1+"&prefix2="+strPrefix2+"&prefix3="+strPrefix3+"&numbers="+strNumbers+"&ExactNumber="+strExactNumber+"&searchType="+strSearchType+"&searchSubtype="+strSearchSubtype+"&ResultsPerPage="+intResultsPerPage+"&page="+intPage;
					bitDoSearch=true
					//document.getElementById("DisplayCurrentSearch").innerHTML="Exact Search"
					break;
				case 'NLExact':
					strNumbers=document.forms['ExactSearchNLForm'].numbers.value;
					strLetter1=document.forms['ExactSearchNLForm'].letter1.value;
					strLetter2=document.forms['ExactSearchNLForm'].letter2.value;
					strLetter3=document.forms['ExactSearchNLForm'].letter3.value;
					
					
					for(i=0;i<document.forms['ExactSearchNLForm'].ExactNumber.length;i++)
						{
						if(document.forms['ExactSearchNLForm'].ExactNumber[i].checked)
							{
							strExactNumber=document.forms['ExactSearchNLForm'].ExactNumber[i].value;
							}
						}
					strAutoGeneratedURL+="&n="+strNumbers+"&l1="+strLetter1+"&l2="+strLetter2+"&l3="+strLetter3+"&en="+strExactNumber
					parameters="numbers="+strNumbers+"&letter1="+strLetter1+"&letter2="+strLetter2+"&letter3="+strLetter3+"&ExactNumber="+strExactNumber+"&searchType="+strSearchType+"&searchSubtype="+strSearchSubtype+"&ResultsPerPage="+intResultsPerPage+"&page="+intPage;
					bitDoSearch=true
					//document.getElementById("DisplayCurrentSearch").innerHTML="Exact Search"
					break;
				case 'Simple':
					strSimpleSearchString=document.forms['SimpleSearchForm'].SimpleSearchString.value;
					strAutoGeneratedURL+="&s="+strSimpleSearchString
					parameters="SimpleSearchString="+strSimpleSearchString+"&searchType="+strSearchType+"&searchSubtype="+strSearchSubtype+"&ResultsPerPage="+intResultsPerPage+"&page="+intPage;
					
					bitDoSearch=true
					//document.getElementById("DisplayCurrentSearch").innerHTML="Simple Search"
					break;
				default:
					if(strSearchSubtype !="") ///Browse type searches e.g. 'BrowseAll' , 'Browse2NL', 'BrowseN2L' etc
						{
						parameters="searchType="+strSearchType+"&searchSubtype="+strSearchSubtype+"&ResultsPerPage="+intResultsPerPage+"&page="+intPage;
						switch(strSearchSubtype)
							{
							case "BrowseAll":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse All";
								break;
							case "Browse1N1L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1N X 1L";
								break;
							case "Browse2N1L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2N X 1L";
								break;
							case "Browse3N1L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 3N X 1L";
								break;
							case "Browse4N1L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 4N X 1L";
								break;
							case "Browse1N2L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1N X 2L";
								break;
							case "Browse2N2L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2N X 2L";
								break;
							case "Browse3N2L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 3N X 2L";
								break;
							case "Browse4N2L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 4N X 2L";
								break;
							case "Browse1N3L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1N X 3L";
								break;
							case "Browse2N3L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2N X 3L";
								break;
							case "Browse3N3L":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 3N X 3L";
								break;
							case "Browse1L1N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1L X 1N";
								break;
							case "Browse1L2N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1L X 2N";
								break;
							case "Browse1L3N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1L X 3N";
								break;
							case "Browse1L4N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 1L X 4N";
								break;
							case "Browse2L1N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2L X 1N";
								break;
							case "Browse2L2N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2L X 2N";
								break;
							case "Browse2L3N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2L X 3N";
								break;
							case "Browse2L4N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 2L X 4N";
								break;
							case "Browse3L1N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 3L X 1N";
								break;
							case "Browse3L2N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 3L X 2N";
								break;
							case "Browse3L3N":
								//document.getElementById("DisplayCurrentSearch").innerHTML="Browse 3L X 3N";
								break;
							}
						
						bitDoSearch=true
						}
					else
						{
						bitDoSearch=false
						}
				}
			break;
		default:
			bitDoSearch=false
		}
	//document.getElementById("AutoGeneratedURL").innerHTML = "a href=\""+strAutoGeneratedURL+"\" >"+strAutoGeneratedURL+">";	
	
	
//alert("debug1.1");
	if(bitDoSearch = true && document.getElementById("DatelessAdvancedSearchOptions").style.diplay!="none" )
		{
		for(i=0;i<document.forms['AdvancedOptionsForm'].SIP.length;i++)
			{
			if(document.forms['AdvancedOptionsForm'].SIP[i].checked)
				{
				strSIP=document.forms['AdvancedOptionsForm'].SIP[i].value;
				}
			}
		strMaximumPrice = document.forms['AdvancedOptionsForm'].MaximumPrice.value
		parameters+="&SIP="+strSIP+"&MaximumPrice="+strMaximumPrice
		
		
		strOrderBy="price";
		if (strOrderResultsContainer != '')
			{
			if(document.getElementById(strOrderResultsContainer).style.diplay!="none" )
				{
					strOrderBy=document.getElementById("orderBy").value;
				}
			}
		
		parameters+="&OrderBy="+strOrderBy;	
		
		
		
		strAutoGeneratedURL+="&SIP="+strSIP+"&MaximumPrice="+strMaximumPrice+"&OrderBy="+strOrderBy;	
		if(document.getElementById("DatelessAdvancedSearchOptions").style.display == "")
			{
				strAutoGeneratedURL+="&ShowOptions=1";
			}

		
	//alert(parameters);
	document.getElementById("AutoGeneratedURL").value = strAutoGeneratedURL;	
	
		var xmlHttp;
		var StrResults;
		var intPage;
		var parameters;
	 
		try
			{    // Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
			}
		catch (e)
			{    // Internet Explorer
			try
				{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
			catch (e)
				{ 
				try
					{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
					}
				catch (e)
					{
						alert("Your browser does not support AJAX!");
					return false;
					} 
				} 
			}
		xmlHttp.onreadystatechange=function()
			{
			if(xmlHttp.readyState==4)
				{
				//alert("debug1.2");
				strResults=xmlHttp.responseText;
				intNumberOfPages=0;
				CurrentResults="";
				eval(strResults);
				
				if(CurrentResults=="")
					{
					 DisplayNoResults(strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer,strAnchor)
					 if(strNavigationContainer !="")
					 	{
						HideSearchingMessage();
						}
					}
				else
					{
					DisplayResults(CurrentResults,intNumberOfPages,intPage,intResultsPerPage,strSearchType,strSearchSubtype,ColumnsOfResults,DisplayNavigation,strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer,strAnchor);
					if(strNavigationContainer !="")
					 	{
						HideSearchingMessage();
						}
					}
				}
			}
		var URL;
		xmlHttp.open("post","/scripts/Searches/AJAXSearches.asp",true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//alert("debug1.3");
		if(strNavigationContainer !="") //dont display message for the samples in the browse preview window. Only show where there are expectred to be alot of results IE if the navigation is going to show.
			{
				//alert("debug5");
			DisplaySearchingMessage();
			}
		xmlHttp.send(parameters);
		
		//return 1;
		}
}



function DisplayResults(CurrentResults,intNumberOfPages,intPage,intResultsPerPage,strSearchType,strSearchSubtype,ColumnsOfResults,DisplayNavigation,strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer,strAnchor)
	{
	

	
	
	
	
	//alert("displaying results");
	//alert(strResults);
	//alert(ColumnsOfResults)	;
	//alert(intNumberOfPages+":"+intPage+":"+intResultsPerPage+":"+strSearchType+":"+strSearchSubtype+":"+ColumnsOfResults+":"+DisplayNavigation+":"+strTargetDisplayArea+":"+strNavigationContainer+":"+strOrderResultsContainer+":"+strNoResultsContainer)
	//eval(strResults);
	//alert(intNumberOfPages);
	//alert(CurrentResults)
	//alert("debug2")

	bitShowInclusivePrice=1; //default
	strPagingNavigationOutput=""

	for(i=0;i<document.forms['AdvancedOptionsForm'].SIP.length;i++)
		{
		if(document.forms['AdvancedOptionsForm'].SIP[i].checked)
			{
				
			bitShowInclusivePrice=document.forms['AdvancedOptionsForm'].SIP[i].value;
			//alert(bitShowInclusivePrice);
			}
		}


	ArrayResults = CurrentResults.split("|");
	intColumn=1
	bitDisplayResults = 0

	if(ArrayResults[0].length>0) //There are valid results
		{
		bitDisplayResults = 1;
		strResultsOutput ="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" border=\"0\">"

		for(i=0;i<ArrayResults.length;i++) 
			{
			
			strIndividualResult = ArrayResults[i]
			ArrayIndividualResult = strIndividualResult.split(":");
			
			////////////*******************///////////////////
			if (ArrayIndividualResult[0] != "" && ArrayIndividualResult[1] != "undefined") /// Format= strPlate:fltSellersPricePlusCashHandling:fltTotalCost:bitPOA:bitUnderOffer:DVLA|
				{
				strPlate=ArrayIndividualResult[0];
				strUnformattedPlate=strPlate.replace(/ /g,"")
				fltSellersPricePlusCashHandling=ArrayIndividualResult[1];
				fltTotalCost=ArrayIndividualResult[2];
				bitPOA=ArrayIndividualResult[3];
				bitUnderOffer=ArrayIndividualResult[4];
				bitDVLA=ArrayIndividualResult[5];
				if(intColumn==1)
					{
					strResultsOutput +="<tr>";
					}
				
				strResultsOutput += "<td width=\"113\"  height=\"24\" align=\"center\" nowrap=\"nowrap\" style=\"background-image:url(/images/public/plateSearchResults_WB2.gif);padding:0px;\"><strong style=\"font-size:14px;\">"+strPlate+"</td>" ;//Plate should already be formatted
				strResultsOutput += "<td width=\"56\" align=\"right\" valign=\"middle\" style=\"padding-right:3px;\"><strong>";
			
				if(bitPOA==1)
					{
					strResultsOutput += "POA";
					}
				else if(bitShowInclusivePrice=="1")
					{
					strResultsOutput += "£"+fltTotalCost;
					}
				else
					{
					strResultsOutput += "£"+fltSellersPricePlusCashHandling	;
					}
				strResultsOutput += "</strong></td>";
				
				if(bitDVLA==0)
					{
					strResultsOutput += "<td  align=\"right\" valign=\"middle\" STYLE=\"PADDING-RIGHT:3px;\"><input name=\"image\" type=\"image\" onClick=\"Search_goToURL('Enquiry','/PopupWindows/enquiry_Classified.asp?plate="+strUnformattedPlate+"&style=C')\" src=\"/images/public/selectBTN.gif\" alt=\"CLICK  HERE TO BUY OR ENQUIRE ABOUT THIS PLATE\" width=\"75\" height=\"18\" border=\"0\" /></td>";
					}
				else if (bitDVLA == 1 && bitUnderOffer == 1) ///DVLA plate that is under offer
					{
					strResultsOutput += "<td  align=\"right\" valign=\"middle\" STYLE=\"PADDING-RIGHT:3px;\"><input name=\"image\" type=\"image\" onClick=\"Search_goToURL('Enquiry','/enquiry/enquiry.asp?plate="+strUnformattedPlate+"&style=D&UnderOffer=1')\" src=\"/images/public/selectBTN.gif\" alt=\"CLICK  HERE TO BUY OR ENQUIRE ABOUT THIS PLATE\" width=\"75\" height=\"18\" border=\"0\" /></td>";
					}
				else
					{
					strResultsOutput += "<td  align=\"right\" valign=\"middle\" STYLE=\"PADDING-RIGHT:3px;\"><input name=\"image\" type=\"image\" onClick=\"Search_goToURL('TransferOptions','/myfolder/index.asp?actionType=addToBasket&amp;plate="+strUnformattedPlate+"&amp;style=P&amp;Details=Yes&amp;Find=Yes&amp;popup=Yes')\" src=\"/images/public/selectBTN.gif\" alt=\"CLICK  HERE TO BUY OR ENQUIRE ABOUT THIS PLATE\" width=\"75\" height=\"18\" border=\"0\" /></td>"	;
					}
				
				intColumn++;
				
				if(intColumn > ColumnsOfResults)
					{
					intColumn = 1;
					strResultsOutput +="</tr>";
					}
				}/// end if
			} ///end for
			if(ColumnsOfResults>1)
				{
				intColSpan=String(3*(ColumnsOfResults-intColumn+1));
				strResultsOutput +="<td colspan=\""+intColSpan+"\" width=\""+String(244*(ColumnsOfResults-intColumn+1))+"\">&nbsp;</TD></tr>";
				}
			strResultsOutput +="</table>"
		//alert(strResultsOutput);

				
		} ////end if(ArrayResults[0].length>0)
		
		//alert("page="+intPage);
		
		//////////////Navigation
		if(bitDisplayResults == 1 && DisplayNavigation==1)
			{

			if(intNumberOfPages>1) //display navigation
				{
				
				if(intPage==1)
					{
					strPagingNavigationOutput +="| First Page &nbsp;&lt;&lt;Previous Page&nbsp;"
					}
				else
					{
					strPagingNavigationOutput +="| <a href=\"#SearchResults\" onClick=\"GetResults('"+strSearchType+"','"+strSearchSubtype+"',"+intResultsPerPage+",1,"+ColumnsOfResults+","+DisplayNavigation+",'"+strTargetDisplayArea+"','"+strNavigationContainer+"','"+strOrderResultsContainer+"','"+strNoResultsContainer+"','SearchResults',1)\">First Page</a> &nbsp;&lt;&lt;<a href=\"#SearchResults\" onClick=\"GetResults('"+strSearchType+"','"+strSearchSubtype+"',"+String(intResultsPerPage)+","+String(intPage-1)+","+ColumnsOfResults+","+DisplayNavigation+",'"+strTargetDisplayArea+"','"+strNavigationContainer+"','"+strOrderResultsContainer+"','"+strNoResultsContainer+"','SearchResults',1)\">Previous Page</a>&nbsp;"
					}
					
				if(intPage >= intNumberOfPages && intNumberOfPages > 10)
					{
					intPageResultsStart = intNumberOfPages - 10;
					intPageResultsEnd = intNumberOfPages;
					}
				else if (intPage >= intNumberOfPages-10 && intNumberOfPages > 10)
					{
					intPageResultsEnd = intNumberOfPages;
					intPageResultsStart = intPage - (10-(intNumberOfPages-intPage));
					}
				else if(intNumberOfPages >= 10)
					{
					intPageResultsEnd = intPage + 10;
					intPageResultsStart = intPage;
					}
				else
					{
					intPageResultsEnd = intNumberOfPages;
					intPageResultsStart = 1;
					}
					//alert(intPageResultsStart+":"+intPageResultsEnd)

					//strPagingNavigationOutput +="["
					
					for(intDisplayPage=intPageResultsStart;intDisplayPage<=intPageResultsEnd;intDisplayPage++)
						{
						if(intDisplayPage==intPage)
							{
							strPagingNavigationOutput +="|&nbsp;<b>"+intDisplayPage+"</b>&nbsp;";
							}
						else
							{
							strPagingNavigationOutput +="| <a href=\"#SearchResults\" onClick=\"GetResults('"+strSearchType+"','"+strSearchSubtype+"',"+intResultsPerPage+","+intDisplayPage+","+ColumnsOfResults+","+DisplayNavigation+",'"+strTargetDisplayArea+"','"+strNavigationContainer+"','"+strOrderResultsContainer+"','"+strNoResultsContainer+"','SearchResults',1)\">"+intDisplayPage+"</a>&nbsp;";
							}	
						}
					

					//strPagingNavigationOutput +="]"
				if(intPage==intNumberOfPages)
					{
					strPagingNavigationOutput +="| Next Page &nbsp;&lt;&lt;Last Page&nbsp;";
					}
				else
					{
					strPagingNavigationOutput +="| <a href=\"#SearchResults\" onClick=\"GetResults('"+strSearchType+"','"+strSearchSubtype+"',"+intResultsPerPage+","+String(intPage+1)+","+ColumnsOfResults+","+DisplayNavigation+",'"+strTargetDisplayArea+"','"+strNavigationContainer+"','"+strOrderResultsContainer+"','"+strNoResultsContainer+"','SearchResults',1)\">Next Page</a> &nbsp;&gt;&gt;&nbsp;<a href=\"#SearchResults\" onClick=\"GetResults('"+strSearchType+"','"+strSearchSubtype+"',"+intResultsPerPage+","+intNumberOfPages+","+ColumnsOfResults+","+DisplayNavigation+",'"+strTargetDisplayArea+"','"+strNavigationContainer+"','"+strOrderResultsContainer+"','"+strNoResultsContainer+"','SearchResults',1)\">Last Page</a>";
					}	
				}
			}

		document.getElementById(strTargetDisplayArea).innerHTML=strResultsOutput;
		document.getElementById(strTargetDisplayArea).style.display="";
		
		
		
		if(strNavigationContainer!='')
			{
			document.getElementById(strNavigationContainer).innerHTML=strPagingNavigationOutput;
			document.getElementById(strNavigationContainer).style.display="";
			}
		if(strOrderResultsContainer!='')
			{
			document.getElementById(strOrderResultsContainer).style.display="";
			}
		if(strNoResultsContainer!='')
			{
			document.getElementById(strNoResultsContainer).style.display="none";
			}
		if(strTargetDisplayArea=="DisplayResultsContainer")
			{
			
			document.getElementById("SearchResultsContainer").style.display="";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display="none";
			document.location.href="#"+strAnchor;
			}
		if(document.getElementById("AutoGeneratedURL").style.display=="" &&  document.getElementById("SearchResultsContainer").style.display=="")
			{
			 document.getElementById("AutoGeneratedURL").focus();
			 document.getElementById("AutoGeneratedURL").select();
			}
		if(document.getElementById("AutoGeneratedURL2").style.display=="" && document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display=="")
			{
			 document.getElementById("AutoGeneratedURL2").focus();
			 document.getElementById("AutoGeneratedURL2").select();
			}
			
		//alert("debug3")
		
		
	}
	
function DisplayNoResults(strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer,strAnchor){
		
		document.getElementById(strTargetDisplayArea).innerHTML="";
		document.getElementById(strTargetDisplayArea).style.display="none";
		if(strNavigationContainer!='')
			{
			document.getElementById(strNavigationContainer).innerHTML="";
			document.getElementById(strNavigationContainer).style.display="none";
			}
		if(strOrderResultsContainer!='')
			{
			document.getElementById(strOrderResultsContainer).style.display="none";
			}
		if(strNoResultsContainer!='')
			{
			document.getElementById(strNoResultsContainer).style.display="";
			}
		document.location.href="#"+strAnchor;

	if(strTargetDisplayArea=="DisplayResultsContainer")
			{
			
			document.getElementById("SearchResultsContainer").style.display="";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display="none";
			document.location.href="#"+strAnchor;
			}
}
function InitialiseBrowseByPlateLength(strType,intResultsPerSet,intColumnstoDisplay)
{
	
	//strType can be irish or Dateless
	//alert(document.getElementById("PreviewBoxesInitialised").value);
	//alert(document.getElementById("Preview1L1NResults").innerHTML);
	//alert("debug2")
	strResultsAvailableTest=document.getElementById("Preview1L1NResults").innerHTML
	if(strResultsAvailableTest=="" || typeof strResultsAvailableTest == "undefined" || strResultsAvailableTest == "undefined" || strResultsAvailableTest==null)
		{
			//alert("debug3")
		GetResults(strType,'Browse1L1N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1L1NResults','','','','Search',1);
		GetResults(strType,'Browse1N1L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1N1LResults','','','','Search',1);
		GetResults(strType,'Browse1L2N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1L2NResults','','','','Search',1);
		GetResults(strType,'Browse2N1L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2N1LResults','','','','Search',1);
		GetResults(strType,'Browse1L3N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1L3NResults','','','','Search',1);
		GetResults(strType,'Browse3N1L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview3N1LResults','','','','Search',1);
		GetResults(strType,'Browse1L4N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1L4NResults','','','','Search',1);
		GetResults(strType,'Browse4N1L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview4N1LResults','','','','Search',1);
		GetResults(strType,'Browse2L1N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2L1NResults','','','','Search',1);
		GetResults(strType,'Browse1N2L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1N2LResults','','','','Search',1);
		GetResults(strType,'Browse2L2N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2L2NResults','','','','Search',1);
		GetResults(strType,'Browse2N2L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2N2LResults','','','','Search',1);
		GetResults(strType,'Browse2L3N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2L3NResults','','','','Search',1);
		GetResults(strType,'Browse3N2L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview3N2LResults','','','','Search',1);
		GetResults(strType,'Browse2L4N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2L4NResults','','','','Search',1);
		GetResults(strType,'Browse4N2L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview4N2LResults','','','','Search',1);
		GetResults(strType,'Browse3L1N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview3L1NResults','','','','Search',1);
		GetResults(strType,'Browse1N3L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview1N3LResults','','','','Search',1);
		GetResults(strType,'Browse3L2N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview3L2NResults','','','','Search',1);
		GetResults(strType,'Browse2N3L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview2N3LResults','','','','Search',1);
		GetResults(strType,'Browse3L3N',intResultsPerSet,1,intColumnstoDisplay,0,'Preview3L3NResults','','','','Search',1);
		GetResults(strType,'Browse3N3L',intResultsPerSet,1,intColumnstoDisplay,0,'Preview3N3LResults','','','','Search',1);
		//alert("debug4")
		}

	/**/
}

function optionsChanged()	{
	//document.getElementById("optionsChangedMessage").style.visibility = ""
}
function DisplayDatelessGuide()
{
	//alert("help");
	document.getElementById("DatelessGuide").style.display="";
	document.location.href="#DatelessGuideAnchor";
	//alert("help2")
}
function HideDatelessGuide()
{
	document.getElementById("DatelessGuide").style.display="none";
	document.location.href="#Search";
	
}


function DatelessSearchControl(strDatelessSearchType,bitInitialiseBrowseByPlateLength,bitHideDatelessGuide)	{
	strSearchType = "dateless"
	//alert(strDatelessSearchType);
	document.getElementById("SearchResultsContainer").style.display="none";
	document.forms['AdvancedOptionsForm'].TempSearchType.value = "dateless";
	document.forms['AdvancedOptionsForm'].TempSearchSubtype.value = strDatelessSearchType;
	if(bitHideDatelessGuide==1)
		{
		HideDatelessGuide();
		//alert("closing Guide");
		}
	
	switch (strDatelessSearchType)
  	{
    case "Simple":
			{
			document.getElementById("DatelessSearchSimple").style.display = "";
			document.getElementById("DatelessSearchExact").style.display = "none";
			document.getElementById("DatelessSearchBrowse").style.display = "none";
			document.getElementById("DatelessSearchBrowsePlateLength").style.display = "none";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display = "none";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").value = "none";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").value = "none";
			document.forms['AdvancedOptionsForm'].TempSearchType.value = 'dateless';
			document.forms['AdvancedOptionsForm'].TempSearchSubtype.value = "Simple";
						
			break;
			}
		case "Exact":
			{
			document.getElementById("DatelessSearchSimple").style.display = "none";
			document.getElementById("DatelessSearchExact").style.display = "";
			document.getElementById("DatelessSearchBrowse").style.display = "none";
			document.getElementById("DatelessSearchBrowsePlateLength").style.display = "none";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display = "none";
			document.forms['AdvancedOptionsForm'].TempSearchType.value = 'dateless';
			document.forms['AdvancedOptionsForm'].TempSearchSubtype.value = 'LNExact';
			break;
			}
		case "Browse":
			{
			
			document.getElementById("DatelessSearchSimple").style.display = "none";
			document.getElementById("DatelessSearchExact").style.display = "none";
			document.getElementById("DatelessSearchBrowse").style.display = "";
			document.getElementById("DatelessSearchBrowsePlateLength").style.display = "none";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display = "none";
			document.forms['AdvancedOptionsForm'].TempSearchType.value = 'dateless';
			document.forms['AdvancedOptionsForm'].TempSearchSubtype.value = 'BrowseAll';
			break;
			}
		case "BrowsePlateLength":
			{
			
			if (bitInitialiseBrowseByPlateLength ==1)
				{
				InitialiseBrowseByPlateLength('dateless',5,1);
				}
			document.getElementById("DatelessSearchSimple").style.display = "none";
			document.getElementById("DatelessSearchExact").style.display = "none";
			document.getElementById("DatelessSearchBrowse").style.display = "none";
			document.getElementById("SearchResultsContainer").style.display = "none";
			document.getElementById("DatelessSearchBrowsePlateLength").style.display = "";
			document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display = "";
			
			
			//alert("debug1")
			break;
			}
  	}
		//document.location.href="#Search";
		//if(document.getElementById("DatelessAdvancedSearchOptions").style.display == "")
		//	{
		//		DatelessAdvancedSearchOptionsClick(SearchType)
		//	}
}

function ClearForm(strFormName)
	{

	if(strFormName=="ExactSearchLNForm")
		{
		document.forms['ExactSearchLNForm'].Prefix1.value='Any';
		document.forms['ExactSearchLNForm'].Prefix2.value='Any';
		document.forms['ExactSearchLNForm'].Prefix3.value='Any';
		document.forms['ExactSearchLNForm'].Numbers.value='Any';
		}
	if(strFormName=="ExactSearchNLForm")
		{
		
		document.forms['ExactSearchNLForm'].Numbers.value='Any';
		document.forms['ExactSearchNLForm'].Letter1.value='Any';
		document.forms['ExactSearchNLForm'].Letter2.value='Any';
		document.forms['ExactSearchNLForm'].Letter3.value='Any';
		}
	}


function CloseDatelessSearchBrowseLengthPlatePreviews()
	{
	//alert("test");
	document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display = "none";	
	}
function OpenDatelessSearchBrowseLengthPlatePreviews()
	{
	//alert("test");
	document.getElementById("DatelessSearchBrowseLengthPlatePreviews").style.display = "";
	document.getElementById("SearchResultsContainer").style.display = "none";
	}


function DatelessAdvancedSearchOptionsClick(SearchType){

 	if(SearchType=='Dateless')
		{
		if(document.getElementById("DatelessAdvancedSearchOptions").style.display == "")
			{
			document.getElementById("DatelessAdvancedSearchOptions").style.display = "none";
			document.getElementById("ShowAdvancedOptionsLabelDatelessExact").innerHTML = "Show Advanced Options";
			document.getElementById("ShowAdvancedOptionsLabelDatelessSimple").innerHTML = "Show Advanced Options";
			document.getElementById("ShowAdvancedOptionsLabelDatelessBrowse").innerHTML = "Show Advanced Options";
			document.getElementById("ShowAdvancedOptionsLabelDatelessBrowsePlateLen").innerHTML = "Show Advanced Options";
			document.getElementById("ASOD").value ="0"
			}
		else
			{
			document.getElementById("DatelessAdvancedSearchOptions").style.display = "";
			document.getElementById("ShowAdvancedOptionsLabelDatelessExact").innerHTML = "Hide Advanced Options";
			document.getElementById("ShowAdvancedOptionsLabelDatelessSimple").innerHTML = "Hide Advanced Options";
			document.getElementById("ShowAdvancedOptionsLabelDatelessBrowse").innerHTML = "Hide Advanced Options";
			document.getElementById("ShowAdvancedOptionsLabelDatelessBrowsePlateLen").innerHTML = "Hide Advanced Options";
			document.getElementById("ASOD").value ="1"
			}
		}
}


	

function DisplaySearchingMessage(){
		var xpos;
		//alert(screen.height);
		//alert(screen.width)
		//alert("debug1");
		
		document.getElementById("SearchingMessage").style.width=document.body.clientWidth;
		document.getElementById("SearchingMessage").style.height=document.body.clientHeight*2;
		
		xpos=parseInt(document.body.clientWidth);
		intPopupWidth = parseInt(document.getElementById("SearchingMessageInner").style.width);
		if (xpos>intPopupWidth)
			{
			xpos=(xpos-intPopupWidth)/2
			}
		
		document.getElementById("SearchingMessageInner").style.left=xpos;
		document.getElementById("SearchingMessageInner").style.top=mouseY()-10;
		document.getElementById("SearchingMessage").style.top=0;
		document.getElementById("SearchingMessage").style.left=0;
		document.getElementById("SearchingMessage").style.display="";
		document.getElementById("SearchingMessageInner").style.display="";
		//alert("debug2");
		return 1;
}
function HideSearchingMessage()
	{
		//alert("debug10")
	document.getElementById("SearchingMessage").style.display="none";	
	document.getElementById("SearchingMessageInner").style.display="none";	
	}
	
function ChangeOrderBy()
{
	//strOrderBy = OrderByValue.value;
	strTempCurrentSearch = document.getElementById("TempCurrentSearch").value;
	eval(strTempCurrentSearch);
	
}

var intWindowsOpen;
intWindowsOpen = 0;

function Search_goToURL() { //v3.0
 	var i, args=Search_goToURL.arguments; document.MM_returnValue = false; 
	intWindowsOpen+=1;
	intWindowWidth = 820;
	//alert(intWindowWidth);
	intScreenwidth=screen.width;
	intXposition = intScreenwidth/2-intWindowWidth/2
	intScreenheight=screen.height-25
	//alert(intXposition)
	//newWindow=window.open(args[1],"TransferOptions_<%=replace(cstr(time()),":","")%>_"+String(intWindowsOpen),"width="+intWindowWidth+",height="+intScreenheight+",status=1,scrollbars=1,menubar=1,resizable=1,location=1,directories=1,toolbar=1");
	
	newWindow=window.open(args[1],"TransferOptions_"+String(intWindowsOpen),"width="+intWindowWidth+",height="+intScreenheight+",status=1,scrollbars=1,menubar=1,resizable=1,location=1,directories=1,toolbar=1");
	
		
	newWindow.moveTo(intXposition,0);
}

          // Y offset from mouse position
var MousePosY = 0;
var MousePosX = 0;

document.onmousemove=getCoors;

function getCoors(e)
{
if(!e){var e = window.event;}
MousePosX = e.screenX;
MousePosY = e.screenY;
//alert(x + ', ' + y);
return false;
}

function mouseY() {
	return MousePosY;
}

function mouseX(e) {
	var posx = 0;
	if (!e) var e = window.event;
	if (e.pageX) 	{
		posy = e.pageX;
	}
	else if (e.clientX) 	{
		posy = e.clientX + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	return posx
}


/*
function mouseX(evt) {
	
	
	
	if (!evt) evt = window.event;
	if (evt.pageX) return evt.pageX;
	else if (evt.clientX) return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft);
	else return 0;
}
function mouseY(evt) {
	alert("positioning")
	if (!evt) evt = window.event;
	if (evt.pageY) return evt.pageY;
	//else if (evt.clientY) return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
	//else return 0;
}
*/

function BrowseAllDateless(strSearchType,strSearchSubtype,intResultsPerPage,intPage,ColumnsOfResults,DisplayNavigation,strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer)
		{

		DatelessSearchControl('Browse',0,1);
		GetResults(strSearchType,strSearchSubtype,intResultsPerPage,intPage,ColumnsOfResults,DisplayNavigation,strTargetDisplayArea,strNavigationContainer,strOrderResultsContainer,strNoResultsContainer,'Search');
	
	
}

function initialAssignDateless()
	{
		//alert("initial Assign");
	assignDateless(document.forms['ExactSearchLNForm'].prefix1.value,'prefix1img','DatelessLN');
	assignDateless(document.forms['ExactSearchLNForm'].prefix2.value,'prefix2img','DatelessLN');
	assignDateless(document.forms['ExactSearchLNForm'].prefix3.value,'prefix3img','DatelessLN');
	assignDateless(document.forms['ExactSearchLNForm'].numbers.value,'numbersimg','DatelessLN');
	assignDateless(document.forms['ExactSearchNLForm'].numbers.value,'numbersimg','DatelessNL');
	assignDateless(document.forms['ExactSearchNLForm'].letter1.value,'letter1img','DatelessNL');
	assignDateless(document.forms['ExactSearchNLForm'].letter2.value,'letter2img','DatelessNL');
	assignDateless(document.forms['ExactSearchNLForm'].letter3.value,'letter3img','DatelessNL');
	
	assignDateless(document.forms['SimpleSearchForm'].SimpleSearchString.value,'SimpleSearch','SimpleSearchForm');

	}


function assignDateless(strElementValue,selection,DatelessSearchStyle){
		//alert("Assign Dateless");
if(DatelessSearchStyle == 'DatelessLN')
	{
		strFormName='ExactSearchLNForm';
	}
else if (DatelessSearchStyle == 'DatelessNL')
	{
		strFormName='ExactSearchNLForm';
	}
else if (DatelessSearchStyle == 'SimpleSearchForm') 
	{
		strFormName='SimpleSearchForm';
	}
//alert(strFormName);

validator=strElementValue;
//alert(selection);
if (selection=="numbersimg") {
	//alert("numbers");
	strImage=validator
	//strImage=document.getElementById(temp).options[document.getElementById(temp).selectedIndex].value;
	strImage0=strImage.charAt(0);
	strImage1=strImage.charAt(1);
	strImage2=strImage.charAt(2);
	strImage3=strImage.charAt(3);
	//alert(strImage);
	if (validator!="") {
		document.forms[strFormName].numbersimg0.src   = "/images/plateGraphicsJava/"+strImage0+ ".gif";
		document.forms[strFormName].numbersimg0.height   = "33";
		if (strImage1 !=""){
			document.forms[strFormName].numbersimg1.src   = "/images/plateGraphicsJava/"+strImage1+ ".gif";
			document.forms[strFormName].numbersimg1.height   = "33";
			}
		else {
			document.forms[strFormName].numbersimg1.src   = "/images/plateGraphicsJava/blanc.gif";
			document.forms[strFormName].numbersimg1.height   = "0";
			}
		if (strImage2 !=""){
			document.forms[strFormName].numbersimg2.src   = "/images/plateGraphicsJava/"+strImage2+ ".gif";
			document.forms[strFormName].numbersimg2.height   = "33";
			}
		else {
			document.forms[strFormName].numbersimg2.src   = "/images/plateGraphicsJava/blanc.gif";
			document.forms[strFormName].numbersimg2.height   = "0";
			}
		if (strImage3 !=""){
			document.forms[strFormName].numbersimg3.src   = "/images/plateGraphicsJava/"+strImage3+ ".gif";
			document.forms[strFormName].numbersimg3.height   = "33";
			}
		else
			{
			document.forms[strFormName].numbersimg3.src   = "/images/plateGraphicsJava/blanc.gif";
			document.forms[strFormName].numbersimg3.height   = "0";
			}
		}
	else {
		
		document.forms[strFormName].numbersimg0.src = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].numbersimg0.height   = "0";
		document.forms[strFormName].numbersimg1.src = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].numbersimg1.height   = "0";
		document.forms[strFormName].numbersimg2.src = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].numbersimg2.height   = "0";
		document.forms[strFormName].numbersimg3.src = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].numbersimg3.height   = "0";
	}
	
}
else if(selection=="SimpleSearch"){
	//alert("test");
	strImage=validator;
	//strImage=document.getElementById(temp).options[document.getElementById(temp).selectedIndex].value;
	strImage0=strImage.charAt(0);
	strImage1=strImage.charAt(1);
	strImage2=strImage.charAt(2);
	strImage3=strImage.charAt(3);
	strImage4=strImage.charAt(4);
	strImage5=strImage.charAt(5);
	strImage6=strImage.charAt(6);
	//alert(strImage0);
	//alert(document.forms[strFormName].img0.src);
	if (strImage0 !="" && strImage0!= " "){
		//alert("debug1");
		document.forms[strFormName].img0.src   = "/images/plateGraphicsJava/"+strImage0+ ".gif";
		document.forms[strFormName].img0.height   = "33";
		}
	else {
		//alert("debug2");
		document.forms[strFormName].img0.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img0.height   = "0";
		}
	if (strImage1 !="" && strImage1!= " "){
		document.forms[strFormName].img1.src   = "/images/plateGraphicsJava/"+strImage1+ ".gif";
		document.forms[strFormName].img1.height   = "33";
		}
	else {
		document.forms[strFormName].img1.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img1.height   = "0";
		}
	if (strImage2 !="" && strImage2!= " "){
		document.forms[strFormName].img2.src   = "/images/plateGraphicsJava/"+strImage2+ ".gif";
		document.forms[strFormName].img2.height   = "33";
		}
	else {
		document.forms[strFormName].img2.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img2.height   = "0";
		}
	if (strImage3 !="" && strImage3!= " "){
		document.forms[strFormName].img3.src   = "/images/plateGraphicsJava/"+strImage3+ ".gif";
		document.forms[strFormName].img3.height   = "33";
		}
	else {
		document.forms[strFormName].img3.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img3.height   = "0";
		}
	if (strImage4 !="" && strImage4!= " "){
		document.forms[strFormName].img4.src   = "/images/plateGraphicsJava/"+strImage4+ ".gif";
		document.forms[strFormName].img4.height   = "33";
		}
	else {
		document.forms[strFormName].img4.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img4.height   = "0";
		}
	if (strImage5 !="" && strImage5!= " "){
		document.forms[strFormName].img5.src   = "/images/plateGraphicsJava/"+strImage5+ ".gif";
		document.forms[strFormName].img5.height   = "33";
		}
	else {
		document.forms[strFormName].img5.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img5.height   = "0";
		}
	if (strImage6 !="" && strImage6 != " "){
		document.forms[strFormName].img6.src   = "/images/plateGraphicsJava/"+strImage6+ ".gif";
		document.forms[strFormName].img6.height   = "33";
		}
	else {
		document.forms[strFormName].img6.src   = "/images/plateGraphicsJava/blanc.gif";
		document.forms[strFormName].img6.height   = "0";
		}
	
		
	
	
}
	
else {
	
	if (validator!="Any" && validator != "ANY" && validator!="Null" && validator != "NULL") {
		
		strJavascript="document.forms[strFormName]."+selection+".src= \"/images/plateGraphicsJava/"+strElementValue+ ".gif\"";
		eval(strJavascript);
		strJavascript="document.forms[strFormName]."+selection+".height= \"33\"";
		eval(strJavascript);
		//document.images [selection].src   = "/images/plateGraphicsJava/"+validator+ ".gif";
		//document.images [selection].height   = "33";
		}
		else {
		strJavascript="document.forms[strFormName]."+selection+".src = \"/images/plateGraphicsJava/blanc.gif\"";
		eval(strJavascript);
		strJavascript="document.forms[strFormName]."+selection+".height= \"0\"";
		eval(strJavascript);	
		}
}


}
var CurrentlyHighlightedLinks='';

function HighightDatelessLinks(strLinksToHighlight){
	//alert("test1");
	
	var ArrayLinks=strLinksToHighlight.split(":");
	if(ArrayLinks[0].length>0) //There are valid results
		{
		for(i=0;i<ArrayLinks.length;i++)
			{
			//alert(ArrayLinks[i]);
			document.getElementById(ArrayLinks[i]).className="HighlightLink";
			}
		}
	if(CurrentlyHighlightedLinks!=strLinksToHighlight )
		{
			//alert("test2");
		var ArrayLinks=CurrentlyHighlightedLinks.split(":");
		if(ArrayLinks[0].length>0) //There are valid results
			{
			for(i=0;i<ArrayLinks.length;i++)
				{
				//alert(ArrayLinks[i]);
				document.getElementById(ArrayLinks[i]).className="noHighlightLink";
				}
			}
		CurrentlyHighlightedLinks=strLinksToHighlight;
		}
}

function DisplayLink()
{
 //document.getElementById("AutoGeneratedURLContainer").visibility="visible";
 if(document.getElementById("SearchResultsContainer").style.display=="")
 	{
  document.getElementById("AutoGeneratedURLLink").style.display="none"
 	document.getElementById("AutoGeneratedURL").style.display=""
 	document.getElementById("AutoGeneratedURL").focus();
 	document.getElementById("AutoGeneratedURL").select();
	}
 else
 	{
	document.getElementById("AutoGeneratedURLLink2").style.display="none"
 	document.getElementById("AutoGeneratedURL2").style.display=""
 	document.getElementById("AutoGeneratedURL2").focus();
 	document.getElementById("AutoGeneratedURL2").select();	
	}
 
}

/*
var divName = 'SearchingMessage';
var offX = -200;          // X offset from mouse position
var offY = 10;
function follow(evt) {
	if (document.getElementById) {var obj = document.getElementById(divName).style; //obj.display = '';
	obj.left = (parseInt(mouseX(evt))+offX) + 'px';
	obj.top = (parseInt(mouseY(evt))+offY) + 'px';}
}
document.onmousemove = follow;
*/

/*
var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}

function markNavigation(i) {
	temp=i;
  if (browserType == "gecko" ) {
     document.poppedLayer = eval('document.getElementById(temp)');
	 }
  else if (browserType == "ie") {
     document.poppedLayer = eval('document.all[temp]');
	 }
	   else
     document.poppedLayer = eval('document.layers[temp]');
 	 document.poppedLayer.style.backgroundColor="F8D071";

}
function validate_input()
{
	regex=/[\s0-9a-zA-Z]$/;
	teststr=document.search.searchInput.value;

	if (!regex.test(teststr))
	{
		document.search.searchInput.value =' ';
		alert("Please enter ONLY letters or numbers");
	}
	strLength = teststr.length;
	if (strLength > 8 ) {
	document.search.searchInput.value =' ';
	window.alert("Please Only Use Up to 7 Digits");
	
	}
}


function FilterByLetter(strLetter){
	
	document.getElementById("A").className = ""
	document.getElementById("B").className = ""
	document.getElementById("C").className = ""
	document.getElementById("D").className = ""
	document.getElementById("E").className = ""
	document.getElementById("F").className = ""
	document.getElementById("G").className = ""
	document.getElementById("H").className = ""
	document.getElementById("I").className = ""
	document.getElementById("J").className = ""
	document.getElementById("K").className = ""
	document.getElementById("L").className = ""
	document.getElementById("M").className = ""
	document.getElementById("N").className = ""
	document.getElementById("O").className = ""
	document.getElementById("P").className = ""
	document.getElementById("R").className = ""
	document.getElementById("S").className = ""
	document.getElementById("T").className = ""
	document.getElementById("U").className = ""
	document.getElementById("V").className = ""
	document.getElementById("W").className = ""
	document.getElementById("X").className = ""
	document.getElementById("Y").className = ""
	document.getElementById("All").className = ""
	
	if(strLetter !="")
		{
		document.getElementById(strLetter).className = "HighlightCell";
		document.getElementById("searchInput").value = "";
		}
	//alert(document.getElementById("A").className);
	searchform.combination.value = strLetter;
	//document.searchform.submit();
	optionsChanged();
}





function showExamples(panel) {
 panel.onTabClick();
}
function validatePrefix() {
	var c = 0;
	strPre = document.searchPrefix.prefix.value
	if (strPre !="Any"){
	 c +=1; 
	}
	strNum = document.searchPrefix.numbers.value
	if (strNum !="Any"){
	 c +=1; 
	}
	strLet1 = document.searchPrefix.letter1.value
	if (strLet1 !="Any"){
	 c +=1; 
	}
	strLet2 = document.searchPrefix.letter2.value
	if (strLet2 !="Any"){
	 c +=1; 
	}
	strLet3 = document.searchPrefix.letter3.value
	if (strLet3 !="Any"){
	 c +=1; 
	}
	if (c < 2) {
		window.alert("Please select two or more entries from the drop down lists")
		}
		else {
			strURL = "plates/interSearch.asp?prefix="+strPre+"&numbers="+strNum+"&letter1=" + strLet1 + "&letter2=" + strLet2 + "&letter3=" + strLet3 +"&actionType=search&Style=P" ;
				MM_goToURL('parent','../strURL');return document.MM_returnValue;

		}
}
function validateNewstyle() {
	var c = 0;
	strPre1 = document.searchNewstyle.prefix1.value
	if (strPre1 !="Any"){
	 c +=1; 
	}
	strPre2 = document.searchNewstyle.prefix2.value
	if (strPre2 !="Any"){
	 c +=1; 
	}
	strNum = document.searchNewstyle.numbers.value
	if (strNum !="Any"){
	 c +=1; 
	}
	strLet1 = document.searchNewstyle.letter1.value
	if (strLet1 !="Any"){
	 c +=1; 
	}
	strLet2 = document.searchNewstyle.letter2.value
	if (strLet2 !="Any"){
	 c +=1; 
	}
	strLet3 = document.searchNewstyle.letter3.value
	if (strLet3 !="Any"){
	 c +=1; 
	}
	if (c < 3) {
		window.alert("Please select three or more entries from the drop down lists")
		}
		else {
			strURL = "/plates/interSearch.asp?prefix1="+strPre1+"&prefix2="+strPre2+"&numbers="+strNum+"&letter1=" + strLet1 + "&letter2=" + strLet2 + "&letter3=" + strLet3 + "&actionType=search&Style=N" ;
				MM_goToURL('parent','../strURL');return document.MM_returnValue;

		}
}





function HelpClicked(){
	document.getElementById("DatelessGuide").style.display = ""
	location.href="#DatelessGuide"
}


*/	

