function gotoLink() {
	top.location.href = "/si/";
}

function detectBrowser() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		var ieversion=new Number(RegExp.$1)
		if (ieversion>=8) {
			resizeWin();
		}
		else if (ieversion>=6) {
			document.getElementById("main").style.background = "none";
			document.body.style.background = "url(img/woman_silhuete1.jpg) no-repeat bottom left #fce5ef";
		}
	} else {
		resizeWin();
	}
}

function resizeWin() {
	window.onresize = resize;
	function resize() {
		resizeMain();		
	}
	
	function resizeMain () {
		document.getElementById("main").style.minHeight = "200px"
		var main = document.getElementById("main");
		var bdy = document.body;
		if ((main.offsetHeight + 150) > bdy.offsetHeight ) {
	   		var visina = main.offsetHeight;
			document.getElementById("main").style.minHeight = visina + "px";
		} else if (main.offsetHeight < bdy.offsetHeight ) {
			var visina2 = bdy.offsetHeight;
			document.getElementById("main").style.minHeight = (visina2-150) + "px";
		}		
	}
	resizeMain ();
}

function fixFontSize() {
	function countCharacters(n) { 
	   if (n.nodeType == 3 /*Node.TEXT_NODE*/){ 
			return n.length; 
	   } else { 
		  var numchars = 0;    
		  for(var m = n.firstChild; m != null; m = m.nextSibling) { 
			   numchars += countCharacters(m); 
		  } 
	   }
	  if (numchars > 90) {
		  	n.style.fontSize = "1.1em";
	  }
	} 
	countCharacters(document.getElementById('Thought').childNodes[1]);
}
