var bindMenu = function() {
	$('menu1').childElements().each(function(child) {
		var ul = child.down('ul');
 		if (ul) {
			ul.hide();
		    var hideSubMenu = function() { ul.hide(); };
     		var showSubMenu = function() { ul.show(); };			
 			child.observe('mouseover', showSubMenu);
			child.observe('mouseout', hideSubMenu);
 		}
	});
}

function doIframe(){
	//$$('iframe.autoHeight').each(function(ifrm) {
//		setHeight(ifrm);
//		Event.observe(ifrm, 'load', doIframe.bindAsEventListener(this));	
//	});
	setHeight($('my-iframe'));
	Event.observe($('my-iframe'), 'load', doIframe.bindAsEventListener(this));	
	
}



function setHeight(e){
	if(e.contentDocument){
		e.height = e.contentDocument.body.offsetHeight;
	} else {
		e.height = e.contentWindow.document.body.scrollHeight;
	}
	$('my-iframe').stopObserving();
}


//var startUp = function() {	
//	bindMenu();
//	doIframe();
//}
Event.observe(window, 'load', doIframe);	
document.observe ('dom:loaded', bindMenu);
