    function popUp(url) {
      window.open(url,
      'popUpWindow',
      'height=120, width=100, left=300, top=300, resizable=no, scrollbars=no, toolbar=no, menubar=no, location=no, directories=no, status=no');
    }
    
    function show(id) {

     if( document.getElementById('desc_' + id).style.display=='none' )
      {
        document.getElementById('desc_' + id).style.display = '';
        document.getElementById('show_' + id).style.display = 'none';
      }
      
     else
      {
        document.getElementById('desc_' + id).style.display = 'none';
      }
    }
    
    function setDisplay(id) {

     if(document.getElementById(id).style.display=='none' ) {
      document.getElementById(id).style.display = ''; }
     else {
      document.getElementById(id).style.display = 'none'; }
    }
	function noDisplay(id) {
      document.getElementById(id).style.display = 'none';
    }
    
    function showprop(id,eventid, type) { 
      if( document.getElementById(id).style.display=='none' ) { 
        document.getElementById(id).style.display = '';
        if(type == "monster") {
        document.getElementById('ajaxDialogue').innerHTML     = 
        "Which action do you prefer? Choose one from the following list: \<p>\<a onclick=\"getDropInfo('" + eventid + "','monster'); showprop('ajaxFrame'); setDisplay('smokescreen')\">Add to current results\<\/a>\<br \/>\<a href=\"http:\/\/rune-nifelheim.com\/mobsearch\/?cid=on&amp;id=" + eventid + "\">Perform a new search\<\/a>\<br \/>\<a href=\"javascript: showprop('ajaxFrame'); setDisplay('smokescreen')\">Close this dialogue\<\/a>\<\/p>";
        }
        if(type == "item") {
        document.getElementById('ajaxDialogue').innerHTML     = 
        "Which action do you prefer? Choose one from the following list: \<p>\<a onclick=\"getDropInfo('" + eventid + "','item'); showprop('ajaxFrame'); setDisplay('smokescreen')\">Add to current results\<\/a>\<br \/>\<a href=\"http:\/\/rune-nifelheim.com\/itemsearch\/?cid=on&amp;id=" + eventid + "\">Perform a new search\<\/a>\<br \/>\<a href=\"javascript: showprop('ajaxFrame'); setDisplay('smokescreen')\">Close this dialogue\<\/a>\<\/p>";

        }
      } 
      else { 
      document.getElementById(id).style.display = 'none';
      }
    }
    
    /* slightly modified ajax function from w3schools */
    
    var xmlHttp;

    function getMonsters(str,id) {
    
      if (str.length==0) { 
        document.getElementById(id).innerHTML="";
        return;
      }
      
      if (str.length>15) { 
        document.getElementById(id).innerHTML="";
        return;
      }
      
      xmlHttp=new XMLHttpRequest();
      
      if (xmlHttp==null) {
        return;
      } 
      
      var url="http://localhost/rune-nifelheim.com/ajax.suggest.php";
      url=url+"?q="+str;
      url=url+"&sid="+Math.random();
      xmlHttp.onreadystatechange=stateChanged;
      xmlHttp.open("GET",url,true);
      xmlHttp.send(null);
    } 

    function stateChanged() { 
      if (xmlHttp.readyState==4) { 
        document.getElementById("monstername").innerHTML=xmlHttp.responseText;
      }
    }

    /* mob search ajax */
    var xmlhttp;

    function getDropInfo(id,type) {

      xmlhttp=null;
      xmlhttp=new XMLHttpRequest();
      
      if (xmlhttp!=null) {
        var url="http://rune-nifelheim.com/db/ajax.addSearch.php";
        url=url+"?searchtype=" + type + "&cid=on&id="+id;
            
        xmlhttp.onreadystatechange=state_Change;
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
      }
    }

    function state_Change() {
      if (xmlhttp.readyState==4) {

        if (xmlhttp.status==200) {
          document.getElementById("AllSearchResults").innerHTML= document.getElementById("AllSearchResults").innerHTML + xmlhttp.responseText;
        }
        
        else {
          alert("Problem retrieving data:" + xmlhttp.statusText);
        }
      
      }
    }

    /* activate check boxes */
      function checkBox(id) {
        document.getElementById(id).checked = 'true';
      } 
        
    /* insert monster name */
      function insertMonster(name) {
        document.getElementById('name').value = name;
      }
