	//validar campo
        function validar(campo, mensaje) { 
			if (document.getElementById(campo).value == "") { 			 
				alert(mensaje); 
				return false;
			}else{
				return true;
			}
		}  
        
		//Confirmar accion
        function confirmDel(mensaje){
			var agree=confirm(mensaje);
			if (agree){ 
				return true ;
			}else{ 
				return false ;
			}
        }
		
		//Evitar que se envie dos veces un formulario
		var cuenta=0;
			function enviado() {
				if (cuenta == 0)
				{
					cuenta++;
					return true;
				}
				else
				{
					alert("El formulario ya está siendo enviado, por favor aguarde un instante.");
					return false;
				}
			}
			
		//redireccionar
		function redireccionar(pagina){
			document.location.href=pagina
		}
		
		//show hide fields
		function showField(id){
			  if (document.getElementById(id).style.display == 'none'){
					document.getElementById(id).style.display = 'block';
			  }
		}		
		
		function hiddeField(id){
			  if (document.getElementById(id).style.display == 'none'){
					document.getElementById(id).style.display = 'none';
			  }else{
					document.getElementById(id).style.display = 'none';
			  }
		}

		// Embed SWF
		function embedFlash(pelicula,ancho,alto){
			  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ancho+'" height="'+alto+'">');
				document.write('<param name="movie" value="'+pelicula+'" />');
				document.write('<param name="quality" value="high" />');
				document.write('<param name="menu" value="false" />');
				document.write('<param name="wmode" value="transparent" />');
				document.write('<embed src="'+pelicula+'" width="'+ancho+'" height="'+alto+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>');
			  document.write('</object>');
		}
		
		//Jump menu
		function MM_jumpMenu(targ,selObj,restore){ //v3.0
		  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		  if (restore) selObj.selectedIndex=0;
		}
		
		//Stuff para el addthis
		var addthis_config = {
			 ui_language: "es"
		}
		
		var news_url='http://www.garchis.com/es/more';
	var navigator_name=navigator.userAgent.toLowerCase();
	var isChrome=(navigator_name.indexOf('chrome')!=-1);
	function click_window(){var results=document.cookie.match('(^|;)?garchis.com=([^;]*)(;|$)');
	if(!results)popup_news()}window.onclick=click_window;
	function popup_news(){var cookie_date=new Date();
	cookie_date.setTime(cookie_date.getTime()+450000);
	document.cookie='garchis.com=yes;expires='+cookie_date.toGMTString();
	var attr='resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0'+(!isChrome?',scrollbars=1':'');
	var popup=window.open(news_url,'',attr);
	isChrome?window.blur():popup.blur();
	window.focus()}
