/*
	Autor: Innovagency - http://www.innovagency.com/
*/

function locationURL(){
	var lang = document.getElementById('ctl00_VariationLabel').value;
	var	urlDest = '/CustomPages/SendAFriendPage.aspx?URLArtigo=';
	//alert(urlDest);
	urlDest = urlDest + document.location.toString();
	
	//alert(urlDest + '&lang=' + lang);
	window.open(urlDest + '&lang=' + lang,'popup','height=650,width=450,status=yes');
	//document.location = urlDest;
}


// WINDOW PRINT
function doPrint() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("print")) {
			links[i].onclick = function() {
				window.print();
				return false;
			}
		}
	}
}


// ADD LOAD EVENTS
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if(oldonload){oldonload();}
			func();
		}
	}
}

function setAchor()
{
	window.location.href = '#sectionBottom' ;
}

var i = 0;
var counter = 1;

function PatrociniosRoller()
{
	var size = ArrayPatrocImg.length;
	

 if (!(ArrayPatrocImg)){
 	var divpat = document.getElementById("PatrocinaroresSlideShow");
 	divpat.style.display = "none";
	return false;
	} 

 showtime=setInterval('slideShow()',5000);
}
 
function slideShow()
{
	if (!document.getElementById("imgMarca")) {
   
		var divPatrocinio = document.getElementById("imgPatrocinio");
		var LinkPatrocinio = document.getElementById("lnkPatroc");

		var Patrocinador = ArrayPatrocImg[i].split("|");
 
		  LinkPatrocinio.setAttribute("alt",Patrocinador[1]);
		  LinkPatrocinio.setAttribute("title",Patrocinador[1]);
		  LinkPatrocinio.setAttribute("target","_blank");
		   LinkPatrocinio.setAttribute("href",Patrocinador[2]);
	
		var Patrocinio = document.createElement("img");
		   Patrocinio.setAttribute("id","imgMarca");
		   Patrocinio.setAttribute("alt",Patrocinador[1]);
		   Patrocinio.setAttribute("src",Patrocinador[0]);



		   LinkPatrocinio.appendChild(Patrocinio);
	  } 
	  else {
  		var placeholder = document.getElementById("imgMarca");
 		var LinkPatrocinio = document.getElementById("lnkPatroc");
  	
  		var Patrocinador = ArrayPatrocImg[i].split("|");
  		
  		LinkPatrocinio.setAttribute("alt",Patrocinador[1]);
 		LinkPatrocinio.setAttribute("title",Patrocinador[1]);
		LinkPatrocinio.setAttribute("target","_blank");
 	    LinkPatrocinio.setAttribute("href",Patrocinador[2]);
  		
  		placeholder.setAttribute("src",Patrocinador[0]);
  		placeholder.setAttribute("alt",Patrocinador[1]);


  }
  
  i = i + 1;
  if (i > (ArrayPatrocImg.length - 1)) {i = 0; counter = counter + 1;}
  
  if (counter > 2) {clearInterval(showtime);PatrociniosRoller();} 
  
  
}

function setAnchorTop()
{
	window.location.href = '#topo' ;
}



/* ---------------------------- */
// Add Load Event

addLoadEvent(doPrint);

