    $(document).ready(function() {

        //fix for IE
        if (jQuery.browser.msie) {
            if(parseInt(jQuery.browser.version) > 6) {  //IE7-8
                $('.groupFunctionSearch').css({ "margin-bottom": "130px" });
            }
            else if(parseInt(jQuery.browser.version) <= 6) { //IE6
                $('.groupFunctionSearch').css({ "margin-bottom": "130px" });
                $('#footerTooltip').css({ "margin-right": "17px" });
                $('.inputbox').css({ "margin-left": "17px" });
            }
        }



         //***Shadowbox
         Shadowbox.init();



        //***Slideshow
        $.fn.cycle.defaults.timeout = 6000;
        $(function() {
            $('#s5').cycle({
                fx: 'scrollHorz',
                timeout: 12000,
                easing: 'easeOutQuint',
                speed:   2500,
                next:   '#next2', 
                prev:   '#prev2'
            });
        });


        //***Slideshow  home
        $.fn.cycle.defaults.timeout = 6000;
        $(function() {
            $('#sHome').cycle({
                fx: 'scrollHorz',
                timeout: 6000,
                easing: 'easeOutQuint',
                speed:   2500,
                next:   '#nextHome',
                prev:   '#prevHome'
            });
        });

        //***search panel
        $(".showPanel").click(function(){
           $("div#searchPanel").animate({height: "500px" }, "fast");  $(".sdc").toggle();
        }); 
        $("#hidePanel").click(function(){
           $("div#searchPanel").animate({height: "0px"}, "fast"); 
        });       
 
 
        //***tooltip  
        // Match all link elements with href attributes within the content div
        $('#cb1').qtip(
        {
          content: catDesc1,
          show: { effect: { type: 'slide' } },
          style: { 
                width: 200,
                padding: 5,
                background: '#f79892',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#cd6f6f'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           }
        });


        $('#cb2').qtip(
        {
          content: catDesc2,
          show: { effect: { type: 'slide' } },
          style: { 
                width: 200,
                padding: 5,
                background: '#f3b668',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#e89325'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           }
        });


        $('#cb3').qtip(
        {
          content: catDesc3,
          show: { effect: { type: 'slide' } },
          style: { 
                width: 200,
                padding: 5,
                background: '#f37ab0',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#de3882'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           }
        });


        $('#cb4').qtip(
        {
          content: catDesc4,
          show: { effect: { type: 'slide' } },
          style: { 
                width: 200,
                padding: 5,
                background: '#afd47b',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#95cb48'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           }
        });


        $('#cb5').qtip(
        {
          content: catDesc5,
          show: { effect: { type: 'slide' } },
          style: { 
                width: 200,
                padding: 5,
                background: '#90d8f0',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#36a4d9'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           }
        });

        $('#cb6').qtip(
        {
          content: catDesc6,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#90d8f0',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#36a4d9'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           }
        });


     $('#cat1').qtip(
        {
          content: cat1,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#f79892',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#cd6f6f'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
           api: {
              onRender: function(){
                 this.elements.target.removeAttr('title')
              }
           }


        });
        $('#cat2').qtip(
        {
          content: cat2,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#f3b668',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#e89325'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
           api: {
              onRender: function(){
                 this.elements.target.removeAttr('title')
              }
           }
        });


        $('#cat3').qtip(
        {
          content: cat3 ,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#f37ab0',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#de3882'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
           api: {
              onRender: function(){
                 this.elements.target.removeAttr('title')
              }
           }
        });


        $('#cat4').qtip(
        {
          content: cat4 ,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#afd47b',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#95cb48'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
           api: {
              onRender: function(){
                 this.elements.target.removeAttr('title')
              }
           }
        });


        $('#cat5').qtip(
        {
          content: cat5 ,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#90d8f0',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#36a4d9'
                },
              tip: 'topRight',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
           api: {
              onRender: function(){
                 this.elements.target.removeAttr('title')
              }
           }
        });

        $('#cat6').qtip(
        {
          content: cat6 ,
          show: { effect: { type: 'slide' } },
          style: {
                width: 200,
                padding: 5,
                background: '#98E4FE',
                color: 'white',
                textAlign: 'center',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#4DC1E8'
                },
              tip: 'topLeft',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
           api: {
              onRender: function(){
                 this.elements.target.removeAttr('title')
              }
           }
        });


$('.tooltipInfo').qtip({ 
                        style: {
                                 width: 395,
                                 height: 160,
                                 padding:0,
                                 name: 'light', 
                                 tip: true ,
                                 border: {
                                           width: 7,
                                           radius: 5,
                                           color: '#e0e0e0'
                                         }
                               },  
                               position: {  corner: {
                                                       target: 'bottomRight',
                                                       tooltip: 'topLeft'
                                                    }
                                         }   
                      });



    


   
$('.infopackImg[title]').qtip({ style: { name: 'light', tip: true },  position: { corner: {target: 'topMiddle', tooltip: 'topLeft' }}   });

 
 
 
    //*** function toggles in seach
  	//Hide (Collapse) the toggle containers on load
  	$(".toggle_containerSearch").hide(); 
  
  	//Switch the "Open" and "Close" state per click
  	$("h2.triggerSearch").toggle(function(){
  		$(this).addClass("active");
  		}, function () {
  		$(this).removeClass("active");
  	});
  
  	//Slide up and down on click
  	$("h2.triggerSearch").click(function(){
  		$(this).next(".toggle_containerSearch").slideToggle("slow");
  	});

 
    
   //***function toggles
  	//Hide (Collapse) the toggle containers on load
  	$(".toggle_container").hide(); 
  
  	//Switch the "Open" and "Close" state per click
  	$(".bump").toggle(function(){
  		$(this).addClass("active");
  		}, function () {
  		$(this).removeClass("active");
  	});
  
  	//Slide up and down on click
  	$(".bump").click(function(){ 
  		$(this).next(".toggle_container").slideToggle("slow");
  	});


      
    });

