var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},show:function(b){if(typeof b=="object"){for(var a=0;a<b.length;a++){this.showhide(b[a],"show")}}else{this.showhide(b,"show")}},hide:function(b){if(typeof b=="object"){for(var a=0;a<b.length;a++){this.showhide(b[a],"hide")}}else{this.showhide(b,"hide")}},toggle:function(a){this.showhide(a,"toggle")},addDiv:function(b,a){this.divholders[b]=({id:b,$divref:null,attrs:a});this.divholders[b].getAttr=function(d){var c=new RegExp(d+"=([^,]+)","i");return(c.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null}},showhide:function(d,c){var a=this.divholders[d].$divref;if(this.divholders[d]&&a.length==1){var b=this.divgroups[a.attr("groupname")];if(a.attr("groupname")&&b.count>1&&(c=="show"||c=="toggle"&&a.css("display")=="none")){if(b.lastactivedivid&&b.lastactivedivid!=d){this.slideengine(b.lastactivedivid,"hide")}this.slideengine(d,"show");b.lastactivedivid=d}else{this.slideengine(d,c)}}},slideengine:function(d,c){var a=this.divholders[d].$divref;if(this.divholders[d]&&a.length==1){var b={height:c};if(a.attr("fade")){b.opacity=c}a.animate(b,a.attr("speed")?parseInt(a.attr("speed")):500);return false}},generatemap:function(){var b={};for(var a=0;a<arguments.length;a++){if(arguments[a][1]!=null){b[arguments[a][0]]=arguments[a][1]}}return b},init:function(){var a=this;jQuery(document).ready(function(e){var b=a.getCookie("acopendivids");var d=a.getCookie("acgroupswithpersist");if(b!=null){b=(b=="nada")?[]:b.split(",")}d=(d==null||d=="nada")?[]:d.split(",");jQuery.each(a.divholders,function(){this.$divref=e("#"+this.id);if((this.getAttr("persist")||jQuery.inArray(this.getAttr("group"),d)!=-1)&&b!=null){var h=(jQuery.inArray(this.id,b)!=-1)?"block":"none"}else{var h=this.getAttr("hide")?"none":null}this.$divref.css(a.generatemap(["height",this.getAttr("height")],["display",h]));this.$divref.attr(a.generatemap(["groupname",this.getAttr("group")],["fade",this.getAttr("fade")],["speed",this.getAttr("speed")]));if(this.getAttr("group")){var g=a.divgroups[this.getAttr("group")]||(a.divgroups[this.getAttr("group")]={});g.count=(g.count||0)+1;if(!g.lastactivedivid&&this.$divref.css("display")!="none"||h=="block"){g.lastactivedivid=this.id}this.$divref.css({display:"none"})}});jQuery.each(a.divgroups,function(){if(this.lastactivedivid){a.divholders[this.lastactivedivid].$divref.show()}});var c=e("*[rel]").filter('[@rel^="collapse-"], [@rel^="expand-"], [@rel^="toggle-"]');var f=/(collapse-)|(expand-)|(toggle-)/;c.each(function(){e(this).click(function(){var g=this.getAttribute("rel");var i=g.replace(f,"");var h=(g.indexOf("collapse-")!=-1)?"hide":(g.indexOf("expand-")!=-1)?"show":"toggle";return a.showhide(i,h)})});e(window).bind("unload",function(){a.uninit()})})},uninit:function(){var b="",a="";jQuery.each(this.divholders,function(){if(this.$divref.css("display")!="none"){b+=this.id+","}if(this.getAttr("group")&&this.getAttr("persist")){a+=this.getAttr("group")+","}});b=(b=="")?"nada":b.replace(/,$/,"");a=(a=="")?"nada":a.replace(/,$/,"");this.setCookie("acopendivids",b);this.setCookie("acgroupswithpersist",a)},getCookie:function(a){var b=new RegExp(a+"=[^;]*","i");if(document.cookie.match(b)){return document.cookie.match(b)[0].split("=")[1]}return null},setCookie:function(b,c,d){if(typeof d!="undefined"){var a=new Date();a.setDate(a.getDate()+d);document.cookie=b+"="+c+"; path=/; expires="+a.toGMTString()}else{document.cookie=b+"="+c+"; path=/"}}};function findElPos(a){var b=curtop=0;if(a.offsetParent){do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return{left:b,top:curtop}}function findAbsElPos(a){var b={left:0,right:0,top:0,btm:0};var c=findElPos(a);b.left=c.left;b.right=b.left+a.offsetWidth;b.top=c.top;b.btm=b.top+a.offsetHeight;return b}function convertFromCamel(e,b){var c=/[A-Z]/g;var d=e.match(c);if(d){for(var a=0;a<d.length;a++){tmpstr=e.split(d[a]);lwr=d[a].toLowerCase();e=tmpstr.join(b+lwr)}}return e}function getElStyle(c,a,d){var b;if(c.currentStyle){b=c.currentStyle[a];if(d){if(isNaN(parseInt(b))){return 0}else{return parseInt(b)}}return b}else{switch(a){case"borderWidth":a="border-top-width";break;case"border":case"borderStyle":a="border-top-style";break;case"borderColor":a="border-top-color";break;default:a=convertFromCamel(a,"-");break}b=document.defaultView.getComputedStyle(c,null).getPropertyValue(a);if(d){if(isNaN(parseInt(b))){return 0}else{return parseInt(b)}}return b}}function addLoadEvent(b){if(window.attachEvent){window.attachEvent("onload",b)}else{if(window.addEventListener){window.addEventListener("load",b,false)}else{if(document.getElementById){var a=window.onload;if(a!="undefined"&&a!=null){window.onload=function(){a();b()}}else{window.onload=b}}}}}function addUnloadEvent(b){if(window.addEventListener){window.addEventListener("unload",b,false)}else{if(window.attachEvent){window.attachEvent("onunload",b)}else{if(document.getElementById){var a=window.unload;if(a!="undefined"&&a!=null){window.onunload=function(){a();b()}}else{window.onunload=b}}}}}var cf_curFontSize=1;var cf_page_elems="";var cf_elems_length=0;function changeFontSizes(d){var b="";if(!cf_page_elems||!cf_elems_length){cf_page_elems=document.body.getElementsByTagName("*");cf_elems_length=cf_page_elems.length}if(d==cf_curFontSize){return}$.ajax({type:"POST",url:"inc/set_font_size.php",data:"curFontSize="+d,success:function(f){}});var e=d-cf_curFontSize;cf_curFontSize=d;for(var c=0;c<cf_elems_length;c++){if(cf_page_elems[c].tagname!="IMG"){var a=getElStyle(cf_page_elems[c],"fontSize",1);if(a!="undefined"&&a!=null){a=(a==0)?10:a;cf_page_elems[c].style.fontSize=(a+(2*e))+"px"}}}}if(cf_newFontSize>1){$(function(){changeFontSizes(cf_newFontSize)})};

function MakeSameSize(){ 
var error;
try{

var DaHeight = (document.getElementById('nav_block').clientHeight + document.getElementById('search_block').clientHeight + 144);

if (DaHeight <= 521){
	
	document.getElementById('search_block').style.height = (521 - 5 - 250 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDTbl').style.height = (521 - 5 - 250 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDRw').style.height = (521 - 5 - 250 - 39 - 69 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('search_block').height = (521 - 5 - 250 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDTbl').height = (521 - 250 - 5 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDRw').height = (521 - 250 - 5 - 39 - 69 - document.getElementById('nav_block').clientHeight)+"px";	
	document.getElementById('lnav').height = DaHeight - 5;	
	document.getElementById('right_block').style.height = '';
	document.getElementById('right_block').height = '';	
	
}else{

	document.getElementById('search_block').style.height = '';
	document.getElementById('right_block').style.height = DaHeight + 5 + "px";
	document.getElementById('search_block').height = '';
	document.getElementById('right_block').height = DaHeight + 5 + "px";

}

}
catch(error){
}

try{
	
var DaHeight = (document.getElementById('nav_block').clientHeight + document.getElementById('search_block').clientHeight + 144);

var RightHeight = (document.getElementById('inn_right_block').clientHeight + 39);

if (DaHeight <= (RightHeight - 49)){
	
	document.getElementById('search_block').style.height = (RightHeight - 210 - 5 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDTbl').style.height = (RightHeight - 210 - 5 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDRw').style.height = (RightHeight - 210 - 5 - 39 - 69 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('search_block').height = (RightHeight - 210 - 5 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDTbl').height = (RightHeight - 210 - 5 - 39 - document.getElementById('nav_block').clientHeight)+"px";
	document.getElementById('BBDRw').height = (RightHeight - 210 - 5 - 39 - 69 - document.getElementById('nav_block').clientHeight)+"px";	
	document.getElementById('lnav').height = DaHeight;	
	document.getElementById('inn_right_block').style.height = '';
	document.getElementById('inn_right_block').height = '';	
	
}else{

	document.getElementById('search_block').style.height = '';
	document.getElementById('inn_right_block').style.height = DaHeight - 10 + "px";
	document.getElementById('search_block').height = '';
	document.getElementById('inn_right_block').height = DaHeight - 10 +  "px";

}

}
catch(error){
}

}

var StartMainTimer = 'MakeSameSize();';

setInterval(StartMainTimer,250);
