// JavaScript function calls for the front page

// jQuery call: Make all video thumbnails pop a modal box to show the full-length videos
$(function() {
    $('.modalboxedNews').click(function(e) {
        e.preventDefault();
        
        var $this = $(this);
        var horizontalPadding = 20;
        var verticalPadding = 20;
        $('<iframe id="externalSite" class="externalSite" src="' + this.href + '" />').dialog({
            title: ($this.attr('title')) ? $this.attr('title') : '最新消息',
            autoOpen: true,
            width: 800,
            height: 500,
            modal: true,
            resizable: false,
			draggable: false,
            autoResize: true,
			position: ['center', 50],
			closeOnEscape: true,
			buttons: { "關閉本視窗": function() { $(this).dialog("close"); } },
            overlay: {
                opacity: 1.5,
                background: "black"
            }
        }).width(800 - horizontalPadding).height(500 - verticalPadding);
    });
});


$(document).ready(function(){	
	$("#eventsSlider").easySlider({
		auto: true,
		continuous: true,
		numeric: true
	});
	$("#sermonSlider").easySlider({
		auto: false,
		continuous: false,
		nextId: "slider3next",
		prevId: "slider3prev"
	});
	$("#testimoniesSlider").easySlider({
		auto: false,
		continuous: false,
		nextId: "slider1next",
		prevId: "slider1prev"
	});
	$("#specialSlider").easySlider({
		auto: false,
		continuous: false,
		nextId: "slider2next",
		prevId: "slider2prev"
	});
});
