
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<a.length-2;i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeForm(what,setting,whichForm) {
    //alert(what+"; setting "+setting+"; whichform="+whichForm);

   //submit self and onLoad will reload Navigate if necessary
   document.forms[whichForm].what.value = what;
   document.forms[whichForm].setting.value = setting;
   submit(whichForm);
}

function change(what,setting) {
    //alert(what);
   document.forms["view"].what.value = what;
   document.forms["view"].setting.value = setting;
   submit("view");
}

function submit(whichForm) {
   document.forms[whichForm].submit();
}

var about_win = null;
function showAbout() {
    var nav_width = 820;
    if (nav_width > screen.width*0.8) nav_width = screen.width*0.8;

    var nav_height = 420;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    about_win = open('about.html','about','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable');
    about_win.focus();
}
var contribute_win = null;
function showContribute() {
    var nav_width = 600;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 450;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    contribute_win = open('contribute.html','contribute','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable');
    contribute_win.focus();
}
var notes_win = null;
function showNotes(key) {
    var nav_width = 400;
    var nav_height = 400;
    var xOffset = screen.width - nav_width;
    var yOffset = screen.height - nav_height;
    var page_url = 'notes.jsp';
  if (key != null)
  {
    page_url += '?key=' + key ;
  }
    notes_win = open(page_url, 'notes','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    notes_win.focus();
}
var reference_win = null;
function showReference(references, key) {
    var nav_width = 400;
    var nav_height = 400;
    var xOffset = 0;
    var yOffset = 0;
    var page_url = 'referenceShow.jsp?references=' + references;
  if (key)
  {
    page_url += '&key=' + key ;
  }
    reference_win = open(page_url,'references','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    reference_win.focus();
}
var mynavigator = null;
function showIndicatorTree() {

    var nav_width = 300;
    var nav_height = 500;
    var xOffset = screen.width - nav_width;
    var yOffset = screen.height - nav_height;
    mynavigator = open('navigator.jsp?x=<%=System.currentTimeMillis()%>','navigator','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    mynavigator.focus();
}
var background_win = null;
function showBackground() {
    var nav_width = 600;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 450;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    background_win = open('background.html','background','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    background_win.focus();
}
var classification_win = null;
function showClassification() {
    var nav_width = 600;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 450;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    classification_win = open('classification.html','classification','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    classification_win.focus();
}
var publications_win = null;
function showPublications() {
    var nav_width = 600;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 450;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    publications_win = open('publications.html','publications','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    publications_win.focus();
}
var under_win = null;
function showUnder() {
    var nav_width = 400;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 150;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    under_win = open('under.html','under','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    under_win.focus();
}
var dataentry_win = null;
function showDataentry() {
    var nav_width = 600;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 200;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    dataentry_win = open('dataEntry.html','dataentry','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable');
    dataentry_win.focus();
}
var membership_win = null;
function showMembership(page) {
    var nav_width = 500;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 250;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    var page_url = "region.html";
    if (page == 1)
        page_url = "membership.html";
    membership_win = open(page_url,'membership','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable');
    membership_win.focus();
}
var survey_win = null;
function showSurvey(surveycode, sourcecode) {
    var nav_width = 760;
    if (nav_width > screen.width*0.85) nav_width = screen.width*0.85;

    var nav_height = 420;
    if (nav_height > screen.height*0.8) nav_height = screen.height*0.8;

    var xOffset = (screen.width - nav_width)/2;
    var yOffset = (screen.height - nav_height)/2;
    survey_win = open('survey.jsp?survey='+surveycode+'&source='+sourcecode,'dataentry','width='+nav_width+',height='+nav_height+',left='+xOffset+',top='+yOffset+',resizable,scrollbars');
    survey_win.focus();
}
