	function isset(obj){return (typeof(obj)!='undefined')&&(obj!=null);};
	function byid(obj){return document.getElementById(obj);}
	function ce(el){return document.createElement(el);}
	function in_array(needle, haystack, strict) {
	    var found = false, key, strict = !!strict;
	    for (key in haystack) {
	        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
	            found = true;
	            break;
	        }
	    }
	    return found;
	}
	function count_of(needle,haystack,strict){
		cnt=0;strict = !!strict;
		for(key in haystack){
	        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {cnt++}
		}
		return cnt;
	}
	String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
	function myajax2(url,dattt,object,p_callback,return_xml,met) {
	   var http_request = false;
	
	    if (window.XMLHttpRequest) { // Mozilla, Safari, Others..
	        http_request = new XMLHttpRequest();
	        if (http_request.overrideMimeType) {
	            http_request.overrideMimeType('text/xml');
	        }
	    } else if (window.ActiveXObject) { // IE
	        try {
	            http_request = new ActiveXObject("Microsoft.XMLHTTP");
	        } catch (e) {
	            try {
	            http_request = new ActiveXObject("Msxml2.XMLHTTP");
	            } catch (e) {}
	        }
	    }
	
	    if (!http_request) {
	        alert('Giving up :( Cannot create an XMLHTTP instance');
	        return false;
	    }
	    http_request.onreadystatechange = function() {
	       if (http_request.readyState == 4) {
	           if (http_request.status == 200) {
	             if (return_xml) {
	                   p_callback(http_request.responseXML,object);
	               } else {
	                   p_callback(http_request.responseText,object);
	               }
	           } else {
	           		object.requestHandler(http_request.status);
	           }
	       }
	   }
	    http_request.open(met, url, true);
	    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
	    http_request.send(dattt);
	
	}

function ChooseNews (id)
{
    document.getElementById('NewsBlock'+id).className = 'active';
    document.getElementById('NewsBlockDescription'+id).style.display = '';

    if (CurrentSelectNews!=id)
    {
        document.getElementById('NewsBlock'+CurrentSelectNews).className = '';
        document.getElementById('NewsBlockDescription'+CurrentSelectNews).style.display = 'none';
    }

    CurrentSelectNews = id;

    for (var i = 0; i<NewsBlockPosledovatelnost.length; i++) {if (NewsBlockPosledovatelnost[i]==CurrentSelectNews) CurrentNewsBlockIndex = i;}
}

function UpNewsBlock ()
{
    if (CurrentNewsBlockIndex >0)
    {
        CurrentNewsBlockIndex --;
        ChooseNews (NewsBlockPosledovatelnost[CurrentNewsBlockIndex]);
    }
}

function DownNewsBlock ()
{
    if (CurrentNewsBlockIndex < (NewsBlockPosledovatelnost.length-1))
    {
        CurrentNewsBlockIndex ++;
        ChooseNews (NewsBlockPosledovatelnost[CurrentNewsBlockIndex]);
    }
}