// Flash Scripts
function RunMain()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="355" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/rehab.swf" />\n');
	document.write('<embed src="_images/rehab.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="355"></embed>\n');
  document.write('</object>\n');
}

function RunClaims()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/claims.swf" />\n');
	document.write('<embed src="_images/claims.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunLaw()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/law.swf" />\n');
	document.write('<embed src="_images/law.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunSelf()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/self.swf" />\n');
	document.write('<embed src="_images/self.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunTPA()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/tpa.swf" />\n');
	document.write('<embed src="_images/tpa.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunElder()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/elder.swf" />\n');
	document.write('<embed src="_images/elder.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunAbout()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/about.swf" />\n');
	document.write('<embed src="_images/about.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunContact()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/contact.swf" />\n');
	document.write('<embed src="_images/contact.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}

function RunForms()
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="165" title=Rehabilitation Planning" />\n');
  document.write('<param name="movie" value="_images/forms.swf" />\n');
	document.write('<embed src="_images/forms.swf" quality="high" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="165"></embed>\n');
  document.write('</object>\n');
}
// Flash Scripts End

// Preload Script
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];}
}
// Preload Script End

// Validation Script
function checkEmail(s, required)
  {
    var i = 1;
    var sLength = s.length;
    //if it's not required and it's blank, then it's ok
    if(!required && sLength == 0)
      return true;
    else
    {
      //look for @
      while((i < sLength) && (s.charAt(i) != "@"))
        i++;
      if((i >= sLength) || (s.charAt(i) != "@"))
        return false;
      else
        i += 2;
      //look for .
      while((i < sLength) && (s.charAt(i) != "."))
        i++
      //there must be at least one character after the .
      if((i >= sLength - 1) || (s.charAt(i) != "."))
        return false;
      else
        return true;
    }
  }

function validate(theForm)
{
  var sEmail=theForm.sEmail.value;

  if (theForm.sReferralSource.value == "")
  {
    alert("Please enter your Referral Source.");
    theForm.sReferralSource.focus();
    return (false);
  }

	if (theForm.sCompany.value == "")
  {
    alert("Please enter your Company.");
    theForm.sCompany.focus();
    return (false);
  }

	if (theForm.sPhone.value == "")
  {
    alert("Please enter your Phone number.");
    theForm.sPhone.focus();
    return (false);
  }

	if (theForm.sClaimNumber.value == "")
  {
    alert("Please enter your Claim Number.");
    theForm.sClaimNumber.focus();
    return (false);
  }

	if (theForm.sClaimantName.value == "")
  {
    alert("Please enter your Claimant Name.");
    theForm.sClaimantName.focus();
    return (false);
  }

	if (theForm.sEmail.value == "")
  {
    alert("Please enter your Email address.");
    theForm.sEmail.focus();
    return (false);
  }
	if (!checkEmail(sEmail, 1))
  {
    alert("Your Email address is invalid. Please enter a valid Email address.");
    theForm.sEmail.focus();
    return (false);
  }
}
// Validation Script End

