// JavaScript Document

//////////////////////
//  Below are quotes for the random quote call out box
//  To add new quote duplicate one below and edit pasted ascii  text with no special characters on one line for both QUOTE and AUTHOR
//////////////////////
var quotes = new Array( );
quotes[quotes.length] = {quote:"We just want to say 'thank you' for your help getting Ron and I from Nebraska to Houston and back home... God bless each and everyone who helped us.", 
                          author:"AFC Passengers Ronnie and Denise"};
quotes[quotes.length] = {quote:"(Mark) would not have seen his daughter get married, celebrated our 11th wedding anniversary, or celebrated his 49th birthday without your service... I will never forget all of the wonderful pilots and flights we made with you. Your pilots and ground angels really are Angels!  Thank you, thank you so very much.", 
                          author:"Marilyn, wife of AFC Passenger Mark, who passed away December 25, 2004"};
quotes[quotes.length] = {quote:"... with your help, our angel Sarah will be well again, we just KNOW it!  She has a collection of angels in her bedroom... and a photo of her with (each AFC) pilot... the most precious angels of her collection no doubt about it!!!", 
                          author:"AFC Passenger's Sarah's Parents, Kevin and Charlotte"};
quotes[quotes.length] = {quote:"... A diagnosis of a rare form of liver cancer rocked our world... when I began to feel I no longer could continue to make my trips to Mayo... God sent Angel Flight... it has truly been one of the miracles in our lives...  I am humbled by the generosity of all these men and women. Thanks for everything", 
                          author:"AFC Passenger Jeanie"};
quotes[quotes.length] = {quote:"God never shuts one door without opening another --thanks for being that door!!", 
                          author:"Inscription on a key chain given to AFC Volunteer Pilot Robert Leader, Brookston, IN, from AFC Passengers."};
quotes[quotes.length] = {quote:"Without Angel Flight, Joshua would have been unable to attend (special needs) camp... .we are so grateful to everyone within the organization that has made this possible... our family believes in Angels! ", 
                          author:"Karen, mother of AFC Passenger Joshua, Kentwood, MI,"};
quotes[quotes.length] = {quote:"After the plane leveled, she shared her story: diagnosed with lung cancer and given only a few months to live... four years later and after many trips for treatment, her cancer has not grown. Just before landing, her eyes filled, she put her hand on my arm and said,  Angel Flight saved my life... tell everyone THANK YOU from the bottom of my heart.", 
                          author:"Excerpt from a story about Susan provided by AFC Volunteer Pilot Thomas H. Holcom, Kansas City, MO"};
quotes[quotes.length] = {quote:"Our family would like to express our deep gratitude to the pilots of your organization who flew our son Michael... these men were truly our son's angels!!", 
                          author:"Arlene and Robert, parents of AFC Passenger Michael, Chesterfield, MO"};
quotes[quotes.length] = {quote:"Amidst the many setbacks I have battled, there shines a beacon of hope... that is you.  Not only do you help in a financial crisis, you give me time... precious hours to spend with my family and not on the road. Hours that I have learned are, like you, truly a gift from God.", 
                          author:"AFC Passenger Colleen, Wisconsin Rapids, WI, who is battling Parkinson Disease and cancer."};
quotes[quotes.length] = {quote:"I am presently flying to MD Anderson for a Clinical Trial as there is no longer anything that they can do at home to combat my rare type of cancer. I live on Social Security Disability... there is no way that I can (afford) an airline ticket after paying rent and utilities. I want you to know how little hope I felt until I became associated with your organization ... my love and a million thanks.", 
                          author:"AFC Passenger Linda, Burnville, MN"};
quotes[quotes.length] = {quote:"Angel Flight flew my daughter and I to a medical facility [for] a second opinion regarding her rare lung disease. During that visit she was hospitalized . . . had we not been able to make that trip, her condition could have deteriorated much more rapidly. We are so grateful for Angel Flight and for the generous, wonderful pilots who made our trip possible!", 
                          author:"AFC Passengers Melanie, and daughter Amber, Rochester, MN"};
quotes[quotes.length] = {quote:"... because of my health... I am unable to work and my husband takes care of me 24/7 which prevents him from working... I was finally able to receive a new type of pacemaker to prevent me from needing a heart transplant for 10 years... I finally feel like there is some hope in life now.  Thank you for your part in helping me achieve that.", 
                          author:"AFC Passenger Kay, Minneapolis, KS"};
