/* 
WMS Lucrasoft Javascript Standaard functies
*/

function makeHttpRequest(url){ 
    if (window.XMLHttpRequest) { // Mozilla, Safari,... 
        http_request = new XMLHttpRequest(); 
        if (http_request.overrideMimeType) { 
            http_request.overrideMimeType('text/xml'); 
    } 
        } else if (window.ActiveXObject) { // IE 
            try { 
                http_request = new ActiveXObject("Msxml2.XMLHTTP"); 
            } catch (e) { 
                try { 
                    http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
                } catch (e) {} 
            } 
        } 
    if (!http_request) { 
        alert('Helaas, jouw browser is te oud om deze pagina te kunnen laden.'); 
        return false; 
    } 
        http_request.open('GET', url, true); 
        http_request.send(null); 
}

function getField(fldName, strType) {
  var arrCheck = new Array;
  var blnFound = false;
  arrObjects = document.getElementsByTagName(strType.toUpperCase());

  for (i=0; i<arrObjects.length; i++) {
    if (arrObjects[i].id.split("_")[arrObjects[i].id.split("_").length - 1] == fldName) {
      blnFound = true;
      break;
    }
  }
	
  return arrObjects[i];
}

function PopUp(strPath) {
    window.open(strPath, 'WMSPOPUP', 'status=yes,resizable=yes,width=1024,height=764');
}

function MailTo(value, title) {
    if (value) {
        var strTemp = '';
        for (i = value.length - 1; i >= 0; i--) {
            strTemp += value.charAt(i);
        }
        strTemp = strTemp.split('|').join('@');
        document.write('<a class="ContactLink" title="' + title + '" href=mailto:' + strTemp + '>' + strTemp + '</a>');
    }
}
        function menubold() {

            var arr = new Array();
            var nodeint = 2;
            //arr = document.getElementsByName("menuitem");
            arr = document.getElementById('rmTopMenu').childNodes.item(2).childNodes;
            if (arr.length == 0) {
                arr = document.getElementById('rmTopMenu').childNodes.item(1).childNodes;
                nodeint = 1;
            }
            for (var i = 1; i < arr.length - 1; i++) {
                
                //var li = document.getElementsByName("menuitem").item(i);
                var li = document.getElementById('rmTopMenu').childNodes.item(nodeint).childNodes.item(i).childNodes.item(0)
                var oldwidth = li.offsetWidth - 12
                li.style.fontWeight = "bold";
                var width = li.offsetWidth - 12
                if (oldwidth > width) {
                    li.style.width = oldwidth + "px"
                } else {
                    li.style.width = width + "px"
                }
                
                li.style.fontWeight = "normal";
            }

        }

        function setSectorEmpty() {
            var combo = $find('rcbSector');
            combo.clearSelection();
            combo.set_emptyMessage("Sector");
        }
        function setLocationEmpty() {
            var combo = $find('rcbLocation');
            combo.clearSelection();
            combo.set_emptyMessage("Location");
        }
        function setSalaryEmpty() {
            var combo = $find('rcbSalary');
            combo.clearSelection();
            combo.set_emptyMessage("Salary");
        }
        function setJobTypeEmpty() {
            var combo = $find('rcbJobType');
            combo.clearSelection();
            combo.set_emptyMessage("Job Type");
        }

