function OpenMapData(lokid) { 
	ahref="http://www.bioportal.si/naprej/drill_pmslepidoptera.php?lokid="+lokid+"&lang=si";
 	window.open(ahref, 'podatki', 'scrollbars=yes,resizable=no,width=450,height=600,top=150,left=150,dependent=yes, modal=yes');
}

function OpenMapDataSpa(spaid) { 
	ahref="http://www.bioportal.si/naprej/drill_spa.php?spaid="+spaid+"&lang=si";
 	window.open(ahref, 'podatki', 'scrollbars=yes,resizable=no,width=450,height=600,top=150,left=150,dependent=yes, modal=yes');
}

function OpenMapDataPsci(psciid) { 
	ahref="http://www.bioportal.si/naprej/drill_psci.php?psciid="+psciid+"&lang=si";
 	window.open(ahref, 'podatki', 'scrollbars=yes,resizable=no,width=450,height=600,top=150,left=150,dependent=yes, modal=yes');
}

function OpenMapDataKali(hid) { 
	ahref="http://www.bioportal.si/naprej/drill_kali.php?lid="+hid+"&lang=si";
 	window.open(ahref, 'podatki', 'scrollbars=yes,resizable=no,width=450,height=600,top=150,left=150,dependent=yes, modal=yes');
	
}

function OpenMapDataBaza(hid) { 
	ahref="http://www.bioportal.si/naprej/drill_baza.php?lid="+hid+"&lang=si";
 	//window.open(ahref, 'podatki', 'scrollbars=yes,resizable=no,width=450,height=600,top=150,left=150,dependent=yes, modal=yes');
	OpenLokalitetePopup(hid);
}
// KONEC

function FormItemSelected() {
  doSubmit();
}
  
function checkRadio(id) {
  xGetElementById(id).checked = 'checked';
}

function setActiveToolButton(toolid) {
  for (var i = 0; i < cw3_tools.length; i++) {
    var elt = xGetElementById(cw3_tools[i] + "_icon");

    if(elt == null) return;
    
    if (cw3_tools[i] == toolid) {
      elt.className = "toolbar_on";
    } else {
      elt.className = "toolbar_off";
    }
  }
  var elt = xGetElementById("tool");
  elt.value = toolid;
  
  if (typeof myfolders != "undefined") { // not on page load
    if (toolid.indexOf('outline') != -1) {
      ontop(5);
    }
    else if (toolid.indexOf('query') != -1) {
      ontop(1);
    }
    else if (toolid.indexOf('pdfrotate') != -1) {
      ontop(2);
    }
  }
}

function setSearchFrame(project, type) {
  var ifr = document.getElementById('search');
  ifr.style.height = '350px';
  ifr.src = project + '/search/index.php?project=' + project + '&searchname=' + type;
}

function resetSession() {
    elm = xGetElementById('fake_reset');
    elm.name = 'reset_session';
    elm.value = 'reset_session';
    document.carto_form.posted.value=0;
    doSubmit();
}

function clearQuery() {
    elm = xGetElementById('fake_query');
    elm.name = 'query_clear';
    elm.value = 'query_clear';
    doSubmit();
}