quotes[quotes.length] = {quote:"Thank you for all of your assistance and kindness... you are all truly angels! It was also so nice to meet four wonderful pilots... the service that you provided us is a blessing at such an uncertain time in my life. I feel like you are all my family... may God bless all of you.", 
                          author:"AFC Passenger Dee, Wichita, KS"};
quotes[quotes.length] = {quote:"Throughout our cancer treatments there have been many terrifying experiences and some incredible blessings. Yesterday, our flight with you was a blessing of unparalleled magnitude.", 
                          author:"AFC Passengers Todd and Karen, Lincoln, NE"};
quotes[quotes.length] = {quote:"... thank goodness for generous people like Mr. Wade who are willing to help a stranger, their kindness reaches deep into a mother's heart... ", 
                          author:"AFC Passengers Meredith and Deacon, Platte City, MO"};
quotes[quotes.length] = {quote:"... Chloe was born premature and had slim hopes for survival. Angel Flight helped save her life by transporting her to where she could receive medical care... we now can't imagine not having this beautiful little girl to love, hug and brag about... thank you Angel Flight!", 
                          author:"Chloe's grandmother Theresa, St. Louis, MO"};
quotes[quotes.length] = {quote:"The joy that comes from these camp mission flights is among the greatest I have ever had in flying missions and I hope my fellow pilots will continue to do as they have in the past, giving these kids the opportunity to get away for a while and have fun.", 
                          author:"AFC Volunteer Pilot Tom Zumm, Wheaton, IL"};
quotes[quotes.length] = {quote:"...  a pilot flew our daughter home... she'd been in a car accident. It meant the world to us, after that shocking challenge, to be able to get her home... our lives had been put on hold.  Please let (the pilots) know what a great ministry they are performing... they truly are like angels... ", 
                          author:"AFC Passenger Margene, Derby, KS"};
quotes[quotes.length] = {quote:"More is being done in New York for (my) rare cancer... and you have made it <br /> possible to go.  When this is over, I'll know I've done all I can do... words won't do justice for the appreciation I feel for Angel Flight and especially for you, Michele!", 
                          author:"Excerpt from a letter sent from AFC Passenger Charlotte, Lenexa, KS to AFC Volunteer Pilot Michele Stauffer, Overland Park, KS"};
quotes[quotes.length] = {quote:"Being a part of Angel Flight Central means being part of something even bigger than any of us could accomplish on our own.", 
                          author:"AFC Volunteer Pilot Michael Freeborn, Chicago, IL about his recent participation in AFC's historic 10,000th Mission"};
quotes[quotes.length] = {quote:"Your willingness to help means so much... it's hard being ill and your cheerful, incredible giving means more than you'll ever know. My heart is full!", 
                          author:"AFC Passenger K.C., Sioux Falls, SD"}; 
// getSaying is used to display a random quote from above on each page 
function getSaying( ) { 
    var currIndex = Math.floor(Math.random( ) * (quotes.length)); 
    var output = "<p class='quote'><span class='quoteMarks'>&#8220;</span>" + quotes[currIndex].quote + "<span class='quoteMarks'>&#8221;</span></p>"; 
    output += "<p class='author'>&#8211; "; 
    output += quotes[currIndex].author + "</p>"; 
    return output; 
} 


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

// MM_jumpMenu is used on Volunteers page whith a dropdown jump menu to select zip code
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// The following is Adobe/Macromedia's Flash Detection and Run Content Code - (AC_OETags.js file copied and pasted)
// Do NOT delete... needed to detect Flash for all browsers and auto start SWF files in IE on Windows


// Flash Player Version Detection - Rev 1.5
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;			
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function JSGetSwfVer(i){
  // NS/Opera version >= 3 check for Flash plugin in plugin array
  if (navigator.plugins != null && navigator.plugins.length > 0) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
      var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
          var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
      descArray = flashDescription.split(" ");
      tempArrayMajor = descArray[2].split(".");
      versionMajor = tempArrayMajor[0];
      versionMinor = tempArrayMajor[1];
      if ( descArray[3] != "" ) {
        tempArrayMinor = descArray[3].split("r");
      } else {
        tempArrayMinor = descArray[4].split("r");
      }
          versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
        } else {
      flashVer = -1;
    }
  }
  // MSN/WebTV 2.6 supports Flash 4
  else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
  // WebTV 2.5 supports Flash 3
  else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
  // older WebTV supports Flash 2
  else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
  // Can't detect in all other cases
  else {
    
    flashVer = -1;
  }
  return flashVer;
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
  			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


// End Adobe/Macromedia Code
//-->
