$(document).ready(function(){
    /* BX Slider - Start 
    var slider = $("ul.bxslider > li").length;
    var auto = false;
    
    if(slider > 1) auto = true;
    if( auto == false ) $(".transparent-bg").hide();
    
    if(slider > 1){
        $('.bxslider').bxSlider( {
            controls:false,
            pager:auto,
            auto:auto,
            mode:'fade',
            pagerSelector: '#slider-pager',
    		pagerLocation: 'bottom'
        });
    }
    
     BX Slider - End */
    
    /* Small Icons - Start */
    var smallIcons = $.trim( $(".small-icons ul").html() );
    if( smallIcons == "" ) $(".small-icons").hide();
    /* Small Icons - End */
    
    /* Search Form - Start */
    var searchform = $.trim( $(".search-form > .row > .columns").html() );
    if(searchform == "" ) $(".search-form").hide();
    
/*    $(".search-form select").chosen({
        disable_search_threshold: 10,
        no_results_text: "Oops, nothing found!",
        width: "235px"
    }); */
    /* Search Form - End */
    
    $('#tabs').easyResponsiveTabs({
        type: 'default', //Types: default, vertical, accordion
        width: 'auto', //auto or any width like 600px
		fit: true, // 100% fit in a container
		closed: 'accordion'
  	});

    var searchListingsLarge8 = $(".search-listings > .row > .columns.large-8").text();
    searchListingsLarge8 = $.trim(searchListingsLarge8);
    var searchListingsLarge4 = $(".search-listings > .row > .columns.large-4").text();
    searchListingsLarge4 = $.trim(searchListingsLarge4);
    if(searchListingsLarge4 == "" ) 
    {
        $(".search-listings > .row > .columns.large-4").hide();
        $(".search-listings > .row > .columns.large-8").attr("class", "large-12 columns");
    }
    if(searchListingsLarge4 == "" && searchListingsLarge8 == "" ) $(".search-listings").hide();
    
    var socialMedias = $(".follow-icons").html();
    socialMedias = $.trim(socialMedias);
    var socialMediaTitle = $(".follow-title").html();
    socialMediaTitle = $.trim(socialMediaTitle);
    if(socialMedias == "" && socialMediaTitle == "" ) $(".follow-us").hide();
    
    var callUsText = $(".call-us-text").html();
    callUsText = $.trim(callUsText);
    var callUsImage = $(".call-us-image").html();
    callUsImage = $.trim(callUsImage);
    if(callUsText == "" && callUsImage == "" ) $(".call-us").hide();
    if(callUsText == "" ) 
    {
        $(".call-us-text").hide();
        $(".call-us-image").attr("class", "large-12 columns call-us-image text-center");
    }
    if(callUsImage == "" ) 
    {
        $(".call-us-image").hide();
        $(".call-us-text").attr("class", "large-12 columns call-us-text text-center");
    }
    
    
    var featLuxuryHTMLEditor = $(".feat-luxury .html-editor").html();
    featLuxuryHTMLEditor = $.trim(featLuxuryHTMLEditor);
    var featLuxuryPhotoUploaders = $(".feat-luxury .photo-uploaders > ul").html();
    featLuxuryPhotoUploaders = $.trim(featLuxuryPhotoUploaders);
    
    if(featLuxuryHTMLEditor == "" && featLuxuryPhotoUploaders == "" ) $(".feat-luxury").hide();
    if(featLuxuryHTMLEditor == "" ) 
    {
        $(".feat-luxury .html-editor").hide();
    }
    if(featLuxuryPhotoUploaders == "" ) 
    {
        $(".feat-luxury .photo-uploaders").hide();
    }
    
    var tabHolder = $(".tab-holder ul > li").length;
    tabHolder = $.trim(tabHolder);
    var tabDescription = $(".tab-description").html();
    tabDescription = $.trim(tabDescription);
    if(tabHolder == 0 && tabDescription == "" ) $(".tabs-text").hide();
    if(tabHolder == 0 ) $(".tab-holder").hide();
    if(tabDescription == "" ){ $(".tab-description").hide() }
    
});
