//var ns = (document.layers)? true:false;
var ie = (document.all)? true:false;
var ruta = 'http://www.rigola.cat/';

function ico(){
document.write('<LINK href="http://www.acudit.net/grafics/rigolanet.ico" rel="SHORTCUTICON">');
}

function trad(){
document.write('<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/translatemypage.xml&up_source_language=ca&w=160&h=60&title=&border=&output=js"></script>');
}

//var ruta = '';
var rutap = ruta + 'pells/';
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
var pell=GetCookie("pell");
var men = false;

function pells(pell){
	document.getElementById("tb_cap").background = '';
	document.getElementById("tb_sec").background = '';
	if (document.getElementById("tb_men") == null) { men = false; } else { men = true; }
	if (men == true) {document.getElementById("tb_men").background = '';}
	document.getElementById("tb_cap").bgColor = 'navy';
	document.getElementById("tb_sec").bgColor = '#5C5D90';
	if (men == true) {document.getElementById("tb_men").bgColor = 'silver';}
	switch (pell) {
		case 'blau':
			break;
		case 'verd':
			document.getElementById("tb_cap").bgColor = 'green';
			document.getElementById("tb_sec").bgColor = '#576861';
			if (men == true) {document.getElementById("tb_men").bgColor = '#808040';}
			break;
		case 'marron':
			document.getElementById("tb_cap").bgColor = 'brown';
			document.getElementById("tb_sec").bgColor = '#A98D89';
			if (men == true) {document.getElementById("tb_men").bgColor = '#CFC5C2';}
			break;
		case 'vermell':
			document.getElementById("tb_cap").bgColor = 'red';
			document.getElementById("tb_sec").bgColor = '#FF8000';
			if (men == true) {document.getElementById("tb_men").bgColor = '#FFF200';}
			break;
		default:
			document.getElementById("tb_cap").background = rutap + pell + '/c_' + pell + '.jpg';
			document.getElementById("tb_sec").background = rutap + pell + '/s_' + pell + '.jpg';
			if (men == true) {document.getElementById("tb_men").background = rutap + pell + '/m_' + pell + '.jpg';}
	}
	SetCookie ("pell", pell, expdate);
}

function cap(num,plana){

	document.write('<div style="visibility: hidden; position:absolute;">Plana de n´Albert i Oriol Rigola i Díaz</div>');
	document.write('<CENTER><TABLE BORDER="0" WIDTH="770" CELLSPACING="0" CELLPADDING="0" id="tb_cap" name="tb_cap" BGCOLOR="NAVY" style="position:relative;">');
	document.write('<TR><TD WIDTH="' + ( (ie)?190:190 ) + '" HEIGHT=20><CENTER><FONT COLOR="white" size="-2">&#39;·&curren;[ OrAl Computer ]&curren;·&#39;</FONT></CENTER></TD>');
	document.write('<TD WIDTH="15" ROWSPAN=2></TD>');
	document.write('<TD WIDTH="450" ROWSPAN=2><CENTER><img src="'+ ruta + 'grafics/granotes100.gif" border=0 style="position:relative;"></CENTER></TD>');
	document.write('<TD WIDTH="30" BGCOLOR="NAVY"><CENTER><a href="javascript:pells('+"'blau'"+');"><img src="' + ruta + 'grafics/res.gif" border=0 width=30 height=16 style="position:relative;"></a></CENTER></TD>');
	document.write('<TD WIDTH="30" BGCOLOR="GREEN"><CENTER><a href="javascript:pells('+"'verd'"+');"><img src="' + ruta + 'grafics/res.gif" border=0 width=30 height=16 style="position:relative;"></a></CENTER></TD>');
	document.write('<TD WIDTH="5">&nbsp;</TD>');
	document.write('<TD WIDTH="' + ( (ie)?100:105 ) + '"><B><A HREF="http://www.rigola.cat" onMouseover="window.status='+"'"+'Rigola.Cat'+"'"+';return true;">');
	document.write('<img src="'+ ruta + 'grafics/rigolanet100.gif" ALT="Rigola.CAT" border="0" style="position:relative;"></A></B></TD></TR>');
	document.write('<TR><TD HEIGHT=20 id="tb_sec" name="tb_sec" BGCOLOR="#5C5D90"><CENTER><FONT COLOR="white"><B>-=< ' + plana + ' >=-</B></FONT></CENTER></TD>');
	document.write('<TD WIDTH="30" BGCOLOR="brown"><CENTER><a href="javascript:pells('+"'marron'"+');"><img src="' + ruta + 'grafics/res.gif" border=0 width=30 height=16 style="position:relative;"></a></CENTER></TD>');
	document.write('<TD WIDTH="30" BGCOLOR="red"><CENTER><a href="javascript:pells('+"'vermell'"+');"><img src="' + ruta + 'grafics/res.gif" border=0 width=30 height=16 style="position:relative;"></a></CENTER></TD>');
	document.write('<TD WIDTH="5">&nbsp;</TD>');
	document.write('<TD><CENTER><FONT COLOR="white" size="-2">desde 1996</font></CENTER></TD></TR>');
	document.write('</TABLE></CENTER>');
	window.status = "Rigola.Cat - Plana dels Germans Rigola i Díaz - " + plana;
	pells(pell);
}

