window.addEvent('domready', function(){
	//external links
	$$('a[rel=external]').set('target', '_blank');
	
	//inject a div needed to stop the sticky footer overlapping content
	var wrapper = $('wrapper');
	if(wrapper){
		//create new div element
		new Element('div', {
			'id': 'push',
			'styles': {
			'clear': 'both',
    		'height': '4em'
			}
		}).inject(wrapper, 'bottom');
	}
	
	//inject the print function for javascript users
	//first find email link and if it exists inject the print function next to it
	var email = $$('.email')[0];
	if(email){
		new Element('li', {
			'html': '<a href="#">Print this page</a>',
			'class': 'print',
			'events': {
				'click': function(e){
					new Event(e).stop();
					window.print();
				}
			}
		}).inject(email, 'after');
	}
	
	//improve logo quality in IE6 
	if(Browser.Engine.trident4){
		var logo = $$('.logo')[0];
	
			//get original source path from markup
			var src = logo.get('src');
			//remove actual image src from markup and replace with spacer to stop duplicate display bug
			logo.set('src', "/_common/img/none.gif");
			//set MS filter using the original image src
			logo.setStyle('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')");
	
	}

});
