<!--
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_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_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];}
}

// this function loads the mouse over images that are used in navigation menus
function LoadMouseOverImage() {
	MM_preloadImages('images/top_home_o.gif','images/top_about_o.gif','images/top_news_o.gif','images/top_newsletter_o.gif','images/top_contactus_o.gif','images/top_login_o.gif','top_logout_o.gif','images/m_hogan_o.jpg','images/m_skymarks_o.jpg','images/m_herpa_o.jpg','images/m_gemini_o.jpg','images/m_corgi_o.jpg','images/m_executive_o.jpg','images/m_schabak_o.jpg','images/m_andmore_o.jpg');
	MM_preloadImages('images/menu_corgi.jpg','images/menu_executive.jpg','images/menu_gemini.jpg','images/menu_herpa.jpg','images/menu_hogan.jpg','images/menu_schabak.jpg','images/menu_skymark.jpg');
}

function displayAirplane(img) {
  layerID='l'+img;
  if (document.getElementById) {
    var layerObj=document.getElementById(layerID);
	x=getImageXfromLeft(img)
	layerObj.style.left=x;
    layerObj.style.visibility='visible';
  } else if (document.all) {
	x=getImageXfromLeft(img)
	layerObj.style.left=x;
    document.all[layerID].style.visibility='visible';
  } else if (document.layers) {
	x=getImageXfromLeft(img)
	layerObj.style.left=x;
    document.layers[layerID].visibility='show';
  }
}

function hideAirplane(layerID) {
  if (document.getElementById) {
    var layerObj=document.getElementById(layerID);
    layerObj.style.visibility='hidden';
  } else if (document.all) {
    document.all[layerID].style.visibility='hidden';
  } else if (document.layers) {
    document.layers[layerID].visibility='hide';
  } 
}

function getImageXfromLeft(imgID) {
  if (NS4) return eval(imgID).x
  else return getRealLeft(imgID);
}

function getImageYfromTop(imgID) {
  if (NS4) return eval(imgID).y
  else return getRealTop(imgID);
}

function getRealLeft(imgElem) {
	xPos = eval(imgElem).offsetLeft;
	tempEl = eval(imgElem).offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}

function getRealTop(imgElem) {
	yPos = eval(imgElem).offsetTop;
	tempEl = eval(imgElem).offsetParent;
	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}

if (document.all) {
	NS4 = false;
}
else {
	NS4 = true,range = "layers.",style = "",topPix = ".top",leftPix = ".left"
}
//////////////////
function validDate(item, itemname) {
  var strErrorMsg = Trim(itemname) + " must be a valid date.\n In mm/dd/yyyy format";
  if (isNaN(Date.parse(item.value))) {
    item.focus();
    alert(strErrorMsg);
    return false;
  }
  else {
    var correctDate = item.value.split("/");
    var validMonth = parseFloat(correctDate[0]);
    var validDay = parseFloat(correctDate[1]);
    var validYear = parseFloat(correctDate[2]);
    if ((validMonth <= 0) || (validMonth > 12)) {
      item.focus();
      alert(strErrorMsg);
      return false;
    }
    if ((validDay <= 0) || (validDay > 31)) {
      item.focus();
      alert(strErrorMsg);
      return false;
    }
    if ((validMonth == 4) || (validMonth == 6) || (validMonth == 9) || (validMonth == 11)) {
      if (validDay > 30) {
        item.focus();
        alert(strErrorMsg);
        return false;
      }
    }
    if (validYear < 1901) {
      item.focus();
      alert(strErrorMsg);
      return false;
    }
    if (validYear > 2079) {
      item.focus();
      alert(strErrorMsg);
      return false;
    }    
    var isLeapYear = true;
    isLeapYear = (((validYear % 4) == 0) && ((validYear % 100) == 0) && ((validYear % 400) == 0));
    if (!(isLeapYear)) {
      if (validMonth == 2) {
        if (validDay > 28) {
          item.focus();
          alert(strErrorMsg);
          return false;
        }
      }
    }
    else {
      if (validMonth == 2) {
        if (validDay > 29) {
          item.focus();
          alert(strErrorMsg);
          return false;
        }
      }
    }
  }
  return true;
}
function Trim(str) {
  var iChar, iCount;
  var strValue = str;
  iChar = strValue.length - 1;
  iCount = -1;
  while (strValue.charAt(iChar) == ' ' && iChar > iCount)
    --iChar;
  if (iChar != (strValue.length - 1))
    strValue = strValue.slice(0, iChar+1);
  iChar = 0;
  iCount = strValue.length - 1;
  while (strValue.charAt(iChar) == ' ' && iChar < iCount)
    ++iChar;
  if (iChar != 0)
    strValue = strValue.slice(iChar, strValue.length);
  return strValue;
}

//-->
