/**
 * @author Mario
 */
function cambiarFoto(newimage){
	var imagew=document.getElementById('product-main-image');
	imagew.src= newimage;
	alert(newimage);
}
function getImages(){
	if (!document.images) return;
	var arr = new Array();
	
	for (var i = 0; i < document.images.length; i++) {
		arr[i] = new Image();
		arr[i].src = document.images[i];
	}
	return arr;
}
function cargarimagenes(){

   for(i in imagenes){
     lista_imagenes[i] = new Image();
     lista_imagenes[i].src = imagenes[i];

   }

}
function preCarga() {
var arrr = getImages();
/*if (!document.images) return;
var ar = new Array();
var arguments = preload.arguments;
for (var i = 0; i < arguments.length; i++) {
ar[i] = new Image();
ar[i].src = arguments[i];
}*/
alert(arrr);
return arrr;

} 
function rechange(source,widi,heig){
	document.images['prove'].src=source;
	document.images['prove'].width=widi;
	document.images['prove'].height=heig;
}

function cambiarImagen2(imagennew,tex){
	

	var imagennn = new Image();
	var coeficient;
	var hei;
	var wid;
	imagennn.src= imagennew;
	wid = imagennn.width;
	hei = imagennn.height;
	
	if (imagennn.width >= imagennn.height) {
		coeficient = 288 / wid;
		imagennn.width = 288;
		imagennn.height = parseInt(hei * coeficient);
	
		
	}else{
		coeficient = 285 / hei;
		imagennn.height = 285;
		imagennn.width = parseInt(wid * coeficient);
		
	
	}
	
	    document.getElementById("prove").src=imagennn.src;
        document.getElementById("prove").style.height=imagennn.height+"px";
        document.getElementById("prove").style.width=imagennn.width+"px";		
		
	
	document.getElementById('desc').innerHTML=tex;
	
	
}

function cambiarImagen(imagennew,tex){
	

	var imagenn = new Image();
	var coeficient;
	var hei;
	var wid;
	imagenn.src= imagennew;
	wid = imagenn.width;
	hei = imagenn.height;
	
	if (imagenn.width >= imagenn.height) {
		coeficient = 300 / wid;
		imagenn.width = 300;
		imagenn.height = parseInt(hei * coeficient);
	/*	document.images['prove'].width=320;
		document.images['prove'].height=imagennew.height * coeficient;*/
		
	}else{
		coeficient = 285 / hei;
		imagenn.height = 285;
		imagenn.width = parseInt(wid * coeficient);
		
	/*	document.images['prove'].height=240;
		document.images['prove'].width=imagennew.width * coeficient;*/
	}
	//alert(imagenn.width);
		/*
		document.images['prove'].width=imagenn.width;
		document.images['prove'].height=imagenn.height;
		*/
		//document.images['prove'].src='http://www.elizabethwilson.com/loading.gif';
		//document.images['prove'].src='http://www.elizabethwilson.com/images/indicador.gif';
//		document.images['prove'].src=imagenn.src;
		//document.getElementById("prove").style.backgroundImage=imagennew.src; 
		/*document.getElementById("ima").style.height=numero+"px";
        document.getElementById("ima").style.width=numero+"px";*/
//		document.images['prove'].style.height=imagenn.height+"px";
//        document.images['prove'].style.width=imagenn.width+"px";
		//document.images['prove'].style.visibility='visible';
	    document.getElementById("prove").src=imagenn.src;
        document.getElementById("prove").style.height=imagenn.height+"px";
        document.getElementById("prove").style.width=imagenn.width+"px";		
		
	

/*        document.getElementById('prove').innerHTML='<img id="prove" name="prove" src='+imagennew+' />';	*/
	
	document.getElementById('desc').innerHTML=tex;
	/*rechange(imagenn.src,wid,hei);
	/*document.prove.src=image.src;
	document.prove.width=image.width;
	document.prove.height=image.height;*/

	
	
	
}
function initfunct(){
	/*if (document.images){ 
		alert(document.images.length);
	} else {
		alert("No hay imagenes");
	} */
	//var lista_imagenes = new Array('<,? echo $imagesgallery?>'; );
	var lista_imagenes= new Array();
	for(i in array_js_preloader){
     lista_imagenes[i] = new Image();
     lista_imagenes[i].src = array_js_preloader[i];

   }
}
function desactivar(strinput) {
	if (document.getElementById(strinput).disabled == true){
		document.getElementById(strinput).disabled = false;
	}else{
		document.getElementById(strinput).disabled = true;
	}
}
//window.onload = initfunct; 
