
var isIE = false;
if (navigator.appName.match("Microsoft*")){
    isIE = true;

}

var included_files = new Array();

function include_dom(script_filename) {
    var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', script_filename);
    html_doc.appendChild(js);
    return false;
}

function include_once(script_filename) {
    if (!in_array(script_filename, included_files)) {
        included_files[included_files.length] = script_filename;
        include_dom(script_filename);
    }
}

function in_array(needle, haystack) {
    for (var i = 0; i < haystack.length; i++) {
        if (haystack[i] == needle) {
            return true;
        }
    }
    return false;
}


//Usage:  removeFirstChildFromObject(FromObjectID)
//ex: removeFirstChildFromObject(this.id)
function removeFirstChildFromObject(FromObjectID) {
	var tempObject = document.getElementById(FromObjectID);
	//remove table so that it can be created again without causing memory leak
	if (tempObject) {
	   //alert ("object: " + FromObjectID + ", got in 1");
	   if (tempObject.firstChild) {
	       //alert ("object: " + FromObjectID + ", got in 2");
		tempObject.removeChild(tempObject.firstChild);
	       //alert ("object: " + FromObjectID + ", got in 3");
	   }
	}
}

function removeChildren(thisObject) {
	while (thisObject.childNodes.length > 0) {
		thisObject.removeChild(thisObject.firstChild);
	}
}

include_once("jslib/hotelres.js");

