function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isOP    = false;  // Opera
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOP = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }

  s = "MSIE";
  if ((i = ua.indexOf(s))) {

	this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
	return;
  }
  
  s = "MSIE 6.0";
  if ((i = ua.indexOf(s))) {

	this.isIE6 = true;
    this.version = parseFloat(ua.substr(i + s.length));
	return;
  }  
}

var browser = new Browser();

function getPageOffsetLeft(el) {

  var x;

  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);

  return y;
}

function abaCarro(abamoto,abacarro,formCarro,formMoto){
var motos = document.getElementById(abamoto);
var carros = document.getElementById(abacarro);
var formMoto = document.getElementById(formMoto);
var formCarro = document.getElementById(formCarro);
/*var imagem_x = "url(img/menu/back_aba_x.gif)"; 	
var imagem = "url(img/menu/back_aba.gif)"; 	
/*	 carros.style.borderBottomStyle="solid";
	 carros.style.borderBottomColor="#CCCCCC";
	 carros.style.borderBottomWidth="1px";	
   	 carros.style.backgroundImage= imagem; 
   
     motos.style.backgroundImage= imagem_x; 
/*	 motos.style.borderBottomStyle="solid";	 
	 motos.style.borderBottomWidth="1px";	 */

 	 formMoto.style.display = "none";
  	 formCarro.style.display = "block";

}

function abaMoto(abamoto,abacarro,formCarro,formMoto){
var motos = document.getElementById(abamoto);
var carros = document.getElementById(abacarro);
var formMoto = document.getElementById(formMoto);
var formCarro = document.getElementById(formCarro);
/*var imagem_x = "url(img/menu/back_aba_x.gif)"; 	
var imagem = "url(img/menu/back_aba.gif)"; 		 
//	 motos.style.borderBottomStyle="none";
//	 motos.style.borderBottomWidth="1px";	
	 motos.style.backgroundImage= imagem;
	  	 
	 carros.style.backgroundImage= imagem_x; 
/*	 carros.style.borderBottomStyle="solid";
	 carros.style.borderBottomColor="#666666";
	 carros.style.borderBottomWidth="1px";	 */
	 

	 
 	 formCarro.style.display = "none";
	 formMoto.style.display = "block";	
}

function getPageOffsetLeft(el) {

  var x;

  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);

  return y;
}

function hover(id){
	navRoot = id;
//	var h=25;
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];	

		if (node.nodeName=="UL") {
			node.style.display="block";
//			alert(node.offsetHeight);
		    h = node.offsetHeight;			

//			x = getPageOffsetLeft(node);
//		    y = getPageOffsetTop(node);
    
//		    w = node.offsetWidth;

		}		
		if (node.nodeName=="IFRAME") {
//			alert(h);
			node.style.visibility = "visible";
			node.style.height = h +"px";
		}		
	}
}


function out(id){
	navRoot = id;
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];	
		if (node.nodeName=="UL") {
			node.style.display="none";
		}		
		if (node.nodeName=="IFRAME") {
			node.style.visibility = "hidden";
		}
	}
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

addClassButton=function(){

	for(var i=0; i < document.getElementsByTagName('input').length; i++){
            if(document.getElementsByTagName('input')[i].type == 'submit'||document.getElementsByTagName('input')[i].type == 'button'){
                document.getElementsByTagName('input')[i].className="button";
                document.getElementsByTagName('input')[i].onmouseover=function() {
						this.className+=" over";
					}	
                document.getElementsByTagName('input')[i].onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}						
            }	
		}

}


addClassRssTitle=function(){

var elem=getElementsByClass("rssTitle",null,"div");
for(var i=0; i < elem.length; i++){
		elem[i].onmouseover=function() { this.className+=" rssTitleOver";}	
        elem[i].onmouseout=function() {	this.className=this.className.replace(" rssTitleOver", "");	}						
		}

}
window.onload=function(){
	addClassButton();
	addClassRssTitle();

}

