//---preload images------------
function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

//---filter text input -----------
/* <!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com --> */

// Begin
// Enter the words to be filtered in the line below:
var ny_words_arr=new Array("NY","ny","New York","new york");

var ny_alert_arr=new Array;
var ny_alert_count=0;
function reset_alert_count()
{
 ny_alert_count=0;
}
function validate_user_text()
{
 reset_alert_count();
 var compare_text=document.form1.state.value;
 for(var i=0; i<ny_words_arr.length; i++)
 {
  for(var j=0; j<(compare_text.length); j++)
  {
   if(ny_words_arr[i]==compare_text.substring(j,(j+ny_words_arr[i].length)).toLowerCase())
   {
    ny_alert_arr[ny_alert_count]=compare_text.substring(j,(j+ny_words_arr[i].length));
    ny_alert_count++;
   }
  }
 }
 var alert_text="";
 for(var k=1; k<=ny_alert_count; k++)
 {
  alert_text+="\n" + "(" + k + ")  " + ny_alert_arr[k-1];
 }
 if(ny_alert_count>0)
 {
  sH('county');
  document.form1.ny_county.select();
  window.scrollBy(0,50);
 }
// else
// {
//  document.form1.submit();
// }
}
function select_area()
{
 document.form1.ny_county.select();
}
//window.onload=reset_alert_count;
//--- End text area filter


//---put focus--------------
function putFocus(formInst, elementInst) {
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
 }
// The second number in the "onLoad" command 
// determines the form's focus. Counting starts with '0'

//---check to see if card is selected; if so, show details; if not, hide and clear details-------------

/* function rewriteIt(id) {
	document.getElementById('id').innerHTML="asterisk"
	} */

function check() {
  if (document.getElementById('aa').checked) {
    sH('ElegantDetails'); 
  }
  if (document.getElementById('bb').checked) {
    sH('HelloDetails'); 
  }
  if (document.getElementById('cc').checked) {
    sH('HearDetails'); 
  }
  if (document.getElementById('dd').checked) {
    sH('WhatsupDetails'); 
  }
  if (document.getElementById('ee').checked) {
    sH('AsstpigsDetails'); 
  }
  if (document.getElementById('ff').checked) {
    sH('FriendshipDetails'); 
  }
  if (document.getElementById('gg').checked) {
    sH('BabyDetails'); 
  }
  if (document.getElementById('hh').checked) { 
    sH('HalloweenDetails');
  }
  if (document.getElementById('ii').checked) { 
    sH('SkatingDetails');
  }
  if (document.getElementById('jj').checked) { 
    sH('BirthdayDetails');
  }
} 
  /*else {	document.getElementById('HalloweenDetails').innerHTML="" }*/
function clearcontent() {
  if (!(document.getElementById('aa').checked)) {
    document.getElementById('ElegantDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('bb').checked)) {
    document.getElementById('HelloDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('cc').checked)) {
    document.getElementById('HearDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('dd').checked)) {
    document.getElementById('WhatsupDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('ee').checked)) {
    document.getElementById('AsstpigsDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('ff').checked)) {
    document.getElementById('FriendshipDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('gg').checked)) {
    document.getElementById('BabyDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('hh').checked)) {
    document.getElementById('HalloweenDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('ii').checked)) {
    document.getElementById('SkatingDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
  if (!(document.getElementById('jj').checked)) {
    document.getElementById('BirthdayDetails').innerHTML="<p class='note'>If you'd like to add this item now, please include the card color [white or cream] and the # of pkgs in the 'notes' area in Step Two.</p>"; 
  }
} 
