// JavaScript Document

var globals;

function hide_body() {
	try {
		var hide = true;
		if (0 in arguments) hide = arguments[0];
		if (document.body) {
			if (hide) document.body.style.visibility = 'hidden';
			else document.body.style.visibility = 'visible';
		}
	} catch(e) { return false; }
}

function init() {
	try {
		if (!jCore.loaded()) return false;
		jCore.apps.client_css.set_widths([780, 980, 1180, 1380, 1580, 1880]);
		jCore.apps.client_css.load_file('/styles/themes/' + jCore.globals.site.theme);
		hide_body(false);
		//Legacy - to be removed with new widget app
			widget_inc();
			widget_content_inc();
		return true;
	} catch(e) { return true; }
}

try {
	var jCore = new jBase();
	jCore.apps.require('client_css');
	jCore.globals.site = new Object();
	jCore.globals.lang = new Object();
	
	// Defaults
	jCore.globals.site.width = 620;
	
		//Legacy - to be removed with new widget app
		jCore.globals.widget = new Object();
		jCore.globals.site.width = 620;
		jCore.globals.widget.style_dir = '/styles/widget/';
		jCore.globals.widget.include_dir = '/scripts/widget/';
		jCore.globals.widget.theme = 'default';
	
} catch(e) { }

var globals = new Object();

drop_down_IE = function() {
	var li_elements = document.getElementById("dropdownmenu").getElementsByTagName("LI");
	for (var i=0; i<li_elements.length; i++) {
		li_elements[i].onmouseover=function() {
			this.className+=" IE_hover";
		}
		li_elements[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" IE_hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", drop_down_IE);

var mark_recurso_links = function (class_name) {
	try {
		if (typeof(class_name) != 'string' || !class_name.length) class_name = 'sel';
		var uri = document.location + '';
		if (typeof(uri) != 'string') return false;
		var links = document.getElementsByTagName('a');
		for (count in links) {
			if (links[count].href == uri) {
				links[count].className += ' ' + class_name;
				links[count].setAttribute('class', links[count].getAttribute('class') + ' ' + class_name);
				links[count].onclick = recurso_onclick;
			}
		}
		return true;
	} catch(e) { return false; }
}
