 var $j = jQuery.noConflict();      
 
 $j(document).ready(function(){
    
    //Search settings
    $j(".searchbutton").click(function(){
    
        if ($j(".searchtext").val() != "")
        {
            var href = $j(this).attr('href') + "?q=" + $j(".searchtext").val();
            window.location = href;
        }
        return false;
    });
    
    $j(".searchtext").keypress(function(event){  
        if (event.keyCode == "13")
        {
            if ($j(this).val())
            {
                var href = $j(".searchbutton").attr('href') + "?q=" + $j(this).val();
                window.location = href;
            }
            return false;
        }
    });
    
    //Tools settings
    if($j('#tools').length)
    {
        //Set Sendtofriend to open in minimized layout by adding device to querystring
        var href = $j('#tools a.share').attr('href').replace('?',"?min=1&");
        $j('#tools a.share').attr('href', href);
            
        //Set print-button to start printing on clickevent
        $j('#tools a.print').click(function(){
            window.print();
            return false;
        });
    }
 });

