$(document).ready(function(){
$(".rollover").hover(
 function() {
  curr = $(this).find("img").attr("src");
  overlen = curr.length;
  over = curr.substr(0, overlen-4);
  over = over+'-hover.jpg';
  $(this).find("img").attr({ src: over});
 },
 function() {
  $(this).find("img").attr({ src: curr});
 }
)

$(".rollover").find("img").each(function(i) {
  temp = this.src;
  prelen = temp.length;
  pre = temp.substr(0, prelen-4);
  pre = pre+'-hover.jpg';
  preload_image_object = new Image();
  preload_image_object.src = pre;
});


$(".rollover2").hover(
 function() {
  curr = $(this).find("img").attr("src");
  overlen = curr.length;
  over = curr.substr(0, overlen-4);
  over = over+'-hover.gif';
  $(this).find("img").attr({ src: over});
 },
 function() {
  $(this).find("img").attr({ src: curr});
 }
)

$(".rollover2").find("img").each(function(i) {
  temp = this.src;
  prelen = temp.length;
  pre = temp.substr(0, prelen-4);
  pre = pre+'-hover.gif';
  preload_image_object = new Image();
  preload_image_object.src = pre;
});

});



function info(load,al){
	ancho = screen.width/2-300;
	alto = screen.height/2-300;

	if(al){
	window.open('detalles.php?moto='+load,'pop','left='+ancho+',top='+alto+',width=630px,height='+al+'px,scrollbars=yes');	
	}else{
	window.open('detalles.php?moto='+load,'pop','left='+ancho+',top='+alto+',width=600px,height=600px,scrollbars=yes');	
	}
}



function info_acc(load,al){
	ancho = screen.width/2-300;
	alto = screen.height/2-300;

	if(al){
	window.open('detalles-acc.php?acc='+load,'pop','left='+ancho+',top='+alto+',width=630px,height='+al+'px,scrollbars=yes');	
	}else{
	window.open('detalles-acc.php?acc='+load,'pop','left='+ancho+',top='+alto+',width=600px,height=600px,scrollbars=yes');	
	}
}
