﻿var bvar=0;

msg="";






function barra(el)

{	

	  var coordinates = $(el).viewportOffset();

 //  alert("Distance from the Left : " +  coordinates[0] );

 //  alert("Distance from the Top  : " +  coordinates[1] );

	if (coordinates[1]<0)

	{

		$(el).morph('top:0px;',{duration:0.3}); 

		bvar=1;

	}

	else

	{

		$(el).morph('top:-71px;',{duration:0.3});

		bvar=0;	

	}

}









function replaceText(text){

	while(text.lastIndexOf("&") > 0){

		text = text.replace('&', '[i-Stats]');

	}

	return text;

}



var web_referrer = replaceText(document.referrer);

istat = new Image(1,1);

istat.src = "counter.php?sw="+screen.width+"&sc="+screen.colorDepth+"&referer="+web_referrer+"&page="+location.href;

	function addLoadEvent(func) {	

	  var oldonload = window.onload;	

	  if (typeof window.onload != 'function') {	

	    window.onload = func;	

	  } else {	

	    window.onload = function() {	

	      if (oldonload) {	

	        oldonload();	

	      }	

	      func();	

	    }	

	  }	

	}		

function getWindowHeight() {

	var windowHeight = 0;

	if (typeof(window.innerHeight) == 'number') {

		windowHeight = window.innerHeight;

	}

	else {

		if (document.documentElement && document.documentElement.clientHeight) {

			windowHeight = document.documentElement.clientHeight;

		}

		else {

			if (document.body && document.body.clientHeight) {

				windowHeight = document.body.clientHeight;

			}

		}

	}

	return windowHeight;

}



function setFooter() {



	if (document.getElementById) {



		var windowHeight = getWindowHeight();



		if (windowHeight > 0) {



			var footerElement = document.getElementById('fundo');



			var footerHeight  = footerElement.offsetHeight;



			var contentElement = document.getElementById('strecher');



			contentElement.style.height = (windowHeight - footerHeight) + 'px';



			footerElement.style.position = 'static';



		}



	}



}





window.onload = function() { 

	setFooter();

}

window.onresize = function() {

	setFooter();

}



