function IsEmpty(valor)
{
	var b=/^[\s]*$/
    return b.test(valor)

}
function displayCountries()
{
	var selCountry = document.getElementById('countries');
	var allCountries = document.getElementById('allcountries');
	selCountry.style.display = 'none';
	allCountries.style.display = 'block';
}
function selectCountry(obj)
{
	var selCountry = document.getElementById('countries');
	var selTextCountry = document.getElementById('country');
	var allCountries = document.getElementById('allcountries');
	
	selTextCountry.innerHTML = obj.innerHTML;
	
	selCountry.style.display = 'block';
	allCountries.style.display = 'none';
}
function RotatePpal(rotates)
{
	this.con = new Array(rotates);
	this.obj = new Array(rotates);
	this.fx  = new Array(rotates);
	
	for (var i = 0; i < this.obj.length; i++)
	{
		this.obj[i] = document.getElementById('box'+(i+1));
		this.con[i] = document.getElementById('box_con_'+(i+1));
		//this.con[i] = new Object();
		this.con[i].index = i;
		this.con[i].fx = this.obj[i];
		this.con[i].onclick = onClick;
	}
	
	var Rotates = rotates;
	var Con = this.con;
	var Obj = this.obj;
	var Current,CurrentBut,CurrentNum = -1,IntAutoplay = false;
	var AutoplayButton = document.getElementById('autoplay');
	AutoplayButton.onclick = AutoPlay;
	
	Show(Con[0]);
	AutoPlay();
	
	function onClick()
	{
		StopAutoPlay();
		Show(this);
	}
	
	function Show(obj)
	{
		if (Current) { Current.style.display = 'none'; CurrentBut.className = ''; }
		CurrentNum = obj.index;
		Current = obj.fx;
		CurrentBut = obj;
		
		$('banner_readmore').onclick = function() { parent.location = $(Obj[CurrentNum]).getProperty('url'); }
		
		$(obj.fx).fade('hide');
		obj.className = 'active';
		obj.fx.style.display = 'block';
		$(obj.fx).fade('in');
	}
	
	function StartAutoPlay()
	{
		if (!IntAutoplay)
		{
			AutoplayButton.className = 'pause';
			IntAutoplay = setInterval(GetNext,6000);
		}
	}
	
	function StopAutoPlay()
	{
		if (IntAutoplay)
		{
			AutoplayButton.className = 'play';
			clearInterval(IntAutoplay);
		}
		IntAutoplay = false;
	}
	
	function AutoPlay()
	{
		if (IntAutoplay)
		{
			StopAutoPlay();
			return true;
		}
		StartAutoPlay();
		return true;
	}
	
	function GetNext()
	{
		if (CurrentNum >= 0)
		{
			if (CurrentNum+1 < Rotates)
			{
				Show(Con[CurrentNum+1]);
				return true;
			}
		}
		Show(Con[0]);
		return true;
	}
	this.onClick = onClick;
	this.current = function () { return SetId; };
}

