function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr;
  for(i=0; a&&i<a.length&&(x=a[i])&&x.oSrc; i++)
    x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document;
  if(d.images){
    if(!d.MM_p)
      d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
    for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){
        d.MM_p[j]=new Image;
        d.MM_p[j++].src=a[i];
      }
   }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function set_status(s) {
  window.status=s;
  return true;
}

function e() {
  document.write('a&#100;&#109;&#105;&#110;');
  a=64;
  document.write('&#'+a);
  document.write('s&#111;&#117;&#116;&#104;&#119;&#101;&#115;&#116;&#55;&#53;&#114;&#101;&#117;&#110;&#105;&#111;&#110;&#46;&#99;&#111;&#109;');
}

function c() {
  document.write('2011 Daniel Austin ');
  e();
}

function open_img_window(i,w,h,c)
{
  //left: 5+23+4+13 [5+40]
  //right: 13+4+23+5 [5+40]
  //top: 24+15+4+13 [24+32]
  //bottom: 16+22+4+15+5 [5+57](no caption: -22 [5+35])

  //taskbar: 28,53



  sh = screen.height;
  //alert(sh+' '+h+80);
  //sw = screen.width;

  willScroll = "no";

  if (h+171 > sh) {	//171:53,146:28
   wh=sh-82;		//82:53,57:28
   willScroll = "yes";
  }
  else {
   wh=h+89;
   //wh=h+67
  }

  ww=w+80;
  picture=i;
  caption=c;
  if ( c == '' && willScroll == "no" ) {
   wh=wh-22;
  }

  window.open('pic.html','_blank','toolbar=no,scrollbars='+willScroll+',menubar=no,location=no,status=no,directories=no,resizable=no,screenY=0,screenX=0,top=0,left=0,height='+wh+',width='+ww);
}

function checkInput(f)
{
 var missing="";
 if (f=='a') {
  df=document.forma;

  if (df.name.value.length == 0) {
    missing+="\n -Name";
  }
  if (df.address.value.length == 0) {
    missing+="\n -Address";
  }
  if (df.city.value.length == 0) {
    missing+="\n -City";
  }
  if (df.state.value.length == 0) {
    missing+="\n -State";
  }
  if (df.zip.value.length == 0) {
    missing+="\n -Zip";
  }

  if (missing.length == 0) {
    alert("Your address information has been sent.  Thank You.");
    return true;
  }
  else {
    missing="Missing Input:"+missing;
    alert(missing);
    return false;
  }
 }
 else if (f=='e') {
  df=document.forme;

  if (df.name.value.length == 0) {
    missing+="\n -Name";
  }
  if (df.comments.value.length == 0) {
    missing+="\n -Message";
  }
  
  //added email to form, but not making it required

  if (missing.length == 0) {
    alert("Your message has been sent.  Thank You.");
    return true;
  }
  else {
    missing="Missing Input:"+missing;
    alert(missing);
    return false;
  }
 }
 else if (f=='r') {
  df=document.formr;
  
  if (df.name.value.length == 0) {
    missing+="\n -Name";
  }
  if (df.qty.value.length == 0) {
    missing+="\n -How Many?";
  }
  if (df.email.value.length == 0 && df.comments.value.length == 0) {
    missing+="\n -Email or Contact Information";
  }

  if (missing.length == 0) {
    alert("Your RSVP has been sent.  Thank You.");
    return true;
  }
  else {
    missing="Missing Input:"+missing;
    alert(missing);
    return false;
  }
 }
}
