	$(document).ready(function(){		   
   $('h2, h3, h4, .rounded, .content-left').not('.square').corner('rounded 10px');
   $("h3, h4, h5, h6").not('.no-arrow').addClass('plus').click( function() { $(this).toggleClass('minus').next().slideToggle(500);});
   $('.toggle-hide, h3, h4, h5, h6').not('.no-arrow').next().hide();
 $('#loading').remove();
	var source=getReferrer();
	var broker=getBroker();
	$('#broker').attr('value',broker);
	$('#referrer').attr('value',source);
	$('a[@href^=http],a[@href^=https]').click( function() { newPage="/funnel/"+$(this).attr('href');pageTracker._trackPageview(newPage);});
    $('#please-wait').remove();
	$('body').unload( function() {GUnload();});
	$('#scotland, #wales, #ireland').hide();
$('#home-tab').addClass('active');
$('input[@name=country]').click ( function() {swap="#"+this.value;$('#england, #scotland, #wales, #ireland').hide();$(swap).show();});
 });					
function getReferrer() {
	var referrer="";
	if ($.cookie('source')){referrer=$.cookie('source');}
	else {referrer=setCookie();}
	return referrer;
}
function setCookie(){
	var setReferrer="";
if (document.referrer){setReferrer= document.referrer;}else {setReferrer="direct"}
$.cookie('source', setReferrer);
return setReferrer;
}
function getBroker() {
	var broker="";
	if ($.cookie('ref')){broker=$.cookie('ref'); return broker;} // check for a broker cookie code and set it as the broker and return the code.
	broker = $.query.get('ref');//check for URL broker Referal Code
	if(broker!=""){$.cookie('ref', broker,{ expires: 7 }); return broker;}// if it exists, set it as a cookie and return the code.	
	else {broker="RESET"; $.cookie('ref', broker,{ expires: 7 });}// if no code can be found use the defaut of RESET and set it as a cookie.
	return broker; // Return the broker code
}
var pageName = "LogbookUK.co.uk - Cash loans to drive away with!";
 function popupwindow(page){
	 window.open(page,'popupwindow','scrollbars=yes,resizable=yes,width=700,height=500');
	   googlepage="/funnel/"+page;
   pageTracker._trackPageview(googlepage); 
 }
  function removeSpaces(string) {
 return string.split(' ').join('');
}
function addToFavorites() {
    if (window.sidebar)
	{ // Mozilla Firefox Bookmark
		window.sidebar.addPanel(document.title, location,"");
	} else if (document.all)
	{
		window.external.AddFavorite(location,document.title);
	}
	  pageTracker._trackPageview("/funnel/add-to-favorites.html");
}
function mailpage()
{
  mail_str = "mailto:?subject=Check out www.LogbookUK.co.uk";
  mail_str += "&body=Hello,%0A%0AI think Logbook UK will interest you, so I am sending you this link!%0A%0A";
  mail_str +="Link: "+location.href + "%0A%0ASpeak soon,%0A%0A%0A"; 
  location.href = mail_str;
  	  pageTracker._trackPageview("/funnel/mail-page.html");
}

