/*if ($('a.thickbox')[0]) {
	document.write('<script type="text/javascript" src="/js/thickbox.js"></script>');
}*/

$(function(){
	function x(s){return encodeURIComponent(s.replace('http://www.thefutureoftheweb.com/','/'))}var w=window,d=document,s=d.createElement('script');s.src='http://www.thefutureoftheweb.com/log/visit?r='+x(d.referrer)+'&u='+x(w.location.href);d.body.appendChild(s);
	
	if (d.body.clientWidth <= 930)
		$('body').addClass('thin');
	
	$('#secret').val(10).hide();
	$('#secret_label').hide();
	
	var cf = $('form.contact'), cs = $(':submit', cf);
	cf.submit(function(){
		$('p.error', cf).remove();
		cf.addClass('sending');
		cs.attr('disabled', true);
		$.ajax({
			type: 'POST',
			url: this.action,
			data: {
				name: $('[name=name]', cf).val(),
				email: $('[name=email]', cf).val(),
				message: $('[name=message]', cf).val()
			},
			success: function() {
				cf.slideUp(function() {
					var p = $('<p class="ajax-msg">Your message has been sent!<br/><br/><a>Click here to re-edit or send another.</a></p>');
					p.hide().insertBefore(cf).slideDown();
					$('a', p).click(function(){
						p.remove();
						cs.removeAttr('disabled');
						cf.removeClass('sending').slideDown();
					});
				});
				pageTracker._trackPageview('/contact/sent');
			},
			error: function() {
				$('<p style="color:red;font-weight:bold" class="error">Error sending message! Please try again.</p>').appendTo(cf);
				cs.removeAttr('disabled');
				cf.removeClass('sending');
			}
		});
		return false;
	});
	
	$('a[@href^=http]').not('[@href^=http://' + location.host + ']').click(function() {
		pageTracker._trackPageview('/outgoing/' + this.href);
	})
	
	$('a.thickbox').click(function(){ window.open(this.href); return false }); //this.href += '?KeepThis=true&TB_iframe=true'; });
});

try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}