// DODAL: Branko I., 15-11-2005

function OpenMapData(lokid) { 
	ahref="http://www.bioportal.si/naprej/drill_pmslepidoptera.php?lokid="+lokid+"&lang="+document.carto_form.language.value;
 	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="+document.carto_form.language.value;
 	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="+document.carto_form.language.value;
 	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="+document.carto_form.language.value;
 	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="+document.carto_form.language.value;
 	window.open(ahref, 'podatki', 'scrollbars=yes,resizable=no,width=450,height=600,top=150,left=150,dependent=yes, modal=yes');
	//OpenVsebinaPopup(hid,document.carto_form.language.value);
}


function OpenVsebinaPopup(lid,lang) {
  	w=800;
	winW=window.screen.availWidth-w-80;
	winH=window.screen.availHeight-400;
	winH=700;
	
      Dialog.alert({url: "http://www.bioportal.si/naprej/vsebina_popup.php?lid="+lid+"&lang="+lang, options: {method: 'get'}}, 
                     {top: 100, left:100, width:w, height:winH, wiredDrag: false, title: " ", className: "bptheme", okLabel:"Zapri okno",draggable:true,resizable:false,closable:true,destroyOnClose:true})    
}



// 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();
}
