var estado=0;
$(document).ready(function(){
	$("#menu").hover(function(){$("#effect_menu").fadeIn('slow');},function(){ $("#effect_menu").fadeOut('slow');});	
	$("#marcas").hover(function(){$("#effect_marcas").fadeIn('slow');},function(){ $("#effect_marcas").fadeOut('slow');});	
	$('#carros')
		.click(function(){
			 if(estado==0){
				 $("#marcas").animate({width: "0", opacity: "hide"}, "slow");
			 	 $("#web_contenido").animate({width: "988"}, "slow");
				 $("#flecha_carros").srt="soa"
			  	 estado=1
			 }
			 else{;
			 	$("#marcas").animate({width: "120"}, "slow");
			 	$("#web_contenido").animate({width: "870"}, "slow");
				estado=0;
			 }
		})
    $("#noti").html('<img src="images/index/'+anuncios[aleatorio(0,(anuncios.length)-1)]+'" />');
    $('#top_menu .noSelect')
		.mouseover(function(){
		$(this).css("background-image","url(http://www.ruedaventa.com/images/background/efect_select_menu_over.png)");})
		.mouseout(function(){$(this).css("background-image","");})	
	$(":text",document.formulario).addClass("input_txt");	
	
});
function change_color($id){
		$("#"+$id+"> a").toggleClass("captar");
}
setInterval("change_color('but_tendresuerte')",500);
var anuncios=new Array();
anuncios[0]="cr7.jpg";
anuncios[1]="kingwash.gif";
anuncios[2]="largoCamino.jpg";
anuncios[3]="color2.gif";
anuncios[4]="bbpin.jpg";
anuncios[5]="foxTuning.jpg";
function aleatorio(inferior,superior){ 
    numPosibilidades = superior - inferior 
    aleat = Math.random() * numPosibilidades 
    aleat = Math.round(aleat) 
    return parseInt(inferior) + aleat 
} 
function maximo(obj,e,ma,w) {  
    tecla=(document.all)?e.keyCode:e.which; 
    if(obj.value.length==ma && tecla!=8) 
        return false; 
	 if(obj.value.length>=ma)
		obj.value=obj.value.substr(0,ma);
		resta=ma-(obj.value.length)
		document.getElementById(w).innerHTML=resta;
} 	
       
