$(document).ready(function(){
$(".rollover").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});
 }
)

$(".rollover").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');	
	}
}


function pop(fuente,nom,an,al){
	ppw = an/2;
	pw = screen.width/2-ppw;

	pph = al/2;
	ph = screen.height/2-pph;

	window.open(fuente,nom,"width="+an+"px,height="+al+"px,top="+ph+",left="+pw+",scrollbars=yes");
}









function popupImg(img){
foto1= new Image();
foto1.src=(img);
Control(img);
}

function Control(img){
if((foto1.width!=0)&&(foto1.height!=0)){
verFoto(img);
}
else{
funcion="Control('"+img+"')";
intervalo=setTimeout(funcion,20);
}
}

function verFoto(img){
	anchom = screen.width/2-320;
	altom = screen.height/2-220;

ancho=foto1.width+20;
alto=foto1.height+20;
cadena="width="+ancho+",height="+alto+",left="+anchom+",top="+altom;
ventana=window.open(img,"",cadena);
}




