/*f2a_scripts.js for Freedom2Act's homepage   2011.12.06 */

/************************
 * popup a new window ***/

function popup(mylink){
  if (!window.focus) return true;
  var href;
  if (typeof(mylink) == 'string')
     href=mylink;
  else
     href=mylink.href;
  newwindow=window.open(href, 'popup', 'width=1024,height=768,scrollbars=yes,resizable=yes,dependent=yes');
  if (window.focus) {newwindow.focus()}
  return false;
}

function popupCV(mylink){
  if (!window.focus) return true;
  newwindow=window.open(mylink, 'popupCV', 'width=315,height=450,scrollbars=no,resizable=no,dependent=yes');
  if (window.focus) {newwindow.focus()}
  return false;
}

/****************************************************************
 * CSS Top Menu: Son of Suckerfish Dropdowns with up to 3 levels
 * By Patrick Griffiths and Dan Webb.   ********/

f2sfHover = function() {
  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    }
  }
}

if (window.attachEvent) window.attachEvent("onload", f2sfHover);


/***************************
 *Google Analytics snippet */

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19731773-1']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

