function mailing() {

	var active_color = '#000'; // Colour of user provided text
	var inactive_color = '#999'; // Colour of default text
 
    var default_values = new Array();
    $$("input.default-value").each( function (s) {
        $(s).setStyle({ color: inactive_color });
        $(s).observe( 'focus', function () {
            if (!default_values[s.id]) {
                default_values[s.id] = s.value;
            }
            if (s.value == default_values[s.id]) {
                s.value = '';
                $(s).setStyle({ color: active_color });
            }
            
            $(s).observe( 'blur', function () {
                if (s.value == '') {
                    $(s).setStyle({ color: inactive_color });
                    s.value = default_values[s.id];
                }
            });
            
        });
    });
}


function activateSubmit() {
	Event.observe('mailingJoin', 'submit', formSubmit);
	
	var button = $$("input.mailSubmit");
	for (i=0; i < button.length; i++){
		Event.observe(button[i], 'click',function(event){ formSubmit(event)});
	}
	
}

function formSubmit(event){
	document.forms['mailingJoin'].submit();
}


function getOutsideLinks(){
	var outsideLinks = $$("a.external");
	for (i=0; i < outsideLinks.length; i++){
		Event.observe(outsideLinks[i], 'click',function(event){ launchLink(event)});
	}
}


function launchLink(event){
	Event.stop(event);
	var link = Event.element(event);
	window.open(link);
}



