function fixContentsStuff(){
		
		var oContentsBanner=document.getElementById("contentsbanner");
		
		if (null!=oContentsBanner)
		{
			var h1 =0;
			var h2 =oContentsBanner.offsetHeight;	
			var oContents=document.getElementById("contents");
			
			if (null!=oContents)
			{
				h1=oContents.offsetHeight;	
			};
		
			var max = h1;
		
			if(h2 > max) 
			{
				max = h2;
			};
			oContentsBanner.style.height = max + "px";
		};
		
		
}
	
	function buildCalendar(elementId,lang,month,year,url){
		
		var strCalendar;
		month=month-1;
		
		if (1==lang)
		{
			strCalendar='<table class="calend" id="calendar"><thead><tr><th>Ïí</th><th>Âò</th>	<th>Ñð</th><th>×ò</th><th>Ïò</th><th>Ñá</th><th>Âñ</th></tr>';
		}
		else if (2==lang)
		{
			strCalendar='<table class="calend" id="calendar"><thead><tr><th>Ïí</th><th>Âò</th>	<th>Ñð</th><th>×ò</th><th>Ïò</th><th>Ñá</th><th>Íä</th></tr>';			
		}
		else
		{
			strCalendar='<table class="calend" id="calendar"><thead><tr><th>Mn</th><th>Tu</th>	<th>Wd</th><th>Th</th><th>Fr</th><th>St</th><th>Su</th></tr>';			
		};
		
		var strMonths = "January,February,March,April,May,June,July,August,September,October,November,December";
		var arrMonths = strMonths.split(",");
		var strTemp = "1 " + arrMonths[month] + " " + year;
		
		var DateTemp = new Date(strTemp);
		var FirstDay = DateTemp.getDay();
		var Today = new Date();
		var IsToday = Today.getDate() + "/" + ( Today.getMonth()+1) + "/" + Today.getFullYear();
		
		var iStart;
		if(FirstDay==0){
			FirstDay=6;
		}
		else{
			FirstDay = FirstDay - 1;
		}
		
		for(var RowCount = 0; RowCount < 42; RowCount = RowCount + 7)
		{
			strCalendar += "<tr>";
	
			for(var i = RowCount; i < (RowCount + 7);i++)
			{	
		
				strTemp = ((i-FirstDay) + 1) + "/" + (month + 1) + "/" + year;
				if(i >= FirstDay && i < (31 + FirstDay))
				{		
					if(isDate(strTemp))
					{
						if(strTemp == IsToday)
						{
							strCalendar += "<td align=\"center\" class=\"CalButtonToday\">";
						}
						else
						{
							strCalendar += "<td align=\"center\">";
						}
						strCalendar += "<a href=\""+url+"?ChosenDay="+ ((i-FirstDay) + 1)+"&ChosenMonth="+(month+1)+"&ChosenYear="+(year)+"\">" + ((i-FirstDay) + 1)+'</a>';	
						strCalendar += "</td>";
					}
					else
					{
						strCalendar += "<td>&nbsp;</td>";
					}
				}
				else
				{
					strCalendar += "<td>&nbsp;</td>";
				}
		
			}//End For
	
			strCalendar += "</tr>";
		};
		
		strCalendar=strCalendar+'</tr></tbody></table>';
		WriteInnerHTML(elementId, strCalendar);		
	}
	
	function isDate(DateToCheck){
	var arrDate = DateToCheck.split("/");
	var myDAY = arrDate[0];
	var myMONTH = arrDate[1];
	var myYEAR = arrDate[2];
	var strDate;
	strDate = myMONTH + "/" + myDAY + "/" + myYEAR;
	var testDate=new Date(strDate);
	if(testDate.getMonth()+1==myMONTH){
	return true;
	} 
	else{
	return false;
	}
	}//end function
	
	function WriteInnerHTML(ElementID, Value){
	if(document.getElementById){
	document.getElementById(ElementID).innerHTML = Value;
	}
	else if(document.all){
	document.all[ElementID].innerHTML = Value;
	}
	else if(NN4){
	document.layers[ElementID].document.open();
	document.layers[ElementID].document.write(Value);
	document.layers[ElementID].document.close();
	}
	}

	function showForm(url,name,height,width)
	{
		height=0+height;
		width=0+width;
		
		if (0==height)
		{
			height=400;	
		};
		if (0==width)
		{
			width=600;	
		};
		
		newwindow=window.open(url,name,'height='+height+',width='+width+',left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,status=no');
		if (window.focus) {newwindow.focus()}
	};	
	
	function addBookmark(url,title)
	{
    	if (document.all)
    	{
          window.external.AddFavorite(url, title);
     	};
	}
	
	var iShiftAnons=0;
	
	function backAnons(all,count,section)
	{
		var now = new Date();
		var sMinute="s"+now.getHours()+now.getDay()+now.getMonth()+Math.round(now.getMinutes()/10);
		
		url="/?getanons=1&sh="+(iShiftAnons-count)+"&section="+section+"&all="+all+"&Min="+sMinute;
		str=null;
		new XMLRequest(url, str,-1*count,all,0);
	};
	
	function nextAnons(all,count,section)
	{
		var now = new Date();
		var sMinute="s"+now.getHours()+now.getDay()+now.getMonth()+Math.round(now.getMinutes()/10);
		
		url="/?getanons=1&sh="+(iShiftAnons+count)+"&section="+section+"&all="+all+"&Min="+sMinute;
		
		str=null;
		new XMLRequest(url, str,count,all,0);		
	};

	function nextAllNews(all,count,section,strict)
	{
		var now = new Date();
		var sMinute="s"+now.getHours()+now.getDay()+now.getMonth()+Math.round(now.getMinutes()/10);
		
		url="/?getnews=1&sh="+(iShiftAnons+count)+"&section="+section+"&st="+strict+"&Min="+sMinute;
		
		str=null;
		new XMLRequest(url, str,count,all,0);
	};

	function backAllNews(all,count,section,strict)
	{
		var now = new Date();
		var sMinute="s"+now.getHours()+now.getDay()+now.getMonth()+Math.round(now.getMinutes()/10);
		
		url="/?getnews=1&sh="+(iShiftAnons-count)+"&section="+section+"&st="+strict+"&Min="+sMinute;
		
		str=null;
		new XMLRequest(url, str,-1*count,all,0);
	};
	
	
