
var jQuery;

jQuery(document).ready(function(){ 
        jQuery('div.all ul').each(function(i) { 
            var ul = jQuery(this), ulh = ul.height(), h = 0, lic = 0;
            //alert(ulh);  
			ul.children('li').each(function(i){					    
			    if(i==3){return false;}
			     h += this.offsetHeight;
			     //alert(h);    
			});
        	
			ul.children('li').each(function(i){
				lic++;				
        	});       	
        	        
        	if (lic > 3) {
        	        ul.css("height", h+'px');
				    ul.css("overflow",'hidden');
				    ul.css("position",'relative');
				    ul.attr("ul_h", ulh);
				    ul.attr("ul_m", h);
				    jQuery(this).siblings('.control').addClass('closed');
				    jQuery(this).siblings('.control').addClass('small');
				    jQuery(this).siblings('.control').html('<a href="#">'+ViewAll+'</a>');
			    } 
			
			
		});
		
		jQuery('.control').click(function(){		
				var me = jQuery(this), ul = me.parent().children("ul"), ulh = 0, h = 0;
				
				if( me.is('.closed') ) {
					ulh = ul.attr("ul_h");
					ul.animate({'height':(ulh)+'px'});
					me.removeClass('closed');
					me.addClass('open');
					jQuery(this).html('<a href="#">'+Hide+'</a>');
				} else {
					ulh = ul.attr("ul_m");
					ul.animate({'height':(ulh)+'px'});
					me.removeClass('open');
					me.addClass('closed');
					jQuery(this).html('<a href="#">'+ViewAll+'</a>');
				}
                return false;
        });
        if(document.getElementById("rsh") != null)
        {
            if(dhtmlHistory.getCurrentLocation() == "information")
            {
                jQuery("#divInformation").removeClass('whitehide');
            }
            else
            {
                jQuery("#divInformation").css("display",'none');
		        jQuery("#divInformation").removeClass('whitehide');
            }
		}
		else
		{
		    jQuery("#divInformation").css("display",'none');
		    jQuery("#divInformation").removeClass('whitehide');
		}
		if(document.getElementById("rsh") != null)
        {
            if(dhtmlHistory.getCurrentLocation() == "documents")
            {
                jQuery("#documentsDiv").removeClass('whitehide');
            }
            else
            {
                jQuery("#documentsDiv").css("display",'none');
		        jQuery("#documentsDiv").removeClass('whitehide');
            }
		}
		else
		{
		    jQuery("#documentsDiv").css("display",'none');
		    jQuery("#documentsDiv").removeClass('whitehide');
		}
  });  

jQuery.noConflict();

