function initialize_events(options) {
	$('#slides').cycle({ 
	    fx:     'fade', 
	    speed:   options.speed, 
	    timeout: options.timeout,
		  next: '#next',
		  prev: '#prev'
	});
}
function slideshow_options_auto() {
	var options = {
        timeout: 5200,
        speed: 1000
    };
	return options;
}
function slideshow_options_manual() {
	var options = {
        timeout: null,
        speed: null
    };
	return options;
}
activatePaymentsModal = function() {
    var that = this;

    $('#modal').height($(document).height());
    $('#modal').css('opacity',.7);
    $('#modal').fadeIn();
    $('#modal_content')
      .append(
        $('<iframe>').attr('src','/site/buy') // TODO -- set hostname
                     .attr('height','365px')
                     .attr('width','425px')
                     .attr('scrolling','no')
                     .css('margin', 0)
                     .css('padding',0)
                     .css('border',0)
      )
      .append(
        $('<div>').attr('id','modal_close_button')
      )
      .css('top',parseInt( ($(window).height() - $('#modal_content').height())/2 ) )
      .css('left',parseInt(  ($(window).width() - $('#modal_content').width())/2))
      .css('padding',0)
      .css('margin',0)
      .show();
    $('#modal').click( function() { that.deactivateModal(); });
    $('#modal_close_button').click( function() { that.deactivateModal(); });

    $(document).keypress(function(e){
        if (e.which == 0 || e.which == 27) {
            that.deactivateModal();
        }
    });
}
deactivateModal = function(something) {
    $('#modal_content').empty().hide();
    $('#modal').fadeOut();
    $(document).unbind('keypress');
    $('#modal_close_button').unbind('click');
}