var the_images = new Array();
function preloadimages()
{
  for (i = 0; i < preloadimages.arguments.length; i++)
  {
    the_images[i] = new Image();
    the_images[i].src = preloadimages.arguments[i];
  }
}

function check_email()
{
  email = document.ccoptin.ea.value;
  if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1)
  {
    alert("You must provide a valid email address.");
    return false;
  }
  else
  {
    return true;
  }
}

if (document.images)
{
  //preloadimages();
}

function imgOn(imgName)
{
  if (document.images) {
    document[imgName].src = eval(imgName + "on.src");
  }
}

function imgOff(imgName)
{
  if (document.images) {
    document[imgName].src = eval(imgName + "off.src");
  }
}

function popup(url, width, height)
{
    window.open(url, "new_win", "width="+width+",height="+height+",scrollbars=yes,resizable=yes")
}



//populate a select box with the elements of 'array'
function change_combo_box(box_id,array)
{
  
  //document.getElementById(td).style.display = "block";
  //document.getElementById(div).style.display = "block";
  
  var sel_box = document.getElementById(box_id);

  //sel_box.style.size=array.length;
  //sel_box.style.display = "block";

  sel_box.options.length=0; //empty the options array
   
  var i = 0;
  var text = "";
  for(var key in array) 
  {
	text = array[key];
	sel_box.options[i] = new Option(text,key,true);
	i++;
  }

  sel_box.selectedIndex = -1;
	
  /*
	if(key == '---')
		sel_box.options[i].disabled = true;
		*/
  
  //drop_day.options[0].disabled = true;
  //drop_day.remove(0);
  //document.getElementById("day").value = day;
  
}


