// loading Links from url (url - localhost)
function loadXMLDoc(url){ 
	// для "родного" XMLHttpRequest
		if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.open("GET", url, false);
		req.send(null);
		
		// для версии с ActiveX
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.open("GET", url, false);
			req.send();
		}
	}
}
//Flag
function processReqChange() { 
	// "complete"
	if (req.readyState == 4) {
		if (req.status == 200) {
			return true;
		}
	}
	return false;
} 
//write links in document
 function writedoc(){ 
			if (processReqChange()){
				document.write(req.responseText);
				return false;
			}else{
				return true;
				//setTimeout('writedoc();',1000);
			}
		}
var numLink=1;
 function initRotator(){
	if (linksKol>0) {
		nameLink='link_' + numLink;
		temp = new statObj(nameLink);
		temp.show();
		setTimeout('refreshBlocks();',3000);
		numLink+=1;
	}
	 
 }

  function statObj(id){
	this.bot=-3;
	this.el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (!this.el) return null;
	this.doc = (document.layers)? this.el.document: this.el;
	this.css = (this.el.style)? this.el.style: this.el;
	var px = (document.layers||window.opera)? "": "px";
	this.width = (this.el.offsetWidth)? this.el.offsetWidth: (this.css.clip.width)? this.css.clip.width: 0;
	this.height = (this.el.offsetHeight)? this.el.offsetHeight: (this.css.clip.height)? this.css.clip.height: 0;
	this.obj = id + "statObj"; 	eval(this.obj + "=this");
}
function linkShow(){this.css.display='block';}
function linkHide(){this.css.display='none';}

function refreshBlocks(){
	if (numLink>linksKol) {numLink=1;}
	temp.hide();
	delete temp;
	nameLink='link_' + numLink;
	temp = new statObj(nameLink);
	numLink+=1;
	temp.show();
	setTimeout('refreshBlocks();',3000);
}
statObj.prototype.show = linkShow;
statObj.prototype.hide = linkHide;