window.addEvent('domready', function(){	

	$$('a[rel=external]').set('target', '_blank');
	
	//Twitter bird on the home page
	var homepage = $$('.home')[0];
	if(homepage){
		$('twitterBird').setStyle('background', 'none');

		birdObj = new Swiff('/_common/swf/twitter00.swf', {
			id: 'tweet',
			container: 'twitterBird',
			version: 8,
			width: '100%',
			height: '100%',
			params: {
				wMode: 'transparent'
			}
		});
	}
	
	//Clear newsletter box on click enter
	var email = $$('input#newssignup_txtEmail')[0];
	if(email){
		if(email.value=="Email address"){
			email.addEvent('click', function(event){
				this.value = "";
			});
		}
	}
	
	//Decorative arrow on home page news section
	var homepageNews = $$('div.news')[0];
	if(homepageNews){
		new Element('span', {
		  'class': 'jsarrow'		
			}).inject(homepageNews, 'bottom');
	}
	
	//Decorative arrow on sub nav
	var navSection = $$('ul.navSection ul')[0];
	if(navSection){
		navSection.setStyle('margin-top', '19px');
		new Element('span', {
		  'class': 'jsarrow'		
			}).inject(navSection, 'bottom');
	}

	//Rounded corners for IE only
	if (Browser.Engine.name=='trident') {
		//Homepage Twitter feed
		var homepageTweets = $$('div.tweets p')[0];
		if(homepageTweets){
			new Element('span', {
			  'class': 'jstl'		
				}).inject(homepageTweets, 'bottom');
			new Element('span', {
			  'class': 'jstr'		
				}).inject(homepageTweets, 'bottom');
			new Element('span', {
			  'class': 'jsbr'		
				}).inject(homepageTweets, 'bottom');
			new Element('span', {
			  'class': 'jsbl'		
				}).inject(homepageTweets, 'bottom');
		}
		//Homepage News section
		var homepageNews = $$('div.news')[0];	
		if(homepageNews){
			new Element('span', {
			  'class': 'jstl'		
				}).inject(homepageNews, 'bottom');
			new Element('span', {
			  'class': 'jstr'		
				}).inject(homepageNews, 'bottom');
			new Element('span', {
			  'class': 'jsbr'		
				}).inject(homepageNews, 'bottom');
			new Element('span', {
			  'class': 'jsbl'		
				}).inject(homepageNews, 'bottom');
		}
		//Sub navsection selected ul
		var navSection = $$('ul.navSection ul')[0];		
		if(navSection){
			new Element('span', {
			  'class': 'jstl'		
				}).inject(navSection, 'bottom');
			new Element('span', {
			  'class': 'jstr'		
				}).inject(navSection, 'bottom');
			new Element('span', {
			  'class': 'jsbr'		
				}).inject(navSection, 'bottom');
			new Element('span', {
			  'class': 'jsbl'		
				}).inject(navSection, 'bottom');
		}
		//Sub navsection selected ul
		var navSectioSelected = $$('ul.navSection li.selected a')[0];		
		if(navSectioSelected){
			new Element('span', {
			  'class': 'jstl'		
				}).inject(navSectioSelected, 'bottom');
			new Element('span', {
			  'class': 'jstr'		
				}).inject(navSectioSelected, 'bottom');
			new Element('span', {
			  'class': 'jsbr'		
				}).inject(navSectioSelected, 'bottom');
			new Element('span', {
			  'class': 'jsbl'		
				}).inject(navSectioSelected, 'bottom');
		}
	};
	
});