Autosuggest search
Autosuggest search

--- a/admin/abr-example.php
+++ b/admin/abr-example.php

--- /dev/null
+++ b/admin/agency2portfolio.php
@@ -1,1 +1,42 @@
+<?php
 
+// Returns portfolio scraped live from directory.gov.au
+// or null if can't find a portfolio
+function agency2portfolio ($agency) {
+	static $cache = array();
+	if (isset($cache[$agency])) { return $cache[$agency]; }
+	$c = curl_init('http://www.directory.gov.au/searchres.php');
+	curl_setopt($c, CURLOPT_POST, true);
+	curl_setopt($c, CURLOPT_HEADER, false);
+	curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
+	curl_setopt($c, CURLOPT_REFERER, 'http://www.directory.gov.au/adsearch.php');
+	curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3');
+	curl_setopt($c, CURLOPT_POSTFIELDS, array(
+		'advkeywordfield' => '',
+		'advorgunitfield' => $agency,
+		'advrolefield' => '',
+		'advsection' => 'All',
+		'advsurnamefield' => '',
+		'search' => 'Submit Query'
+	));
+	$results = curl_exec($c);
+	
+	if (preg_match('#<span\s+class="standardlinks"><a\s+href="([^"]+)">#smi', $results, $m)) {
+		$nextURL = $m[1];
+	} else {
+		$cache[$agency] = false; return false;
+	}
+	
+	curl_setopt($c, CURLOPT_URL, 'http://www.directory.gov.au' . $nextURL);
+	curl_setopt($c, CURLOPT_HTTPGET, true);
+	curl_setopt($c, CURLOPT_REFERER, 'http://www.directory.gov.au/searchres.php');
+	$results = curl_exec($c);
+	if (preg_match('#portfolios:\s+([^<]+)#ims', $results, $m)) {
+		$cache[$agency] = $m[1]; return $m[1];
+	} else {
+		$cache[$agency] = false; return false;
+	}
+}
+
+?>
+

--- a/admin/convertToThematicMapping.php
+++ b/admin/convertToThematicMapping.php

--- /dev/null
+++ b/admin/displayRepresentatives.php
@@ -1,1 +1,7 @@
+SELECT representative_id,firstname,surname,party,house,division_id,	portfolio
+FROM portfolio2representative
+INNER JOIN representatives
+ON portfolio2representative.representative_id=representatives.id
+INNER JOIN portfolios
+ON portfolio2representative.portfolio_id=portfolios.id
 

--- /dev/null
+++ b/admin/displayUNSPSC.php
@@ -1,1 +1,25 @@
+<?php

+error_reporting(E_ALL);

+

+$link = mysql_connect('localhost', 'team7', 'wlUsnD2xu9');

+if (!$link) {

+    die('Could not connect: ' . mysql_error());

+}

+@mysql_select_db("team7") or die("Unable to select database");

+

+$unspscresult = mysql_query ("select * from UNSPSCcategories;");

+while ($row = mysql_fetch_assoc($unspscresult)) {

+	$unspsc[$row['UNSPSC']] = $row['Title'];

+}

+$catsresult = mysql_query ("SELECT LEFT( categoryUNSPSC, 2 ) as cat , SUM( value ) as value

+FROM `contractnotice`

+GROUP BY cat ;");

+echo "<table>";

+while ($row = mysql_fetch_assoc($catsresult)) {

+	$catName = $unspsc[$row['cat']."000000"].$row['cat'];

+	if ($row['cat'] = "") $catName = "null";

+	

+	echo "<tr><td>$catName</td><td>".$row['value']."</td></tr>";

+}

+?>

 

--- a/admin/google-example.php
+++ b/admin/google-example.php

--- a/admin/import.php
+++ b/admin/import.php
@@ -98,17 +98,17 @@
 	
 $result = mysql_query($contractNoticeInsert);
 if ($result) $success++;
-else echo $data[2] . " failed CN insert.<br>". mysql_error() ." <br>  $contractNoticeInsert <br><br>\n";
+else if (strpos(mysql_error(),"Duplicate entry") === false) echo $data[2] . " failed CN insert.<br>". mysql_error() ." <br>  $contractNoticeInsert <br><br>\n";
 	
-	//$result = mysql_query($agencyInsert);
+	$result = mysql_query($agencyInsert);
 if ($result) $success++;
-else echo $data[2] . " failed agency insert.<br>". mysql_error() ." <br> $agencyInsert <br><br>\n";
+else if (strpos(mysql_error(),"Duplicate entry") === false) echo $data[2] . " failed agency insert.<br>". mysql_error() ." <br> $agencyInsert <br><br>\n";
 	
 	$result = mysql_query($supplierInsert);
 if ($result) $success++;
-else echo $data[2] . " failed supplier insert.<br>". mysql_error() ." <br> $supplierInsert <br><br>\n";
+else if (strpos(mysql_error(),"Duplicate entry") === false) echo $data[2] . " failed supplier insert.<br>". mysql_error() ." <br> $supplierInsert <br><br>\n";
 
-echo "<hr>\n";
+//echo "<hr>\n";
 	}
 	
     $row++;
