/*
 * JS.Celulosa
 * By Martin Prado 
 * Mootools Framework JS - AlienTools API
 */


//Funciones Al cargar la Pagina
window.addEvent('domready', function(){
	//Bordes redondeados								 	
	borderRound();
	//Cabezal Dinamico
	//headerRandom();
	
	startList();

});


//Injerta en la div que queremos los bordes los bordes superiores e inferiores
function borderRound(){
	var divRedondeadas =  $$('div.border');
	divRedondeadas.each(function(ladiv){					 
		var BorderTop = createBorderSup();			 	
	  	BorderTop.injectInside(ladiv);
		var BorderBottom = createBorderInf();			 	
	  	BorderBottom.injectInside(ladiv);	

	});
}

//Borde Superior
function createBorderSup(){	
	var div = new Element('div', {
		'class': 'top'    
	});
	new Element('b').injectInside(div);
	return div;
}

//Borde Inferior
function createBorderInf(){
	var div_bottom = new Element('div', {
		'class': 'bottom'    
	});
	new Element('b').injectInside(div_bottom);
	return div_bottom;
}

//Cabezal Dinamico
function headerRandom(){
	//array con las clases del cabezal
	var headers = new Array();
	headers = ['forestal', 'pulpa', 'papel', 'madera', 'dist'];
	//
	$('dynamic').addClass(headers[$random(0, 4)]);
}


//sukerfish en IE6
startList = function() {
if (document.all&&document.getElementById) {
	navRoot = $("menu");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
			node.onmouseover=function() {
				this.className+=" over";
		  }
  		node.onmouseout=function() {		
  		this.className=this.className.replace(" over", "");
	}
   }
  }
 }
}

//Firma SOJO
function ES_firma() {
			//No esta Funcionando la Pagina de soho que se deberia desplegar
			
         //direccion = "http://www.soho.com.uy/soho_win.asp?Sitio=" + document.title;
         //window.open(direccion,'SohoWin','width=299,height=203');
        }
		
