/* 
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) {
   if (value) {
		 var strTemp='';
		 for (i = value.length-1; i>=0; i--){
			 strTemp+=value.charAt(i);
		 }
		 strTemp = strTemp.split('|').join('@');
		 document.write('<a href=mailto:' + strTemp + '>' + strTemp + '</a>');
	 }
}
var tempRoot = document.location.href;
var splitRoot = tempRoot.split("/");
var root = splitRoot[0] + '/' + splitRoot[1] + '/' + splitRoot[2] + '/' + splitRoot[3] + '/';
var checkRoot = root.split("victorverhuis");
if (checkRoot[1] !== undefined) {
    root = root;
}
else {
    root = splitRoot[0] + '/' + splitRoot[1] + '/' + splitRoot[2] + '/';
}
function Mouseover(temp){ 
    var imgUrl = temp.src;
    imgUrl = imgUrl.split("1.");
    var imgString = imgUrl[0];
    var ext = imgUrl[1];
    temp.src = imgString + "2." + ext;
}
function Mouseout(temp){
    var imgUrl = temp.src;
    imgUrl = imgUrl.split("2.");
    imgString = imgUrl[0];
    var ext = imgUrl[1];
    temp.src = imgString + "1." + ext;
}
function ClosePopUp() {
    var popup = document.getElementById("SalesPoints");
	popup.style.visibility = 'hidden';
}