function addClickListener(){
        EventInn.addListener([DomInn.getElementsByClassName("checkroom_link"),DomInn.getElementsByClassName("viewphone_link"),DomInn.getElementsByClassName("contactinn_link"),DomInn.getElementsByClassName("visitinnpage_link"),DomInn.getElementsByClassName("emailafriend_link"),DomInn.getElementsByClassName("emailinn_link")],"click",trackingCallBack);
}

function trackingCallBack(){
        section = this.className;
        remoteUrl='/scripts/incrementClicks.php?section='+section + '&name=' + nameInn;
        //alert(remoteUrl);
        if(navigator.appName == "Microsoft Internet Explorer") {
                http = new ActiveXObject("Microsoft.XMLHTTP");
        } else {
                http = new XMLHttpRequest();
        }

        http.open("GET", remoteUrl);
        http.onreadystatechange=function() {
                if(http.readyState == 4) {
                        //alert(http.responseText);
                }
        }
        http.send(null);
}

function showPhoneNumber(){
        document.getElementById('phonenumber').innerHTML = innPhone;
}

function openPopup(url, width, height) {
  var o = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=auto,"; 
  o += "width=" + width + ",height=" + height;
  var w = window.open(url, '', o);
  w.focus();
}

function openMapPopup(url) {
  openPopup(url, 520, 420);
}

/*
  This isn't comprehesive, but it should fairly decent.
  Don't know why JS doesn't have a native implementation
  
*/
function htmlEncode(text) {
  //must be first for obvious reason
  text = text.replace(/&/, "&amp;");
  text = text.replace(/\-/, "&minus;");
  text = text.replace(/</, "&lt;");
  text = text.replace(/>/, "&gt;");
  return text;
}


