function js_load () {
	js_menu ();
	if ($('portada')) {
		js_rotator ();
		js_diarios ();
	}
}
function js_menu () {
	$('menu').getLast ().setStyle ('border', 'none');
	if (Browser.Engine.webkit || Browser.Platform.mac) $$('#menu>li>a').setStyle ('padding', '4px 18px 5px 18px');
	$$('#menu ul').forEach (function (oUl) {
	    oUl.set ('tween', { 'link': 'cancel'});
        oUl.mostrar = function () { this.tween ('height', [this.getStyle ('height'), this.scrollHeight]); };
		oUl.ocultar = function () { this.tween ('height', [this.scrollHeight, (Browser.Engine.trident4 ? 0 : 0)]); };
		oUl.getParent ().set ('events', {
			'mouseenter': function () { this.getLast ().mostrar (); },
			'mouseleave': function () { this.getLast ().ocultar (); }
		});
	});
}
function js_rotator () {
	var swf = new Swiff ('audiovisual/imagerotator.swf', {
		id: 'swfrotator',
		width: 169,
		height: 93,
		params: {
			wmode: 'opaque',
			bgcolor: '#000000'
		},
		vars: {
			file: 'imagerotator.php?l='+ $$('html')[0].getProperty ('xml:lang'),
			transition: 'fade',
			overstretch: false,
			displayheight: 93,
			rotatetime: 3
		}
	});
	swf.replaces ($('imgrotator'));
}
function js_diarios () {
	$$('#portdiarios a').set ({
		'styles': { 'opacity': 0.6 },
		'events': {
			'mouseenter': function () { this.fade (0.99); },
			'mouseleave': function () { this.fade (0.6); }
		}
	});
}


if (window.addEvent) window.addEvent ('domready', js_load);