/* *************************************** JS Document  ***************************************
   **                                  Autor: David Bassa                                    **
   **				     Empresa: MD Software - www.mdsoft.org                               **
   **                                  Fecha: 19/10/2009                                     ** 
   **                               Contacto: adsl@mdsoft.org                                **
   **                                Version: 1.0                                            **
   ******************************************************************************************** */
$(document).ready(function() {
	//Cargamos la css que corresponda según la resolución del monitor como minimo es de 800x600,
	//si es menor carga por defecto la de 800x600, si es mayor de 1280x1024 carga por defecto
	//la de 1280x1024
	if ((screen.width<800) && (screen.height<600)) {  
		$("link").attr({href : "css/style800x600.css"})  
	} 
	if ((screen.width==800) && (screen.height==600)) {  
		$("link").attr({href : "css/style800x600.css"})  
	} 					   
	if ((screen.width==1024) && (screen.height==768)) {  
		$("link").attr({href : "css/style1024x768.css"});
	}  
	if ((screen.width==1280) && (screen.height==1024)) {  
		$("link").attr({href : "css/style1280x1024.css"}) 
	}
	if ((screen.width>1280) && (screen.height>1024)) {  
		$("link").attr({href : "css/style1280x1024.css"}) 
	}
		$(".es").mouseover(function (){
			$('.txtTable').html("Castellano");
		});
		$(".es").mouseout(function (){
			$('.txtTable').html("");
		});
		$(".cat").mouseover(function (){
			$('.txtTable').html("Català");
		});
		$(".cat").mouseout(function (){
			$('.txtTable').html("");
		});
	$("#content").load("inicio-cas.html");	
});

//Funcion que carga AJAX
function nuevoAjax(xmlhttp){

   try {
       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } 
   catch (e) {
       try {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (E) {
          xmlhttp = false;
      }
   }
   if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
      xmlhttp = new XMLHttpRequest();
   }
   return xmlhttp
}
//Funcion que carga la url(pagina) que recive en el div content
function cargarContenido(pagina){
   var contenedor;
   var ajax;
   contenedor = document.getElementById('content');
   ajax = nuevoAjax(ajax);
   ajax.open("GET", pagina, true);
   ajax.onreadystatechange=function() {
      if (ajax.readyState==4) {
         contenedor.innerHTML = ajax.responseText;
      }
   }
   ajax.send(null);
}






