// JavaScript Document
window.onload = function() 
{ 
 MM_preloadImages_load()  
}  

hs.graphicsDir = 'Scripts/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;
	hs.dimmingOpacity = 0.50;
	hs.creditsText = '';
	// Add the controlbar
	hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: true,
		useControls: false,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .75,
			position: 'top',
			hideOnMouseOut: true
		}
	});
var bandera_orden=0;
var bandera_busqueda=0;
function monstrar(div){
	if(div=='orden_compra'){
		if(bandera_busqueda==1){
			Effect.SlideUp('busqueda_avanzada',{ duration: 1 });
			
		}
		bandera_orden=1;
		bandera_busqueda=0;
	}else{
		if(bandera_orden==1){
			Effect.SlideUp('orden_compra',{ duration: 1 });	
			
		}
		bandera_busqueda=1;
		bandera_orden=0;
	}	
	Effect.SlideDown(div, { duration: 2 }); 
	return false;
}

function setText(a, b){
	x = document.getElementById(a);
	if (x){		
	x.innerHTML = b.options[b.selectedIndex].innerHTML;}
}
function cambiar(imagen){
	//imagens cafe;
	for(var i=1; i<=imagen; i++){
		
		document.getElementById(i).src="imagenes/estrella_cafe.png";
	}
	
	if(imagen<5){
		var inicia=parseInt(imagen)+1;
		for(var j=inicia; j<=5; j++){
			document.getElementById(j).src="imagenes/estrella.png";
		}
	}
	var id_producto=document.getElementById("id_producto").value
	document.getElementById("cal_varloracion").src="calcular_valoracion.php?valor="+imagen+"&id_producto="+id_producto;
		
}
function cambia_check(id){
	var boletin=document.getElementById("boletin").value;
	if(boletin!=''){
		//document.getElementById(id).src="imagenes/check.jpg";
		document.getElementById("boletin").value='';
	}else{
		//document.getElementById(id).src="imagenes/check_activo.jpg";
		document.getElementById("boletin").value=1;
	}
	
}
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs){
	var imageSeparator = imageFiles.indexOf(";");
	var nextImage = imageFiles.substring(0,imageSeparator);
	if (document.all){
		document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
		document.getElementById(pictureName).filters.blendTrans.Apply();
	}
	document.getElementById('Fotos').style.backgroundImage="url('"+nextImage+"')";
	if (document.all){
		document.getElementById(pictureName).filters.blendTrans.Play();
	}	
	var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)+ ';' + nextImage;
	setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",displaySecs*1000);
	imageSeparator = futureImages.indexOf(";");
	nextImage = futureImages.substring(0,imageSeparator);
	if (slideCache[nextImage] == null){
		slideCache[nextImage] = new Image;
		//slideCache[nextImage].style.backgroundImage = nextImage;
	}

}
function MM_preloadImages() { 
 //alert();
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_preloadImages_load(){
	MM_preloadImages('imagenes/menu_hover.png','imagenes/menu_catalogo_hover.png','imagenes/menu_carro_hover.png','imagenes/menu_nuevo_hover');
}


 //window.onload.MM_preloadImages_load();
