/////////////////////////////////////
ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

//////////////////////////////////////////
function menuRapido(url){
	//alert(url);
	if (url != ""){
		location.href=url;
	}		
}

/////////////////////////////////////////////////////
//                     SCROLL                      //
/////////////////////////////////////////////////////

var loop = true;
var direction = "up";
var speed = 15;
var timer1 = null;

function scroll(dir,spd){
	
    direction = dir;
    speed = spd;    
    
    if (ie4){var page = texto.style;}
    if (ns4){var page = document.textoclip.document.texto;}
    
    var y_pos = parseInt(page.top);
    
    if(loop == true){
        if(direction == "dn"){
            page.top = (y_pos-(speed));
            clearTimeout(timer1);
            timer1 = setTimeout("scroll(direction,speed)", 1);
            
        } 
        else if(direction == "up"  && y_pos < 0){        	
            page.top = (y_pos+(speed));            
            clearTimeout(timer1);
            timer1 = setTimeout("scroll(direction,speed)", 1);
            
        } 
        else if(direction == "top"){
            page.top = 0;
        }
    }     
}

/////////////////////////////////////////////////////
//           Mudar Imagem  Missa                   //
/////////////////////////////////////////////////////
Nselecao = 'video';
Vselecao = null;

img1 = new Image();
img1.src = "ficcao_b.gif";
img2 = new Image();
img2.src = "video_b.gif";
img3 = new Image();
img3.src = "documento_b.gif";

function mudar(img1,img2,sel){
		
		Vselecao = Nselecao;
		Nselecao = sel;
		
		if (ie4){
			texto.style.top = 0;
			document.imgcima.src= img1;
			document.imgbaixo.src= img2;
			
			document.images[Vselecao].src = Vselecao + '_a.gif';
			document.images[Nselecao].src = Nselecao + '_b.gif';
		
		} 
	
		if (ns4){
			
			document.textoclip.document.texto.top = 0;
			document.imgcimaLyr.document.imgcima.src= img1;
			document.imgbaixoLyr.document.imgbaixo.src= img2;
			
			document.menuLyr.document.images[Vselecao].src = Vselecao + '_a.gif';
			document.menuLyr.document.images[Nselecao].src = Nselecao + '_b.gif';
		} 		
		return Nselecao;
		return Vselecao;
}

/////////////////////////////////////////////////////
//               Over e Out Missa                  //
/////////////////////////////////////////////////////

function mouseover(nomeimg,urlimg){
	
	if (Nselecao != nomeimg){
		if (ie4){
			document.images[nomeimg].src = urlimg;
		}
		
		if (ns4){
			document.menuLyr.document.images[nomeimg].src = urlimg;
		}
	}
	
}

function mouseout(nomeimg,urlimg){
	
	if (Nselecao != nomeimg){
		if (ie4){
			document.images[nomeimg].src = urlimg;
		}
		
		if (ns4){
			document.menuLyr.document.images[nomeimg].src = urlimg;
		}		
	}
}

///////////////////Fim do Script//////////////////
function escrever(id,nestref,url){
		if (ns4){
			var lyr = (nestref)? eval('document.'+nestref+'.document.textoclip.document.'+id) : document.textoclip.document.layers[id];
			lyr.load(url,lyr.clip.width=280);
		}
		else if (ie4) {
			parent.bufferframe.document.location = url;
		}
}
	
function escreverfinal(id){
	if (ie4) document.all[id].innerHTML = parent.bufferframe.document.body.innerHTML;
}
/////////////////////////////////////////////////////