		
	function llama(d)
	{
		switch(d)
		{
			case 'inicio':
				//window.location.href='/';
				loadUrl('/');
				break;
			case 'empresa':
				//window.location.href='/es/empresa.html';
				loadUrl('/es/empresa.html');
				break;
			case 'servicios':
				//window.location.href='/es/servicios.html';
				loadUrl('/es/servicios.html');
				break;
			case 'proyectos':
				//window.location.href='/es/proyectos.html';
				loadUrl('/es/proyectos.html');
				break;
			case 'portafolio':
				//window.location.href='/es/portafolio.html';
				loadUrl('/es/portafolio.html');
				break;
			case 'sugerencias':
				//window.location.href='/es/sugerencias.html';
				loadUrl('/es/sugerencias.html');
				break;
			case 'contacto':
				//window.location.href='/es/contacto.html';
				loadUrl('/es/contacto.html');
				break;
			case 'actualidad':
				//window.location.href='/es/noticias.html';
				loadUrl('/es/noticias.html');
				break;				
		}
	}
	
	function irUrl(d)
	{
		switch(d)
		{
			case 'Tw': 
				window.open("http://twitter.com/SICSolutions", this.target); 
				break;
			case 'In': 	
				window.open("http://es.linkedin.com/pub/SICSolutions/18/a12/b5", this.target); 
				break;
			case 'Fa': 	
				window.open("http://www.facebook.com/pages/SIC-Solutions/217342561138", this.target); 
				break;
			case 'Pw': 
			case 'pw':
				//window.location.href="/es/diseno-paginas-web-mallorca.html";
				loadUrl('/es/diseno-paginas-web-mallorca.html');
				break;
			case 'To':
			case 'to':
				//window.location.href="/es/mantenimiento-equipos-informaticos.html";
				loadUrl('/es/mantenimiento-equipos-informaticos.html');
				break;					
			case 'Sf':
			case 'sf':
				//window.location.href="/es/desarrollo-aplicaciones-web.html";
				loadUrl('/es/desarrollo-aplicaciones-web.html');
				break;
			case 'Im':
			case 'im':
				//window.location.href="/es/diseno-imagen-corporativa.html";
				loadUrl('/es/diseno-imagen-corporativa.html');
				break;
			case 'concocenos':
				document.getElementById('dcompabus').style.display = '';
				document.getElementById('dcompint').style.display = 'none';
				document.getElementById('dcompwus').style.display = 'none';
				break;
			case 'internet':
				document.getElementById('dcompabus').style.display = 'none';
				document.getElementById('dcompint').style.display = '';
				document.getElementById('dcompwus').style.display = 'none';
				break;
			case 'nosotros':
				document.getElementById('dcompabus').style.display = 'none';
				document.getElementById('dcompint').style.display = 'none';
				document.getElementById('dcompwus').style.display = '';
				break;
			default:
				alert(d);
				
		}
	}
	
	function goURL(url)
	{
		window.location.href = url;
	}
			
	function SendForm()
	{
		var obj = document.getElementById('form1');
		if(obj.name.value=='')
		{
			alert('El campo nombre no puede estar vacio');
			return;
		}
		
		if(obj.phone.value=='' && obj.email.value=='')
		{
			alert('Debe facilitarnos un número de teléfono de contacto o una dirección de correo electrónico');
			return;
		}
		if(obj.text.value=='')
		{
			alert('Debe indicarnos el motivo de su consulta');
			return;
		}
		return obj.submit();
	}
		
	function changeport(j)
	{
		for(i=0;i<np;i++)
		{
			d = document.getElementById('port'+i);
			if(j==i)
			{
				d.style.display='';
			}else{
				d.style.display='none';
			}
		}
	}
		
		
	function clickaVideo()
	{
		var req = new Request({
				url: "/include/clickvideo.php",
				method: "post",
				onSuccess: function(html)
				{
			
				}
			});
		req.send();
	}

			
	function loadUrl(url)
	{
		try
		{
			$("content").innerHTML = '<br/><br/><div style="text-align:center"><img src="/images/loading.gif" /></div><br/><br/>';
			$$("body")[0].scrollTo(0,0);
			var req = new Request({
				url: url,
				method: "post",
				data: "ajax=true",
				onSuccess: function(html)
				{
					try					
					{
						var aux = unescape(html);
						aux = aux.replace(/\+/gi," ");
						$("content").innerHTML = aux;
						
						scs = $$("#content script");
						for (i=0; i<scs.length; i++){
							sc = scs[i];
							var etiquetaScript = document.createElement("script");
							document.getElementsByTagName("head")[0].appendChild(etiquetaScript);
							etiquetaScript.text = sc.text;
						}
						InitMultiboxes();
						InitAjaxLinks();						
						var pageTracker = _gat._getTracker("UA-2838120-5");
						pageTracker._trackPageview(url);
					}catch(err){
						goURL(url);
					}
				},
				onFailure: function(){goURL(url);} 
			});
			req.send();
		}catch(err){
			goURL(url);
		}
	}	

	function InitMultiboxes()
	{
		var initMultiBox = new multiBox({
							mbClass: '.mb',
							container: $(document.body),
							descClassName: 'multiBoxDesc',
							useOverlay: true,
							addRollover: false,
							addOverlayIcon: false,
							addChain: false,
							recalcTop: false,
							addTips: true,
							contentColor: 'none',
							autoOpen: 0,
							showNumbers: true,
							showControls: true,
							openFromLink: true,
							relativeToWindow: false
						});	
	}
	
	function InitAjaxLinks()
	{
		links = $$('.licoaj');
		for(i=0;i<links.length;i++)
		{
			l = links[i];
			l.addEvent('click', function(e){
					e.stop()
					loadUrl(this.href);
				}.bind(l));
		}
	}
	
	window.addEvent('domready', function(){
		var initMultiBox = new multiBox({
							mbClass: '.mbln',
							container: $(document.body),
							descClassName: 'multiBoxDesc',
							useOverlay: true,
							addRollover: false,
							addOverlayIcon: false,
							addChain: false,
							recalcTop: false,
							addTips: true,
							contentColor: 'none',
							autoOpen: 0,
							showNumbers: true,
							showControls: true,
							openFromLink: true,
							relativeToWindow: false
						});	
		InitMultiboxes();		
		InitAjaxLinks();
	});	
