function glbQuickAdvancedSearchLink_Click(ev) {
	// Sort out WatermarkExtender default text.
	if (typeof(PJB.UI.Controls.WatermarkExtender.onSubmit) == "function") {
		PJB.UI.Controls.WatermarkExtender.onSubmit();
	}
	var queryString;
	var keywords = $get(QuickSearch_ClientID+"_txtKeywords").value;
	if (keywords.length > 0) {
		//if the keywords string contains special characters.this check is to ensure tht both the 
		//places are displayed correctly in the search page
		keywords = escape(keywords);
		queryString = "Keywords=" + keywords;
	}
	else {
		queryString = "Keywords=";
	}
	var location = $get(QuickSearch_ClientID+"_txtLocation").value;
	
	if (location.length > 0) {
	//if the location string contains special characters.this check is to ensure tht both the 
	//places are displayed correctly in the search page
		location=escape(location);
		queryString = queryString + "&LTxt=" + location;
	}
	// Get link href.
	var url = ev.target.href;
	if (typeof(queryString) != "undefined") {
		window.location = (url + "?" + queryString);
	}
	else {
		window.location = url;
	}
	// Stops browser from navigating to href.
	ev.preventDefault();
}

var QuickSearch_ClientID = "QuickSearch";

function QuickSearch_Init(clientId) {
	QuickSearch_ClientID = clientId;
}

function QuickSearch_Load(clientId) {
	var link = $get(QuickSearch_ClientID+"_glbQuickAdvancedSearchLink");
	// Check TJNL
	if (link == null) {
		link = $get(QuickSearch_ClientID+"_glbQuickUitgebreidZoekenLink");
	}
	if (link != null) {
		$addHandler(link, "click", glbQuickAdvancedSearchLink_Click);
	}
}

