window.status="Programacion UTN - FRA" 

var nombre=0;
var email=0;
var asunto=0;
var mensaje=0;

function Chat()
{
	window.open('chat_java.php','','width=557,height=307');
}

function Vaciar(cual)
{
	if (cual=="nombre" && nombre == 0)
	{
		FormEmail.nombre.value="";
		nombre=1;
	}
	
	if (cual=="email" && email == 0)
	{
		FormEmail.email.value="";
		email=1;
	}
	
	if (cual=="asunto" && asunto == 0)
	{
		FormEmail.asunto.value="";
		asunto=1;
	}
	
	if (cual=="mensaje" && mensaje == 0)
	{
		FormEmail.mensaje.value="";
		mensaje=1;
	}
}

function enviarEmail() 
{ 
	if (ValidaDatosEmail())
			FormEmail.submit();
} 

function EnviarRecomendacion() 
{ 
	if (ValidaDatosRecomendacion())
			FormRecomendacion.submit();
} 

function ValidaDatosRecomendacion()
{
	if (FormRecomendacion.nombre_emisor.value == "")
	{
		alert("Nombre inválido !! Por favor, reingreselo.")
		FormRecomendacion.nombre_emisor.focus();
		return (false)        
	}        
	
	if (FormRecomendacion.nombre_receptor.value == "")
	{
		alert("Nombre inválido !! Por favor, reingreselo.")
		FormRecomendacion.nombre_receptor.focus();
		return (false)        
	}        

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FormRecomendacion.email_emisor.value))
	{
	}
	else
	{
		alert("Direccion de e-mail inválida !! Por favor, reingresela.")
		FormRecomendacion.email_emisor.focus();
		return (false)
	}
	
	if (FormRecomendacion.email_emisor.value == "")
	{
		alert("Direccion de e-mail inválida !! Por favor, reingresela.")
		FormRecomendacion.email_emisor.focus();
		return (false)
	}        
	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FormRecomendacion.email_receptor.value))
	{
	}
	else
	{
		alert("Direccion de e-mail inválida !! Por favor, reingresela.")
		FormRecomendacion.email_receptor.focus();
		return (false)
	}
	
	if (FormRecomendacion.email_receptor.value == "")
	{
		alert("Direccion de e-mail inválida !! Por favor, reingresela.")
		FormRecomendacion.email_receptor.focus();
		return (false)
	}        
					
	return true;
}

function ValidaDatosEmail()
{
	if (FormEmail.nombre.value == "")
	{
		alert("Nombre inválido !! Por favor, reingreselo.")
		FormEmail.nombre.focus();
		return (false)        
	}        
	
	if (FormEmail.nombre.value == "Escriba aqui su nombre")
	{
		alert("Nombre inválido !! Por favor, reingreselo.")
		FormEmail.nombre.focus();
		return (false)        
	}        

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FormEmail.email.value))
	{
	}
	else
	{
		alert("Direccion de e-mail inválida !! Por favor, reingresela.")
		FormEmail.email.focus();
		return (false)
	}
	
	if (FormEmail.email.value == "Escriba aqui su email")
	{
		alert("Direccion de e-mail inválida !! Por favor, reingresela.")
		FormEmail.email.focus();
		return (false)
	}        

	if (FormEmail.asunto.value == "")
	{
		alert("Asunto inválido !! Por favor, reingreselo.")
		FormEmail.asunto.focus();
		return (false)        
	}        

	if (FormEmail.mensaje.value == "")
	{
		alert("Mensaje inválido !! Por favor, reingreselo.")
		FormEmail.mensaje.focus();
		return (false)        
	}        
	
	if (FormEmail.mensaje.value == "Escriba aqui su mensaje y luego presione el boton enviar.")
	{
		alert("Mensaje inválido !! Por favor, reingreselo.")
		FormEmail.mensaje.focus();
		return (false)        
	}        
					
	return true;
}

function MenuOpcion(opcion) 
{ 
	switch(opcion) 
	{ 
		case "Principal"    : location.href = "inicio.php";             break; 
	    case "Teoricos"     : location.href = "categorias.php?id=1";    break;
        case "Manuales"     : location.href = "manuales.php";           break;
	    case "Ejercicios"   : location.href = "ejercicios.php";         break;
	    case "Codigo"       : location.href = "codigo.php";             break;
        case "Compiladores" : location.href = "compiladores.php";       break;
	    case "Consultas"    : location.href = "consultas.php";          break;
        case "Links"        : location.href = "links.php";              break;
	    case "Fechas"       : location.href = "fechas.php";             break;
	    case "Busqueda"     : location.href = "busqueda.php";           break;
	    case "Contacto"     : location.href = "contacto.php";           break;
	    case "Foro"         : location.href = "foro/index.php";         break; 
		case "Chat"         : location.href = "chat.php";               break; 
		case "SubirArchivo" : location.href = "upload_form.php";        break; 
		case "MisArchivos"  : location.href = "upload_misarchivos.php"; break; 
	}  
}

function AgregarFavoritos()
{
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) 
	{
		var url="http://www.programacionutn.com.ar/";
		var titulo="Programacion UTN-FRA";
		window.external.AddFavorite(url,titulo);
	}
	else 
	{
		if(navigator.appName == "Netscape") 
			alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks");
	}
}

function LmOver(elem, bfilename)
{
	elem.background = "images/"+bfilename;
	elem.children.tags('a')[0].style.color = "#7E93AA";
}

function LmOut(elem, bfilename)
{
	elem.background = "images/"+bfilename;
	elem.children.tags('a')[0].style.color = "#FFFFFF";
}

function LmDown(elem, bfilename)
{
	elem.background = "images/"+bfilename;
	elem.children.tags('a')[0].style.color = "#7E93AA";
}

function LmUp(path)
{
	location.href = path;
}

var highlighting, theobject;

function high(which2)
{
    theobject=which2;
    highlighting=setInterval("highlightit(theobject)",50);
}

function low(which2)
{
    clearInterval(highlighting)

    if (which2.style.MozOpacity)
        which2.style.MozOpacity=0.4
    else
        if (which2.filters)
            which2.filters.alpha.opacity=60
}

function highlightit(cur2)
{
    if (cur2.style.MozOpacity<1)
        cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
    else
        if (cur2.filters&&cur2.filters.alpha.opacity<100)
            cur2.filters.alpha.opacity+=10
        else
            if (window.highlighting)
                clearInterval(highlighting)
}

cellswitch = new Image();
cellswitch.src = "images/navcell-off.gif"

cellswitchB = new Image();
cellswitchB.src = "images/navcell_large-off.gif"
