﻿// JScript File
function DisplayMenu(movieName, imageName) {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
  if(hasRightVersion) {  // if we've detected an acceptable version
     var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' 
      + 'width="860" height="115"'
      + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
      + '<param name="movie" value="' + movieName + '" />'
      + '<param name="quality" value="high" />'
      + '<param name="menu" value="false" />'
      + '<param name="wmode" value="transparent" />'
      + '<!--[if !IE]> <-->'
      + '<object data="' + movieName + '"'
      + '  width="860" height="115" type="application/x-shockwave-flash">'
      + '  <param name="quality" value="high" />'
      + '  <param name="menu" value="false" />'
      + '  <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />'
      + '  <param name="wmode" value="transparent" />'
      + '    FAIL (the browser should render some flash content, not this).'
      + '  </object>'
      + '  <!--> <![endif]-->'
      + '<\/object>';
      document.write(oeTags);   // embed the flash movie
    } 
    else 
    { 
        
	    var noFlash = IsNonFlashClient();
	    if (noFlash)
	    {
      		// flash is too old or we can't detect the plugin     		   
	        var alternateContent = '<img src="images/logo.jpg" id="logo" alt="Pilates Power Cronulla" />' +
                  '<ul id="headerlist">' +
                    '<li><a href="Default.aspx">Home page</a></li>' +
                    '<li><a href="AboutUs.aspx">About Us</a></li>' +
                    '<li><a href="Schedule.aspx">Timetables</a></li>' +
                    '<li><a href="Prices.aspx">Prices</a></li>' +
                    '<li><a href="ContactUs.aspx">Contact Us</a></li>' +
                  '</ul><div id="head-line"></div>';
      	}
	   else
	   {
      		// flash is too old or we can't detect the plugin
      		var alternateContent = '<div class="NoFlash">'
                           + '<img src="' + imageName + '" />'
                           + '<div class="FlashText">'
                           + 'This content requires the Macromedia Flash Player.<a href="http://www.macromedia.com/go/getflash/">Get Flash</a></div></div>';
	   }
		
	   document.write(alternateContent);  // insert non-flash content
    }
}

function IsNonFlashClient()
{
	if ((navigator.userAgent.toLowerCase().indexOf("iphone") != -1) || (navigator.userAgent.toLowerCase().indexOf("ipad") != -1))
	{
		return true;
	}
	else
		return false;
}

