Cufon.replace('#greyheadermenu ul li a', { hover: true });
Cufon.replace('.cufon', { hover: true });
Cufon.replace('.pageheader h2', { hover: true });
Cufon.replace('.postheader h2', { hover: true });
Cufon.replace('.postheaderdate', { hover: true });
Cufon.replace('.postheaderauthor', { hover: true });
Cufon.replace('#rightsidewrapper .center', { hover: true });
Cufon.replace('#rightsidewrapper ul li h2', { hover: true });
Cufon.replace('#h3comments', { hover: true });
Cufon.replace('.articledesc h2', { hover: true });
Cufon.replace('.trumpheading', { hover: true });
Cufon.replace('#playlistarchive a', { hover: true });
Cufon.replace('.center h2', { hover: true });
Cufon.replace('.portfoliotitle h2', { hover: true });
Cufon.replace('#konami', { hover: true });

var name = "#top-of-page-link";
var menuYloc = null;
	
$(document).ready(function(){
	menuYloc = parseInt($(name).css("bottom").substring(0,$(name).css("bottom").indexOf("px")))
	$(window).scroll(function () { 
		offset = menuYloc-$(document).scrollTop()+"px";
		$(name).animate({bottom:offset},{duration:500,queue:false});
	});
	
});

twttr.anywhere(function(T) {
	T("#content").hovercards();
	T(".tweet").hovercards();
	T("#subscribe-twitter a").hovercards({
      username: function(node) {
        return node.rel;
      }
    });
}); 

$(function() {

	$(".greyheadersearchbox").Watermark("search me :)")
	$("input.#searchsite404").Watermark("hey, use me!", "#ff8a01");
	$("#commentformauthor").Watermark("Name");
	$("#commentformemail").Watermark("E-mail");
	$("#footer-form-name").Watermark("Username", "#949494")
	$("#footer-form-password").Watermark("Password", "#949494")
		
	var showText="quick reply";
	var hideText="hide";
	var is_visible = false;
	$('.toggle').prev().append('<span class="togglelink"><a href="" title="Quick comment">'+showText+'</a></span>');
	$('.toggle').hide();
	$('.togglelink').click(function() {
		is_visible = !is_visible; $(this).html( (!is_visible) ? showText : hideText);	$(this).parent().next('.toggle').toggle('200'); return false;
	});

	jQuery("input.greyheadersearchbox").textGrow({ pad: 1, min_width: 176, max_width: 325 });
	

	function imageresize() {  
		var contentwidth = $('body').width();  
		if ((contentwidth) < '901'){  
			$("html").removeClass("htmlbgbig").addClass("htmlbgsmall"); 
		} else {  
			$("html").removeClass("htmlbgsmall").addClass("htmlbgbig"); 
		}  
	}  

	imageresize();  
	 
	$(window).bind("resize", function() { imageresize(); });
	
		$('.portfolio-apparel .text').stop().animate({ opacity: '0'  }, { duration: 1 });
	    $('.portfolio-apparel')
        .hover(function() {
            $(this).find('.text').stop().animate({ top: '0', opacity: '1'  }, 'fast');
        }, function() {
            $(this).find('.text').stop().animate({ top: '-30', opacity: '1'  }, 'slow');
        });
 
});
		
var player = null;

function playerReady(obj) {
	player = document.getElementById('aerialplayerswf');
};


function listLoader(plname) {
	thelist = 'http://www.aerialdesign.co.uk/wp-content/plugins/audio/playlist/'+plname+'/'+plname+'.xml';
	player.sendEvent('LOAD', thelist);
	window.setTimeout('playDelay()',300);
};

function playDelay() {
	player.sendEvent('PLAY', 'true');
};

if ( window.addEventListener ) {
		var konamiLoop = 'no';
        var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
        window.addEventListener("keydown", function(e){
                kkeys.push( e.keyCode );
                if ( kkeys.toString().indexOf( konami ) >= 0 )
        			$("#footer-logo").stop().animate({ top: '-4000px' }, { duration: 30000 });
        }, true);
}

$(document).ready(function() {
	
		Cufon.replace('#footer-thanks', { hover: true, textShadow: '#000000 2px 2px 10px' });
				
		$("#footer-logo-hover").animate({opacity: '0'}, { duration: 0});
		$("#footer-logo").hover(function(){
			$(this).stop().animate({ top: '-65px' }, { duration: 100 });	
			$(this).find('div').stop().animate({ opacity: '1'}, { duration: 100});	
		},function(){
			$(this).stop().animate({ top: '-60px' }, { duration: 200 });	
			$(this).find('div').stop().animate({ opacity: '0' }, { duration: 500});
		});
		
		$("#subscribe div div").animate({opacity: '0'}, { duration: 0});
		$("#subscribe > div").hover(function(){
			$(this).find('div').stop().animate({ opacity: '1'}, { duration: 150});	
		},function(){
			$(this).find('div').stop().animate({ opacity: '0' }, { duration: 300});
		});

		$("#showwork p a img, .content a img").hover(function(){
			$(this).stop().animate({ opacity: '0.85'}, { duration: 100});	
		},function(){
			$(this).stop().animate({ opacity: '1' }, { duration: 300});
		});		
		
		$("#footer-blurb-links a").hover(function(){
			$(this).stop().animate({ top: '+3px', color: '#ffffff' }, { duration: 100 });	
		},function(){
			$(this).stop().animate({ top: '0', color: '#6a6a6a' }, { duration: 300 });	
		});

		$("#footer-outside-links a").animate({opacity: '0.6'}, { duration: 0});
		$("#footer-outside-links a").hover(function(){
			$(this).stop().animate({ opacity: '1' }, { duration: 100 });	
		},function(){
			$(this).stop().animate({ opacity: '0.6' }, { duration: 300 });	
		});	

		$("#greyheaderlogo").hover(function(){
			$(this).stop().animate({ opacity: '0.6', top: '+1px' }, { duration: 100 });	
		},function(){
			$(this).stop().animate({ opacity: '1', top: '0' }, { duration: 300 });	
		});		

		$("#footer-ads-holder a").hover(function(){
			$(this).stop().animate({ color: '#ff8a00' }, { duration: 100 });	
		},function(){
			$(this).stop().animate({ color: '#949494' }, { duration: 300 });	
		});		
		
	});