var home = "http://www.crownlaboratories.com/bluelizard/";
var thislocation = new String(window.location.href);
var thisPage = thislocation.replace (home,"");
var thisArr = thisPage.split("/");
var thisDir = thisArr[0];
var subOpen = "no";
var openSub = "";
var secs;
var timerID = null;
var timerRunning = false;
var delay = 1000;

function InitializeTimer(numSecs) {
    secs = numSecs
    StopTheClock()
    StartTheTimer()
}

function StopTheClock() {
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer() {
    if (secs==0) {
        StopTheClock()
		hideSub (openSub);
	} else {
        // self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}

function makeNav () {
	element = document.getElementById(thisDir);
	if (element) {
		element.style.fontWeight = "bold";
		element.style.fontColor = "#000000";
	}
}

function makeEmail (name, user, domain) {
	document.write("<a href=" + "mail" + "to:" + user + "@" + domain + ">" + name + "</a>");
}
	
function showSub (section) {
	if (openSub !== section) {
		if (subOpen == "yes") hideSub (openSub);
		parElement = document.getElementById(section);
		parentY = new String(parElement.style.top);
		var newY = parseInt(parentY.replace ("px","")) + 80;
		thisID = "sub_" + section;
		if (thisElement = document.getElementById(thisID)) {
			thisElement.style.left = 145;
			thisElement.style.top = newY;
			thisElement.style.visibility = "visible";
			subOpen = "yes";
			openSub = section;
		}
	}
}

function hideSub (section) {
	thisID = "sub_" + section;
	if (thisElement = document.getElementById(thisID)) {
		thisElement.style.visibility = "hidden";
	}
	subOpen = "no";
	openSub = "";
}

function popUp() {	
	winpops=window.open(popUp.arguments[0],'PopUpWindow','width=700,height=500,menubar=no,location=no,resizable=no,scrollbars=yes,status=no');
}
