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

