// JavaScript Document

$(document).ready(function(){
	try {
		$("#slider").easySlider();
	} catch(oError) {
	}
	
	prepareNewsLinks(document.getElementById("bloc-esquerre"));
	try {
		prepareNewsLinks(document.getElementById("bloc-dret"));
	} catch(oError) {
	}
});


/**
*
*/
function prepareNewsLinks(oContainer) {
	
	aElements = oContainer.getElementsByTagName("div");
	
	for(i=0; i<aElements.length; i++) {
		var oElem = aElements[i];
		var sClass = "";
		
		if (oElem.className == "noticia") {
			sClass = "noticia";
		} else if (oElem.className == "cronica") {
			sClass = "cronica";
		}
		
		if (sClass != "" && oElem.className == sClass) {
			oElem.onmouseover = function() {
				this.className = sClass + " cool-item-sel";
				this.style.cursor = "pointer";
				notLink = this.getElementsByTagName("a")[0];
				this.getElementsByTagName("a")[0].style.textDecoration = "underline";
			}
			
			oElem.onmouseout = function() {
				this.className = sClass;
				this.getElementsByTagName("a")[0].style.textDecoration = "none";
			}
			
			oElem.onclick = function() {
				window.location = this.getElementsByTagName("a")[0].href;
			}
		}
	}

	
}

