	Event.observe(window, 'load', function() {   

		var url		= 'ajax.detalle-productos.php';
		var params	= 'flag=productos&id='+$('id').value;
		
		new Ajax.Request(url, {
			method: 'get', parameters: params,
			onSuccess: function(transport) {
				if(transport.responseText.length > 0){
					$('recibeDatos').update(transport.responseText);
				}
			}
		});

		Event.observe($('divCargaProductos'), 'click', function(e) {

			var url		= 'ajax.detalle-productos.php';
			var params	= 'flag=productos&id='+$('id').value;
			
			new Ajax.Request(url, {
				method: 'get', parameters: params,
				onSuccess: function(transport) {
					if(transport.responseText.length > 0){
						$('recibeDatos').update(transport.responseText);
					}
				}
			});

		});
		
		if (document.getElementById('divCargaNoticias'))
		{
			Event.observe($('divCargaNoticias'), 'click', function(e) {
			
				var url		= 'ajax.detalle-productos.php';
				var params	= 'flag=noticias&id='+$('id').value;

				new Ajax.Request(url, {
					method: 'get', parameters: params,
					onSuccess: function(transport) {
						if(transport.responseText.length > 0){
							$('recibeDatos').update(transport.responseText);
						}
					}
				});

			});
		
		}
		
		
	}); 



