/*
layout dinamico
por http://www.particletree.com
---------------------------*/
function dynamicLayout(){
    var browserWidth = getBrowserWidth();
	//alert(browserWidth);
    //Load Thin CSS Rules
    if (browserWidth < 800){
        changeLayout("thin");
		cambiaNoticias(true);
    }
    //Load Wide CSS Rules
    if ((browserWidth >= 800) && (browserWidth <= 950)){
        changeLayout("wide");
		cambiaNoticias(true);
    }
    //Load Wider CSS Rules
    if (browserWidth > 950){
        changeLayout("wider");
		cambiaNoticias(false);
    }
}
function getBrowserWidth(){
    if (window.innerWidth){
        return window.innerWidth;}  
    else if (document.documentElement && document.documentElement.clientWidth != 0){
        return document.documentElement.clientWidth;    }
    else if (document.body){return document.body.clientWidth;}      
        return 0;
}
function changeLayout(newLayout) {
  document.body.className = newLayout;
}
addEvent(window, 'load', dynamicLayout);
addEvent(window, 'resize', dynamicLayout);
/*
COmentarios
------------------------------------*/
function checkRequired()
{
	//alert("aaa");
	var aut = document.getElementById("author").value;
	var email = document.getElementById("email").value;
	if(aut == "" || email == ""){
		alert("Deja tus datos!");return false;
	}
	return true;
}
/*
Saca noticias de menu y las pone bajo artículos
---------------------------------------------------------------------*/
function cambiaNoticias(inte)
{
	var nots = document.getElementById("noticias");
	var content = document.getElementById("content");
	if(inte && !document.getElementById("noticias2"))//pone noticias bajo artículos
	{
		nots2 = nots.cloneNode(true);
		nots2.id = "noticias2";
		content.appendChild(nots2);
		//nots.parentNode.removeChild(nots);
	}
	else
	{
		if(nots2 = document.getElementById("noticias2"))
		{
			nots2.parentNode.removeChild(nots2);
		}
	}
}