﻿function editContent(PageID, EntityID, Lang, CanEdit) { parent.editContent(PageID, EntityID, Lang, CanEdit); return false; }
function editControlContainer(EntityID, PageID, CanEdit, Language) { parent.editControlContainer(EntityID, PageID, CanEdit, Language); return false; }
function editRelation(PropertyID) { parent.editRelation(PropertyID); return false; }
function editProperties(EntityName, EntityID, PageID, CanEdit, Lang) { parent.editProperties(EntityName, EntityID, PageID, CanEdit, Lang); return false; }
(function ($) {
    $.fn.slideshow = function (options) {
        var o = $.extend({}, $.fn.slideshow.defaults, options); return this.each(function () {
            var $this = $(this); var $s = $('.slide', $this); var nb = $('.slide', $this).length; var swidth = $s.outerWidth(true); var iwidth = nb * (swidth); var iposition = '-' + o.position * swidth + 'px'; var pwidth = o.pwidth * nb; $('.inner', $this).css({ 'width': iwidth + 1 + 'px', 'margin-left': iposition }); $this.append($('<ul />')
.addClass('pages')
.css({ 'width': pwidth + 'px' })); for (i = 0; i < nb; i++) {
                if ($(this).attr('id') == 'mainPanel') { var altText = $('.slide:eq(' + i + ') img').attr('alt'); } else { var altText = 'See set ' + (i + 1); }
                $('.pages', $this).append($('<li />')
.append($('<a />')
.attr('href', '#')
.attr('title', altText)
.html(i + 1)));
            }
            $('.pages li', $this).eq(o.position).addClass('active'); $('.pages li', $this).click(function () { $('.inner', $this).stop('true', 'true'); clearInterval(autoSlide); slidding($('.pages li', $this).index($(this))); return false; }); var slidding = function (next) {
                current = $('.pages li', $this).index($('.pages li.active', $this)); if (!(next) && (next != 0)) { if (current < (nb - 1)) { next = current + 1; } else { next = 0; } } else { next = next; }
                $('.pages li', $this).removeClass('active'); speed = o.speed * Math.abs(current - next); $('.inner', $this).animate({ marginLeft: -(next * swidth) }, speed); $('.pages li', $this).eq(next).addClass('active');
            }
            if (o.autoSlide) { var autoSlide = ''; setTimeout(function () { autoSlide = setInterval(function () { slidding(); }, 7000); }, o.delay); } 
        });
    }; $.fn.slideshow.defaults = { position: 0, pwidth: 23, speed: 500, delay: 0, pause: 3000, autoSlide: true };
})(jQuery); $(function () { $('#homepage .half:eq(0) .slideshow').slideshow({ speed: '800', delay: '900', pause: '1000' }); $('#homepage .half:eq(1) .slideshow').slideshow({ speed: '800', delay: '1800', pause: '1000' }); $('#mainPanel').slideshow({ speed: '1000' }); });