@@ -117,3 +117,4 @@
 fclose($handle);
 }
 ?>
+

--- a/admin/linkAmendments.php
+++ b/admin/linkAmendments.php

--- a/admin/setAgencyStatus.php
+++ b/admin/setAgencyStatus.php

--- a/admin/setAgencyURLABN.php
+++ b/admin/setAgencyURLABN.php

--- /dev/null
+++ b/admin/updateReport.php
@@ -1,1 +1,30 @@
+<?php

+include_once("../lib/common.inc.php");

+$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end 

+FROM `contractnotice` WHERE childCN = 0 AND parentCN = 0 AND DATE(importDate) in (select * from (SELECT DATE(importDate) 

+FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)";

+$result = mysql_query($query);

+$stats = mysql_fetch_array($result, MYSQL_BOTH);

+echo $stats["count"] . " new records in period " . $stats["start"] . "  to " . $stats["end"] ."<br>";

+

+$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end 

+FROM `contractnotice` WHERE (childCN != 0 OR parentCN != 0) AND DATE(importDate) in (select * from (SELECT DATE(importDate) 

+FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)";

+$result = mysql_query($query);

+$stats = mysql_fetch_array($result, MYSQL_BOTH);

+echo $stats["count"] . " updated records in period " . $stats["start"] . "  to " . $stats["end"] ."<br>";

+

+$query = "SELECT count(*) as count FROM `agency` WHERE `abn` = '0'";

+$result = mysql_query($query);

+$stats = mysql_fetch_array($result, MYSQL_BOTH);

+echo $stats["count"] . " agencies with no ABN<br>";

+

+/*$query = "SELECT count(*) as count FROM `supplierdetails` WHERE `supplierABN` = '0' and supplierCountry LIKE 'Australia'";

+$result = mysql_query($query);

+$stats = mysql_fetch_array($result, MYSQL_BOTH);

+echo $stats["count"] . " Australian suppliers with no ABN<br>";*/

+

+

+echo "Last updated: ". $stats["importday"]."<br>";

+?>

 

--- /dev/null
+++ b/admin/updateUNSPSC.php
@@ -1,1 +1,38 @@
+<?php

+error_reporting(E_ALL);

+

+$link = mysql_connect('localhost', 'team7', 'wlUsnD2xu9');

+if (!$link) {

+    die('Could not connect: ' . mysql_error());

+}

+@mysql_select_db("team7") or die("Unable to select database");

+

+$unspscresult = mysql_query ("select * from UNSPSCcategories;");

+while ($row = mysql_fetch_assoc($unspscresult)) {

+	$unspsc[$row['Title']] = $row['UNSPSC'];

+}

+

+$query = "SELECT CNID,category,value

+FROM `contractnotice`

+WHERE `categoryUNSPSC` IS NULL OR `categoryUNSPSC` = 0";

+$emptycatresult = mysql_query ($query);

+$missing = Array();

+if ($emptycatresult){

+	while ($record = mysql_fetch_assoc($emptycatresult)) {

+	if ($unspsc[$record['category']] == "") {

+		$missing[$record['category']]= $missing[$record['category']]+ $record['value'];

+//		echo "<br>\n Category not found for: \n";

+//		print_r($record);

+	} else {

+	$result = mysql_query("UPDATE contractnotice SET categoryUNSPSC = 

+'".mysql_real_escape_string($unspsc[$record['category']])."' where CNID = 

+'".mysql_real_escape_string($record['CNID'])."';");

+	if ($result) echo $record['CNID']. " set to ". ($unspsc[$record['category']]) . " <br>\n";

+	else echo "error".mysql_error();

+	}

+	} 

+} else echo "error".mysql_error();

+asort($missing);

+print_r($missing);

+?>

 

--- /dev/null
+++ b/autosuggest_inquisitor.css
@@ -1,1 +1,177 @@
+/* 
+================================================
+autosuggest, inquisitor style
+================================================
+*/
 
+body
+{
+	position: relative;
+}
+
+
+div.autosuggest
+{
+	position: absolute;
+	background-image: url(images/img_inquisitor/as_pointer.gif);
+	background-position: top;
+	background-repeat: no-repeat;
+	padding: 10px 0 0 0;
+}
+
+div.autosuggest div.as_header,
+div.autosuggest div.as_footer
+{
+	position: relative;
+	height: 6px;
+	padding: 0 6px;
+	background-image: url(images/img_inquisitor/ul_corner_tr.gif);
+	background-position: top right;
+	background-repeat: no-repeat;
+	overflow: hidden;
+}
+div.autosuggest div.as_footer
+{
+	background-image: url(images/img_inquisitor/ul_corner_br.gif);
+}
+
+div.autosuggest div.as_header div.as_corner,
+div.autosuggest div.as_footer div.as_corner
+{
+	position: absolute;
+	top: 0;
+	left: 0;
+	height: 6px;
+	width: 6px;
+	background-image: url(images/img_inquisitor/ul_corner_tl.gif);
+	background-position: top left;
+	background-repeat: no-repeat;
+}
+div.autosuggest div.as_footer div.as_corner
+{
+	background-image: url(images/img_inquisitor/ul_corner_bl.gif);
+}
+div.autosuggest div.as_header div.as_bar,
+div.autosuggest div.as_footer div.as_bar
+{
+	height: 6px;
+	overflow: hidden;
+	background-color: #333;
+}
+
+
+div.autosuggest ul
+{
+	list-style: none;
+	margin: 0 0 -4px 0;
+	padding: 0;
+	overflow: hidden;
+	background-color: #333;
+}
+
+div.autosuggest ul li
+{
+	color: #ccc;
+	padding: 0;
+	margin: 0 4px 4px;
+	text-align: left;
+}
+
+div.autosuggest ul li a
+{
+	color: #ccc;
+	display: block;
+	text-decoration: none;
+	background-color: transparent;
+	text-shadow: #000 0px 0px 5px;
+	position: relative;
+	padding: 0;
+	width: 100%;
+}
+div.autosuggest ul li a:hover
+{
+	background-color: #444;
+}
+div.autosuggest ul li.as_highlight a:hover
+{
+	background-color: #1B5CCD;
+}
+
+div.autosuggest ul li a span
+{
+	display: block;
+	padding: 3px 6px;
+	font-weight: bold;
+}
+
+div.autosuggest ul li a span small
+{
+	font-weight: normal;
+	color: #999;
+}
+
+div.autosuggest ul li.as_highlight a span small
+{
+	color: #ccc;
+}
+
+div.autosuggest ul li.as_highlight a
+{
+	color: #fff;
+	background-color: #1B5CCD;
+	background-image: url(images/img_inquisitor/hl_corner_br.gif);
+	background-position: bottom right;
+	background-repeat: no-repeat;
+}
+
+div.autosuggest ul li.as_highlight a span
+{
+	background-image: url(images/img_inquisitor/hl_corner_bl.gif);
+	background-position: bottom left;
+	background-repeat: no-repeat;
+}
+
+div.autosuggest ul li a .tl,
+div.autosuggest ul li a .tr
+{
+	background-image: transparent;
+	background-repeat: no-repeat;
+	width: 6px;
+	height: 6px;
+	position: absolute;
+	top: 0;
+	padding: 0;
+	margin: 0;
+}
+div.autosuggest ul li a .tr
+{
+	right: 0;
+}
+
+div.autosuggest ul li.as_highlight a .tl
+{
+	left: 0;
+	background-image: url(images/img_inquisitor/hl_corner_tl.gif);
+	background-position: bottom left;
+}
+
+div.autosuggest ul li.as_highlight a .tr
+{
+	right: 0;
+	background-image: url(images/img_inquisitor/hl_corner_tr.gif);
+	background-position: bottom right;
+}
+
+
+
+div.autosuggest ul li.as_warning
+{
+	font-weight: bold;
+	text-align: center;
+}
+
+div.autosuggest ul em
+{
+	font-style: normal;
+	color: #6EADE7;
+}

file:a/displayLatestUpdate.php (deleted)
--- a/displayLatestUpdate.php
+++ /dev/null
@@ -1,23 +1,1 @@
-<?php

-include_once("./lib/common.inc.php");

-$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end 

-FROM `contractnotice` WHERE childCN = 0 AND parentCN = 0 AND DATE(importDate) in (select * from (SELECT DATE(importDate) 

-FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)";

-$result = mysql_query($query);

-echo "<table>";

-$stats = mysql_fetch_array($result, MYSQL_BOTH);

-echo $stats["count"] . " new records in period " . $stats["start"] . "  to " . $stats["end"] ."<br>";

-

-

-$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end 

-FROM `contractnotice` WHERE (childCN != 0 OR parentCN != 0) AND DATE(importDate) in (select * from (SELECT DATE(importDate) 

-FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)";

-$result = mysql_query($query);

-echo "<table>";

-$stats = mysql_fetch_array($result, MYSQL_BOTH);

-echo $stats["count"] . " updated records in period " . $stats["start"] . "  to " . $stats["end"] ."<br>";

-

-

-echo "Last updated: ". $stats["importday"]."<br>";

-/* Check for null Procurement method and 0 ABN when not ABN exempt */

-?>
+

 Binary files /dev/null and b/images/img_inquisitor/.DS_Store differ
 Binary files /dev/null and b/images/img_inquisitor/._.DS_Store differ
 Binary files /dev/null and b/images/img_inquisitor/._as_pointer.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._hl_corner_bl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._hl_corner_br.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._hl_corner_tl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._hl_corner_tr.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._ul_corner_bl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._ul_corner_br.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._ul_corner_tl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/._ul_corner_tr.gif differ
 Binary files /dev/null and b/images/img_inquisitor/_source/.DS_Store differ
 Binary files /dev/null and b/images/img_inquisitor/_source/._.DS_Store differ
 Binary files /dev/null and b/images/img_inquisitor/_source/._as_pointer.png differ
 Binary files /dev/null and b/images/img_inquisitor/_source/._li_corner.png differ
 Binary files /dev/null and b/images/img_inquisitor/_source/._ul_corner.png differ
 Binary files /dev/null and b/images/img_inquisitor/_source/as_pointer.png differ
 Binary files /dev/null and b/images/img_inquisitor/_source/li_corner.png differ
 Binary files /dev/null and b/images/img_inquisitor/_source/ul_corner.png differ
 Binary files /dev/null and b/images/img_inquisitor/as_pointer.gif differ
 Binary files /dev/null and b/images/img_inquisitor/hl_corner_bl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/hl_corner_br.gif differ
 Binary files /dev/null and b/images/img_inquisitor/hl_corner_tl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/hl_corner_tr.gif differ
 Binary files /dev/null and b/images/img_inquisitor/ul_corner_bl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/ul_corner_br.gif differ
 Binary files /dev/null and b/images/img_inquisitor/ul_corner_tl.gif differ
 Binary files /dev/null and b/images/img_inquisitor/ul_corner_tr.gif differ
--- /dev/null
+++ b/lib/bsn.AutoSuggest_2.1.3_comp.js
@@ -1,1 +1,1 @@
-
+if(typeof(bsn)=="undefined")_b=bsn={};if(typeof(_b.Autosuggest)=="undefined")_b.Autosuggest={};else alert("Autosuggest is already set!");_b.AutoSuggest=function(b,c){if(!document.getElementById)return 0;this.fld=_b.DOM.gE(b);if(!this.fld)return 0;this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.oP=c?c:{};var k,def={minchars:1,meth:"get",varname:"input",className:"autosuggest",timeout:2500,delay:500,offsety:-5,shownoresults:true,noresults:"No results!",maxheight:250,cache:true,maxentries:25};for(k in def){if(typeof(this.oP[k])!=typeof(def[k]))this.oP[k]=def[k]}var p=this;this.fld.onkeypress=function(a){return p.onKeyPress(a)};this.fld.onkeyup=function(a){return p.onKeyUp(a)};this.fld.setAttribute("autocomplete","off")};_b.AutoSuggest.prototype.onKeyPress=function(a){var b=(window.event)?window.event.keyCode:a.keyCode;var c=13;var d=9;var e=27;var f=1;switch(b){case c:this.setHighlightedValue();f=0;break;case e:this.clearSuggestions();break}return f};_b.AutoSuggest.prototype.onKeyUp=function(a){var b=(window.event)?window.event.keyCode:a.keyCode;var c=38;var d=40;var e=1;switch(b){case c:this.changeHighlight(b);e=0;break;case d:this.changeHighlight(b);e=0;break;default:this.getSuggestions(this.fld.value)}return e};_b.AutoSuggest.prototype.getSuggestions=function(a){if(a==this.sInp)return 0;_b.DOM.remE(this.idAs);this.sInp=a;if(a.length<this.oP.minchars){this.aSug=[];this.nInpC=a.length;return 0}var b=this.nInpC;this.nInpC=a.length?a.length:0;var l=this.aSug.length;if(this.nInpC>b&&l&&l<this.oP.maxentries&&this.oP.cache){var c=[];for(var i=0;i<l;i++){if(this.aSug[i].value.substr(0,a.length).toLowerCase()==a.toLowerCase())c.push(this.aSug[i])}this.aSug=c;this.createList(this.aSug);return false}else{var d=this;var e=this.sInp;clearTimeout(this.ajID);this.ajID=setTimeout(function(){d.doAjaxRequest(e)},this.oP.delay)}return false};_b.AutoSuggest.prototype.doAjaxRequest=function(b){if(b!=this.fld.value)return false;var c=this;if(typeof(this.oP.script)=="function")var d=this.oP.script(encodeURIComponent(this.sInp));else var d=this.oP.script+this.oP.varname+"="+encodeURIComponent(this.sInp);if(!d)return false;var e=this.oP.meth;var b=this.sInp;var f=function(a){c.setSuggestions(a,b)};var g=function(a){alert("AJAX error: "+a)};var h=new _b.Ajax();h.makeRequest(d,e,f,g)};_b.AutoSuggest.prototype.setSuggestions=function(a,b){if(b!=this.fld.value)return false;this.aSug=[];if(this.oP.json){var c=eval('('+a.responseText+')');for(var i=0;i<c.results.length;i++){this.aSug.push({'id':c.results[i].id,'value':c.results[i].value,'info':c.results[i].info})}}else{var d=a.responseXML;var e=d.getElementsByTagName('results')[0].childNodes;for(var i=0;i<e.length;i++){if(e[i].hasChildNodes())this.aSug.push({'id':e[i].getAttribute('id'),'value':e[i].childNodes[0].nodeValue,'info':e[i].getAttribute('info')})}}this.idAs="as_"+this.fld.id;this.createList(this.aSug)};_b.AutoSuggest.prototype.createList=function(b){var c=this;_b.DOM.remE(this.idAs);this.killTimeout();if(b.length==0&&!this.oP.shownoresults)return false;var d=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});var e=_b.DOM.cE("div",{className:"as_corner"});var f=_b.DOM.cE("div",{className:"as_bar"});var g=_b.DOM.cE("div",{className:"as_header"});g.appendChild(e);g.appendChild(f);d.appendChild(g);var h=_b.DOM.cE("ul",{id:"as_ul"});for(var i=0;i<b.length;i++){var j=b[i].value;var k=j.toLowerCase().indexOf(this.sInp.toLowerCase());var l=j.substring(0,k)+"<em>"+j.substring(k,k+this.sInp.length)+"</em>"+j.substring(k+this.sInp.length);var m=_b.DOM.cE("span",{},l,true);if(b[i].info!=""){var n=_b.DOM.cE("br",{});m.appendChild(n);var o=_b.DOM.cE("small",{},b[i].info);m.appendChild(o)}var a=_b.DOM.cE("a",{href:"#"});var p=_b.DOM.cE("span",{className:"tl"}," ");var q=_b.DOM.cE("span",{className:"tr"}," ");a.appendChild(p);a.appendChild(q);a.appendChild(m);a.name=i+1;a.onclick=function(){c.setHighlightedValue();return false};a.onmouseover=function(){c.setHighlight(this.name)};var r=_b.DOM.cE("li",{},a);h.appendChild(r)}if(b.length==0&&this.oP.shownoresults){var r=_b.DOM.cE("li",{className:"as_warning"},this.oP.noresults);h.appendChild(r)}d.appendChild(h);var s=_b.DOM.cE("div",{className:"as_corner"});var t=_b.DOM.cE("div",{className:"as_bar"});var u=_b.DOM.cE("div",{className:"as_footer"});u.appendChild(s);u.appendChild(t);d.appendChild(u);var v=_b.DOM.getPos(this.fld);d.style.left=v.x+"px";d.style.top=(v.y+this.fld.offsetHeight+this.oP.offsety)+"px";d.style.width=this.fld.offsetWidth+"px";d.onmouseover=function(){c.killTimeout()};d.onmouseout=function(){c.resetTimeout()};document.getElementsByTagName("body")[0].appendChild(d);this.iHigh=0;var c=this;this.toID=setTimeout(function(){c.clearSuggestions()},this.oP.timeout)};_b.AutoSuggest.prototype.changeHighlight=function(a){var b=_b.DOM.gE("as_ul");if(!b)return false;var n;if(a==40)n=this.iHigh+1;else if(a==38)n=this.iHigh-1;if(n>b.childNodes.length)n=b.childNodes.length;if(n<1)n=1;this.setHighlight(n)};_b.AutoSuggest.prototype.setHighlight=function(n){var a=_b.DOM.gE("as_ul");if(!a)return false;if(this.iHigh>0)this.clearHighlight();this.iHigh=Number(n);a.childNodes[this.iHigh-1].className="as_highlight";this.killTimeout()};_b.AutoSuggest.prototype.clearHighlight=function(){var a=_b.DOM.gE("as_ul");if(!a)return false;if(this.iHigh>0){a.childNodes[this.iHigh-1].className="";this.iHigh=0}};_b.AutoSuggest.prototype.setHighlightedValue=function(){if(this.iHigh){this.sInp=this.fld.value=this.aSug[this.iHigh-1].value;this.fld.focus();if(this.fld.selectionStart)this.fld.setSelectionRange(this.sInp.length,this.sInp.length);this.clearSuggestions();if(typeof(this.oP.callback)=="function")this.oP.callback(this.aSug[this.iHigh-1])}};_b.AutoSuggest.prototype.killTimeout=function(){clearTimeout(this.toID)};_b.AutoSuggest.prototype.resetTimeout=function(){clearTimeout(this.toID);var a=this;this.toID=setTimeout(function(){a.clearSuggestions()},1000)};_b.AutoSuggest.prototype.clearSuggestions=function(){this.killTimeout();var a=_b.DOM.gE(this.idAs);var b=this;if(a){var c=new _b.Fader(a,1,0,250,function(){_b.DOM.remE(b.idAs)})}};if(typeof(_b.Ajax)=="undefined")_b.Ajax={};_b.Ajax=function(){this.req={};this.isIE=false};_b.Ajax.prototype.makeRequest=function(a,b,c,d){if(b!="POST")b="GET";this.onComplete=c;this.onError=d;var e=this;if(window.XMLHttpRequest){this.req=new XMLHttpRequest();this.req.onreadystatechange=function(){e.processReqChange()};this.req.open("GET",a,true);this.req.send(null)}else if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");if(this.req){this.req.onreadystatechange=function(){e.processReqChange()};this.req.open(b,a,true);this.req.send()}}};_b.Ajax.prototype.processReqChange=function(){if(this.req.readyState==4){if(this.req.status==200){this.onComplete(this.req)}else{this.onError(this.req.status)}}};if(typeof(_b.DOM)=="undefined")_b.DOM={};_b.DOM.cE=function(b,c,d,e){var f=document.createElement(b);if(!f)return 0;for(var a in c)f[a]=c[a];var t=typeof(d);if(t=="string"&&!e)f.appendChild(document.createTextNode(d));else if(t=="string"&&e)f.innerHTML=d;else if(t=="object")f.appendChild(d);return f};_b.DOM.gE=function(e){var t=typeof(e);if(t=="undefined")return 0;else if(t=="string"){var a=document.getElementById(e);if(!a)return 0;else if(typeof(a.appendChild)!="undefined")return a;else return 0}else if(typeof(e.appendChild)!="undefined")return e;else return 0};_b.DOM.remE=function(a){var e=this.gE(a);if(!e)return 0;else if(e.parentNode.removeChild(e))return true;else return 0};_b.DOM.getPos=function(e){var e=this.gE(e);var a=e;var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else if(a.x)b+=a.x;var a=e;var c=0;if(a.offsetParent){while(a.offsetParent){c+=a.offsetTop;a=a.offsetParent}}else if(a.y)c+=a.y;return{x:b,y:c}};if(typeof(_b.Fader)=="undefined")_b.Fader={};_b.Fader=function(a,b,c,d,e){if(!a)return 0;this.e=a;this.from=b;this.