 jQuery(document).ready(function(){

//Sidebar testimonials Cycle
jQuery('#testimonials').cycle({
    fx: 'scrollDown',
    speed: 2000,
    cleartype:  true, // disable cleartype corrections
    cleartypeNoBg:  true,
    sync:   0, 
    pause: 1,
    timeout:   10000,
    delay: 1000
});
jQuery(function () {
    var tabContainers = jQuery('div.tab');
    tabContainers.hide().filter(':first').show();

    jQuery('#tabnav a').click(function () {
        tabContainers.hide();
        tabContainers.filter(this.hash).show();
         initialize() ;
         google.maps.event.trigger(map, 'resize');
        jQuery('#tabnav a').removeClass('selected');
        jQuery(this).addClass('selected');
        return false;
    }).filter(':first').click();
});
            
jQuery('a#request-call').click(function () {

   jQuery('#tabnav a' ).filter(':last').click();
   return false;
});
 

jQuery('.home-search .search-button').click(function(){  
      jQuery('#search_box_home').addClass('search_box_top');
});

// fill the subject  field of contact form with title of property
 if (jQuery('#contact-subject').lenght != 0 ) {
     var address = jQuery('#the_title').html();
    jQuery('#contact-subject').val(address);
 }
 
 });
 
 //try to remove skype plugin formatting
 jQuery(document).ready(function() {
		window.setTimeout(function() {
                            jQuery('.skype_pnh_container').html('');
			jQuery('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
		}, 800);
});

//submit contact form
jQuery(document).ready(function(){
    jQuery('#submit-button').click(function(e){
            e.preventDefault();
            jQuery('.wpcf7-form').submit();
    });
});

// get-updates form
jQuery(document).ready(function(){
    jQuery('a.check-all').click(function(e){
        e.preventDefault();
        var select_all = jQuery(this);
        if (select_all.hasClass("uncheck")){
             select_all.removeClass("uncheck").html("Select All");
              select_all.parent().find('input[type=checkbox]').removeAttr("checked");
        }
        else {
             select_all.parent().find('input[type=checkbox]').attr("checked", "checked");
             select_all.addClass("uncheck").html("Deselect All");
        }
    } )
    
});
