in_Rotator.restartDelay = 500;

in_Rotator.col=[];

function in_Rotator(name,speed,path,tgt){
	this.name=name;
	this.speed=speed||4500;
	this.path=path||"";
	this.tgt=tgt;this.ctr=0;
	this.timer=0;
	this.imgs=[];
	this.actions=[];
	this.index=in_Rotator.col.length;in_Rotator.col[this.index]=this;
	this.animString="in_Rotator.col["+this.index+"]";
};

in_Rotator.prototype.addImages=function()
{
	var img;
	for (var i=0;arguments[i];i++){
		img=new Image();
		img.src=this.path+arguments[i];
		this.imgs[this.imgs.length]=img;
	}
};

var in_Inf={};

in_Inf.fn=function(v){return eval(v)};

in_Rotator.prototype.addActions=function()
	{
	var len=arguments.length;
	for(var i=0;i<len;i++)this.actions[this.actions.length]=arguments[i];};
	
	in_Inf.gw=in_Inf.fn("window.location");
	in_Inf.ar='Rotator propiedad de Intecna Soluciones, S. L.';

	in_Inf.get=function(ar){
		var s="";
		var ln=ar.length;
		for(var i=0; i<ln; i++){s+=String.fromCharCode(ar[i]);
	}
	
	return s;
};

in_Rotator.prototype.rotate=function(){
	clearTimeout(this.timer);

	this.timer=null;

	if(this.ctr<this.imgs.length-1)this.ctr++;
	else this.ctr=0;

	var imgObj=document.images[this.name];

		if(imgObj&&in_Rotator.ready){
			imgObj.src=this.imgs[this.ctr].src;
			this.timer=setTimeout(this.animString+".rotate()",this.speed);
		}
};


in_Inf.mg=in_Inf.fn('in_Inf.ar');
in_Inf.fn('in_Inf.gw=in_Inf.gw.hostname');
in_Inf.fn('in_Inf.gw=in_Inf.gw.toLowerCase();');

in_Rotator.start=function()
{
	var len=in_Rotator.col.length,obj;

	for(var i=0; i<len; i++){
		obj=in_Rotator.col[i];
		if(obj&&obj.name)obj.timer=setTimeout(obj.animString+".rotate()",obj.speed);
	}
};

in_Rotator.doClick=function(n){
	var obj=in_Rotator.col[n];
	if(!document.images||!obj)return true;
	if(obj.actions&&obj.actions[obj.ctr]){
		if(typeof obj.actions[obj.ctr]=="string"){
			if(obj.tgt){
				var win=window.open(obj.actions[obj.ctr],obj.tgt);
				if(win&&!win.closed)win.focus();
			}
			else{
				window.location=obj.actions[obj.ctr];
			}
		}
		else{
			obj.actions[obj.ctr]();
		}
	}
	return false;
};

in_Inf.x0=function(){

	in_Inf.fn(';');
	in_Inf.fn('in_Inf.ready=true;');
	in_Inf.fn('in_Rotator.ready=true;');

};

in_Rotator.pause=function(n){
	in_Rotator.clearTimers(n);
};

in_Rotator.clearTimers=function(n){
	var obj=in_Rotator.col[n];
	if(obj){
		clearTimeout(obj.timer);
		obj.timer=null;
	}
};

in_Inf.fn('in_Inf.x0();');

in_Rotator.resume=function(n){
	in_Rotator.clearTimers(n);
	var obj=in_Rotator.col[n];
	if(obj){
		obj.timer=setTimeout(obj.animString+".rotate()",in_Rotator.restartDelay);
	}
};
