
function MEB_add_CSS_patch_to(currentDocument) {

	var link = currentDocument.createElement("link");
	link.setAttribute('type','text/css');
	link.setAttribute('rel','stylesheet');
	link.setAttribute('id','meb_css');
	link.setAttribute('href','http://www.amadeus.net/home/MEB/MEB_patch.css');
	
	currentDocument.getElementsByTagName("head")[0].appendChild(link);
}


function MEB_addLoadEvent(func) {
	
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function MEB_init() {

	var MEB_frame = window.top.frames["MEB_trip_tool_container_frame"] ;

	if(null != MEB_frame) {
		// Meb webapp detected:
		// We had a CSS script tag to the head of the local frame document. This CSS file will hide the language selection block and the help/faq link:
		MEB_add_CSS_patch_to(MEB_frame.frames["contents"].document);
	}
}

MEB_addLoadEvent(MEB_init);
