/*
 * Search widget!
 */
 	var ckID = 1;
	/*alert (window.location.href);*/
	function writeIt(cID) {
		if (cID == 1){
			ckID = 1;
			document.write("<div align=\"center\" onclick=\"javascript: initSearch();\" style=\"height: 115px; margin: 0px; padding: 0px; background: #ffffff url(http://www.artfact.com/wwwImages/widget-search-bg-img-af.gif) 0 0 no-repeat; width: 213px; overflow: hidden;\"><form method=\"post\" action=\"http://www.artfact.com/catalog/searchLots.cfm\" name=\"searchFormHead\"><input onFocus=\"javascript: checkIt();\" onBlur=\"javascript: checkIt();\" name=\"withAll\" id=\"withAll\" type=\"text\" style=\"border: 0px; padding-left: 0px; font-size: 12px; margin: 62px 0px 0px 0px; width: 155px; background: transparent;\" value=\"Search Auctions\" /><input type=\"hidden\" value=\"1\" name=\"resetPage\"/><input type=\"hidden\" value=\"1\" name=\"alFirst\"/><br /><div style=\"margin-top: 6px; font-family: Arial, sans-serif; font-size: 10px; padding: 0px; padding-left: 25px;\" align=\"left\"><input type=\"radio\" id=\"upcmg\" name=\"srchScope\" value=\"u\" checked=\"true\" /><span style=\"vertical-align: 3px;\"><label for=\"upcmg\">Upcoming</label></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" id=\"pst\" name=\"srchScope\" value=\"p\" /><span style=\"vertical-align: 3px;\"><label for=\"pst\">Past</label></span></div></form></div>");
		}
		else {
			ckID = 2;
			document.write("<div align=\"center\" onclick=\"javascript: initSearch();\" style=\"height: 115px; margin: 0px; padding: 0px; background: #ffffff url(http://www.invaluable.com/wwwImages/widget-search-bg-img-inv.gif) 0 0 no-repeat; width: 213px; overflow: hidden;\"><form method=\"post\" action=\"http://www.invaluable.com/catalog/searchLots.cfm\" name=\"searchFormHead\"><input onFocus=\"javascript: checkIt();\" onBlur=\"javascript: checkIt();\" name=\"withAll\" id=\"withAll\" type=\"text\" style=\"border: 0px; padding-left: 0px; font-size: 12px; margin: 62px 0px 0px 0px; width: 155px; background: transparent;\" value=\"Search Auctions\" /><input type=\"hidden\" value=\"1\" name=\"resetPage\"/><input type=\"hidden\" value=\"1\" name=\"alFirst\"/><br /><div style=\"margin-top: 6px; font-family: Arial, sans-serif; font-size: 10px; padding: 0px; padding-left: 25px;\" align=\"left\"><input type=\"radio\" id=\"upcmg\" name=\"srchScope\" value=\"u\" checked=\"true\" /><span style=\"vertical-align: 3px;\"><label for=\"upcmg\">Forthcoming</label></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" id=\"pst\" name=\"srchScope\" value=\"p\" /><span style=\"vertical-align: 3px;\"><label for=\"pst\">Past</label></span></div></form></div>");
		};
	};
	function initSearch() {
		document.getElementById("withAll").focus();
	}
	function checkIt() {
		var xValue = document.getElementById("withAll").value;
		if (ckID == 1) {
			if (xValue == "Search Auctions") {
				document.getElementById("withAll").value = "";
			}
			else if (xValue == "") {
				document.getElementById("withAll").value = "Search Auctions";
			};
		} else {
			if (xValue == "Search Auctions") {
				document.getElementById("withAll").value = "";
			}
			else if (xValue == "") {
				document.getElementById("withAll").value = "Search Auctions";
			};
		} 
	};