var location_hash = undefined;
var played = false;

function play_intro(id, obj){
 // alert(home_flash_id + ' --- ' + id);
  
  
 // $('.tab_handle').removeClass('selected');
 // $(obj).addClass('selected');

  
  var hm_flash = thisMovie(home_flash_id);
  hm_flash.play_clip(0,id);
  
}



function play_case_study(hash){

  var bt = $('#intro_bt_' + hash);
  if(bt.get(0)!=undefined){
    //alert($('#bottom_menu_container').index(bt));
    $('#bottom_menu_container a').each(function(idx){
      if(this == bt.get(0)){
        rev_idx = $('#bottom_menu_container a').length - idx;
        var hm_flash = thisMovie(home_flash_id);
        hm_flash.play_clip(rev_idx,undefined);
        hover_button(rev_idx);
      }
    });
  }
  
  

  
  
}

function callExternalInterface() {
    get_flash("externalInterfaceExample").goHome();
}


function hover_button(idx){
  
  var hover_idx = $('.tab_handle').length - idx;


  if(played == false){
    var hash = location.hash.replace(/#/,'');  
    played = true;
    play_case_study(hash);
    return;
        
  }  
  

  $('.tab_handle').removeClass('selected');  
  $($('.tab_handle')[hover_idx]).addClass('selected');
  
}

function thisMovie(movieName) {
   // alert(BrowserDetect.browser);
    if(navigator.appName.indexOf("Microsoft") != -1 || BrowserDetect.browser =='Safari' || BrowserDetect.browser=='Chrome') {
        return window[movieName];
    }else {

        return document[movieName + '_obj'];
    }
}
