
// Cross-browser implementation of element.addEventListener()
function addEventHandler(oNode, sEvt, fFunc, bCap) {
	
	if (oNode.addEventListener) { // DOM

		oNode.addEventListener(sEvt, fFunc, bCap);
	
	} else if (oNode.attachEvent) { // IE
	
		oNode.attachEvent("on" + sEvt, fFunc);
		
	} 
}
function getEventObject(e){
	var evt=window.event || e //evt evaluates to window.event or inexplicit e object, depending on which one is defined
	return evt;
}

// Cross-brower XMLHttpObject
function getHTTPObject(){
   if (window.ActiveXObject) { //MS IE
	   
       return new ActiveXObject("Microsoft.XMLHTTP");
	   
   } else if (window.XMLHttpRequest) {  //W3C DOM
   
       return new XMLHttpRequest();
	   
   } else {
	   
      alert("Your browser does not support AJAX.");
      return null;
	  
   }
}


function getImageInfoAjax(container, GAL, imgidx) {
	
	xhr = getHTTPObject();
	var html="";
	if (xhr != null) {
		var qrys = './getImgInfo.php?gal=' + GAL + '&id=' + imgidx;
		xhr.open("GET", qrys, true);
		xhr.send(null); 
		xhr.onreadystatechange = function(){
			if (xhr.readyState == 4) {
				ret = xhr.responseText;
				html = "<div id=\"iptc_left\">\n";
				html += ret;
				html += "</div>";
				container.innerHTML=html;
			} else {
				container.innerHTML="<h2>....</h2>";
			}
		};
	}
}

function initAll() {
	
	
	
}

window.onload=initAll;


