jQuery(
function($) {

    init();
    bindEvents();

    function init() {
        preLoad();
    }

    function preLoad() {
        $(window).bind('load', doLoad);
    }

    function doLoad(e) {
		processHash(location.hash.slice(1));
		bindEvents();
    }

    function bindEvents() {
		$('a[rel*=external]').live('click',openExternals);
		
    }

	function openExternals(e){
		window.open(this.href);
		return false;
	}
	

    function processHash(locationHash) {

        if (locationHash != '') {
	     	switch(locationHash) {
				case 'subscribed':
				loadSuccess();
				break;
			}
        }

    }

	function loadSuccess(data){
		$('#emailSuccess').fadeIn('slow');
		$('#emailSuccess').animate({opacity:0}, {speed:1000,duration:600,queue:'newsletter',scope:'newsletter',preDelay:3000},null,function(){
			$('#emailSuccess').css({display:'none'});
		});
	}
	
});