function menu(){
	document.write('<TABLE BGCOLOR="silver" WIDTH="175" VALIGN="TOP" "ALIGN=LEFT" CELLSPACING="0" CELLPADDING="5" id="tb_men" name="tb_men"><TR><TD><BR>');
	document.write('<A HREF="' + ruta + '" onMouseover="window.status='+"'Inici'"+';return true;">Inici</A><BR>');
	document.write('<A HREF="http://blog.rigola.cat" onMouseover="window.status='+"'Blog de Notes'"+';return true;">Blog de Notes</A><BR>');
	document.write('<A HREF="http://www.lacomunitat.net/blog.php?user=llibreobert" onMouseover="window.status='+"'Llibre Obert'"+';return true;">Llibre Obert</A><BR>');
	document.write('<A HREF="http://flog.rigola.cat" onMouseover="window.status='+"'Rigolofotolog'"+';return true;">Fotolog</A><BR>');
	document.write('<A HREF="http://kia.rigola.cat" onMouseover="window.status='+"'K I A'"+';return true;">K I A</A><br>');
	document.write('<A HREF="' + ruta + 'fotcur/index.htm" onMouseover="window.status='+"'Fotos Curioses'"+';return true;">Fotos Curioses</A><BR>');
	document.write('<A HREF="' + ruta + 'textes/index.htm" onMouseover="window.status='+"'Textes'"+';return true;">Textes</A><BR>');
	document.write('<A HREF="http://www.e-rucades.tk" onMouseover="window.status='+"'e-Rucades (eMule)'"+';return true;">E-Rucades</A><BR>');
	document.write('<A HREF="' + ruta + 'nexes.htm" onMouseover="window.status='+"'Nexes'"+';return true;">Nexes</A><BR>');
	document.write('<A HREF="' + ruta + 'strangelove/index.htm" onMouseover="window.status='+"'Dj. Strangelove'"+';return true;">Dj.Strangelove</A><BR>');
	document.write('<A HREF="' + ruta + 'comics/index.htm" onMouseover="window.status='+"'Comics'"+';return true;">Comics</A><BR>');
	document.write('<A HREF="' + ruta + 'ferran/index.htm" onMouseover="window.status='+"'Club de Fans del Ferran'"+';boom(2);return true;">Club Fans Ferran</A><BR>');
	document.write('<A HREF="' + ruta + 'loiro/index.htm" onMouseover="window.status='+"'LoirO'"+';return true;">LoirO</A><BR>');
	document.write('<A HREF="' + ruta + 'disseny/index.htm" onMouseover="window.status='+"'Disseny'"+';return true;">Disseny</A><br>');
	document.write('<br><HR><BR><center>');
	document.write('<a href="http://www.comptadors.com" style="background: #F0E68C; font-size: 18px; color: #A52A2A;">Comptadors.com</a><br>');
	document.write('<A HREF="http://www.acudit.net" onMouseover="window.status='+"'@cud.it'"+';return true;" target="_blank"><img src="http://www.acudit.net/grafics/logo.gif" border="0" width="100" style="position:relative;"></A><br>');
	document.write('<a href="http://www.costumari.com"><img src="http://www.acudit.net/grafics/banner-costumari.jpg" style="position:relative;" border="0" height="20" width="155"></a>');
	document.write('</center><BR><HR><BR>');
	document.write('Javascript:');
	document.write('<BR>&nbsp;&nbsp;&nbsp;&middot;&nbsp;<A HREF="' + ruta + 'curs/index.htm" onMouseover="window.status='+"'Curs de JavaScript'"+';return true;">Curs</A>');
	document.write('<BR>&nbsp;&nbsp;&nbsp;&middot;&nbsp;<A HREF="' + ruta + 'jocs/index.htm" onMouseover="window.status='+"'Jocs de JavaScript'"+';return true;">Jocs</A>');
	document.write('<BR><BR><HR><BR>');
	document.write('<CENTER><a href="http://kia.rigola.cat" onMouseover="window.status='+"'Plana d&acute;Albert'"+';return true;">Albert Rigola i D&iacute;az</a></CENTER>');
	document.write('<CENTER><A HREF="mailto:albert'+'@'+'rigola.cat" onMouseover="window.status='+"'Correu d&acute;Albert'"+';return true;">albert(a)rigola.cat</A></CENTER>');
	document.write('<BR><HR><BR>');
	document.write('<CENTER><A HREF="http://oriol.rigola.cat" onMouseover="window.status='+"'Plana d&acute;Oriol'"+';return true;">Oriol Rigola i D&iacute;az</a></CENTER>');
	document.write('<CENTER><A HREF="mailto:oriol'+'@'+'rigola.cat" onMouseover="window.status='+"'Correu d&acute;Oriol'"+';return true;">oriol(a)rigola.cat</A></CENTER>');
	document.write('<BR>');
	document.write('<CENTER><a href="http://www.facebook.com/people/Oriol-Rigola/618893072" title="Perfil al Facebook de Oriol Rigola" target=_TOP><img src="http://badge.facebook.com/badge/618893072.602.54477007.png" border=0 alt="Perfil al Facebook de Oriol Rigola"></a></CENTER>');
	document.write('<BR><HR><div style="text-align:center">');
        trad();
	document.write('<BR><HR><div style="text-align:center">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="160" height="160" style="position:relative;"><param name=movie value="http://' + ruta + 'grafics/rellotge.swf"><PARAM NAME=bgcolor VALUE=#FFFFFF><param name="wmode" value="transparent"><param name="menu" value="false">');
	document.write('<embed src="' + ruta + 'grafics/rellotge.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="160" height="160" wmode="transparent" menu="false" style="position:relative;"></embed></object>');
	document.write('<a href="http://www.comptadors.com/estadistica.php?cs=rigola" target="_blank"><img ');
	document.write('src="http://www.comptadors.com/comptadors/comptadors.php?cs=rigola" border="0" width="160" height="39" style="position:relative;"></a>');
	document.write('</div></TD></TR></TABLE>');
	pells(pell);
}

