var MM_contentVersion = 5;
var MM_contentVersion4music = 7;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	   for (var i = 0; i < words.length; ++i) {
			if (isNaN(parseInt(words[i]))) continue;
			var MM_PluginVersion = words[i]; 
	   }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	var MM_FlashCanPlay2 = MM_PluginVersion >= MM_contentVersion4music;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0  && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('MM_FlashCanPlay2 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion4music)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function genFlashHelp(strA, strB)
{
	if (MM_FlashCanPlay){
      document.write(strA);
  }else{
      document.write(strB);
  }
}


function genHmFlash(obj) {
  genFlashHelp('<object width="100%" height="400"><param name=movie value=images/jukebox.swf><embed src=images/jukebox.swf width="100%" height="400"></embed></object><br><br>','<p class="emlight">This page requires Macromedia Flash Player 7 or newer: <a target="new" href="http://www.macromedia.com/go/getflashplayer/"><img style="vertical-align:middle;" border="0" src="images/get_flashplayer.gif" alt="Get Flash Player" /></a></p>');
}

function genboxingFlash(obj) {
	genFlashHelp('<object width=600 height=400><param name="movie" value="images/boxing.swf"><embed src="images/boxing.swf" width=600 height=400></embed></object>','<img src="images/IMG_7173.jpg" alt="agape youth boxing" />');

}

function genBishopFlash(obj) {
	genFlashHelp('<object><embed src="images/bishop.swf" width=180 height=240></embed></object>','<img style="margin:0 .5em 0 .75em;" src="images/Bishop0107-0.gif" alt="Bishop L. A. Wilkerson" />');
}

function genElderLisaFlash(obj) {
	genFlashHelp('<object><embed src="images/elderlisa.swf" width=180 height=270></embed></object>','<img style="margin:0 .75em 0 .5em;" src="images/elderlisa1.gif" alt="Elder Lisa" />');
}

function genglobalprayerFlash(obj) {
  genFlashHelp('<ILAYER SRC="http://www.gdop-austin.com/"></ILAYER><IFRAME NAME="cal" SRC="http://www.gdop-austin.com/" frameborder=0 height=800 width=625></IFRAME>','<p class="emlight">This page requires Macromedia Flash Player 7 or newer: <a target="new" href="http://www.macromedia.com/go/getflashplayer/"><img style="vertical-align:middle;" border="0" src="images/get_flashplayer.gif" alt="Get Flash Player" /></a></p>');
}

function genConcertprayerFlash(obj) {
	genFlashHelp('<object width=600 height=400><param name="movie" value="myron.swf"><embed src="myron.swf" width=600 height=400></embed></object>','<img src="images/IMG_0344.jpg" alt="Concert" />');
}

function genBannerFlash(obj) {
	if (MM_FlashCanPlay)
  {
    document.write('<object width="100%" height="100%"><param name="movie" value="images/logoflash.swf"><embed src="images/logoflash.swf" width="100%" height="100%"></embed></object>');
    var obj = document.getElementById("banner");
    obj.style.margin = "0 0 0 2px;";
  } 
  else
  {
    document.write('<img src="images/logo07v1.gif" alt="agape" />');
  }
}

function genMediaBannerFlash(obj) {
	if (MM_FlashCanPlay)
  {
    document.write('<object width="100%" height="100%"><param name="movie" value="../images/logoflash.swf"><embed src="../images/logoflash.swf" width="100%" height="100%"></embed></object>');
    var obj = document.getElementById("banner");
    obj.style.margin = "0 0 0 2px;";
  } 
  else
  {
    document.write('<img src="../images/logo07v1.gif" alt="agape" />');
  }
}
/*
function genMediaBannerFlash(obj) {
  genFlashHelp('<object width="100%" height="100%"><param name="movie" value="http://agape-cm.org/images/churchlooklogo1.swf"><embed src="http://agape-cm.org/images/churchlooklogo1.swf" width="100%" height="100%"></embed></object>','<img src="images/churchface5.gif" alt="agape" width="750" height="150" />');
}
*/

function genBreakoutFlash(obj) {
	genFlashHelp('<object width="100%" height="500">        <param name="movie" value="images/breakout.swf">        <embed src="images/breakout.swf" width="100%" height="500">        </embed>        </object><br><br>','<img src="images/004_4.jpg" alt="agape" width="600" height="400" />');
}

function genChildrenFlash(obj) {
	genFlashHelp('<object width="600" height="400">        <param name="movie" value="images/youth.swf">        <embed src="images/youth.swf" width="600" height="400">        </embed>        </object><br><br>','<img src="images/youth_3.jpg" alt="agape" width="600" height="400" />');
}

function genMessageFlash(obj) {
	genFlashHelp('<object width="200" height="50"><param name="movie" value="images/message.swf"><embed src="images/message.swf" width="200" height="50"></embed></object>','<p class="emlight">This page requires Macromedia Flash Player 6 or newer: <a target="new" href="http://www.macromedia.com/go/getflashplayer/"><img style="vertical-align:middle;" border="0" src="images/get_flashplayer.gif" /></a></p>');
}

function setH(id1,id2){
		IE=(navigator.appName.indexOf('Microsoft') >= 0);
		NS=(navigator.appName.indexOf('Netscape') >= 0);
    if(document.layers){    //isns4
      if(document.layers[id1].clientHeight>document.layers[id2].clientHeight){
          var elem_ht=document.layers[id1];
      }
      else{
          var elem_ht=document.layers[id2];
      }
     var p = document.layers["linkList"];
      p.clip.height=elem_ht.clientHeight;     
    }
    else{
      if(document.getElementById){  //isdom
        if(document.getElementById(id1).offsetHeight>document.getElementById(id2).offsetHeight){
          var elem_ht=document.getElementById(id1);
        }
        else{
          var elem_ht=document.getElementById(id2);
        }  
        
        var p = document.getElementById("linkList");
      }else if(document.all){ //isie4
        if(documet.all[id1]>documet.all[id2]){
          var elem_ht=document.all[id1];
        }
        else{
          var elem_ht=document.all[id2];
        }
        var p = document.all["linkList"];
      }
      var em5 = elem_ht.offsetHeight+ 25;
      
      if(IE)
      {
        elem_ht.style.height=em5;
        p.style.height = em5;
      }
      else if(NS)
      {
        elem_ht.style.height=em5 + 'px';
        p.style.height = em5 + 'px';
      }
      
    }
 
}
function showPopup(id)
{
  var elem = document.getElementById(id);
  elem.style.visibility = "visible";
}
function hidePopup(id)
{
  var elem = document.getElementById(id);
  elem.style.visibility = "hidden";
}

var oldWidth;
function showBishopItinerary()
{
  showPopup("itineraryPopup");
  document.getElementById("downloadItinerary").style.display = "inline";
}
function hideBishopItinerary()
{
  hidePopup("itineraryPopup");
  document.getElementById("downloadItinerary").style.display = "none";
}

function showCheckCredit(x)
{
      var online = document.getElementById("onlinep");
      var mailin = document.getElementById("mailin");
		  if (x=="check")
		  {
        online.style.visibility = "hidden";
        online.style.position= "absolute";
        mailin.style.visibility = "visible";
        mailin.style.position = "relative";
      }
      else
      {
        online.style.visibility = "visible";
        online.style.position = "relative";
        mailin.style.visibility = "hidden";
        mailin.style.position = "absolute";
      }
}