function setTextSize(container, size) {
    $("."+container).css('font-size', size); 
}

function search() {
    var words;
    var pattern = /\s/g;
    if($("#search").length > 0) {
        words = $("#search").val();
        words = $.trim(words);
        words = words.replace(pattern, '-');
        document.location.href='index,s'+words+'.html';
    }
}

/**
 * scale objects
 */
function scaleObjects() {
    var max_width = 200;
    $(".news_content img").addClass('noborder');
    $(".news_content table").css('max-width', '600px');
    $(".news_content div").css('max-width', '600px');
    
    $(".news_content img").each(function(index) {
        if(!$(this).hasClass('noresize')) {
            var width = $(this).width();
            var height = $(this).height();
            if(width > max_width) {
                var ratio = (height / width);
                var new_width = max_width;
                var new_height = (new_width * ratio);
                $(this).css('width', new_width);
                $(this).css('height', new_height);
            }
        }
    });
    
    $(".news_content a > img").parent().each(function(index) {
        var str = $(this).attr('href');
        if(str.search(/jpg/i) != -1) {
            $(this).addClass('lightbox'); 
        }
    });
    
    $("a.lightbox").lightBox({
        fixedNavigation:    true,
        imageLoading: 'backend/templates/js/lightbox/images/loading.gif',
    	imageBtnClose: 'backend/templates/js/lightbox/images/close.gif',
    	imageBtnPrev: 'backend/templates/js/lightbox/images/prev.gif',
    	imageBtnNext: 'backend/templates/js/lightbox/images/next.gif'
    });   
}
