var prevHeight = 0;

function correctionHTML() {
    	$.ajax({
  		url: document.location.pathname+'?type=3',
  		success: function(data) {
  			$('.banner').html(data);	
  		}
	});

	$(window).load(function(){
       _pie_ielades();
	   _pie_kustibas();
	   adjustTitleTable();
	   
	  
	   $(window).resize(function(){
			if(prevHeight != $(window).height()){
				_pie_kustibas();
				prevHeight = $(window).height();
			}
			adjustTitleTable();
		})	   
	})

		if($.browser.name=='msie' && (parseInt($.browser.version)==6 || parseInt($.browser.version)==7) ){
			$("div.menu_item_cell").each(function (i) {
				$(this).removeClass("m_item_cell_inl_blck");
				$(this).addClass("m_item_cell_flt_left");
			});
			$("div.footer").each(function (i) {
				 $(this).addClass("clear_both_div");
			});
		}
}


var zeka=0;


function _pie_kustibas() {
	mekletVietuFooterim();	
}

function _pie_ielades() {
	mekletVietuFooterim();	
}

function mekletVietuFooterim()
{
	var left_bottom=500;
	var center=0;
	var footer_height=0;
	
	
	var win_he=$(window).height();	
	left_bottom=win_he;	
	if(win_he < ($('div.root').outerHeight()+20)) 
	{
		left_bottom=$('div.root').outerHeight() + 20;
	}
	
	center=$("div.border").width()/2 + $("div.border").offset().left;
	center=center+13;
	
	if($.browser.name=='msie' && parseInt($.browser.version)==6){
		$("div.rte_text").css({"margin-top":"35px"});
		$("div.title").css({"margin-left":"25px"});
	    $("div.small_txt").css({"margin-left":"25px"});
	}
	
	var v1=$("div.footer").outerHeight();
	if (v1<=35) v1=35;
	$("div.footer").css({"top":(left_bottom - v1) + "px","left":84+"px","position":"absolute"});
	
			
		
		
	//openSeaerchBlock prieks IE6
	if($("div#panel") && $.browser.name=='msie' && parseInt($.browser.version)==6)
	{
		$("div#panel").css({"top":"15px"});
	}
}

	function openSearchPanel()
	{
		$("div#panel").animate({
			height: "272px"
			})
			.animate({
				height: "272px"
				}, "fast");
			$("div.panel_button").toggle();
	}
	function closeSearchPanel()
	{
		$("div#panel").animate({
			height: "0px"
			}, "fast");
	}
function adjustTitleTable(){
	if(("#titleTable"))	{
		var tekosais= $("div.title_block").width();		
		$("#titleTable").css({"width":(parseInt(tekosais)-3)+"px"});		
		
		var plat= $("#titleTable").height();
		var plat2 = $("div.links_right").height();
		$("div.links_right").css({"padding-top":(plat-plat2-6)+"px"});
	}
	if($.browser.name=='msie' && parseInt($.browser.version)==7)
		$("#titleTable td:first-child").css({"padding-left":"20px"});
}
