function openWindow(url, name) {
  var l = openWindow.arguments.length;
  var w = "";
  var h = "";
  var features = "";

  for (i=2; i<l; i++) {
    var param = openWindow.arguments[i];
    if ( (parseInt(param) == 0) ||
      (isNaN(parseInt(param))) ) {
      features += param + ',';
    } else {
      (w == "") ? w = "width=" + param + "," :
       h = "height=" + param;
    }
  }

  features += w + h;
  var code = "popupWin = window.open(url, name";
  if (l > 2) code += ", '" + features;
  code += "')";
  eval(code);
  }


// email this page
var fileName = document.URL;
escapedFileName = escape(fileName);
function emailfriend()
{
var popurl="/wnet/nature/email_friend/email.html?"+escapedFileName;
winpops=window.open(popurl,"","width=540,height=452,status,scrollbars");
}  
			
  
 // drop down menu
function gotosite(site) {            
        if (site != "") {                    
                self.location=site; 
        }
}    






if ((window.navigator.appName.indexOf("Microsoft")==0) &
(window.navigator.appVersion.substring(0,1)=="4")) {
                                window.focus();
                        }
                        else
                            if ((window.navigator.appName.indexOf("Netscape")
==0) & (window.navigator.appVersion.substring(0,1)=="4")) {
                                window.focus();
                        }
						
 function myOpenWindow() {
    myWindowHandle = window.open('/cgi-registry/poll/poll.pl','myWindowName','width=333,height=400');
} 						

 function myOpenWindow1() {
    myWindowHandle = window.open('/cgi-registry/poll/poll.pl','myWindowName','width=345,height=175');
} 						


// write media player javascript
document.write('<script src="/mediaplayer/player.js" language="JavaScript"></script>');

PBVideoWindow_X=580;
PBSVideoWindow_Y=390;
PBSAudioWindow_X=394;
PBSAudioWindow_Y=128;

// write flash javascript
document.write('<script src="/wnet/nature/includes/swfobject.js" language="JavaScript"></script>');

// popup poll
function goToPoll() {
  var pollUrl = "/cgi-registry/poll/poll.pl?results=";
  var pollName = "popup_poll";
  var theAnswer = null;
  var results = document.forms[pollName].results.value;
  var site_id = document.forms[pollName].site_id.value;
  var poll_id = document.forms[pollName].poll_id.value;
  pollUrl = pollUrl + results + '&site_id=' + site_id + '&poll_id=' + poll_id;
  for (counter=0; counter<document.forms[pollName].q1.length;counter++) {
    if (document.forms[pollName].q1[counter].checked) theAnswer = counter+1;
  }
  if (theAnswer) pollUrl = pollUrl + '&q1=' + theAnswer;
  self.name = "nature_parentwindow";
  window.open(pollUrl, "PollResults", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=524,height=500")


  return false;
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}
