
function getCookie(a){with(document.cookie){var b=new RegExp("(^|;\\s+)"+a+"=(.*?)(;|$)");var c=b.exec(document.cookie);if(c&&c.length>2)return Utf8.decode(unescape(replaceAll(c[2],'+','%20')));else return''}}

function set_cookie(a,b,c){if(c){var d=new Date();d.setTime(d.getTime()+(c*24*60*60*1000));var e="; expires="+d.toGMTString()}else e="";document.cookie=a+"="+b+e+"; path=/"}

function del_cookie(a){document.cookie=a+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/'}

var mozilla = !document.all && self.innerWidth;
var msie = !mozilla;
var opera = window.opera;
var docSize = null;

function closeMenu()
{
    var date = new Date();
    date.setTime(date.getTime()+(24*60*60*1000));
    
    z('leftmenudiv2').className = 'hiden';
	set_cookie('closeMenu', '1', 30);
	location.reload();
}

function closePostbox()
{
    var date = new Date();
    date.setTime(date.getTime()+(24*60*60*1000));
    
    z('arriba').className = 'hiden';
	set_cookie('closePostbox', '1', 30);
    location.reload();
}

//-----------------------------------------------------------------------------

function restaurarMenu(){
      var d = new Date();
	  document.cookie = 'closeMenu=0; expires=Fri, 3 Aug 2000 20:47:11 UTC; path=/';
      location.reload();
 }

function restaurarPostbox(){
      var d = new Date();
 	  document.cookie = 'closePostbox=0; expires=Fri, 3 Aug 2000 20:47:11 UTC; path=/';
      location.reload();
 }

//-----------------------------------------------------------------------------

function valid(f) {
!(/^[A-zÑñ0-9]*$/i).test(f.value)?f.value = f.value.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;
} 

function z(element)
{
	if (typeof(element) == "string")
		element = document.getElementById(element);
	
	return 	element;
}

$(function(){
	$('#navmenu-h2 a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-105px 0)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-180px 0)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 0"})
			}})
		})

});

function checkMenu() {
//establish div object to manipulate
contentdiv=document.getElementById("leftmenudiv2");
contentdiv2=document.getElementById("unhidemenu");
//check if cookie includes "closeMenu"
if (document.cookie.indexOf("closeMenu")!=-1) {
//if it does (not false), display the div object
contentdiv.style.display="none";
}
else {
//if it does not, set the cookie for next page load
contentdiv2.style.display="none";
}
}

function checkPostbox() {
contentdiv3=document.getElementById("arriba");
contentdiv4=document.getElementById("unhidepostbox");
contentdiv5=document.getElementById("hidepostbox");
contentdiv7=document.getElementById("extrahr");
if (document.cookie.indexOf("closePostbox")!=-1) {
contentdiv3.style.display="none";
contentdiv5.style.display="none";
contentdiv7.style.display="none";
}
else {
//if it does not, set the cookie for next page load
contentdiv4.style.display="none";
}
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}


