 var $j = jQuery.noConflict();      
 
 $j(document).ready(function(){
    
    //Search settings
    $j(".searchbutton").click(function(){
        var href = $j(this).attr('href') + "?q=" + $j(this).parent().find(".searchtext").val();
        window.location = href;
        return false;
    });
    
    $j(".searchtext").keypress(function(event){  
        if (event.keyCode == "13")
        {
            var href = $j(this).parent().find(".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;
        });
    }
    
    //Print settings
    if($j('.print').length){
        $j('.print').click(function(){
            window.print();
        });
    }
 });

