// javascript

var resizeFooter = function(){
	/*var fh = 80;
	var sh = dojo.coords(dojo.byId("site")).h + fh;
	var wh = (document.body)?document.body.clientHeight:window.innerHeight;
	
	if(sh > wh){		
		dojo.query(".resizable").forEach(function(el){
			dojo.style(el,"bottom","-"+((sh-wh)+fh)+"px");
		});	
	}else{
		dojo.query(".resizable").forEach(function(el){
			dojo.style(el,"bottom","0");
		});	
	}
	if(dojo.isIE){
		dojo.style(dojo.byId("informations"),"height",(sh-(fh*2))+"px");
	}
	setTimeout(resizeFooter,1000);*/
	
	if($chk($$(".newsInside")[0])){	
		if($$(".newsInside")[0].getCoordinates().height < 700){
			$$(".newsInside")[0].setStyle("height","700px");
		}
	}
	
	var siteH = $("site").getSize().y ;
	var bodyH = $$("body")[0].getSize().y;
	var textH = ($chk($("textBody")))?$("textBody").getCoordinates().top + $("textBody").getCoordinates().height:0 ;
	var footerH = ($chk($("footer")))?$("footer").getCoordinates().top:0;	
		
	var avoid = (Browser.Engine.trident && Browser.Engine.version == 4 && $chk(IS_ENTREPRISES));
	if(!avoid){		
		if(textH != 0){
		
			if(footerH < textH){
				$$(".resizable").each(function(el){
					el.setStyle("position","absolute");
					el.setStyle("top",textH+20);
				});
			}
			
		}else{
			
			if(bodyH < siteH){
				var diff = siteH - bodyH;
				if(siteH > 900) diff += 200;		
				$$(".resizable").each(function(el){
					el.setStyle("bottom",-diff);
				});
				
			}else{
				$$(".resizable").each(function(el){
					el.setStyle("bottom",0);
				});
			}
		
		}		
		
		/**/
		
	}else{
		
		/*$$(".resizable").each(function(el){
			el.setStyle("top",document.body.clientHeight+"px");
		});*/
	}
	
	setTimeout(resizeFooter,1000);
	$$(".resizable").each(function(el){
		el.removeClass("hideForIe6");
	});

}

var centerForIe = function(){
	if(dojo.isIE){
		var wh = (document.body)?document.body.clientWidth:window.innerWidth;
		dojo.style(site,"margin","0");
		dojo.style(site,"marginLeft",(Math.round(wh/2)-500)+"px");
	}
}

dojo.connect(window,"onresize",resizeFooter);
dojo.connect(window,"onresize",centerForIe);
dojo.connect(window,"onload",resizeFooter);
dojo.addOnLoad(centerForIe);
