
var included_files = new Array();

function include_dom(script_filename) {
    var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', script_filename);
    html_doc.appendChild(js);
    return false;
}

function include_once(script_filename) {
    if (!in_array(script_filename, included_files)) {
        included_files[included_files.length] = script_filename;
        include_dom(script_filename);
    }
}

function in_array(needle, haystack) {
    for (var i = 0; i < haystack.length; i++) {
        if (haystack[i] == needle) {
            return true;
        }
    }
    return false;

}

function launchMailer(e) {
	var target = YAHOO.util.Event.getTarget(e);
	
	if (target.options[target.selectedIndex].value != "") {
		window.location = target.options[target.selectedIndex].value;
	}
}

window.onload = function() {
	YAHOO.util.Event.addListener( document.getElementsByTagName('select'), 'change', launchMailer );
}

include_once('../scripts/js/yui/yahoo-min.js');
include_once('../scripts/js/yui/event-min.js');