function changebackgroundinside() {

the_body = document.getElementById("content");

back = document.backgroundinside.image.value;

!(/^[A-zÑñ0-9]*$/i).test(back)?back = back.replace(/[^A-z:/.[\]\-%Ññ #0-9]/ig,''):null;

repeat = document.backgroundinside.repeat.value;

!(/^[A-zÑñ0-9]*$/i).test(repeat)?repeat = repeat.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

fixed1 = document.backgroundinside.fixed.value;

!(/^[A-zÑñ0-9]*$/i).test(fixed1)?fixed1 = fixed1.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

if (fixed1.charAt(0)=='') { fixed = "scroll"; } else { fixed = fixed1; }

color1 = document.backgroundinside.color.value;

!(/^[A-zÑñ0-9]*$/i).test(color1)?color1 = color1.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

if (color1.charAt(0)=='') { color = "transparent"; } else { color = color1; }

position = document.backgroundinside.position.value;
!(/^[A-zÑñ0-9]*$/i).test(position)?position = position.replace(/[^A-z:/.[\]\-%Ññ #0-9]/ig,''):null;

the_body.style.background = 'url("'+back+'") '+color+' '+position+' '+repeat+' '+fixed+'';

set_cookie('insidecustom', 'yes', 30);

set_cookie('insidecb', ''+color+'', 30);

set_cookie('insidefixed', ''+fixed+'', 30);

set_cookie('insiderepeat', ''+repeat+'', 30);

set_cookie('insideposition', ''+position+'', 30);

set_cookie('insidebackground', ''+back+'', 30);

}


function changebackgroundoutside() {

the_body = document.getElementsByTagName("body");

back = document.backgroundoutside.image.value;

!(/^[A-zÑñ0-9]*$/i).test(back)?back = back.replace(/[^A-z:/.[\]\-%Ññ #0-9]/ig,''):null;

repeat = document.backgroundoutside.repeat.value;

!(/^[A-zÑñ0-9]*$/i).test(repeat)?repeat = repeat.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

fixed1 = document.backgroundoutside.fixed.value;

!(/^[A-zÑñ0-9]*$/i).test(fixed1)?fixed1 = fixed1.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

if (fixed1.charAt(0)=='') { fixed = "scroll"; } else { fixed = fixed1; }

color1 = document.backgroundoutside.color.value;

!(/^[A-zÑñ0-9]*$/i).test(color1)?color1 = color1.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

if (color1.charAt(0)=='') { color = "transparent"; } else { color = color1; }

position = document.backgroundoutside.position.value;
!(/^[A-zÑñ0-9]*$/i).test(position)?position = position.replace(/[^A-z:/.[\]\-%Ññ #0-9]/ig,''):null;

the_body[0].style.background = 'url("'+back+'") '+color+' '+position+' '+repeat+' '+fixed+'';

set_cookie('outsidecustom', 'yes', 30);

set_cookie('outsidecb', ''+color+'', 30);

set_cookie('outsidefixed', ''+fixed+'', 30);

set_cookie('outsiderepeat', ''+repeat+'', 30);

set_cookie('outsideposition', ''+position+'', 30);

set_cookie('outsidebackground', ''+back+'', 30);

}

function changebackgroundheader() {

the_body = document.getElementById("header");

back = document.backgroundheader.image.value;

!(/^[A-zÑñ0-9]*$/i).test(back)?back = back.replace(/[^A-z:/.[\]\-%Ññ #0-9]/ig,''):null;

repeat = document.backgroundheader.repeat.value;

!(/^[A-zÑñ0-9]*$/i).test(repeat)?repeat = repeat.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

fixed1 = document.backgroundheader.fixed.value;

!(/^[A-zÑñ0-9]*$/i).test(fixed1)?fixed1 = fixed1.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

if (fixed1.charAt(0)=='') { fixed = "scroll"; } else { fixed = fixed1; }

color1 = document.backgroundheader.color.value;

!(/^[A-zÑñ0-9]*$/i).test(color1)?color1 = color1.replace(/[^A-z:/.[\]\-%Ññ#0-9]/ig,''):null;

if (color1.charAt(0)=='') { color = "transparent"; } else { color = color1; }

position = document.backgroundheader.position.value;
!(/^[A-zÑñ0-9]*$/i).test(position)?position = position.replace(/[^A-z:/.[\]\-%Ññ #0-9]/ig,''):null;

the_body.style.background = 'url("'+back+'") '+color+' '+position+' '+repeat+' '+fixed+'';

set_cookie('headercustom', 'yes', 30);

set_cookie('headercb', ''+color+'', 30);

set_cookie('headerfixed', ''+fixed+'', 30);

set_cookie('headerrepeat', ''+repeat+'', 30);

set_cookie('headerposition', ''+position+'', 30);

set_cookie('headerbackground', ''+back+'', 30);

}


function readCookie(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)

		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function readBackground() {
the_body = document.getElementsByTagName("body");
the_content = document.getElementById("content");
the_header = document.getElementById("header");
var x = readCookie('outsidecustom')
if (x) {
		var x1 = readCookie('outsidecb');
		var x2 = readCookie('outsiderepeat');
		var x3 = readCookie('outsidefixed');
		var x4 = readCookie('outsideposition');
		var x5 = readCookie('outsidebackground');
		the_body[0].style.background = 'url("'+x5+'") '+x4+' '+x1+' '+x2+' '+x3+'';
}
var y = readCookie('insidecustom')
if (y) {
		var y1 = readCookie('insidecb');
		var y2 = readCookie('insiderepeat');
		var y3 = readCookie('insidefixed');
		var y4 = readCookie('insideposition');
		var y5 = readCookie('insidebackground');
		the_content.style.background = 'url("'+y5+'") '+y4+' '+y1+' '+y2+' '+y3+'';
}
var z = readCookie('headercustom')
if (z) {
		var z1 = readCookie('headercb');
		var z2 = readCookie('headerrepeat');
		var z3 = readCookie('headerfixed');
		var z4 = readCookie('headerposition');
		var z5 = readCookie('headerbackground');
		the_header.style.background = 'url("'+z5+'") '+z4+' '+z1+' '+z2+' '+z3+'';
}
}

function theme() {

document.cookie = 'outsidebackground=0; expires=Fri, 3 Aug 2000 20:47:11 UTC; path=/';

document.cookie = 'insidebackground=0; expires=Fri, 3 Aug 2000 20:47:11 UTC; path=/';

location.reload();

}


function checksection() {
contentdiv6=document.getElementById("Misc");
contentdiv7=document.getElementById("Interests");
contentdiv8=document.getElementById("Adult");
contentdiv9=document.getElementById("Hentai");
contentdiv10=document.getElementById("Computers");
contentdiv11=document.getElementById("Other");
if (document.cookie.indexOf("nav_show_Misc")!=-1) {
contentdiv6.style.display="none";}
if (document.cookie.indexOf("nav_show_Interests")!=-1) {
contentdiv7.style.display="none";}
if (document.cookie.indexOf("nav_show_Adult")!=-1) {
contentdiv8.style.display="none";}
if (document.cookie.indexOf("nav_show_Hentai")!=-1) {
contentdiv9.style.display="none";}
if (document.cookie.indexOf("nav_show_Computers")!=-1) {
contentdiv10.style.display="none";}
if (document.cookie.indexOf("nav_show_Other")!=-1) {
contentdiv11.style.display="none";}
}

function hidesection(button, area) {
	var tog=document.getElementById(area);
	 var d = new Date();
	if(tog.style.display)	{
		tog.style.display="";
		     
     document.cookie =
  'nav_show_'+area+'=0; expires=Fri, 3 Aug 2000 20:47:11 UTC; path=/';

		
	} else {
		tog.style.display="none";
		set_cookie('nav_show_'+area, tog.style.display?'0':'1', 30);
	}
	button.innerHTML=(tog.style.display)?'+':'&minus;';
}