// JavaScript Document

// author: Tercel Payne
// date: 9/14/06

// These functions help control the multi-service quote checkboxes.
// This function checks all of the checkboxes in the contact_requestquote.php form.
// The id's correspond to the id's found in the form.
function checkAll() {
	if(document.getElementById("showAllChecked").checked == true){
		document.getElementById("webServicesOptions").checked=true;
		document.getElementById("marketingServicesOptions").checked=true;
		document.getElementById("tradeShowOptions").checked=true;
		document.getElementById("logoPrintOptions").checked=true;
		document.getElementById("webServicesOptions").style.display="block";
		document.getElementById("marketingServicesOptions").style.display="block";
		document.getElementById("logoPrintOptions").style.display="block";
		document.getElementById("tradeShowOptions").style.display="block";
		document.getElementById("wizardLinks").style.display="block";
	}
	else if(document.getElementById("showAllChecked").checked == false) {
		document.getElementById("webServicesOptions").checked=false;
		document.getElementById("marketingServicesOptions").checked=false;
		document.getElementById("tradeShowOptions").checked=false;
		document.getElementById("logoPrintOptions").checked=false;
		document.getElementById("webServicesOptions").style.display="none";
		document.getElementById("marketingServicesOptions").style.display="none";
		document.getElementById("logoPrintOptions").style.display="none";
		document.getElementById("tradeShowOptions").style.display="none";
		document.getElementById("wizardLinks").style.display="none";
	}
}

// This function basically shows and hides the unordered lists based on the id of the main check box and the list id.
// For example, if you wanted to show or hide the list items under Web Services and Marketing, you would
// write the code like this showHide('webServices', 'web_service').
function showHide(checkId, listId) {
	if(document.getElementById(checkId).checked == true) {
		document.getElementById(listId).style.display="block";
		document.getElementById("wizardLinks").style.display="block";
	} 
	else if(document.getElementById(checkId).checked == false) {
		document.getElementById(listId).style.display="none";
		document.getElementById("wizardLinks").style.display="none";
	}
}

// This function will display parts of the form in a wizard like format using next and previous buttons.
function wizardDisplay(blockId) {
	if(blockId == "productOptions") {
		document.getElementById("contactInformation").style.display="none";
		document.getElementById(blockId).style.display="block";
		document.getElementById("submitForm").style.display="inline";
	}
	else if(id == "contactInformation") {
		document.getElementById("productOptions").style.display="none";
		document.getElementById(blockId).style.display="block";
		document.getElementById("submitForm").style.display="inline";
	}
}

function hide(blockId) {
	document.getElementById(id).style.display="none";
}

function showAlert() {
	alert("If this function is called there is an error in my script somewhere");
}

// Move to the next id based on the first argument and hide the rest.
function next(showId) {
	document.getElementById(arguments[0]).style.display="block";
	document.getElementById("contactInformation").style.display="none";
	for(i=1; i < arguments.length; i++) {
		document.getElementById(arguments[i]).style.display="none";
	}
	if(arguments[0] == "budgetOptions") { 
		document.getElementById("nextButton").style.display="none";
	}
}
// Move to the previous id and hide the first one.
function prev(showId) {
	document.getElementById(arguments[0]).style.display="block";
	for(i=1; i < arguments.length; i++) {
		document.getElementById(arguments[i]).style.display="none";
	}
	if(document.getElementById("contactInformation")) {
		document.getElementById("wizardLinks").style.display="none";
	}
}
