/*
Script: ajaxByIdReload.js
	Easy Reloadscript for HTML Ids.

Autor: Henry Kluck
*/

function ajaxByIdReload(file,id,time)
			{
				var
					$http,
					$self = arguments.callee;

				if (window.XMLHttpRequest) {
					$http = new XMLHttpRequest();
				} else if (window.ActiveXObject) {
					try {
						$http = new ActiveXObject('Msxml2.XMLHTTP');
					} catch(e) {
						$http = new ActiveXObject('Microsoft.XMLHTTP');
					}
				}
				if ($http) {
					$http.onreadystatechange = function()
					{
						if (/4|^complete$/.test($http.readyState)) {
							document.getElementById(id).innerHTML = $http.responseText;
							setTimeout(function(){$self(file,id,time);},time);
						}
					};
					$http.open('GET', file + '?' + new Date().getTime(), true);
					$http.send(null);
				}
			}



function ajaxByIdClick(file,id)
			{
				var
					$http,
					$self = arguments.callee;

				if (window.XMLHttpRequest) {
					$http = new XMLHttpRequest();
				} else if (window.ActiveXObject) {
					try {
						$http = new ActiveXObject('Msxml2.XMLHTTP');
					} catch(e) {
						$http = new ActiveXObject('Microsoft.XMLHTTP');
					}
				}
				if ($http) {
					$http.onreadystatechange = function()
					{
						if (/4|^complete$/.test($http.readyState)) {
							document.getElementById(id).innerHTML = $http.responseText;
						}
					};
					$http.open('GET', file + '?' + new Date().getTime(), true);
					$http.send(null);
				}
			}
