

function popUp ( foto ) {
	mywindow = window.open('foto.php?src=' + foto, 'mywindow','width=600, height=400; scrollbars=0, status=0, toolbar=0,menubar=0,resizable=0');
}

function clientesTicker (z) {
	arels = new Array("AENA", "ANTENA3", "PRC", "PP", "IU", "PSOE", "KPMG", "TELEFONICA", "AYUNTAMIENTO", "AYTO_NAVALCARNERO", "FCC", "LAST");
	if (z == undefined) z = 0;
	if (z < arels.length) { 
	    cliente = arels[z];
		setTimeout("$('clientes_t').innerHTML = '<img src=\"new_clientes/LOGO_' + cliente + '.jpg\"/><br/>';", 500);
		setTimeout("Effect.Appear('clientes_t', {duration: 0.5});", 1000);
		setTimeout("Effect.Fade('clientes_t', {duration: 0.5})",2000);
		setTimeout("clientesTicker(" + (z + 1) + ")",2000);
	} else {
		setTimeout("clientesTicker(0)",0);
	}
}

function showHideAreasdepre ( area ){
	if ($('area_' + area).style.display == 'none') {
		Effect.BlindDown ('area_' + area);
//		$('area_' + area).style.display = '';
	} else {
		Effect.BlindUp ('area_' + area);
	}
}

function showHideAreas ( area ){
	for (i = 1; i <= 6; i++) {
		if ($('area_' + i).style.display == 'none' && area == i) {
			Effect.BlindDown ('area_' + i, {duration: 1});
	//		$('area_' + area).style.display = '';
		} else {
			Effect.BlindUp ('area_' + i, {duration: 1});
		}
	}
}


function getUrl ( url ) {
//	$('contentTd').style.height = 1000;
	location.href=url;
/*	Effect.Fade('mainContent', { duration: 0.2 });
//	setTimeout("Effect.Appear('loader', { duration: 0.2 })", 200);
	setTimeout("pageLoader('"+ url+"')", 500);*/
}

function pageLoader (url) {
	var randNum = Math.floor(Math.random()*9823476982374928374);
	var myRequest = new Ajax.Request ('components/' + url + '?' + randNum, { 
		method:'get', 
		onFailure: function (transport) {
			var responseText = "<br/><br/><table width='500' border='0' cellpadding='20' cellspacing='1' bgcolor='CCCCCC' align='center'>  <tr>    <td height='300' align='center' bgcolor='F6F6F6' class='m_text'><p><img src='images/warning_big.gif' width='100' height='88'></p>    <p><b>No se pudo completar la operaci&oacute;n.<br>      Vuelva a intentarlo pasados unos instantes.</b>      </p></td>  </tr></table>";
//			Effect.Fade('loader', { duration: 0.2 });
			$('mainContent').innerHTML = responseText;
			setTimeout('Effect.Fade(\'mainContent\', { duration: 0.2 })', 200);	
		},
		onSuccess: function(transport) {
//			Effect.Fade('loader', { duration: 0.2 });
			$('mainContent').innerHTML = transport.responseText;
			setTimeout('Effect.Appear(\'mainContent\', {duration: 0.2})', 200);
		}
	})
}

function sendMail () {
	if (validateStandard($('form1'), 'error')) {
		msg = 	"nombre=" + $('nombre').value + "" +
				"&email=" + $('email').value + "" + 
				"&msg=" + $('msg').value;
//		alert(msg);
		$('layercontacto').style.display = '';
		$('sendbutton').disabled = true;
		var myRequest = new Ajax.Request('executables/run.contacto.php', {
			method: 'post',
			parameters: msg, 
			onSuccess: function (transport) {
				if (transport.responseText == '1') {
					$('sendertd').innerHTML = 'Su  mensaje fue enviado con éxito.<br/>Gracias por su colaboraci&oacute;n';
				} else {
					$('sendertd').innerHTML = "<img src='images/warning_med.gif' width='50' height='44'></p>    <p style='color:red'>Hubo un error y no se pudo completar la operaci&oacute;n.<br>      Vuelva a intentarlo pasados unos instantes.";
				}
			}
		})
	}
}

/*function drawInterface () {
	$('mainContent').style.display = 'none';
	setTimeout('Effect.Fade(\'loader\', {duration: 0.2})', 100);
	setTimeout('Effect.Appear(\'menu\', {duration: 0.2})', 200);
//	setTimeout('Effect.Appear(\'noticias\', {duration: 0.2})', 200);
	setTimeout('Effect.Appear(\'mainContent\', {duration: 0.2})', 200);
}*/
	
	