function postMySelections() {
	if( opener && opener.document.orderForm != null ) {
		opener.document.orderForm.bridge_selections.value = urldecode(document.bridge_form.bridge_selections.value);
		opener.document.orderForm.bridge_selection_uuids.value = document.bridge_form.bridge_selection_uuids.value;
		window.open('', '_parent', '');
		window.close();
	}
	return true;
}
function urldecode(str) {
	// http://kevin.vanzonneveld.net
	// + original by: Philip Peterson
	// + improved by: Kevin van Zonneveld
	// (http://kevin.vanzonneveld.net)
	// * example 1: urldecode('Kevin+van+Zonneveld%21');
	// * returns 1: 'Kevin van Zonneveld!'
	var ret = str;
	ret = ret.replace(/\+/g, '%20');
	ret = decodeURIComponent(ret);
	ret = ret.toString();
	return ret;
}

//Function for showing tooltip
function tooltip(title, message, element, container) {
	if( message.length > 0 && element != null ) {
		
		// format message
		var message_body = '';
		if( title.length > 0 ) {
			message_body += '<div style=\' font-weight: bold;margin-bottom:10px;\'>' + title + '</div>';
		}
		message_body += message;
		
		// check container
		if( container == null ) {
			container = document.body;
		}
		
		// remove tooltip shadow
		YAHOO.widget.Tooltip.prototype.onRender = function () {};
		
		// init tooltip
		var tooltip = new YAHOO.widget.Tooltip("tooltip_"+element, {
															context:element,
															text:message_body,
															width:"300px",
															showdelay:0,
															autodismissdelay:360000,
															hidedelay:0,
															container:container,
															effect:{ effect:YAHOO.widget.ContainerEffect.FADE, duration:0.20 }
		} );
	}
}

tooltip('Email', 'We prefer a valid .edu e-mail, or one from your institution. We ask this to more rapidly provide full access to the readings.', 'email_address_tooltip', 'form-validate');
tooltip('URL of Faculty Directory', 'This page on your university website will list you, your department, your e-mail address, course name, or all of the above.  Simply copy and paste the link into this field.', 'customer_facultyurl_tooltip', 'form-validate');
tooltip('Phone', 'Please enter the University office phone so we can contact you directly or verify your teaching schedule, if needed.', 'customer_phone_tooltip', 'form-validate');
