
	subject_id = '';

	function handleHttpResponse(fct) {
		if (http.readyState != 1){
			sending = false;
			var div = document.getElementById('blocking_div');
				if (div!=null)			
					document.body.removeChild(div);
		}
		if (http.readyState == 4) {
			if (fct==null){
				if (subject_id != '') {
					document.getElementById(subject_id).innerHTML = http.responseText;
				}
			}
			else
				fct(http.responseText);
		}
	}
	
	function getHTTPObject() {
		var xmlhttp;
		/*@cc_on
		@if (@_jscript_version >= 5)
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (E) {
					xmlhttp = false;
				}
			}
		@else
		xmlhttp = false;
		@end @*/
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
				xmlhttp = new XMLHttpRequest();
			} catch (e) {
				xmlhttp = false;
			}
		}
		return xmlhttp;
	}
	var http = getHTTPObject(); // We create the HTTP Object
	var sending = false;
 AIM = {  
     frame : function(c) {  
   
         var n = 'f' + Math.floor(Math.random() * 99999);  
         var d = document.createElement('DIV');  
         d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>';  
         document.body.appendChild(d);  
   
         var i = document.getElementById(n);  
         if (c && typeof(c.onComplete) == 'function') {  
             i.onComplete = c.onComplete;  
         }  
   
         return n;  
     },  
   
     form : function(f, name) {  
         f.setAttribute('target', name);  
     },  
   
     submit : function(f, c) {  
         AIM.form(f, AIM.frame(c));  
         if (c && typeof(c.onStart) == 'function') { 
             return c.onStart();  
         } else {  
             return true;  
         }  
     },  
   
     loaded : function(id) {  
         var i = document.getElementById(id);  
         if (i.contentDocument) {  
             var d = i.contentDocument;  
         } else if (i.contentWindow) {  
             var d = i.contentWindow.document;  
         } else {  
             var d = window.frames[id].document;  
         }  
         if (d.location.href == "about:blank") {  
             return;  
         }  
   
         if (typeof(i.onComplete) == 'function') {  
             i.onComplete(d.body.innerHTML);  
         }  
     }  
 }  
 
 		function startCallback() {  
             // make something useful before submit (onStart)  
			
             return true;  
         }  
   
         function completeCallback(response) {  
             // make something useful after (onComplete)  

             document.getElementById('nr').innerHTML = parseInt(document.getElementById('nr').innerHTML) + 1;  
             document.getElementById('r').innerHTML = response;  
         }  
         
         
         
function getScriptPage(div_id,param,script_page,functionname, functionname2, functionname2Params) {
			if (!sending){
			sending = true;

			var div = document.createElement("div");
				div.setAttribute("id","blocking_div");
				div.style.position = 'absolute';
				div.style.width = "100px";
				div.style.backgroundColor="#FFFFFF";
				div.style.height = "24px";
				//div.style.height = getPageSizeWithScroll()[1]+"px";
				div.style.top = getScrollXY()[1]+"px";
				div.style.left = "0";
				div.style.zIndex = "999";
				//div.style.opacity= "0.6";
				//div.style.filter = "alpha(opacity=10)";	
				//div.innerHTML = '<img  src="img/antaris/loading.gif" style="margin:0"/>&nbsp;<span style="margin-bottom:2px">Loading...</span>';
				
				document.body.appendChild(div);

				subject_id = div_id;
	  	 	
	  	 		http.open('POST', script_page, true);
	      		http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	      		http.setRequestHeader("Content-length", param.length);
	      		http.setRequestHeader("Connection", "close");
	
	      
				//http.open("GET", script_page + "?"+param, true);
					http.onreadystatechange = function() { 
						handleHttpResponse(functionname); 
						if (http.readyState == 4 && functionname2) functionname2(functionname2Params);
					};
				//http.send(null);
		   		http.send(param);
	   		}
		}
		
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  arrayPageSizeWithScroll = new Array(scrOfX,scrOfY);
  return arrayPageSizeWithScroll;
}

	function getPageSize() {
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	  }
	   return [ myWidth, myHeight ];
	}
