
	//show flashs
	function showswf(flash, w, h)
	{
		var fswf = flash.split("?")[0];
		var fvars = flash.split("?")[1];
		var swfHTM ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownloadocument.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'">';
		swfHTM +='<param name="movie" value="'+fswf+'" /><param name="quality" value="high" /><param name="flashvars" value="'+fvars+'" /><param name="AllowScriptAccess" value="always" />';
		swfHTM += '<param name="wmode" value="transparent" />';
		swfHTM +='<embed wmode="transparent" src="'+fswf+'" flashvars="'+fvars+'" AllowScriptAccess="always" quality="high" width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		document.write (swfHTM);
	}
	
	//#banners	
	function expandirBanner(d,bnLargura,bnAltura,ContemVideo) {   
	document.getElementById(d).style.width = bnLargura+'px'; // expanded width
  	document.getElementById(d).style.height = bnAltura+'px'; // expanded height  
	document.getElementById(d).style.display = "block";
	document.getElementById(d).style.zIndex = 3;
	
	if(ContemVideo==1)
	{document.getElementById('player').style.visibility = 'hidden';
	}

	
 	}   

	function fecharBanner(d,bnLargura,bnAltura,ContemVideo) {   
	document.getElementById(d).style.display = "block";
	document.getElementById(d).style.width = bnLargura+'px'; // expanded width
  	document.getElementById(d).style.height = bnAltura+'px'; // expanded height  
	document.getElementById(d).style.zIndex = 1;
	
	if(ContemVideo==1){
	document.getElementById('player').style.visibility = 'visible';
	}

	//function zindex(d){document.getElementById(d).style.zIndex = 1;}
	//setTimeout(function(){zindex(d)},300);
	}
	
/*<![CDATA[*/
 	function inputfocus() {
	document.getElementById('nome').focus();
	document.getElementById('seu_nome').focus();
	document.getElementById('pesquisar').focus();
	document.getElementById('titulo').focus();
	}
	/*
	window.onload = function() {
	inputfocus();
	}
	*/
/*]]>*/

//hide and show
set = function(field, val1, val2)
{
    if (field.value == val1) field.value = val2;
}

/* HILITE_INPUT: ADD EFFECT FOCUS/BLUR TO THE SPECIFIED ELEMENT
 * el: AN FORM ELEMENT
 * bgf: ONFOCUS BACKGROUND COLOR
 * bgb: ONBLUR BACKGROUND COLOR
 */

hilite_input = function( el, bgf, bgb ){
	if( !el ){ return; }
	if( !el.style ){ return; }
	v = ['text', 'password'];
	if( el.tagName == 'INPUT' && !in_array(el.type, v) ){ return; }
	switch(el.tagName){
		case 'TEXTAREA':
		case 'SELECT':
		case 'INPUT':
			addon_event( el, 'onfocus', function(){ el.style.backgroundColor = bgf; } );
			addon_event( el, 'onblur', function(){ el.style.backgroundColor = bgb; } );
			break;
		default: return;
	}
}



/* HILITE_FORM: ADD EFFECT FOCUS/BLUR TO THE SPECIFIED FORM
 * el: AN FORM
 * bgf: ONFOCUS BACKGROUND COLOR
 * bgb: ONBLUR BACKGROUND COLOR
 */
 hilite_form = function( el, bgf, bgb ){
 	if( !el ){ return; }
	if( el.tagName != 'FORM' ){ return; }
	for( i = 0; i < el.elements.length; i++){ hilite_input( el.elements[i], bgf, bgb ); }
}

/* HILITE_TABLE: HIGHLIGHTS TABLE ROWS IF CLASS ISN'T NOHILITE
 */
hilite_table = function( id, on, out ){
	if( !document.getElementById && !document.getElementsByTagName ){ return; }
	table = document.getElementById( id );
	if( !table ){ return; }
	rows = table.getElementsByTagName('tr');
	for( i = 0; i < rows.length; i++ ){
		r = rows[i];
		if( r.className != 'nohilite' ){
			overfunc = get_source(r.onmouseover, 'this.style.backgroundColor = "' + on + '";');
			r.onmouseover = overfunc;
			outfunc = get_source(r.onmouseout, 'this.style.backgroundColor = "' + out + '";');
			r.onmouseout = outfunc;
		}
	}
}


error = function(fld, message)
{
    alert(message);
    fld.focus();
    return false;
}

get_element = function(id)
{
    doc = arguments.length == 2? arguments[1] : document;
    
    if (document.getElementById) { return doc.getElementById(id) }
    else if (document.all) { return doc.all[id]; }
    else if (document.layers) { return doc.layers[id]; }
}

hide = function()
{
    els = arguments;

    for (i = 0; i < els.length; i++) {
        el = get_element(els[i]);
        if (el) el.style.display = 'none';
    }
}

show = function()
{
    els = arguments;

    for (i = 0; i < els.length; i++) {
        el = get_element(els[i]);
        if (el) el.style.display = 'block';
    }
}


//hide_all

function hide_all()
	{
	hide('positivo','negativo','no-permition','embed','link');
	}


//addFavorite
function addFav(){
	var url="http://brasilcaminhoneiro.com.br/";
	var title="Brasil Caminhoneiro";
	if (window.sidebar) window.sidebar.addPanel(title, url,"");
	else if(window.opera && window.print){
		var mbm = document.createElement('a');
		mbm.setAttribute('rel','sidebar');
		mbm.setAttribute('href',url);
		mbm.setAttribute('title',title);
		mbm.click();
	}
	else if(document.all){window.external.AddFavorite(url, title);}
	
	
}


//addHomePage
		function setHomepage()
		{
		if (document.all)
			{
				document.body.style.behavior='url(#default#homepage)';
		  		document.body.setHomePage('http://www.brasilcaminhoneiro.com.br');
			}
			else if (window.sidebar)
			{
			if(window.netscape)
			{
				 try
		    {  
					netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
				 }  
				 catch(e)  
				 {  
			alert("Por padrão o Firefox possui está opção bloqueada, retorne e escolha a opção permitir, ou pressione Ctlr + D de seu teclado para tornar este site sua página incial.");  
				 }
			} 
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage','http://www.brasilcaminhoneiro.com.br');
		}
		}
		
		
//ESCONDE MOSTRA
function toggle(idx) {
	if (idx == 10 && idx != 21 && idx != 20){
		document.getElementById('escondemostra20').style.display='none'
		document.getElementById('escondemostra21').style.display='none'
		document.getElementById('escondemostra10').style.display=(document.getElementById('escondemostra10').style.display=='none')?'':'none';	
	}
	
	if (idx == 21 && idx != 10 && idx != 20){
		document.getElementById('escondemostra20').style.display='none'
		//document.getElementById('escondemostra10').style.display='none'
		document.getElementById('escondemostra21').style.display=(document.getElementById('escondemostra21').style.display=='none')?'':'none';	
	}
	if (idx == 20 && idx != 21 && idx != 10){
		document.getElementById('escondemostra21').style.display='none'
		//document.getElementById('escondemostra10').style.display='none'
		document.getElementById('escondemostra20').style.display=(document.getElementById('escondemostra20').style.display=='none')?'':'none';	
	}
}
function toggle_perfil(idx) {
document.getElementById('escondemostra'+idx).style.display=(document.getElementById('escondemostra'+idx).style.display=='none')?'':'none';
}