function boom(n) {
  if (window.top.moveBy) {
    for (i = 10; i > 0; i--) {
      for (j = n; j > 0; j--) {
        window.top.moveBy(0,i);
        window.top.moveBy(i,0);
        window.top.moveBy(0,-i);
        window.top.moveBy(-i,0);
      }
    }
  }
}

function blockError() {return true;}
window.onerror = blockError;

function SetCookie (name, value) {
         var argv = SetCookie.arguments;
         var argc = SetCookie.arguments.length;
         var expires = (argc > 2) ? argv[2] : null;
         var path = (argc > 3) ? argv[3] : null;
         var domain = (argc > 4) ? argv[4] : null;
         var secure = (argc > 5) ? argv[5] : false;
         document.cookie = name + "=" + escape (value) +
         ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
         ((path == null) ? "" : ("; path=" + path)) +
         ((domain == null) ? "" : ("; domain=" + domain)) +
         ((secure == true) ? "; secure" : "");
}
function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape (document.cookie.substring(offset, endstr));
}
function GetCookie(name) {
   var arg = name+"=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}

if (pell== null) {
	var pell = 'blau';
        var expdate = new Date ();
        expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
        SetCookie ("pell", pell, expdate);
}else{
        var expdate = new Date ();
        expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
        SetCookie ("pell", pell, expdate);
}
