function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function onSearchEnter( evt, frm ) {
  var keyCode = null;

  if( evt.which ) {
  keyCode = evt.which;
  } else if( evt.keyCode ) {
  keyCode = evt.keyCode;
  }
  if( 13 == keyCode ) {
  window.location='/search/search-results.aspx?zoom_query=' + document.getElementById('zoom_query').value;
  return false;
  }
  return true;
}

function onSearchEnter(evt, frm) {
    var keyCode = null;

    if (evt.which) {
        keyCode = evt.which;
    } else if (evt.keyCode) {
        keyCode = evt.keyCode;
    }
    if (13 == keyCode) {
        goToSearch();
        return false;
    }
    return true;
}

function goToSearch() {
    var seoSearch = document.getElementById('zoom_query').value;
    while (seoSearch.indexOf(' ') >= 0) seoSearch = seoSearch.replace(' ', '-');
    allowedChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-"
    while (seoSearch.indexOf('--') >= 0) seoSearch = seoSearch.replace('--', '-');
    var i = 0;
    while (i < seoSearch.length) {
        currentChar = seoSearch.substr(i, 1);
        if (allowedChars.indexOf(currentChar) == -1) {
            while (seoSearch.indexOf(currentChar) >= 0) seoSearch = seoSearch.replace(currentChar, '');
        }
        else i++;
    }
    window.location = '/search/' + seoSearch + '.html'
}

function toggleVideo(panelId, videoSource)
{
	document.getElementById('videoPanel').style.display = 'none';
	document.getElementById('comingSoonPanel').style.display = 'none';
	document.getElementById(panelId).style.display = 'block';
	if (panelId == 'videoPanel') document.getElementById(panelId).src = videoSource;
}

function clearBox(textboxId) {
    if (document.getElementById(textboxId).value == "search") document.getElementById(textboxId).value = "";
}

function populateBox(textboxId) {
    if (document.getElementById(textboxId).value == "") document.getElementById(textboxId).value = "search";
}

var _gaq = _gaq || []; 
_gaq.push(['_setAccount', 'UA-1759227-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'; 
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga); 
})(); 

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-26936246-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);
  })();

