	
	function wbcFlashEmbed(parentElement, fileName, clickTag, w, h) {
		if (DetectFlashVer(8, 0, 0)) {
			$(parentElement).innerHTML = 
			'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" id="msvFlashItem">' + 
			'<param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="wmode" value="transparent" />' +
			'<param name="movie" value="' + fileName + '?clickTag=' + clickTag + '" /><param name="quality" value="high" /><param name="quality" value="transparent" /><param name="bgcolor" value="#c2d9e4" />	<embed src="' + fileName + '?clickTag=' + clickTag + '" quality="high" bgcolor="#c2d9e4" width="' + w + '" height="' + h + '" name="msvFlashItem" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		} 
	}
	
try{	
$(document).ready(function() {
	
	// hide our hidden elements since scripting is supported:
	$("div").filter(".wbcMenu_subSection").hide();
	$("div").filter(".cityDetails").hide();
	$("div").filter(".movie_details").find("div").filter(".details_wrap").hide();
	$("div").filter(".details_footer").hide();
  $("div").filter(".entertainment_detailsFooter").hide();
  
  // event to clear search field and/or restore default value 
  $("input.input_text").focus(function() {
  	// check if the value is the one defined in the HTML code:
    if( this.value == this.defaultValue ) {
  		this.value = "";
  	}
  }).blur(function() {
    // check to see if user has entered anything, else restore default
  	if( !this.value.length ) {
  		this.value = this.defaultValue;
  	}
  });
  
// expand colapse menu subSection when header clicked:  meals
	$("div").filter(".wbcMenu_subSection").find("h4").click(
			function(){
				$(this ).next(".wbcMenu_subSection").toggle();
				if($(this).attr("className").indexOf("closed") != -1)
					$(this).toggleClass("open","closed");
				
				
				return false;
			});
			
// expand colapse menu subSection when header clicked:
	$("div").filter(".menuItem").find("h3").click(
			function(){
				$(this).next(".wbcMenu_subSection").slideToggle("slow");
				$(this).nextAll(".cityDetails:visible").hide();
				if($(this).attr("className").indexOf("dark") != -1)
					$(this).toggleClass("darkOpen","dark");
				else
					$(this).toggleClass("lightOpen","light");
				return false;
			});
			

	
	// add index class item to each of these lists of links:
	// entertainment
  jQuery.each($("div").filter(".movie_details"),
    function(){var i = 0;
      jQuery.each($(this).find("ul").find("a"),function(){$(this).addClass(String(i));i++;});
      //console.log($(this).find("ul").find("a"))
    });
    
  // world clubs club links
  jQuery.each($("div").filter(".world_clubs"),
    function(){var i = 0;
      jQuery.each($(this).find("ul").find("a"),function(){$(this).addClass(String(i));i++;});
      //console.log($(this).find("ul").find("a"))
    });
  
  // connections map links 

  jQuery.each($("div").filter(".wbcMenu_connections_subSection"),
    function(){var i = 1;
      jQuery.each($(this).find("ul").find("a"),function(){$(this).addClass(String(i));i++;});
      //console.log($(this).find("ul").find("a"))
    });

	
	// entertainment list anchor events:
	$("div").filter(".movie_details").find("ul").find("a").click(
		function(){
			var list = $(this).parents(".doubleList");
      var sect = $(this).parents(".wbcMenu_subSection");
      var footer = sect.find(".entertainment_detailsFooter");
      var filter = ".details_wrap:eq("+ $(this).attr("className")+")"; 		
			$(list).slideUp();
			sect.find("div").filter(filter).slideDown("normal",function(){$(footer).show();});
			
			return false;
	});

// view movie details list link in details sections
  $("div.movie_details").find("a").filter(".viewList").click(
    function(){
        
        var sect = $(this).parents(".menuItem");
        
        sect.find("div").filter(".details_wrap:visible").slideUp("normal",function(){sect.find("div").filter(".doubleList").show("normal");});
        
        return false;
    });
// view movie details list link in details sections
  $("div").find("a").filter(".backArrow").click(
    function(){
        
        var sect = $(this).parents(".details_wrap");
        var prevItem = sect.prev(".details_wrap:hidden");
       if(prevItem[0] != undefined)
        {
          sect.hide();
          prevItem.show();
        } 
        return false;
    });    
// view movie details list link in details sections
  $("div").find("a").filter(".forwardArrow").click(
    function(){
        
        var sect = $(this).parents(".details_wrap");
        var prevItem = sect.next(".details_wrap:hidden");
        //alert(prevItem[0])
        if(prevItem[0] != undefined)
        {
          sect.hide();
          prevItem.show();
        } 
        return false;
    });    
    
    
    
// expand colapse menu subSection when header clicked:
	$("div").filter(".world_clubs").find("ul").find("a").click(
		function(){
		  var section = $(this).parent().parent().parent().parent();
			$(section).parent().find(".wbcMenu_subSection:eq(0)").hide("slow");
			var filter = ".cityDetails:eq("+ $(this).attr("className")+")"; 
      $(section).parent().find(filter).slideDown("slow");
			//$(section).parent().find(".wbcMenu_subSection:eq(1)").slideDown("slow");
		
			
			return false;
	});
	
	
// world clubs view list link in details sections
  $("div").filter(".world_clubs_rightNAV").find("a").filter(".viewList").click(
    function(){
        
        var sect = $(this).parents(".menuItem");
        var list = $(this).parents(".cityDetails").prevAll(".wbcMenu_subSection");
        
        // world clubs
        sect.find("div").filter(".cityDetails:visible").hide();
        list.slideDown("slow");
        return false;
    });
    
// world clubs close link in details sections
  $("div").filter(".world_clubs_rightNAV").find("a").filter(".close").click(
    function(){
        
        var sect = $(this).parents(".menuItem");
        var list = $(this).parents(".cityDetails").prevAll(".wbcMenu_subSection");
        
        // world clubs
        sect.find("div").filter(".cityDetails:visible").hide();
        //list.show();
        return false;
    });    
    
// world clubs back arrow in details sections
  $("div").filter(".world_clubs_rightNAV").find("a").filter(".backArrow").click(
    function(){
        
        var sect = $(this).parents(".cityDetails");
        var prevItem = sect.prev(".cityDetails:hidden");
       if(prevItem[0] != undefined)
        {
          sect.hide();
          prevItem.show();
        } 
        return false;
    });    
// world clubs forward arrow in details sections
  $("div").filter(".world_clubs_rightNAV").find("a").filter(".forwardArrow").click(
    function(){
        
        var sect = $(this).parents(".cityDetails");
        var prevItem = sect.next(".cityDetails:hidden");
        //alert(prevItem[0])
        if(prevItem[0] != undefined)
        {
          sect.hide();
          prevItem.show();
        } 
        return false;
    });    



// connections - load map links	
$("div").filter(".wbcMenu_connections_subSection").find("ul").find("a").click(
		function(){
			//if($(this).parent().classN
		  var imgToSwitch = $("div").filter(".connections_content_image").find("img");
			var newImgSrc = "images/connections/maps/map_"+ $(this).attr("className")+".jpg"; 
     	imgToSwitch.attr("src",newImgSrc) ;
			
			return false;
	});	
	
	// end doc ready
	
});
}
catch(e){}





