function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
	this.DOM   = (document.getElementById);
}

var is = new Is();

if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
} else if(is.ie4) {
    doc = "document.all";
    sty = ".style";
    htm = ""
}

var loop      = true;
var direction = "up";
var speed     = 10;
var timer1    = null;

function scroll(dir, spd) {
    direction = dir;
    speed = spd;

	var page = getObjectById("content", true);
	var panel = getObjectById("scrollPanel", true);

	if (page) {
		panel.position = "relative";
		var pos = parseInt(page.top);

		if(direction == "dn") {
			page.top = (pos-(speed));

			if (loop == true) {
				clearTimeout(timer1);
				timer1 = setTimeout("scroll(direction, speed)", 1);
			}
		} else if(direction == "up" && pos < 0) {
			page.top = (pos+(speed));
			if (loop == true) {
				clearTimeout(timer1);
				timer1 = setTimeout("scroll(direction, speed)", 1);
			}
		} else if(direction == "top") {
			page.top = 0;
		}
		if (is.ie) panel.position = "static";
	}
}

var SCROLL_DEFAULT_ID = 1;
var last_selection    = SCROLL_DEFAULT_ID;
var last_object       = null;

function updatescrollcontent(id, o) {
	if (!id) id = SCROLL_DEFAULT_ID;

	var page = getObjectById("content");
	var content = getObjectById("cnt" + id);

	if (page && content) {
		page.innerHTML = content.innerHTML;
		scroll("top");

		img_curr = eval("document.seta" + id);

		img_last = null;
		if (last_selection) 
			img_last = eval("document.seta" + last_selection);
		last_selection = id;
		
		if (img_last) img_last.src = "img/0.gif";
		if (img_curr) img_curr.src = "img/seta1.gif";
		
		if (o) {
			o.className = "submenuo";
			if (last_object) last_object.className = "submenu";
		}
		last_object = o;
	}
}


var LOGO_ID = 1;

function updatelogo(id) {
	if (!id) id = LOGO_ID;

	var page = getObjectById("logos");
	var content = getObjectById("logo" + id);

	if (page && content) {
		page.innerHTML = content.innerHTML;
	}
}
