//-----------------------------------------------------------------------------
// INI. Ajax Core Function
//
			function CreateXmlHttpObj() {
				try {
					XmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e) {
					try	{
						XmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
					} 
					catch(oc) {
						XmlHttpObj = null;
					}
				}
					
				if(!XmlHttpObj && typeof XMLHttpRequest != "undefined") {
					XmlHttpObj = new XMLHttpRequest();
				}
			}
//
// FIN. Ajax Core Function
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------

			function SendMail() {

					cadenaEnvio = '/sys_sendinfo.php?';

					var formulario = document.getElementById('formulario');

					for (var i=0; i<formulario.length; i++) {
							var elemento = formulario.elements[i].name;
							var valor = formulario.elements[i].value;

							if (valor.replace(' ', '') != '') {
								cadenaEnvio += elemento + '=' + formulario.elements[i].value + '&';
							} 
							
					}

					CreateXmlHttpObj();
					
					if(XmlHttpObj) {	
						XmlHttpObj.onreadystatechange = function () {
							if (XmlHttpObj.readyState == 1) {				
								document.getElementById('theForm').innerHTML='<br /><h1>Contacto</h1><br /><p><br /><br /><img src=\"/img/fixed/loading_mini.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;Enviando datos...</p>';
							}

							if(XmlHttpObj.readyState == 4) {

								if(XmlHttpObj.status == 200) {			
									document.getElementById('theForm').innerHTML= XmlHttpObj.responseText;
								}
								else {
									alert("Código de error: "  + XmlHttpObj.status);
								}
							}
						}
//						document.getElementById('mailOK').value = controlEmail;

						XmlHttpObj.open("POST", cadenaEnvio, true );
						XmlHttpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
						XmlHttpObj.send('');		
					}

				

			}

//-----------------------------------------------------------------------------



//------------------------Lista Noticias

function LoadList(lang,optype,year,month,event,opcode,id){
		
		if (year!='' && month!='')
		{
			var elem = document.getElementsByTagName("*");
			for (var i = 0; i < elem.length; i++) {
				var classes = elem[i].className;
				if (classes=='active')
				{
					elem[i].setAttribute("class", "normal");
				}
			}
			document.getElementById(year+month).setAttribute("class", "active");
		}

		cadenaEnvio = '/sys_newsList.php?lang='+ lang + '&ot=' + optype + '&oc=' + opcode + '&m=' + month + '&y=' + year + '&evid=' + event + '&id=' + id;

		var msg = 'Cargando lista de noticias...';

		if (id!='')
		{
			var msg = 'Cargando noticia...';
		}

		CreateXmlHttpObj();
					
		if(XmlHttpObj) {	
			XmlHttpObj.onreadystatechange = function () {
				if (XmlHttpObj.readyState == 1) {				
					document.getElementById('newsList').innerHTML='<div class="contenido news"><p><br /><br /><img src=\"/img/fixed/loading_mini.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;'+msg+'</p></div>';
				}

				if(XmlHttpObj.readyState == 4) {

					if(XmlHttpObj.status == 200) {			
						document.getElementById('newsList').innerHTML= XmlHttpObj.responseText;
					}
					else {
						alert("Código de error: "  + XmlHttpObj.status);
					}
				}
			}
//						document.getElementById('mailOK').value = controlEmail;

			XmlHttpObj.open("POST", cadenaEnvio, true );
			XmlHttpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			XmlHttpObj.send('');		
		}



}


//========================================================================

function ShowMenu(id){
	var Menu = document.getElementById(id);

	if (Menu != 'null')
	{

		if (Menu.style.display == 'none') {
			Menu.style.display = 'block';
		}else{
			Menu.style.display = 'none';
		}
	}
}
