	var its;
	var browserName = '';
	var browserNameLong = '';
	var browserNew = '';
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.ff = ua.indexOf('firefox') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
				var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
				this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ff) {
			browserName = "Firefox";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		browserNameLong = browserName + its.major;
	}

	function createObject(imgName,imgSrc) {
		if (loadingFlag) {
			eval(imgName + ' = new Image()');
			eval(imgName + '.src = "' + imgSrc + '"');
			return imgName;
		}
	}

	function changeImage(layer,imgName,imgObj) {
		if (preloadFlag) {
			if (browserNew) {
				document.getElementById(imgName).src = eval(imgObj+'.src');
			}
			if ((!browserNew) && (browserName == "NS") && (layer!=null)) {
				eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
			}
			else {
				document.images[imgName].src = eval(imgObj+'.src');
			}
		}
	}

	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if ((browserNew) || (browserName == "IE")) {
			if (browserNew) {
				links = document.getElementsByTagName("a");
			}
			else {
				links = document.all.tags("a");
			}
			for(i=0; i<links.length; i++) {
				links[i].onfocus = unblur
			}
		}
		if (browserName == "IE") {
			if (browserNew) {
				drops = document.getElementsByTagName("select");
			}
			else {
				drops = document.all.tags("select");
			}
			for(i=0; i<drops.length; i++) {
				drops[i].onfocus = unblur
			}
		}
	}

	function antispam(name,domain) {
    	document.location = "mailto:" + name + "@" + domain;
	}
	
	function checkMenu(menuId) {
		theMenu = menuId + "Nav";
		theTrigger = menuId + "Trigger";
		if (menuStates[theMenu]) {
			menuSwitcher(theTrigger,theMenu,'off');
			menuStates[theMenu] = false;
		}
		else {
			menuSwitcher(theTrigger,theMenu,'on');
			menuStates[theMenu] = true;
			resetNavs(menuId);
		}
	}
	
	function menuSwitcher(trigger,menuId,param) {
		if (browserNew) {
			d = document.getElementById(menuId);
			dt = document.getElementById(trigger);
			if (param=="on") {
				d.style.display = 'inline';
				dt.style.backgroundImage = 'url(/_img/menu/sub_open.gif)';
				dt.style.backgroundColor = '#CCCCCC';
				dt.style.color = '#000000';
			}
			else {
				d.style.display = 'none';
				dt.style.backgroundImage = 'url()';
				dt.style.backgroundColor = '';
				dt.style.color = '';
			}
		}
		else {
			d = document.all[menuId];
			d.className = param;
			dt = document.all[trigger];
			dt.className = 'back'+param;
		}
	}
	
	function resetNavs(menuId) {
		for (i=0; i<submenuNumb; i++) {
			if (menuNames[i]!=menuId) {
				theMenu = menuNames[i] + "Nav";
				theTrigger = menuNames[i] + "Trigger";
				menuStates[theMenu] = false;
				if (browserNew) {
					d = document.getElementById(theMenu);
					dt = document.getElementById(theTrigger);
					d.style.display = 'none';
					dt.style.backgroundImage = 'none';
					dt.style.backgroundColor = '';
					dt.style.color = '';
				}
				else {
					d = document.all[menuId];
					d.className = 'off';
					dt = document.all[theTrigger];
					dt.className = 'backoff';
				}
			}
		}
	}
	
	function searchOptions(param) {
		if (browserNew) {
			d = document.getElementById('opBusquedaDiplay');
			dt = document.getElementById('opOcultar');
			ds = document.getElementById('opMostrar');
			if (param=="on") {
				d.style.display = 'inline';
				dt.style.display = 'inline';
				ds.style.display = 'none';
			}
			else {
				d.style.display = 'none';
				dt.style.display = 'none';
				ds.style.display = 'inline';
			}
		}
		else {
			d = document.all['opBusquedaDiplay'];
			d.className = param;
			dt = document.all['opOcultar'];
			dt.className = param;
			ds = document.all['opMostrar'];
			if (param=="offBusc") {
				ds.className = 'on';
			}
			else {
				ds.className = 'off';
			}
		}
	}
	
	divVars = new Array();
	
	function showDiv(divId) {
		if(!divVars[divId]) {
			divVars[divId] = true;
			param = 'on';
		}
		else {
			divVars[divId] = false;
			param = 'off';
		}
		if (browserNew) {
			d = document.getElementById(divId);
			if (param=="on") {
				d.style.display = 'inline';
			}
			else {
				d.style.display = 'none';
			}
		}
		else {
			d = document.all[divId];
			d.className = param;
		}
	}
	
	function checkSearchForm(form){
		var keywords = form.keywords.value;
		if (keywords==null || keywords=="") {
			alert("Debe ingresar un criterio de búsqueda.");
			return false;
		}
		else if (keywords.length<3) {
			alert("El criterio de búsqueda debe ser de mas de dos letras.");
			return false;
		}
		else {
			return true;
		}
	}
	
	function randNum(num) {
		var now = new Date();
		var rand = Math.round(num * Math.cos(now.getTime()));
		if (rand < 0) rand = - rand; 
		return rand;
	}