
Colors = new Array();

Colors[1] = "#FFFFFF";
Colors[2] = "#FFFFFF";
Colors[3] = "#E5E7ED";
Colors[4] = "#9097B1";
Colors[5] = "#616C90";
Colors[6] = "#3A4774";
Colors[7] = "#1F2E62";

var codes = new Array("b","d","t","k","s","f","i","o","x","e","l","c","y","r","w","p","m","n");
var bloggerCode = new Array();
var timeid = Array();
var aboutBox = 'off';
var decoderBox = 'off';
var brackets = 0;

for (x=0; x < codes.length; ++x){
    bloggerCode[codes[x]] = "";
}

function fadein(slice, id) {
  if (slice >= 1) {
    document.getElementById(id).style.backgroundColor = Colors[slice];
    if (slice > 1) {
      slice -= 1;
      timeid[id] = window.setTimeout("fadein("+slice+",'"+id+"')", 100);
    } else {
      slice -= 1;
      document.getElementById(id).style.backgroundColor = "transparent";
      myclearTimeout(id);
    }
  }
}

function SetToOff(id){
    document.getElementById(id).className = "off";
}


function myclearTimeout(id) {
  clearTimeout(timeid[id]);
}

function hideBlock(d, v){

    var text = d + "t";
    var heading = d + "x";
    
    document.getElementById(heading).className = "itemheadingSelected";
    
    fadein(7, heading);
    
    setVar(d, v);
    
    thisDiv = document.getElementById(d);
    thisDiv.style.display = "none";
    toggleBrackets("inc");
    
}

function showBlock(d){

    var text = d + "t";
    var heading = d + "x";
    var heading2 = d + "heading";

    thisDiv = document.getElementById(d);
    thisDiv.style.display = "block";
    SetToOff(heading);
    fadein(7, heading2);
	toggleBrackets("dec");
    dumpVar(d);
    
    

}
 
function setVar(d, v){
    bloggerCode[d] = v;
}

function dumpVar(d){

    bloggerCode[d] = "";

}

function aboutToggle(){

    if (aboutBox == 'on'){
        document.getElementById('aboutbox').className = "aboutboxoff";
        aboutBox = 'off';
    }else if(aboutBox == 'off'){
        document.getElementById('aboutbox').className = "aboutboxon";
        aboutBox = 'on';
    }
}

function decoderToggle(){

    if (decoderBox == 'on'){
        document.getElementById('decoderbox').className = "aboutboxoff";
        decoderBox = 'off';
    }else if(decoderBox == 'off'){
        document.getElementById('decoderbox').className = "aboutboxon";
        decoderBox = 'on';
    }
}

function toggleBrackets(s){
	
	if (s == "inc"){
		brackets += 1;
	}else if(s == "dec"){
		brackets -= 1;
	}
	
	if (brackets > 0){
		document.getElementById("lt").className = "brackets";
		document.getElementById("gt").className = "brackets";
		document.getElementById("theButton").className = "subButton";
	}else{
		SetToOff("lt");
		SetToOff("gt");
		SetToOff("theButton");
	}	
}

