function objetoAjax(){ 
  var xmlhttp=false; 
  try { 
   // Creación del objeto ajax para navegadores diferentes a Explorer 
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) { 
   // o bien 
   try { 
     // Creación del objet ajax para Explorer 
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { 
     xmlhttp = false; 
   } 
  } 

  if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 
   xmlhttp = new XMLHttpRequest(); 
  } 
  return xmlhttp; 
} 

//inicializa los componentes
//insertion: Insertion.Top

function init(){
	Element.hide('vspace1');
	Element.show('vspace1');
}

function loadPage(opc){
	new Ajax.Updater('contenido', '/vialphp/pages/t_'+opc+'.php', {
				method: 'post',
				asynchronous:true, 
				evalScripts:true,
				onLoading: showLoad,
				onComplete: showResponse
	});
}

function loadMail(){
	new Ajax.Updater('contenido', '/email/contact.php', {
				method: 'post',
				asynchronous:true, 
				evalScripts:true,
				onLoading: showLoad,
				onComplete: showResponse
	});
}

function showLoad() {
	Element.hide('contenido');
	Element.show('loading');
}

function showResponse(originalRequest) {
	setTimeout('wait()', 500);
	//$('load').style.display = 'none';
	//var newData = originalRequest.responseText;
	//$('contenido').innerHTML = newData;
}

function wait () {	
	Element.hide('loading');
	Element.show('contenido');
}