var hos = location.host;
var urlbase= "http://"+ hos + "";


//Browser Support Code
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 showHint(str,uid,page)
{
		
	document.getElementById('loading').style.display = "block";
	document.getElementById('divearly').style.display = "none";
	document.getElementById('venuesearch').value = "Enter Venue Name";
		
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var c_value = "";
for (var i=0; i < document.searching.chk.length; i++)
   {
   if (document.searching.chk[i].checked)
      {
		  	if(c_value)
		      c_value = c_value + "," + document.searching.chk[i].value;
			else
				 c_value = document.searching.chk[i].value;
      }
   }
//alert(c_value);

var url= urlbase + "/getaj.php";
url=url+"?q="+c_value+"&uid="+uid+"&page="+page;
//alert(url);
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
			document.getElementById('loading').style.display = "none";
			document.getElementById('divearly').style.display = "block";
			myString = xmlHttp.responseText;
			//alert(myString);
			document.getElementById("divearly").innerHTML=myString;
	}	
}

function ajhs(str)
{
	//alert(str);
	if(str == 'd1'){hsd = 'di1'; csd = 'sd1'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;CAPACITY'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;CAPACITY';}
	if(str == 'd2'){hsd = 'di2'; csd = 'sd2'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;LOCATIONS (MANHATTAN)'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;LOCATIONS (MANHATTAN)';}
	if(str == 'd3'){hsd = 'di3'; csd = 'sd3'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;LOCATIONS (OTHER)'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;LOCATIONS (OTHER)';}
	if(str == 'd4'){hsd = 'di4'; csd = 'sd4'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;EVENT TYPE'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;EVENT TYPE';}
	if(str == 'd5'){hsd = 'di5'; csd = 'sd5'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;SPECIAL FEATURES'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;SPECIAL FEATURES';}
	if(str == 'd6'){hsd = 'di6'; csd = 'sd6'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;TAGS'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;TAGS';}
	if(str == 'd7'){hsd = 'di7'; csd = 'sd7'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;TRUST RATING'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;TRUST RATING';}
	if(str == 'd8'){hsd = 'di8'; csd = 'sd8'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;USER RATINGS'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;USER RATINGS';}
	if(str == 'd9'){hsd = 'di9'; csd = 'sd9'; dioff = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;MY PLACES'; dion = '<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;MY PLACES';}
	
	if(document.getElementById(hsd).style.display == 'block')
	{
		
		document.getElementById(hsd).style.display = 'none';
		document.getElementById(csd).innerHTML=dioff;
	}
	else
	{	
		
		document.getElementById(hsd).style.display = 'block';
		document.getElementById(csd).innerHTML=dion;
	}
	
	if((document.getElementById('di1').style.display == 'block')&&(document.getElementById('di2').style.display == 'block')&&(document.getElementById('di3').style.display == 'block')&&(document.getElementById('di4').style.display == 'block')&&(document.getElementById('di5').style.display == 'block')&&(document.getElementById('di7').style.display == 'block')&&(document.getElementById('di8').style.display == 'block')&&(document.getElementById('di6').style.display == 'block')&&(document.getElementById('di9').style.display == 'block'))
	{
		document.getElementById('ddlj').style.display = 'inline';
		document.getElementById('ddss').style.display = 'none';
	}
	
	if((document.getElementById('di1').style.display == 'none')&&(document.getElementById('di2').style.display == 'none')&&(document.getElementById('di3').style.display == 'none')&&(document.getElementById('di4').style.display == 'none')&&(document.getElementById('di5').style.display == 'none')&&(document.getElementById('di7').style.display == 'none')&&(document.getElementById('di8').style.display == 'none')&&(document.getElementById('di6').style.display == 'none')&&(document.getElementById('di9').style.display == 'none'))
	{
		document.getElementById('ddlj').style.display = 'none';
		document.getElementById('ddss').style.display = 'inline';
	}
	//&&(document.getElementById('di6').style.display == 'block')&&(document.getElementById('di6').style.display == 'none')
}

function adg(str){
	if(str == 'c')
	{
		document.getElementById('di1').style.display = 'none';
		document.getElementById('di2').style.display = 'none';
		document.getElementById('di3').style.display = 'none';
		document.getElementById('di4').style.display = 'none';
		document.getElementById('di5').style.display = 'none';
		document.getElementById('di6').style.display = 'none';
		document.getElementById('di7').style.display = 'none';
		document.getElementById('di8').style.display = 'none';
		document.getElementById('di9').style.display = 'none';
		document.getElementById('sd1').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;CAPACITY';
		document.getElementById('sd2').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;LOCATIONS (MANHATTAN)';
		document.getElementById('sd3').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;LOCATIONS (OTHER)';
		document.getElementById('sd4').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;EVENT TYPE';
		document.getElementById('sd5').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;SPECIAL FEATURES';
		document.getElementById('sd6').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;TAGS';
		document.getElementById('sd7').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;TRUST RATING';
		document.getElementById('sd8').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;USER RATINGS';
		document.getElementById('sd9').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/plus_icon.gif />&nbsp;MY PLACES';
		document.getElementById('ddlj').style.display = 'none';
		document.getElementById('ddss').style.display = 'block';
		document.getElementById('ddlj1').style.display = 'none';
		document.getElementById('ddss1').style.display = 'block';
	}
	else
	{
		document.getElementById('di1').style.display = 'block';
		document.getElementById('di2').style.display = 'block';
		document.getElementById('di3').style.display = 'block';
		document.getElementById('di4').style.display = 'block';
		document.getElementById('di5').style.display = 'block';
		document.getElementById('di6').style.display = 'block';
		document.getElementById('di7').style.display = 'block';
		document.getElementById('di8').style.display = 'block';
		document.getElementById('di9').style.display = 'block';
		document.getElementById('sd1').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;CAPACITY';
		document.getElementById('sd2').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;LOCATIONS (MANHATTAN)';
		document.getElementById('sd3').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;LOCATIONS (OTHER)';
		document.getElementById('sd4').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;EVENT TYPE';
		document.getElementById('sd5').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;SPECIAL FEATURES';
		document.getElementById('sd6').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;TAGS';
		document.getElementById('sd7').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;TRUST RATING';
		document.getElementById('sd8').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;USER RATINGS';
		document.getElementById('sd9').innerHTML='<img src='+urlbase+'/sites/all/themes/greatperformances/images/minus_icon.gif />&nbsp;MY PLACES';
		document.getElementById('ddlj').style.display = 'block';
		document.getElementById('ddss').style.display = 'none';	
		document.getElementById('ddlj1').style.display = 'block';
		document.getElementById('ddss1').style.display = 'none';	
	}
}
function qcl(){
	//alert(document.searching.chk.length);
	for (j = 0; j < document.searching.chk.length; j++)
			{
				document.searching.chk[j].checked = false;
			}
}

function show(str,page){
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
		
	var url= urlbase + "/getajax.php";
	url=url+"?q="+str+"&page="+page;	
	//alert(url);
	qcl();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function fndvnu(str,page){
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	//var str = document.getElementById("findvn").value;	
	var url= urlbase + "/fndvn.php";
	url=url+"?a="+str+"&page="+page;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ajj(uid,str,name,op){
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var str = str.replace(/##/, "''");
	//var str = document.getElementById("findvn").value;	
	var url= urlbase + "/ajj.php";
	url=url+"?q="+uid+"&st="+str+"&name="+name+"&op="+op;
	//alert(url);
	xmlHttp.onreadystatechange=blockChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function blockChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
			document.getElementById("userstate").innerHTML=xmlHttp.responseText;
	}	
}

function fav(str,page){
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
		
	var url= urlbase + "/fav.php";
	url=url+"?q="+str+"&page="+page;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}