// JavaScript Document


function EsEmail(str)
{
	//Tipo de direccion: nombre@s-com.com
	var strEmail = /^[a-z][a-z_0-9\.\-]+@[a-z_0-9\.\-]+\.[a-z]{3}$/i
	if (strEmail.test(str) == false)
	{
		//Tipo de direccion: nombre@racsa.co.cr
		strEmail = /^[a-z][a-z_0-9\.\-]+@[a-z_0-9\.\-]+\.[a-z]{2}\.[a-z]{2}$/i
		return strEmail.test(str);
	}
	else
		return true;
}


              function checkdata_contactenos(obj){
				  
						  if(document.frcontacto.name.value ==''){
									alert('Por favor indique su Nombre');
									document.frcontacto.name.focus();
									return false;
								}				
																			
						
						if(document.frcontacto.email.value ==''){
									alert('Por favor indique su e-mail');
									document.frcontacto.email.focus();
									return false;
								}		
						  
						  
						if(document.frcontacto.email.value != ''){
							if (!EsEmail(document.frcontacto.email.value))
								{alert('Por favor indicar un e-mail valido');
								//document.frcontacto.email.value='';
								document.frcontacto.email.focus();
								return false;}
						}	  
						  
						  
						  
						 if(document.frcontacto.consulta.value ==''){
									alert('Por favor indicar su consulta');
									document.frcontacto.consulta.focus();
									return false;
								}
				  
				     return true;
				  }


             function checkdata_noticia_detalle(obj){
												
						save_in_textarea_all();
						 return true;
						document.fr.submit();	 
					   
				}

			<!--
				function checkdata_articulo(obj){
							
						//alert(document.fr.descripcion.value);
						//alert("siiiii**i/*///");
							
						if(document.fr.fecha_visible.value ==''){
							alert('Please fill the fecha_visible');
							document.fr.fecha_visible.focus();
							return false;
						}				
					
						
						
						if(document.fr.detalle.value ==''){
							alert('Please fill the titulo');
							document.fr.detalle.focus();
							return false;
						}				
					
							
						
						save_in_textarea_all();
						 return true;
						document.fr.submit();	 
					   
				}
			




     function sumitir(thisf){
		//alert("entra");
		tmp = eval(thisf);
		
		document.login.submit();
		
		
	}

	
	function do_reload_news(page){
		document.frm.page.value = page;
		document.frm.submit();
	}



function submitfrm_noticia(){				   				   
			//alert("entra");
			document.frm.submit();																		
	}
	
	
	
function displaySubs(the_sub){
	 if (document.getElementById(the_sub).style.display==""){
	   document.getElementById(the_sub).style.display = "none";return
  }
  //for (i=0;i<subs_array.length;i++){
	//   var my_sub = document.getElementById(subs_array[i]);
	 //  my_sub.style.display = "none";
	// }
  document.getElementById(the_sub).style.display = "";
}



function Cambio(numero)
				{  
					tmp = eval(numero);
					//tmp2 = eval('Imagen' + numero);										
					if (tmp.className == "contraido")
						{tmp.className = "expandido"; 
						//tmp2.src = 'img/contraido.gif';
						}
					else
						{tmp.className = "contraido";
						//tmp2.src = 'img/expandido.gif';
						}
				}
