


////////////////////////////////////////////////////////////////////////////////////////////////////////
// Handler for Search Button Click
////////////////////////////////////////////////////////////////////////////////////////////////////////
function on_SearchButtonClick()
{
	//store the url of the calling page
	var calling_page = document.URL;
    
    //gather the text entered into the criteria edit control
	var search_criteria = document.searchForm.searchCriteria.value;
	
	//rem the following out for real usage - only for debug
	//alert( (calling_page + "   " + search_criteria) );
    
    //the call below results in redirection to server side processing page and then results page
    InvokeContentSearch( calling_page, search_criteria );
}
 
 

////////////////////////////////////////////////////////////////////////////////////////////////////////
// Invokes Server Side Search Processing Page
////////////////////////////////////////////////////////////////////////////////////////////////////////
function InvokeContentSearch(CallingPage, SearchCriteria)
{
    //code for gathering criteria from edit controls and assembling 
    //into a Search Criteria XML stream, which is passed to the 
    //server-side search page
    
//	alert( ("CallingPage: " + CallingPage + "  " + "CallingPage: " + SearchCriteria) );

	var page_url = "http://www.baylorhealth.com/Processors/SearchGateway.aspx";
	var clean_calling_page = StripQueryString(CallingPage);
    var query_str = "?Requestor=" + clean_calling_page + "&SearchCriteria=" + SearchCriteria;
    var complete_url = page_url + query_str;

	//rem the following out for real usage - only for debug
	//alert( ("complete_url: "   " + complete_url) );
    //url below should reflect valid production url to consumer site
    top.location = complete_url;
}
 


////////////////////////////////////////////////////////////////////////////////////////////////////////
// Handler for Search Button Click
////////////////////////////////////////////////////////////////////////////////////////////////////////
function StripQueryString( URLWithQueryString )
{
	//store the url of the calling page
	var url = URLWithQueryString;
	var clean_url = "";
//	var idx = url.indexOf("?Requestor=");
//	if(idx > -1) { clean_url = url.substring(0, idx); }
			
	//rem the following out for real usage - only for debug
//	alert( ("Clean URL:  " + clean_url) );
	return clean_url;
}



////////////////////////////////////////////////////////////////////////////////////////////////////////
// Encodes Potentially Invalid Data Into HTML Acceptable Data
////////////////////////////////////////////////////////////////////////////////////////////////////////
function EncodeSourceURLAndSearchParams(ThisPageURL, SearchCriteria)
{
 
    //base-64 encode the strings and append the second to the first

    var encoded_url_str = ""
    var encoded_criteria_str = ""
    var encoded_qry_str = (encoded_url_str  + encoded_criteria_str );
    return encoded_qry_str ;

}
  
 
 
/*
9/8/05 Verify that this works with all driving pages.  Should be OK since the forms post to processor 
page instead of using the Java Script function.
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Handler for Get Directions Button Click
////////////////////////////////////////////////////////////////////////////////////////////////////////
function on_GetDirectionsButtonClick()
{
	//store the url of the calling page
	var calling_page = document.URL;

//	alert( calling_page );
    
    //gather the text entered into the criteria edit control
	var street_address = document.drivingDirectionsForm.address.value;
	var city = document.drivingDirectionsForm.city.value;
	var state = document.drivingDirectionsForm.state.value;
	var postal_code = document.drivingDirectionsForm.zip.value;
	
	//rem the following out for real usage - only for debug
	alert( (calling_page) );
    
    //var map_quest_url = "http://xml.sa.mapquest.com/&transaction=route?clientId=30587?origAddress=111%20Cimmaron%20trail?origPostalCode=75063?destAddress=3310%20Cole%20Ave.origCity=Dallas?origState=tx";
    var map_quest_url = "http://localhost/Processors/GeographicSvcsGateway.aspx";
    InvokeGeographicServices(map_quest_url);
}
 
 
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
// Invokes Geographic Mapping Services Processing Page
////////////////////////////////////////////////////////////////////////////////////////////////////////
function InvokeGeographicServices(target_page_url)
{
    //url below should reflect valid production url to consumer site
    top.location = target_page_url;
}
*/



 
