this.ver=navigator.appVersion;
this.agent=navigator.userAgent;
this.dom=document.getElementById?1:0;
this.opera5=this.agent.indexOf("Opera 5")>-1;
this.ie=(this.ver.indexOf("MSIE")>-1 && this.dom && !this.opera5)?1:0;
function showNews(){	
	this.act = 0;
	this.className = "newsLine";
	this.idName = "newsBlock";
	this.news = document.getElementsByClassName(this.className);
	this.newsLength = this.news.length;
	this.step = 0.1;
	this.alpha = 0;
	this.speed = 100;
	this.pause = 4000;
	this.idInterval;	
	
	startShow();
	
	function doShow(){
		setBrowserOpacity(this.news[this.act],this.alpha);
		this.alpha += this.step;
		if(this.alpha >= 1){
			clearInterval(this.idInterval);
			setTimeout(startHide, this.pause);
		}
	}
	function doHide(){
		setBrowserOpacity(this.news[this.act],this.alpha);
		this.alpha -= this.step;
		if(this.alpha <= 0){
			clearInterval(this.idInterval);
			this.act ++;
			if(this.act >= this.newsLength){
				this.act = 0;
			}
			startShow();
		}
	}
	function startHide(){
		this.idInterval = setInterval(doHide,this.speed);
	}
	function startShow(){
		for(i=0;i<this.newsLength;i++){
			if(i!=this.act){
				this.news[i].style.display = "none";
			}
		}
		setBrowserOpacity(this.news[this.act],this.alpha);
		this.news[this.act].style.display = "block";
		this.idInterval = setInterval(doShow,this.speed);
	}
}
document.getElementsByClassName = function(cl) {
	var retnode = [];
	var myclass = new RegExp('\\b'+cl+'\\b');
	var elem = this.getElementsByTagName('*');
	for (var i = 0; i < elem.length; i++) {
	var classes = elem[i].className;
	if (myclass.test(classes)) retnode.push(elem[i]);
	}
	return retnode;
};
function setAlphaElement(el,alpha){
	var arr = el.getElementsByTagName("*");
	for(i=0;i<arr.length;i++){
		setElementOpacity(arr[i],alpha);			
	}	
}
function setBrowserOpacity(el,alpha){
	if(ie){
		setAlphaElement(el,alpha);
	}
	else{
		setElementOpacity(el,alpha);
	}
}