/**********************************************/
function XMLRequest(url, str,count,all,typefeedback)
{
	var xmlhttp;
	var xmlrs = '';
	var err;
	var razdel;

	if (window.ActiveXObject) // Internet Explorer
        {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              if (xmlhttp)
              {
                if (0==typefeedback)
	            {
	            	xmlhttp.onreadystatechange=state_Change;
	            }
	            else if (1==typefeedback)
	            {
	            	xmlhttp.onreadystatechange=state_ChangeComment;
	            };
            	xmlhttp.open("GET",url,true);
                xmlhttp.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
                xmlhttp.send(str);
              }
        }
    else if (window.XMLHttpRequest) // Not Internet Explorer
        {
            xmlhttp=new XMLHttpRequest();
            
            if (0==typefeedback)
            {
            	xmlhttp.onreadystatechange=state_Change;
            }
            else if (1==typefeedback)
            {
            	xmlhttp.onreadystatechange=state_ChangeComment;
            };
            
            xmlhttp.open("GET",url,true);
            xmlhttp.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
            xmlhttp.send(str);            
        }
        
    
        
    function state_Change()
	{
		if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") 
		{
			if (xmlhttp.status==200) // i.e. "OK"
			{
				var oprevAnons=document.getElementById("prevAnons");
				var onextAnons=document.getElementById("nextAnons");
					
				if (null==oprevAnons || null==onextAnons)
				{
					exit;	
				};
			   	
				var respA=xmlhttp.responseText.split("{outside}");
			   	
				for (i=0;i<respA.length; i++)
			   	{
			   		NewsName=respA[i].split("{inside}");
			   		
			   		oli=document.getElementById("hrefAnons"+(i+1));
					if (null!=oli)
					{
						oli.innerHTML=NewsName[0];
						oli.href=NewsName[1];
						oli.title=NewsName[2];
					};
			   	
			   	};
			   	
			   	for (i=respA.length;i<all; i++)
			   	{
			   		oli=document.getElementById("hrefAnons"+(i+1));
					if (null!=oli)
					{
			   			oli.innerHTML="";
						oli.href="";
						oli.title="";
					};
			   	};
			   	
			   	iShiftAnons=iShiftAnons+count;
			   	
			   	if (0==iShiftAnons)
			   	{
			   		oprevAnons.style.display="none";
			   	}
			   	else 
			   	{
			   		oprevAnons.style.display="block";
			   	};
			   	
			   	if (all-count<=iShiftAnons)
			   	{
			   		onextAnons.style.display="none";
			   	}
			   	else
			   	{
			   		onextAnons.style.display="block";
			   	};
			   	
			   	
			}
		}
	}
	
	function state_ChangeComment()
	{
		if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") 
		{
			if (xmlhttp.status==200) // i.e. "OK"
			{
				var oprevAnons=document.getElementById("prevComment");
				var onextAnons=document.getElementById("nextComment");
					
				if (null==oprevAnons || null==onextAnons)
				{
					exit;	
				};
			   	
				var respA=xmlhttp.responseText.split("{outside}");
			   	
				for (i=0;i<respA.length; i++)
			   	{
			   		NewsName=respA[i].split("{inside}");
			   		oli=document.getElementById("comment_published"+(i+1));
			   		if (null!=oli)
					{
						oli.innerHTML=NewsName[0];						
					};
					
					oli=document.getElementById("comment_text"+(i+1));
					if (null!=oli)
					{
						oli.innerHTML=NewsName[1];						
					};
			   		
					oli=document.getElementById("comment_block"+(i+1));
					if (null!=oli)
					{
			   			oli.style.display="block";						
					};
			   	};
			   	
			   	for (i=respA.length;i<all; i++)
			   	{
			   		oli=document.getElementById("comment_block"+(i+1));
					if (null!=oli)
					{
						oli.style.display="none";						
					};
			   	};
			   	
			   	iShiftComment=iShiftComment+count;
			   	
			   	if (0==iShiftComment)
			   	{
			   		oprevAnons.style.display="none";
			   	}
			   	else 
			   	{
			   		oprevAnons.style.display="block";
			   	};
			   	
			   	if (all-count<=iShiftComment)
			   	{
			   		onextAnons.style.display="none";
			   	}
			   	else
			   	{
			   		onextAnons.style.display="block";
			   	};
			   	
			   	
			}
		}
	}
}

	function mesup(id)
	{
		var oRat=document.getElementById("rat"+id);
			
		if (null==oRat)
		{
			exit;	
		};	
		
		var iRat=(++oRat.innerHTML);		
	}
	
	function ismaxlength(obj)
	{
		var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "" 
		if (obj.getAttribute && obj.value.length>mlength) 
		{
			obj.value=obj.value.substring(0,mlength) 
		};
	} 
	
	var iShiftComment=0;
	
	function backComment(all,count,url)
	{
		url=url+"?getcomments=1&sh="+(iShiftComment-count)+"&all="+all;
		var str=null;
		new XMLRequest(url, str,-1*count,all,1);
	};
	
	function nextComment(all,count,url)
	{
		url=url+"?getcomments=1&sh="+(iShiftComment+count)+"&all="+all;
		var str=null;
		new XMLRequest(url, str,count,all,1);		
	};
	