// JavaScript Document

function preload(images) {
    if (document.images) {
        var i = 0;
        var imageArray = new Array();
        imageArray = images.split(',');
        var imageObj = new Image();
        for(i=0; i<=imageArray.length-1; i++) {
            //document.write('<img src="' + imageArray[i] + '" />');// Write to page (uncomment to check images)
            imageObj.src=images[i];
        }
    }
}

var numSteps = 6;

function showHide (id) {
  // var numArticles will change depending on how many articles are on a particular page.  Needs to be set in each page that will call this function.

  for (i=1;i<=numSteps;i++) {
	document.getElementById("step" + i).style.display = 'none';
  }
  
  document.getElementById("step" + id).style.display = '';
 
}

function clearFields(field) {
	
	if (field.name == "qfront" && field.value == "Start Searching...")
		field.value = "";
	
	if (field.name == "name" && field.value == "Your Last Name")
		field.value = "";
	
	if (field.name == "email" && field.value == "Your Email Address")
		field.value = "";
}

function setFields(field) {
	
	if (field.name == "qfront" && field.value == "")
		field.value = "Start Searching...";
	
	if (field.name == "name" && field.value == "")
		field.value = "Your Last Name";
	
	if (field.name == "email" && field.value == "")
		field.value = "Your Email Address";
}
