 	// Array.indexOf( value, begin, strict ) - Return index of the first element that matches value
	Array.prototype.indexOf = function( v, b, s ) {
		for( var i = +b || 0, l = this.length; i < l; i++ ) {
	  	if( this[i]===v || s && this[i]==v ) { return i; }
		}
		return -1;
	}

	var firefox=document.getElementById&&!document.all;	
	
/*
<%
	response.write("var enquirelist = new Array")
	
	if IsArray(Session("EnquireList")) then
		response.write("(")
		response.write(Session("EnquireList")(0))
		for i = (LBound(Session("EnquireList"))+1) to UBound(Session("EnquireList"))
			response.write("," & Session("EnquireList")(i))
		next
		response.write(")")
	else
		response.write("(0)")
	end if
%>
	//var enquirelist = new Array
*/

	function addenquireitem(theitem) {
		theForm = document.searchbox
		theForm1 = document.enquirebasketcountform
		
		//alert(enquirelist)
		
		var itemindex = -1
		if (enquirelist.length > 0) {
			itemindex = enquirelist.indexOf(theitem)		// check to see if item already in list
		}
		if (itemindex == -1) {
			//alert(document.searchbox.theenquirelist.value)
			enquirelist.push(theitem)
			theForm.theenquirelist.value = enquirelist
			theForm1.enquirebasketcount.value = parseInt(theForm1.enquirebasketcount.value) + 1
			thevalue = theForm1.enquirebasketcount.value + " items in your enquiry basket | <a href='viewbasket.asp?enquirebasketlist=" + document.searchbox.theenquirelist.value + "'>View Basket</a>&nbsp;&nbsp;"
			theitemtr = "tr_" + theitem
			if ((document.getElementById) || firefox) {
				document.getElementById('js_updateenquirelist').innerHTML = thevalue //theForm1.enquirebasketcount.value
				document.getElementById(theitemtr).style.backgroundColor = "#99ccff"
			}
			if (document.all) {
				document.all['js_updateenquirelist'].innerHTML = thevalue
				document.all[theitemtr].style.backgroundColor = "#99ccff"
			}
			if (document.layers) {
        document['js_updateenquirelist'].open();
        document['js_updateenquirelist'].write(thevalue);
        document['js_updateenquirelist'].close();
				document[theitemtr].style.backgroundColor = "#99ccff";
			}

			//alert(theForm.theenquirelist.value)
			alert("Das zu Ihrer Nachfrageliste beigefügte Eigentum \n \nUm Ihr ausgewältes Eigentum anzusehen klicken Sie oben auf den „Korb sehen“")
		} else {
			alert("You have already requested information on this location.")
		}
	}
	
