/* This script hides all except the first paragraph and headline. After clicking the link you can show more/less. 
        author: Jana Moudra, jana.moudra@imatic.cz
        date: 22-12-2010
*/
jQuery(document).ready(function(){   
          jQuery('.paragraph').each(function(){
            var firstParagraph, clickLink, otherParagraph, moreText, lessText, hidden = true;
            
            if(jQuery('body.cs').size()){
                moreText = 'více';
                lessText = 'méně';
            } else if(jQuery('body.en').size()){
                moreText = 'more';
                lessText = 'less';
            } else if(jQuery('body.it').size()){
                moreText = 'di più';
                lessText = 'meno';
            } else if(jQuery('body.ru').size()){
                moreText = 'более';
                lessText = 'менее';
            }
            
            
            firstParagraph = jQuery(this).find('p:first');          
            otherParagraph = jQuery(this).find('p:first').nextAll().css('display','none');
            clickLink = jQuery(document.createElement('a')).attr({'href': '#', 'class': 'link paragraph-more'}).text(moreText);
                    
            jQuery(this).append(clickLink);
            
            jQuery(clickLink).click(function(){
                if(hidden){
                    jQuery(otherParagraph).css('display','block'); 
                    jQuery(this).attr('class', 'link paragraph-less');
                    jQuery(this).text(lessText);
                    hidden = false;
                } else{
                    jQuery(otherParagraph).css('display','none');
                    jQuery(this).attr('class', 'link paragraph-more');
                    jQuery(this).text(moreText);
                    hidden = true;
                }               
                return false; 
            }); 
        });        
});

