function showErrors(){
    document.getElementById("error").style.visibility = "visible";
}

function hideErrors(){
    document.getElementById("error").style.visibility = "hidden";
}

function buildTestWindow(testid){
    window.open("mktest.php?theTest="+testid, "_blank", "dependent=yes,width=600,height=700,hotkeys=no,left=50,top=50,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");
}

function buildImageWindow(image){
    window.open("viewimage.php?theImage="+image, "_blank", "dependent=yes,width=500,height=500,hotkeys=no,left=100,top=100,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
}

function buildContentImageWindow(image){
    window.open("viewcontentimage.php?theImage="+image, "_blank", "dependent=yes,width=500,height=500,hotkeys=no,left=100,top=100,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
}

function buildSoundWindow(sound){
    window.open("viewsound.php?theSound="+sound, "_blank", "dependent=yes,width=300,height=80,hotkeys=no,left=100,top=100,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}

function buildContentSoundWindow(sound){
    window.open("viewcontentsound.php?theSound="+sound, "_blank", "dependent=yes,width=300,height=80,hotkeys=no,left=100,top=100,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}

function startTimer(minutes) {
	minutes -= 1;

    if(minutes > 0){
    	if (minutes <= 9) minLeft = "0" + minutes;
        else minLeft = minutes;
	
	   if(minutes > 10) tag = "<b style=\"color: green\">";	
	   if(minutes <= 10) tag = "<b style=\"color: orange\">";
	   if(minutes <= 5) tag = "<b style=\"color: red\">";
	
	   document.getElementById('timer').innerHTML = "Time to go: "+tag+minLeft+" minutes</b>";
    } else{
        document.forms[0].submit();
    }
    
    window.setTimeout("startTimer('"+minutes+"')",60000);
}

function mkInfo(itemOn,itemOff){
    if(itemOn != itemOff){
        if(itemOff != ""){
            if(document.getElementById(itemOff).style.display != "none") new Effect.Fade(itemOff);
            window.setTimeout("new Effect.Appear('"+itemOn+"')",1000)
        } else new Effect.Appear(itemOn);
    }
    item2Kill = itemOn;
    return item2Kill;
}

function unsetVars(){
    item2Kill = 0;
    return item2Kill;
}
