// JavaScript Document

function renderGHPLoginStatus(id) 
{
	var strIn = id
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("");
		return;
	} 
	var url="/includes/getloginStatus_a.asp";
	//url=url+"?ssID="+strIn;
	//url=url+"&eid="+EventCode;
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedlogin;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function renderGHPLoginStatus_net(id) 
{
	var strIn = id
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("");
		return;
	} 
	var url="/includes/getloginStatus_net.asp";
	//url=url+"?ssID="+strIn;
	//url=url+"&eid="+EventCode;
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedlogin;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function renderGHPmemberMenu(loginid) 
{
	var strIn = loginid
	//alert(strIn);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("");
		return;
	} 
	var url="/includes/getMemberMenu_a.asp";
	url=url+"?ssID="+strIn;
	//url=url+"&eid="+EventCode;
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateMemberNenu;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChangedlogin() 
{
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("search-menu").innerHTML=xmlHttp.responseText;
	}
}

function stateMemberNenu() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("MbrMnu").innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function ChangeQty(obj,price,x,code, id) {
	var oProdQty = obj;
	var prod = code;
	var qty = oProdQty.value;
	var extPrice = price*qty;
	var fld2 = "totPrice"
	var fld = (fld2.concat(x));
	document.getElementById(fld).value = extPrice;	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX");
		return;
	} 
	var url="http://www.houston.org/includes/updateShoppingBasket.asp";
	url=url+"?id="+id;
	url=url+"&code="+prod;
	url=url+"&qty="+qty;
	url=url+"&price="+price;
	//url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=stateChangedBasket;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	//alert(url);

}

function stateChangedBasket() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("basket").innerHTML=xmlHttp.responseText;
	}
}

function showViewbutton(obj)
{
	var oFrm = obj;
	BusSearch.vwCo.style.visibility="visible";
}

function doOnLoad(obj)
{
	var oFrm = obj;
	BusSearch.vwCo.style.visibility="hidden";
}

function getCoSrch()
{
	var row = document.getElementById("srchCoRow");
	row.style.display = "block";
	row.style.visibility = "visible"; 
	
	var row = document.getElementById("srchIndRow0");
	row.style.display = "none";
	row.style.visibility = "hidden"; 
	
	var row = document.getElementById("srchIndHrRow0");
	row.style.display = "none";
	row.style.visibility = "hidden"; 
	
	var row = document.getElementById("srchIndRow1");
	row.style.display = "none";
	row.style.visibility = "hidden"; 
	
	var row = document.getElementById("srchIndHrRow1");
	row.style.display = "none";
	row.style.visibility = "hidden"; 
	
	var row = document.getElementById("srchIndRow2");
	row.style.display = "none";
	row.style.visibility = "hidden"; 

	//this.srchIndustry.style.display="compact";
	
}

function getindustrySrch()
{
	var row = document.getElementById("srchCoRow");
	if (row.style.display == "")
	{
		row.style.display = "none";
	}
	else
	{
		row.style.display = "none";
	}
	//var row = document.getElementById("srchCoHrRow");
	//if (row.style.display == '')
	//{
	//	row.style.display = "none";
	//}
	//else
	//{
	//	row.style.display = "none";
	//}
	var row = document.getElementById("srchIndRow0");
	if (row.style.display == 'none')
	{
		row.style.display = "";
	}
	else
	{
		row.style.display = "";
	}
	var row = document.getElementById("srchIndHrRow0");
	if (row.style.display == 'none')
	{
		row.style.display = "";
	}
	else
	{
		row.style.display = "";
	}
	var row = document.getElementById("srchIndRow1");
	if (row.style.display == 'none')
	{
		row.style.display = "";
	}
	else
	{
		row.style.display = "";
	}
	var row = document.getElementById("srchIndHrRow1");
	if (row.style.display == 'none')
	{
		row.style.display = "";
	}
	else
	{
		row.style.display = "";
	}
	var row = document.getElementById("srchIndRow2");
	if (row.style.display == 'none')
	{
		row.style.display = "";
	}
	else
	{
		row.style.display = "";
	}
	this.srchIndDiv.style.visibility="visible";
	this.srchCoDiv.style.visibility="hidden";
	
	//this.srchCompany.style.display="compact";
}

function displayCosFound(loginid, StrPos, CompStr,  mbr) 
{
	var strIn = loginid
	var strCo = document.getElementById('CompStr').value;
	var strmbr = document.getElementById('mbr').value;
	if (BusSearch.StrPos[0].checked)
	{	
		var strPos=1;
	}
	else
	{
		var strPos=2;
	}
	//alert(strPos);
	//if(!xmlHttp && typeof XMLHttpRequest!= 'undefined')
	//{ 
	//xmlHttp = new XMLHttpRequest()
	//}
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("");
		return;
	} 
	var url="/includes/getCosFound.asp";
	url=url+"?ssID="+strIn;
	url=url+"&StrPos="+strPos;
	url=url+"&CompStr="+strCo;
	url=url+"&mbr="+strmbr;
	xmlHttp.onreadystatechange=stateDropDown;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateDropDown() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("CoDrpDn").innerHTML=xmlHttp.responseText;
	}
}

function getindustrySrchWOnaics()
{
	var row = document.getElementById("srchCoRow");
	row.style.display = "none";
	row.style.visibility = "hidden"; 
	
	var row = document.getElementById("srchIndRow0");
	row.style.display = "block";
	row.style.visibility = "visible"; 
	
	var row = document.getElementById("srchIndHrRow0");
	row.style.display = "block";
	row.style.visibility = "visible";
	
	var row = document.getElementById("srchIndRow1");
	row.style.display = "block";
	row.style.visibility = "visible";
	
	var row = document.getElementById("srchIndHrRow1");
	row.style.display = "block";
	row.style.visibility = "visible";
	
	var row = document.getElementById("srchIndRow2");
	row.style.display = "block";
	row.style.visibility = "visible";
	
	var row = document.getElementById("viewResultsRow1");
	row.style.display = "block";
	row.style.visibility = "visible";
	
	var row = document.getElementById("viewResultsRow2");
	row.style.display = "block";
	row.style.visibility = "visible";
	
	var row = document.getElementById("viewResultsRow3");
	row.style.display = "block";
	row.style.visibility = "visible";
	//this.vwres.style.visibility="visible";
	//this.vwres.style.display="visible";
	//this.srchCompany.style.display="compact";
}

