// Start slideshow if on page
$(document).ready(function(){     
  $('#jquery_slideshow').each(function() {                     
     $(this).cycle({
      speed: 4000,
      timeout: 6000
     });          
  });
});  

// Start featured prop slideshow
 $(document).ready(function(){  
$('.featuredProp').each(function() {                     
     $(this).cycle({
      speed: 750,
      timeout: 6000
     });          
  }); 
});            

// For ace menus
var ace_path="/nav/acemenu/";
$(document).ready(function(){
  ACELoadMenu();
  isLoaded = 1;
});

// Detail page javascript

// open new window function - takes url,width,height as parameters
// Used in email to friend
function openWindow(sURL, width, height) {
  var sFeatures = "top=50,left=50,height=" + height + ",width=" + width + ",status=yes,scrollbars=yes,resizable=1,menubar=<?php echo $menubar ?>";
  var oSampWin = window.open(sURL,"_newwindow",sFeatures);
}


$(document).ready(function(){
  $("#tabs").tabs();
  $('#hidden_cal').hide();
  $('a#toggle_cal').click(function() {
    if ($(this).html()=='See more months at a time') {
      $(this).html('See less months at a time');
    } else {
      $(this).html('See more months at a time');
    }
    $('#hidden_cal').toggle(400);
    return false;
  });
});

// Featured prop controls
var slideshow_off = false;

function slideshow(op) {
 $('.featuredProp').cycle(op);
 if (op == 'pause') {
  slideshow_off = true;
  $(".slideshow_pause").css('display', 'none');
  $(".slideshow_resume").css('display', 'inline');
 } else if (slideshow_off) {
  $('.featuredProp').cycle('pause');
 }
}

function resume() {
 $('.featuredProp').cycle('resume', true);
 slideshow_off = false;
  $(".slideshow_pause").css('display', 'inline');
  $(".slideshow_resume").css('display', 'none');
}