function vai(voce) {
dove="http://www.bra"+"cegird"+"le.it";
location.href=dove + voce;
}
function goto(voce2) {
dove2="http://";
url=window.open('','url');
url.location.href=dove2 + voce2;
}
function vai2(voce3) {
dove3="http://www.bra"+"cegird"+"le.it";
url3=window.open('','url');
url3.location.href=dove3 + voce3;
}
function settaCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function trovaCookie(name) {

	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function nopromo() {
settaCookie('nopromo','attivo','30');
     alert('Opzione attivata:\nla finestra non verrą mostrata per 30 giorni.\nPer ripristinare la finestra, eliminare il cookie - nopromo - impostato da questo sito.');
	 window.location.reload();
}
function risol(name,value,days) {
	if (value==0){
		var value = window.screen.width;
	}
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function selris(selez) {
	if (selez!=0) {
		var selez2=selez;
		if(selez>=950){	
			if(selez>=1200){
				selez2=1200;
			}
			else {
				selez2=950;
			}
		}
		else {
			selez2=770;
		}
		risol('risoluzione',selez2,1000)
		window.location.reload();
	}
}
function grey(td,frase)
{
document.getElementById(td).style.background="#c0c0c0";
if (td=="q12" || td=="q13"){
	if (td=="q12"){
		if (trovaCookie("risoluzione") < 1024){
			var dista=-71;
		}
		else {
			var dista=-44;
		}
	}
	else {
		if (trovaCookie("risoluzione") < 1024){
			var dista=-148;
		}
		else {
			var dista=-134;
		}
	}
}
else {
	var dista=-35;
}
Tip(frase, BGCOLOR, '#FFFFFF', PADDING, 5, DELAY, 20, DURATION, 3000, FIX, [td, dista, 0]);
}
function sgrey(td)
{
document.getElementById(td).style.background="#FEFFF2"; 
UnTip();
}
function login1(id_name)
{
document.getElementById(id_name).className = 'login1';
}
function login2(id_name)
{
document.getElementById(id_name).className = 'login2';
}
function chiudi(div)
{
document.getElementById(div).style.display='none';
}
function convy(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += " ";
flag = 1;
}
}
}
x=out;
}
function contr() {
var cnt=1;
var x=document.forma.q.value;
convy(x);
document.forma.q.value=x;
x=x.toString().replace(/^[ \t\r\n]+/,'').replace(/[ \t\r\n]+$/,'');
document.forma.q.value=x;
if (x == '' || x == ' ' || x == '   ')
{
alert ('Ricerca di soli spazi non consentita.');
cnt++;
return false;
}
if (x.length < 3){
alert ('La stringa deve essere almeno di 3 caratteri.');
cnt++;
return false;
}

if (cnt==1){
var url='ricerca.php?q=';
location.href = url+document.forma.q.value;
}
}
function feed(sito)
{
switch (sito)
{
case "Bracegirdle.it":
  numfeed=10836;
	break
case "Tolkien Library":
  numfeed=10837;
	break
case "Eldamar.it":
  numfeed=10839;
	break
case "TheOneRing.net":
  numfeed=10841;
	break
case "Tolkien News":
  numfeed=10843;
	break
case "topix":
  numfeed=10845;
	break
case "Eldaliė.it":
  numfeed=10847;
	break
}

document.getElementById('tolkien_feed').innerHTML='<object type="application/x-shockwave-flash" data="http://www.feedflash.net/feedflash.swf?bc=#FFFFFF&bfc=#000000&cc1=#FFFFE7&cc2=#F5FFFF&fc1=#000000&fc2=#000000&f=' + numfeed + '" height="250" width="160"><param name="movie" value="http://www.feedflash.net/feedflash.swf?bc=#FFFFFF&bfc=#000000&cc1=#FFFFE7&cc2=#F5FFFF&fc1=#000000&fc2=#000000&f=' + numfeed + '"><param name="quality" value="high"></object>';

}