function RecordClick(info_id, type, link_id)
{
	//ISF-TM 2010-03-13
	//see record_click.php for documentation related to this function.
	
	var xmlhttp;

	//alert(info_id+" "+type+" "+link_id);

	//check which browser
	if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	else 
		if (window.ActiveXObject) // code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		else
			alert("Your browser does not support XMLHTTP!");
		//endif
	//endif
	
	//set function to receive the results from the server --- we don't need this in this case
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			//alert(xmlhttp.responseText);
			//document.getElementById('elementname').value=xmlhttp.responseText;
		}
	}

	//Send the request to the server
	xmlhttp.open("GET","http://www.stokepages.co.uk/record_click.php?info_id="+info_id+"&type="+type+"&link_id="+link_id,true);
	xmlhttp.send(null);
}	

function commonSearchCheckFields()
{
	if (document.commonSearchForm.name.value=="" || document.commonSearchForm.location.value=="")
	{
		alert("Please enter a Company Name, the full or partial Postcode or full or partial location/address.");
		return false;
	}
	return true;
}

function goback() 
{
  history.go(-1);
}
	
function bookmarksite(title, url){
  if (url==''){
    url = document.location;
  }
  if (document.all)
    window.external.AddFavorite(url, title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
}
  
function socialbookmark(socialsite){
  url = document.location;    
  switch (socialsite){
    
    case 'reddit':
      document.location = 'http://reddit.com/submit?url='+url;
      break;
    
    case 'delicious':
      document.location = 'http://del.icio.us/post?url='+url;
      break;        
      
    case 'stumbleupon':
      document.location = 'http://www.stumbleupon.com/submit?url='+url;
      break;
      
    case 'digg':
      document.location = 'http://digg.com/submit?url='+url;
      break;
      
    case 'facebook':
      document.location = 'http://www.facebook.com/sharer.php?u='+url;
      break;
  }
}

/*
$(document).ready(function() {
  $('a#searchLink').mouseover(function() {
    var a = document.getElementById('searchImage').src;
    alert(a)
  });
});
*/

$(function(){
  $('#layerMoreLinks').aqLayer({clone:true,closeBtn:true,attach:'nw',offsetY:-130,offsetX:0});
	$('#popMoreLinks').click(function() { $('#layerMoreLinks').aqLayer('show') });
});