var countdown = 0;
var beenRun = 0
function delayHide_custom () {
	countdown = setTimeout('hide_custom()', 400);
}
function hide_custom() { 
	document.getElementById("customPrintingSecond").style.visibility="hidden";
  }
function display_custom() {
	hide_all();
	clearTimeout (countdown);
	document.getElementById("customPrintingSecond").style.visibility="visible";
	var res = document.getElementById("customPrintingSecond");
	drawInfo(res,0,200,0,0);
}

function display_custom_full() {
	document.getElementById("customPrintingSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_essproducts() {
	countdown = setTimeout('hide_essproducts()', 400);
}
function hide_essproducts() { 
	document.getElementById("essproductsSecond").style.visibility="hidden";
  }
function display_essproducts() {
	hide_all();
	clearTimeout (countdown);
	document.getElementById("essproductsSecond").style.visibility="visible";
	var res = document.getElementById("essproductsSecond");
	drawInfo(res,0,250,0,0); 
}

function display_essproducts_full() {
	document.getElementById("essproductsSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_carts() {
	countdown = setTimeout('hide_carts()', 400);
}
function hide_carts() { 
 document.getElementById("cartsStorageSecond").style.visibility="hidden";
  }
function display_carts() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("cartsStorageSecond").style.visibility="visible";
	var res = document.getElementById("cartsStorageSecond");
	drawInfo(res,0,230,0,0); 
}

function display_carts_full() {
	document.getElementById("cartsStorageSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_ess() {
	countdown = setTimeout('hide_ess()', 400);
}
function hide_ess() { 
	document.getElementById("ESSSecond").style.visibility="hidden";
  }
function display_ess() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("ESSSecond").style.visibility="visible";
	var res = document.getElementById("ESSSecond");
	drawInfo(res,0,230,0,0); 
}

function display_ess_full() {
	document.getElementById("ESSSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_precinct() {
	countdown = setTimeout('hide_precinct()', 400);
}
function hide_precinct() { 
	document.getElementById("precinctSecond").style.visibility="hidden";
  }
function display_precinct() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("precinctSecond").style.visibility="visible";
	var res = document.getElementById("precinctSecond");
	drawInfo(res,0,230,0,0); 
}

function display_precinct_full() {
	document.getElementById("precinctSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_ramps() {
	countdown = setTimeout('hide_ramps()', 400);
}
function hide_ramps() { 
	document.getElementById("rampsSecond").style.visibility="hidden";
  }
function display_ramps() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("rampsSecond").style.visibility="visible";
	var res = document.getElementById("rampsSecond");
	drawInfo(res,0,230,0,0); 
}

function display_ramps_full() {
	document.getElementById("rampsSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_security() {
	countdown = setTimeout('hide_security()', 400);
}
function hide_security() { 
	document.getElementById("securitySecond").style.visibility="hidden";
  }
function display_security() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("securitySecond").style.visibility="visible";
	var res = document.getElementById("securitySecond");
	drawInfo(res,0,230,0,0); 
}

function display_security_full() {
	document.getElementById("securitySecond").style.visibility="visible";
	clearTimeout (countdown);
}


function delayHide_stickers() {
	countdown = setTimeout('hide_stickers()', 400);
}
function hide_stickers() { 
	document.getElementById("stickersSecond").style.visibility="hidden";
  }
function display_stickers() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("stickersSecond").style.visibility="visible";
	var res = document.getElementById("stickersSecond");
	drawInfo(res,0,230,0,0); 
}

function display_stickers_full() {
	document.getElementById("stickersSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_voter() {
	countdown = setTimeout('hide_voter()', 800);
}
function hide_voter() { 
	document.getElementById("voterSecond").style.visibility="hidden";
  }
function display_voter() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("voterSecond").style.visibility="visible";
	var res = document.getElementById("voterSecond");
	drawInfo(res,0,230,0,0); 
}

function display_voter_full() {
	document.getElementById("voterSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_booths() {
	countdown = setTimeout('hide_booths()', 800);
}
function hide_booths() { 
	document.getElementById("boothsSecond").style.visibility="hidden";
  }
function display_booths() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("boothsSecond").style.visibility="visible";
	var res = document.getElementById("boothsSecond");
	drawInfo(res,0,230,0,0); 
}

function display_booths_full() {
	document.getElementById("boothsSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function delayHide_system() {
	countdown = setTimeout('hide_system()', 800);
}
function hide_system() { 
	document.getElementById("systemSecond").style.visibility="hidden";
  }
function display_system() {
	hide_all()
	clearTimeout (countdown);
	document.getElementById("systemSecond").style.visibility="visible";
	var res = document.getElementById("systemSecond");
	drawInfo(res,0,230,0,0); 
}

function display_system_full() {
	document.getElementById("systemSecond").style.visibility="visible";
	clearTimeout (countdown);
}

function drawInfo(element,top,right,bottom,left) {
	element.style.clip="rect("+top+"px"+","+right+"px"+","+bottom+"px"+","+left+"px"+")";
		
	var newtop = top;
	var newright = right;
	var newbottom = bottom + 10;
	var newleft = left;
	var repeat = function () {		
		drawInfo(element,newtop,newright,newbottom,newleft)
	};
	if (bottom >= 400) {
		return;
	} else {
	element.info = setTimeout(repeat,1);
	}
}

function hide_all() {
	
	document.getElementById("essproductsSecond").style.visibility="hidden";
	document.getElementById("customPrintingSecond").style.visibility="hidden";
}
