$(document).ready(function(){
	
 	//if (window.XMLHttpRequest) {
 	
 	//var highestCol = Math.max($('.col1').height(),$('.col2').height(),$('.col3').height());
 	//$('.col1, .col2, .col3').height(highestCol);

    //}
    
    $('a.m1, a.m2, a.m3, a.m4').click(function(){
    	return false;
    });
    
    $('.twitter').click(function(){
    	window.open('http://twitter.com/TravelDest');
    });
  
    // TWITTER
    
    $(".twitter").tweet({
        username: "TravelDest",
        join_text: "auto",
        avatar_size: null,
        count: 3,
        auto_join_text_default: "we said,",
        auto_join_text_ed: "we",
        auto_join_text_ing: "we were",
        auto_join_text_reply: "we replied to",
        auto_join_text_url: "we were checking out",
        loading_text: "loading tweets..."
    }).ajaxStop(function(){
          $('.tweet_list').cycle({
    fx: 'fade',
    timeout: 5000      });
       });
       
    // LOGO CAROUSEL
    
    jQuery('.logo_c').jcarousel({
            wrap: 'circular'
        });
    
    // MEGA MENU
    
	function addMega(){
	    
	    $('.mega_box', this).fadeIn();
	    $(this).addClass('megahovered');
	    }
	
	function removeMega(){
	    
	    $('.mega_box', this).fadeOut();
	    $(this).removeClass('megahovered');
	    }
	
	var megaConfig = {
	     interval: 0,
	     sensitivity: 4,
	     over: addMega,
	     timeout: 200,
	     out: removeMega
	};
	
	$('.mega').hoverIntent(megaConfig);
	  
});

$(window).load(
    function() {
    // TOP IMAGE AND NEWS SLIDERS
    
    $('.news_big_img').cycle({ 
        fx:     'fade',
        cycleH: 225,
        cycleW: 940, 
        speed:  3000, 
        timeout: 3000, 
        pagerEvent: 'mouseover',
        pauseOnPagerHover: true,
        pager:  '.news_small_thumb', 
        pagerAnchorBuilder: function(idx, slide) { 
            // return selector string for existing anchor 
            return '.news_small_thumb li:eq(' + idx + ') a.fake_link'; 
        } 
    });
    }
);
