
//* Form elements	
	var _ddlProductType		= null;
	var _btnSearch			= null;




/* EVENT: Page_OnLoad
*/
	function Page_OnLoad()
	{
		Init_Page();
		Init_DetailPanel();
		menubar_setPageHeight();
	}


/* EVENT: imgOpenDetail_OnClick
*/
	function imgOpenDetail_OnClick(productId)
	{
		Data_GetProductDetail(productId);
	}


/* METHOD: Init_Page
*/
	function Init_Page()
	{
		_ddlProductType		= document.getElementById("ddlProductType");
		_btnSearch			= document.getElementById("btnSearch");
	}

	
/* METHOD: Show_DropDowns
   Method is included primarily for IE users. Can be called to hide the 
   SELECT boxes when a popup or window is attempting to display on top.
   
   TRUE = display the drop down list boxes
   FALSE = hide the drop down list boxes
*/	
	function Show_DropDowns(bShow)
	{
		_ddlProductType.style.display = (bShow)? "" : "none";
	}
	
/* METHOD: Display_Details
	function Display_Details(bDisplay)
	{
		if(_dvDetailPanel.style.display == "none" && bDisplay)
		{
			// for IE ... hide the drop down list box
			if(IsIE())
				_ddlProductType.style.display = "none";
			_dvDetailPanel.style.display = "";
		}
		else if(_dvDetailPanel.style.display == "" || !bDisplay)
		{
			// for IE ... display the drop down list box
			if(IsIE())
				_ddlProductType.style.display = "";
			_dvDetailPanel.style.display = "none";
		}
	}
*/

/* METHOD: LoadDetails	
	function LoadDetails( xmlNode )
	{
		var prodId 	= XML_GetInnerText( xmlNode.getElementsByTagName("productId").item(0) );
		var typeId	= XML_GetInnerText( xmlNode.getElementsByTagName("typeId").item(0) );
		var compName	= XML_GetInnerText( xmlNode.getElementsByTagName("companyName").item(0) );
		var desc		= XML_GetInnerText( xmlNode.getElementsByTagName("description").item(0) );
		var profile	= XML_GetInnerText( xmlNode.getElementsByTagName("companyProfile").item(0) );
		var url		= XML_GetInnerText( xmlNode.getElementsByTagName("url").item(0) );
		var contact	= XML_GetInnerText( xmlNode.getElementsByTagName("contact").item(0) );
		
		_spCompanyName.innerHTML 	= compName;
		_spDescription.innerHTML 	= desc.toHTML();
		_spProfile.innerHTML		= profile.toHTML();
		_spContact.innerHTML		= contact.toHTML();
		
		var aHref	= "<A href='"+ url +"' target='_new'>"+ url +"</a>";
		_dvDetailWebSite.innerHTML	= aHref;
	}
*/


/* DATA METHOD: Data_GetProductDetail
*/
	function Data_GetProductDetail(nProductId)
	{
		var sTargetUrl 	= _webRoot + "/_resources/WebServices/wsBuyersGuide.asmx/GetProductById?prodId="+nProductId;
		Init_HttpRequest();
		_xmlHttp.open("GET", sTargetUrl, true);
		_xmlHttp.onreadystatechange = onReadyStateChange;
		_xmlHttp.send(null);
	}
	
	function onReadyStateChange()
	{
	// Completed loading
		if(_xmlHttp.readyState == 4)
		{
		// Success
			if(_xmlHttp.status != 200)
			{
				alert("HTTP ERROR:"+_xmlHttp.status);
			}
			else
			{
			// check the results for an error
				Details_LoadDetails( _xmlHttp.responseXML );
				Details_Display(true);
			}
		}
		else
		{
			// onReadyStateChange();
		}
	}








