/*
Anchor created functions
Flash BackNavigator
Tested in IE, Firefox, Safari, Opera
For IE6 I need to fix a problem with the add Anchor
*/
var current;
document.isIE = navigator.appName.indexOf("Microsoft") != -1;
/**
Reads the anchor selected on the browser.
Return the value of the hash. 
*/
function readHash(){
  return top.location.hash.replace("#", "");
}
/**
Returns the Flash movie
*/
function thisMovie(movieName) {
  if (navigator.appName.indexOf("Microsoft") != -1) {
    return window[movieName];
  }
  else {
    return document[movieName];
  }
}
/**
GotoSection Function
*/
var gotoSectionCalls = 0;
function gotoSection() { 
  var section = readHash();
  section =(section)?section:"1";

  //alert("HOLAS " + section);

  if (document.isIE && !section){
    top.location.hash = "1";
    current = "1";
  } else if(document.isIE){
    current = section;
  }

  try {
    thisMovie("sw_sweep").gotoSection(section);
  } catch (e) {
    // registration pages has no gotoSection
  }
}
/**
callActionMovie Function
This function is for IE6 fix
*/
function callActionMovie(){
  thisMovie("sw_sweep").gotoSection(current);
}
/**
Returns the Flash movie
*/
function hashChange() {
  if (current!=readHash()){
    current = readHash();
    gotoSection();
  } 
}
/**
Add Anchor
*/
function addAnchor(id){
  top.location.hash = id;
  //location.href = location.href.split("#")[0] + "#" + id;
}
/*
Interval  
*/
setInterval(hashChange, 500);
