var xmlHttpTY;

function RunTimerTY(type)
{
	/*xmlHttpTY=GetXmlHttpObject()
	if (xmlHttpTY==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	
	var url = "ajThankYouPoints.aspx?typ=" + type + "&sid="+Math.random();
	xmlHttpTY.onreadystatechange=getThankYouCheck;		
	xmlHttpTY.open("GET",url,true)
	xmlHttpTY.send("");*/
}

function switchDetailsPanel(dividstr,iconopen,iconclose)
{
	if(document.getElementById(dividstr).style.display == "block"){
		document.getElementById(dividstr).style.display = "none";
	} 
	else 
	{
		document.getElementById(dividstr).style.display = "block";
		//RunTimerTY("d")
	}
}

function GoogleMap(aid,typ)
{	
	//RunTimerTY("m")
	var url = "frmGoogleMapSingle.aspx?aid="+ aid + "&typ="+typ;
	window.open(url,"GoogleMap","width=550,height=550")
}

function getThankYouCheck() 
{ 
	/*var panel = document.getElementById('spThankYou');
	var txtpoints = document.getElementById('txtPointsTY');
	var points = 0;
	var message = "";
	var last = "0";
	var multiple = false;
	
	if (xmlHttpTY.readyState==4 || xmlHttpTY.readyState=="complete")
	{
		if(xmlHttpTY.responseText.length > 0)
		{
			if(xmlHttpTY.responseText.indexOf("4,") != -1)
				last = "4";
			else if(xmlHttpTY.responseText.indexOf("3,") != -1)
				last = "3";
			else if(xmlHttpTY.responseText.indexOf("2,") != -1)
				last = "2";
				
			if(xmlHttpTY.responseText.indexOf("1,") != -1)
			{
				points += 250;
				message += "You have just completed your 1,000th Yellow Page Search.";
				multiple = true;
				panel.style.display = "block";
			
			}
			if(xmlHttpTY.responseText.indexOf("2,") != -1)
			{
				points += 25;
				
				if(multiple)
				{
					message = message.substring(0,message.length-1);
					if(last == "2") message += " and ";
					message += "saved your 25th phone number to your FCN List.";
					
				}
				else
					message += "You have just saved your 25th phone number to your FCN List.";
					
				multiple = true;
				panel.style.display = "block";
			}
			if(xmlHttpTY.responseText.indexOf("3,") != -1)
			{
				points += 10;
				
				if(multiple)
				{
					message = message.substring(0,message.length-1);
					message += ", ";
					
					if(last == "3") message += " and ";
					message += "clicked on the details link for the 100th time.";
				}
				else
					message += "You have just clicked on the details link for the 100th time.";
				
				multiple = true;
				panel.style.display = "block";
			}
			if(xmlHttpTY.responseText.indexOf("4,") != -1)
			{
				points += 10;
				
				if(multiple)
				{
					message = message.substring(0,message.length-1);
					if(last == "4") message += " and ";
					message += "clicked on the map link for the 50th time.";
				}
				else
					message += "You have just clicked on the map link for the 50th time.";
					
				panel.style.display = "block";
			}
			
			if(xmlHttpTY.responseText.indexOf("hide") != -1)
				panel.style.display = "none";
			
			message += " We want to show our appreciation for using our site by giving you ";
			message += points + " FREE POINTS!<br>";
			txtpoints.value = points;
			
			document.getElementById('spTYText').innerHTML = message;
			TYTimer();
		}
		else
			panel.style.display = "none";
	}*/
} 

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)objXMLHttp=new XMLHttpRequest()
	else if (window.ActiveXObject)	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	return objXMLHttp
}

function TYTimer()
{
	/*var sptime = document.getElementById('spTimerTY');
	var txttime = document.getElementById('txtTimerTY');
	var panel = document.getElementById('spThankYou');
	
	if(sptime != null)
	{
		var x = 30;
			
		if(Trim(sptime.innerHTML).length > 0)
			x = Trim(sptime.innerHTML);
		
		x--;
		
		//if(txttime.value.length > 0)
		//{
		//	panel.style.display = "none";
		//	x = 0;
		//}
		
		if(x > 9)
			sptime.innerHTML = x;
		else if(x < 10)
			sptime.innerHTML = "0" + x;
					
		if (x>0)
			setTimeout("TYTimer()",1000);
		else
		{
			txttime.value = "1";
			//panel.style.display = "none";			
		}
	}*/
}
