// JavaScript Document
$(function() {



$(function () {
			$('#defaultCountdown').countdown({
				until: new Date(2010, 5 - 1, 29, 18, 0, 0), 
				format: 'DHMS',
				layout: '<div id="t7_timer">'+
							'<div id="t7_vals">'+
								'<div id="t7_d" class="t7_numbs">{dnn}</div>'+
								'<div id="t7_h" class="t7_numbs">{hnn}</div>'+
								'<div id="t7_m" class="t7_numbs">{mnn}</div>'+
								'<div id="t7_s" class="t7_numbs">{snn}</div>'+
							'</div>'+
							'<div id="t7_labels">'+
								'<div id="t7_dl" class="t7_labs">days</div>'+
								'<div id="t7_hl" class="t7_labs">hours</div>'+
								'<div id="t7_ml" class="t7_labs">mins</div>'+
								'<div id="t7_sl" class="t7_labs">secs</div>'+
							'</div>'+
							'<div id="t7_timer_over"></div>'+
						'</div>'
				});
		});

$(function () {
        $('ul.drawers').accordion({
            header: 'h4.drawer-handle',
            selectedClass: 'open',
            event: 'mouseover'
        });

		$("#tabs2").tabs({
			//event: 'mouseover'
		});
		$("#Calendar").tabs();
		$("#accordion").accordion({
			active:false,
			autoHeight: false,
			navigation: true
		});
		$("#accordion2").accordion({
			active:false,
			autoHeight: false,
			navigation: true
		});
		$("#accordion3").accordion({
			active:false,
			autoHeight: false,
			navigation: true
		});


	});

$('.FooterBSRight li:last a').addClass('noborder');
  

$(".fg-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
	});
  function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "",             // Start text
		        stopText: "",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
        });
		
		$(function(){
   
 
 
 
   

$('#preview1').slideUp('slow');
$('#preview2').slideUp('slow');

$('#Hidepoll').click(function () {
$('#preview2').slideUp('slow');	
});
$('#Signup').click(function () {
$('#preview1').slideDown('slow');					 
});
		
// Thumbs Scroller
if ($("div.scrollable").length > 0) {
$("div.scrollable").scrollable({

				size: 1,
				items: '#thumbs',  
				hoverClass: 'hover'
				/*interval: 6000	*/		
				
		});
	};

		
	$('#PollOpen').click(function () {
								 
			$('#preview2').slideDown('slow');		 
								 
	});
	$('#CloseSignup').click(function () {
								 
			$('#preview1').slideUp('slow');		 
								 
	});});
	   
	
/*Jquery Anything Slider */		
(function($){
	
    $.anythingSlider = function(el, options){
        // To avoid scope issues, use 'base' instead of 'this'
        // to reference this class from internal events and functions.
        var base = this;
        
        // Access to jQuery and DOM versions of element
        base.$el = $(el);
        base.el = el; 

		// Set up a few defaults
        base.currentPage = 1;
		base.timer = null;
		base.playing = false;

        // Add a reverse reference to the DOM object
        base.$el.data("AnythingSlider", base);
        
        base.init = function(){
            base.options = $.extend({},$.anythingSlider.defaults, options);
			
			// Cache existing DOM elements for later 
			base.$wrapper = base.$el.find('> div').css('overflow', 'hidden');
            base.$slider  = base.$wrapper.find('> ul');
            base.$items   = base.$slider.find('> li');
            base.$single  = base.$items.filter(':first');

			// Build the navigation if needed
			if(base.options.buildNavigation) base.buildNavigation();
        
        	// Get the details
            base.singleWidth = base.$single.outerWidth();
            base.pages = base.$items.length;

            // Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
			// This supports the "infinite" scrolling
			base.$items.filter(':first').before(base.$items.filter(':last').clone().addClass('cloned'));
            base.$items.filter(':last' ).after(base.$items.filter(':first').clone().addClass('cloned'));

			// We just added two items, time to re-cache the list
            base.$items = base.$slider.find('> li'); // reselect
            
			// Setup our forward/backward navigation
			base.buildNextBackButtons();
		
			// If autoPlay functionality is included, then initialize the settings
			if(base.options.autoPlay) {
				base.playing = !base.options.startStopped; // Sets the playing variable to false if startStopped is true
				base.buildAutoPlay();
			};
			
			// If pauseOnHover then add hover effects
			if(base.options.pauseOnHover) {
				base.$el.hover(function(){
					base.clearTimer();
				}, function(){
					base.startStop(base.playing);
				});
			}
			
			// If a hash can not be used to trigger the plugin, then go to page 1
			if((base.options.hashTags == true && !base.gotoHash()) || base.options.hashTags == false){
				base.setCurrentPage(1);
			};
        };

		base.gotoPage = function(page, autoplay){
			// When autoplay isn't passed, we stop the timer
			if(autoplay !== true) autoplay = false;
			if(!autoplay) base.startStop(false);
			
			if(typeof(page) == "undefined" || page == null) {
				page = 1;
				base.setCurrentPage(1);
			};
			
			// Just check for bounds
			if(page > base.pages + 1) page = base.pages;
			if(page < 0 ) page = 1;

			var dir = page < base.currentPage ? -1 : 1,
                n = Math.abs(base.currentPage - page),
                left = base.singleWidth * dir * n;
			
			base.$wrapper.filter(':not(:animated)').animate({
                scrollLeft : '+=' + left
            }, base.options.animationTime, base.options.easing, function () {
                if (page == 0) {
                    base.$wrapper.scrollLeft(base.singleWidth * base.pages);
					page = base.pages;
                } else if (page > base.pages) {
                    base.$wrapper.scrollLeft(base.singleWidth);
                    // reset back to start position
                    page = 1;
                };
				base.setCurrentPage(page);
				
            });
		};
		
		base.setCurrentPage = function(page, move){
			// Set visual
			if(base.options.buildNavigation){
				base.$nav.find('.cur').removeClass('cur');
				$(base.$navLinks[page - 1]).addClass('cur');	
			};
			
			// Only change left if move does not equal false
			if(move !== false) base.$wrapper.scrollLeft(base.singleWidth * page);

			// Update local variable
			base.currentPage = page;
		};
		
		base.goForward = function(autoplay){
			if(autoplay !== true) autoplay = false;
			base.gotoPage(base.currentPage + 1, autoplay);
		};
		
		base.goBack = function(){
			base.gotoPage(base.currentPage - 1);
		};
		
		// This method tries to find a hash that matches panel-X
		// If found, it tries to find a matching item
		// If that is found as well, then that item starts visible
		base.gotoHash = function(){
			if(/^#?panel-\d+$/.test(window.location.hash)){
				var index = parseInt(window.location.hash.substr(7));
				var $item = base.$items.filter(':eq(' + index + ')');
				if($item.length != 0){
					base.setCurrentPage(index);
					return true;
				};
			};
			return false; // A item wasn't found;
		};
        
		// Creates the numbered navigation links
		base.buildNavigation = function(){
			base.$nav = $("<div id='thumbNav'></div>").appendTo(base.$el);
			base.$items.each(function(i,el){
				var index = i + 1;
				var $a = $("<a href='#'></a>");
				
				// If a formatter function is present, use it
				if( typeof(base.options.navigationFormatter) == "function"){
					$a.html(base.options.navigationFormatter(index, $(this)));
				} else {
					$a.text(index);
				}
				$a.click(function(e){
                    base.gotoPage(index);
                    
                    if (base.options.hashTags)
						base.setHash('panel-' + index);
						
                    e.preventDefault();
				});
				base.$nav.append($a);
			});
			base.$navLinks = base.$nav.find('> a');
		};
		
		
		// Creates the Forward/Backward buttons
		base.buildNextBackButtons = function(){
			var $forward = $('<a class="arrow forward">&gt;</a>'),
				$back    = $('<a class="arrow back">&lt;</a>');
				
            // Bind to the forward and back buttons
            $back.click(function(e){
                base.goBack();
				e.preventDefault();
            });

            $forward.click(function(e){
                base.goForward();
				e.preventDefault();
            });

			// Append elements to page
			base.$wrapper.after($back).after($forward);
		};
		
		// Creates the Start/Stop button
		base.buildAutoPlay = function(){

			base.$startStop = $("<a href='#' id='start-stop'></a>").html(base.playing ? base.options.stopText :  base.options.startText);
			base.$el.append(base.$startStop);            
            base.$startStop.click(function(e){
				base.startStop(!base.playing);
				e.preventDefault();
            });

			// Use the same setting, but trigger the start;
			base.startStop(base.playing);
		};
		
		// Handles stopping and playing the slideshow
		// Pass startStop(false) to stop and startStop(true) to play
		base.startStop = function(playing){
			if(playing !== true) playing = false; // Default if not supplied is false
			
			// Update variable
			base.playing = playing;
			
			// Toggle playing and text
			if(base.options.autoPlay) base.$startStop.toggleClass("playing", playing).html( playing ? base.options.stopText : base.options.startText );
			
			if(playing){
				base.clearTimer(); // Just in case this was triggered twice in a row
				base.timer = window.setInterval(function(){
					base.goForward(true);
				}, base.options.delay);
			} else {
				base.clearTimer();
			};
		};
		
		base.clearTimer = function(){
			// Clear the timer only if it is set
			if(base.timer) window.clearInterval(base.timer);
		};
		
		// Taken from AJAXY jquery.history Plugin
		base.setHash = function ( hash ) {
			// Write hash
			if ( typeof window.location.hash !== 'undefined' ) {
				if ( window.location.hash !== hash ) {
					window.location.hash = hash;
				};
			} else if ( location.hash !== hash ) {
				location.hash = hash;
			};
			
			// Done
			return hash;
		};
		// <-- End AJAXY code


		// Trigger the initialization
        base.init();
    };

	
    $.anythingSlider.defaults = {
        easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Start",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: null       // Details at the top of the file on this use (advanced use)
    };
	

    $.fn.anythingSlider = function(options){
		if(typeof(options) == "object"){
		    return this.each(function(i){			
				(new $.anythingSlider(this, options));

	            // This plugin supports multiple instances, but only one can support hash-tag support
				// This disables hash-tags on all items but the first one
				options.hashTags = false;
	        });	
		} else if (typeof(options) == "number") {

			return this.each(function(i){
				var anySlide = $(this).data('AnythingSlider');
				if(anySlide){
					anySlide.gotoPage(options);
				}
			});
		}
    };

	
})(jQuery);

/* Jquery Hint */
(function ($) {

$.fn.hint = function (blurClass) {
  if (!blurClass) { 
    blurClass = 'blur';
  }
    
  return this.each(function () {
    // get jQuery version of 'this'
    var $input = $(this),
    
    // capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = $(this.form),
      $win = $(window);

    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }

    // only apply logic if the element has the attribute
    if (title) { 
      // on blur, set value to title attr if text is blank
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur(); // now change all inputs to title
      
      // clear the pre-defined text when form is submitted
      $form.submit(remove);
      $win.unload(remove); // handles Firefox's autocomplete
    }
  });
};

})(jQuery);

$(function(){ 
				$('input[title!=""]').hint();
});

/* Jquery Scrollable */
(function($){function fireEvent(opts,name,self,arg){var fn=opts[name];if($.isFunction(fn)){try{return fn.call(self,arg);}catch(error){if(opts.alert){alert("Error calling scrollable."+name+": "+error);}else{throw error;}return false;}}return true;}var current=null;function Scrollable(root,conf){var self=this;if(!current){current=self;}var horizontal=!conf.vertical;var wrap=$(conf.items,root);var index=0;var navi=root.siblings(conf.navi).eq(0);var prev=root.siblings(conf.prev).eq(0);var next=root.siblings(conf.next).eq(0);var prevPage=root.siblings(conf.prevPage).eq(0);var nextPage=root.siblings(conf.nextPage).eq(0);$.extend(self,{getVersion:function(){return[1,0,1];},getIndex:function(){return index;},getConf:function(){return conf;},getSize:function(){return self.getItems().size();},getPageAmount:function(){return Math.ceil(this.getSize()/conf.size);},getPageIndex:function(){return Math.ceil(index/conf.size);},getRoot:function(){return root;},getItemWrap:function(){return wrap;},getItems:function(){return wrap.children();},seekTo:function(i,time,fn){time=time||conf.speed;if($.isFunction(time)){fn=time;time=conf.speed;}if(i<0){i=0;}if(i>self.getSize()-conf.size){return self;}var item=self.getItems().eq(i);if(!item.length){return self;}if(fireEvent(conf,"onBeforeSeek",self,i)===false){return self;}if(horizontal){var left=-(item.outerWidth(true)*i);wrap.animate({left:left},time,conf.easing,fn?function(){fn.call(self);}:null);}else{var top=-(item.outerHeight(true)*i);wrap.animate({top:top},time,conf.easing,fn?function(){fn.call(self);}:null);}if(navi.length){var klass=conf.activeClass;var page=Math.ceil(i/conf.size);page=Math.min(page,navi.children().length-1);navi.children().removeClass(klass).eq(page).addClass(klass);}if(i===0){prev.add(prevPage).addClass(conf.disabledClass);}else{prev.add(prevPage).removeClass(conf.disabledClass);}if(i>=self.getSize()-conf.size){next.add(nextPage).addClass(conf.disabledClass);}else{next.add(nextPage).removeClass(conf.disabledClass);}current=self;index=i;fireEvent(conf,"onSeek",self,i);return self;},move:function(offset,time,fn){var to=index+offset;if(conf.loop&&to>(self.getSize()-conf.size)){to=0;}return this.seekTo(to,time,fn);},next:function(time,fn){return this.move(1,time,fn);},prev:function(time,fn){return this.move(-1,time,fn);},movePage:function(offset,time,fn){return this.move(conf.size*offset,time,fn);},setPage:function(page,time,fn){var size=conf.size;var index=size*page;var lastPage=index+size>=this.getSize();if(lastPage){index=this.getSize()-conf.size;}return this.seekTo(index,time,fn);},prevPage:function(time,fn){return this.setPage(this.getPageIndex()-1,time,fn);},nextPage:function(time,fn){return this.setPage(this.getPageIndex()+1,time,fn);},begin:function(time,fn){return this.seekTo(0,time,fn);},end:function(time,fn){return this.seekTo(this.getSize()-conf.size,time,fn);},reload:function(){return load();},click:function(index,time,fn){var item=self.getItems().eq(index);var klass=conf.activeClass;if(!item.hasClass(klass)&&(index>=0||index<this.getSize())){self.getItems().removeClass(klass);item.addClass(klass);var delta=Math.floor(conf.size/2);var to=index-delta;if(to>self.getSize()-conf.size){to--;}if(to!==index){return this.seekTo(to,time,fn);}}return self;}});if($.isFunction($.fn.mousewheel)){root.bind("mousewheel.scrollable",function(e,delta){var step=$.browser.opera?1:-1;self.move(delta>0?step:-step,50);return false;});}prev.addClass(conf.disabledClass).click(function(){self.prev();});next.click(function(){self.next();});nextPage.click(function(){self.nextPage();});prevPage.addClass(conf.disabledClass).click(function(){self.prevPage();});if(conf.keyboard){$(window).unbind("keypress.scrollable").bind("keypress.scrollable",function(evt){var el=current;if(!el){return;}if(horizontal&&(evt.keyCode==37||evt.keyCode==39)){el.move(evt.keyCode==37?-1:1);return evt.preventDefault();}if(!horizontal&&(evt.keyCode==38||evt.keyCode==40)){el.move(evt.keyCode==38?-1:1);return evt.preventDefault();}return true;});}function load(){navi.each(function(){var nav=$(this);if(nav.is(":empty")||nav.data("me")==self){nav.empty();nav.data("me",self);for(var i=0;i<self.getPageAmount();i++){var item=$("<"+conf.naviItem+"/>").attr("href",i).click(function(e){var el=$(this);el.parent().children().removeClass(conf.activeClass);el.addClass(conf.activeClass);self.setPage(el.attr("href"));return e.preventDefault();});if(i===0){item.addClass(conf.activeClass);}nav.append(item);}}else{var els=nav.children();els.each(function(i){var item=$(this);item.attr("href",i);if(i===0){item.addClass(conf.activeClass);}item.click(function(){nav.find("."+conf.activeClass).removeClass(conf.activeClass);item.addClass(conf.activeClass);self.setPage(item.attr("href"));});});}});if(conf.clickable){self.getItems().each(function(index,arg){var el=$(this);if(!el.data("set")){el.bind("click.scrollable",function(){self.click(index);});el.data("set",true);}});}if(conf.hoverClass){self.getItems().hover(function(){$(this).addClass(conf.hoverClass);},function(){$(this).removeClass(conf.hoverClass);});}return self;}load();var timer=null;function setTimer(){timer=setInterval(function(){self.next();},conf.interval);}if(conf.interval>0){root.hover(function(){clearInterval(timer);},function(){setTimer();});setTimer();}}jQuery.prototype.scrollable=function(conf){var api=this.eq(typeof conf=='number'?conf:0).data("scrollable");if(api){return api;}var opts={size:5,vertical:false,clickable:true,loop:false,interval:0,speed:400,keyboard:true,activeClass:'active',disabledClass:'disabled',hoverClass:null,easing:'swing',items:'.items',prev:'.prev',next:'.next',prevPage:'.prevPage',nextPage:'.nextPage',navi:'.navi',naviItem:'a',onBeforeSeek:null,onSeek:null,alert:true};$.extend(opts,conf);this.each(function(){var el=new Scrollable($(this),opts);$(this).data("scrollable",el);});return this;};})(jQuery);

/* Jquery innerfade */
(function($) {

    $.fn.innerfade = function(options) {
        return this.each(function() {   
            $.innerfade(this, options);
        });
    };

    $.innerfade = function(container, options) {
        var settings = {
        		'animationtype':    'fade',
            'speed':            'normal',
            'type':             'sequence',
            'timeout':          2000,
            'containerheight':  'auto',
            'runningclass':     'innerfade',
            'children':         null
        };
        if (options)
            $.extend(settings, options);
        if (settings.children === null)
            var elements = $(container).children();
        else
            var elements = $(container).children(settings.children);
        if (elements.length > 1) {
            $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
            for (var i = 0; i < elements.length; i++) {
                $(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
            };
            if (settings.type == "sequence") {
                setTimeout(function() {
                    $.innerfade.next(elements, settings, 1, 0);
                }, settings.timeout);
                $(elements[0]).show();
            } else if (settings.type == "random") {
            		var last = Math.floor ( Math.random () * ( elements.length ) );
                setTimeout(function() {
                    do { 
												current = Math.floor ( Math.random ( ) * ( elements.length ) );
										} while (last == current );             
										$.innerfade.next(elements, settings, current, last);
                }, settings.timeout);
                $(elements[last]).show();
						} else if ( settings.type == 'random_start' ) {
								settings.type = 'sequence';
								var current = Math.floor ( Math.random () * ( elements.length ) );
								setTimeout(function(){
									$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);
								}, settings.timeout);
								$(elements[current]).show();
						}	else {
							alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
						}
				}
    };

    $.innerfade.next = function(elements, settings, current, last) {
        if (settings.animationtype == 'slide') {
            $(elements[last]).slideUp(settings.speed);
            $(elements[current]).slideDown(settings.speed);
        } else if (settings.animationtype == 'fade') {
            $(elements[last]).fadeOut(settings.speed);
            $(elements[current]).fadeIn(settings.speed, function() {
							removeFilter($(this)[0]);
						});
        } else
            alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');
        if (settings.type == "sequence") {
            if ((current + 1) < elements.length) {
                current = current + 1;
                last = current - 1;
            } else {
                current = 0;
                last = elements.length - 1;
            }
        } else if (settings.type == "random") {
            last = current;
            while (current == last)
                current = Math.floor(Math.random() * elements.length);
        } else
            alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
        setTimeout((function() {
            $.innerfade.next(elements, settings, current, last);
        }), settings.timeout);
    };

})(jQuery);

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
	if(element.style.removeAttribute){
		element.style.removeAttribute('filter');
	}
}
$(document).ready(function(){
	
	$('.fade').innerfade({ speed: 'slow', timeout: 5500, type: 'sequence'}); 

});

/* Jquery countdown */
(function($){function Countdown(){this.regional=[];this.regional['']={labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labels1:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],timeSeparator:':',isRTL:false};this._defaults={until:null,since:null,timezone:null,format:'dHMS',layout:'',compact:false,description:'',expiryUrl:'',expiryText:'',alwaysExpire:false,onExpiry:null,onTick:null};$.extend(this._defaults,this.regional[''])}var s='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.extend(Countdown.prototype,{markerClassName:'hasCountdown',_timer:setInterval(function(){$.countdown._updateTargets()},980),_timerTargets:[],setDefaults:function(a){this._resetExtraLabels(this._defaults,a);extendRemove(this._defaults,a||{})},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},_attachCountdown:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName)){return}c.addClass(this.markerClassName);var d={options:$.extend({},b),_periods:[0,0,0,0,0,0,0]};$.data(a,s,d);this._changeCountdown(a)},_addTarget:function(a){if(!this._hasTarget(a)){this._timerTargets.push(a)}},_hasTarget:function(a){return($.inArray(a,this._timerTargets)>-1)},_removeTarget:function(b){this._timerTargets=$.map(this._timerTargets,function(a){return(a==b?null:a)})},_updateTargets:function(){for(var i=0;i<this._timerTargets.length;i++){this._updateCountdown(this._timerTargets[i])}},_updateCountdown:function(a,b){var c=$(a);b=b||$.data(a,s);if(!b){return}c.html(this._generateHTML(b));c[(this._get(b,'isRTL')?'add':'remove')+'Class']('countdown_rtl');var d=this._get(b,'onTick');if(d){d.apply(a,[b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,new Date())])}var e=b._hold!='pause'&&(b._since?b._now.getTime()<=b._since.getTime():b._now.getTime()>=b._until.getTime());if(e&&!b._expiring){b._expiring=true;if(this._hasTarget(a)||this._get(b,'alwaysExpire')){this._removeTarget(a);var f=this._get(b,'onExpiry');if(f){f.apply(a,[])}var g=this._get(b,'expiryText');if(g){var h=this._get(b,'layout');b.options.layout=g;this._updateCountdown(a,b);b.options.layout=h}var i=this._get(b,'expiryUrl');if(i){window.location=i}}b._expiring=false}else if(b._hold=='pause'){this._removeTarget(a)}$.data(a,s,b)},_changeCountdown:function(a,b,c){b=b||{};if(typeof b=='string'){var d=b;b={};b[d]=c}var e=$.data(a,s);if(e){this._resetExtraLabels(e.options,b);extendRemove(e.options,b);this._adjustSettings(e);$.data(a,s,e);var f=new Date();if((e._since&&e._since<f)||(e._until&&e._until>f)){this._addTarget(a)}this._updateCountdown(a,e)}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null}}}},_destroyCountdown:function(a){var b=$(a);if(!b.hasClass(this.markerClassName)){return}this._removeTarget(a);b.removeClass(this.markerClassName).empty();$.removeData(a,s)},_pauseCountdown:function(a){this._hold(a,'pause')},_lapCountdown:function(a){this._hold(a,'lap')},_resumeCountdown:function(a){this._hold(a,null)},_hold:function(a,b){var c=$.data(a,s);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'y'+d+c._periods[1]+'o'+d+c._periods[2]+'w'+d+c._periods[3]+'d'+d+c._periods[4]+'h'+d+c._periods[5]+'m'+d+c._periods[6]+'s');this._addTarget(a)}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,s,c);this._updateCountdown(a,c)}},_getTimesCountdown:function(a){var b=$.data(a,s);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,new Date())))},_get:function(a,b){return(a.options[b]!=null?a.options[b]:$.countdown._defaults[b])},_adjustSettings:function(a){var b=new Date();var c=this._get(a,'timezone');c=(c==null?-new Date().getTimezoneOffset():c);a._since=this._get(a,'since');if(a._since){a._since=this.UTCDate(c,this._determineTime(a._since,null))}a._until=this.UTCDate(c,this._determineTime(this._get(a,'until'),b));a._show=this._determineShow(a)},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a){a=a.toLowerCase();var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':h+=parseInt(j[1],10);break;case'm':g+=parseInt(j[1],10);break;case'h':f+=parseInt(j[1],10);break;case'd':e+=parseInt(j[1],10);break;case'w':e+=parseInt(j[1],10)*7;break;case'o':d+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break;case'y':c+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break}j=i.exec(a)}return new Date(c,d,e,f,g,h,0)};var o=(k==null?l:(typeof k=='string'?n(k):(typeof k=='number'?m(k):k)));if(o)o.setMilliseconds(0);return o},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_generateHTML:function(c){c._periods=periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,new Date()));var d=false;var e=0;for(var f=0;f<c._show.length;f++){d|=(c._show[f]=='?'&&periods[f]>0);c._show[f]=(c._show[f]=='?'&&!d?null:c._show[f]);e+=(c._show[f]?1:0)}var g=this._get(c,'compact');var h=this._get(c,'layout');var i=(g?this._get(c,'compactLabels'):this._get(c,'labels'));var j=this._get(c,'timeSeparator');var k=this._get(c,'description')||'';var l=function(a){var b=$.countdown._get(c,'compactLabels'+periods[a]);return(c._show[a]?periods[a]+(b?b[a]:i[a])+' ':'')};var m=function(a){var b=$.countdown._get(c,'labels'+periods[a]);return(c._show[a]?'<span class="countdown_section"><span class="countdown_amount">'+periods[a]+'</span><br/>'+(b?b[a]:i[a])+'</span>':'')};return(h?this._buildLayout(c,h,g):((g?'<span class="countdown_row countdown_amount'+(c._hold?' countdown_holding':'')+'">'+l(Y)+l(O)+l(W)+l(D)+(c._show[H]?this._twoDigits(periods[H]):'')+(c._show[M]?(c._show[H]?j:'')+this._twoDigits(periods[M]):'')+(c._show[S]?(c._show[H]||c._show[M]?j:'')+this._twoDigits(periods[S]):''):'<span class="countdown_row countdown_show'+e+(c._hold?' countdown_holding':'')+'">'+m(Y)+m(O)+m(W)+m(D)+m(H)+m(M)+m(S))+'</span>'+(k?'<span class="countdown_row countdown_descr">'+k+'</span>':'')))},_buildLayout:function(b,c,d){var e=(d?this._get(b,'compactLabels'):this._get(b,'labels'));var f=function(a){return($.countdown._get(b,(d?'compactLabels':'labels')+b._periods[a])||e)[a]};var g={yl:f(Y),yn:b._periods[Y],ynn:this._twoDigits(b._periods[Y]),ol:f(O),on:b._periods[O],onn:this._twoDigits(b._periods[O]),wl:f(W),wn:b._periods[W],wnn:this._twoDigits(b._periods[W]),dl:f(D),dn:b._periods[D],dnn:this._twoDigits(b._periods[D]),hl:f(H),hn:b._periods[H],hnn:this._twoDigits(b._periods[H]),ml:f(M),mn:b._periods[M],mnn:this._twoDigits(b._periods[M]),sl:f(S),sn:b._periods[S],snn:this._twoDigits(b._periods[S])};var h=c;for(var i=0;i<7;i++){var j='yowdhms'.charAt(i);var k=new RegExp('\\{'+j+'<\\}(.*)\\{'+j+'>\\}','g');h=h.replace(k,(b._show[i]?'$1':''))}$.each(g,function(n,v){var a=new RegExp('\\{'+n+'\\}','g');h=h.replace(a,v)});return h},_twoDigits:function(a){return(a<10?'0':'')+a},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(f,g,h){f._now=h;f._now.setMilliseconds(0);var i=new Date(f._now.getTime());if(f._since&&h.getTime()<f._since.getTime()){f._now=h=i}else if(f._since){h=f._since}else{i.setTime(f._until.getTime());if(h.getTime()>f._until.getTime()){f._now=h=i}}var j=[0,0,0,0,0,0,0];if(g[Y]||g[O]){var k=$.countdown._getDaysInMonth(h.getFullYear(),h.getMonth());var l=$.countdown._getDaysInMonth(i.getFullYear(),i.getMonth());var m=(i.getDate()==h.getDate()||(i.getDate()>=Math.min(k,l)&&h.getDate()>=Math.min(k,l)));var n=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var o=Math.max(0,(i.getFullYear()-h.getFullYear())*12+i.getMonth()-h.getMonth()+((i.getDate()<h.getDate()&&!m)||(m&&n(i)<n(h))?-1:0));j[Y]=(g[Y]?Math.floor(o/12):0);j[O]=(g[O]?o-j[Y]*12:0);var p=function(a,b,c){var d=(a.getDate()==c);var e=$.countdown._getDaysInMonth(a.getFullYear()+b*j[Y],a.getMonth()+b*j[O]);if(a.getDate()>e){a.setDate(e)}a.setFullYear(a.getFullYear()+b*j[Y]);a.setMonth(a.getMonth()+b*j[O]);if(d){a.setDate(e)}return a};if(f._since){i=p(i,-1,l)}else{h=p(new Date(h.getTime()),+1,k)}}var q=Math.floor((i.getTime()-h.getTime())/1000);var r=function(a,b){j[a]=(g[a]?Math.floor(q/b):0);q-=j[a]*b};r(W,604800);r(D,86400);r(H,3600);r(M,60);r(S,1);return j}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}$.fn.countdown=function(a){var b=Array.prototype.slice.call(arguments,1);if(a=='getTimes'){return $.countdown['_'+a+'Countdown'].apply($.countdown,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){$.countdown['_'+a+'Countdown'].apply($.countdown,[this].concat(b))}else{$.countdown._attachCountdown(this,a)}})};$.countdown=new Countdown()})(jQuery);



// JavaScript Document

$(function () {
				
		$('ul.spy').simpleSpy();
		
	});


(function ($) {
    
$.fn.simpleSpy = function (limit, interval) {
    limit = limit || 1;
    interval = interval || 8000;
    
    return this.each(function () {
        // 1. setup
            // capture a cache of all the list items
            // chomp the list down to limit li elements
        var $list = $(this),
            items = [], // uninitialised
            currentItem = limit,
            total = 0, // initialise later on
            height = $list.find('> li:first').height();
            
        // capture the cache
        $list.find('> li').each(function () {
            items.push('<li>' + $(this).html() + '</li>');
        });
        
        total = items.length;
        
        $list.wrap('<div class="spyWrapper" />').parent().css({ height : height * limit });
        
        $list.find('> li').filter(':gt(' + (limit - 1) + ')').remove();

        // 2. effect        
        function spy() {
            // insert a new item with opacity and height of zero
            var $insert = $(items[currentItem]).css({
                height : 0,
                opacity : 0,
                display : 'none'
            }).prependTo($list);
                        
            // fade the LAST item out
            $list.find('> li:last').animate({ opacity : 0}, 200, function () {
                // increase the height of the NEW first item
                $insert.animate({ height : height }, 200).animate({ opacity : 1 }, 200);
                
                // AND at the same time - decrease the height of the LAST item
                // $(this).animate({ height : 0 }, 1000, function () {
                    // finally fade the first item in (and we can remove the last)
                    $(this).remove();
                // });
            });
            
            currentItem++;
            if (currentItem >= total) {
                currentItem = 0;
            }
            
            setTimeout(spy, interval)
        }
        
        spy();
    });
};
    
})(jQuery);

$(function () {
				
		$('ul.spy2').simpleSpy2();
		
	});

(function ($) {
    
$.fn.simpleSpy2 = function (limit, interval) {
    limit = limit || 3;
    interval = interval || 8000;
    
    return this.each(function () {
        // 1. setup
            // capture a cache of all the list items
            // chomp the list down to limit li elements
        var $list = $(this),
            items = [], // uninitialised
            currentItem = limit,
            total = 0, // initialise later on
            height = $list.find('> li:first').height();
            
        // capture the cache
        $list.find('> li').each(function () {
            items.push('<li>' + $(this).html() + '</li>');
        });
        
        total = items.length;
        
        $list.wrap('<div class="spyWrapper" />').parent().css({ height : height * limit });
        
        $list.find('> li').filter(':gt(' + (limit - 1) + ')').remove();

        // 2. effect        
        function spy() {
            // insert a new item with opacity and height of zero
            var $insert = $(items[currentItem]).css({
                height : 0,
                opacity : 0,
                display : 'none'
            }).prependTo($list);
                        
            // fade the LAST item out
            $list.find('> li:last').animate({ opacity : 0}, 1000, function () {
                // increase the height of the NEW first item
                $insert.animate({ height : height }, 1000).animate({ opacity : 1 }, 1000);
                
                // AND at the same time - decrease the height of the LAST item
                // $(this).animate({ height : 0 }, 1000, function () {
                    // finally fade the first item in (and we can remove the last)
                    $(this).remove();
                // });
            });
            
            currentItem++;
            if (currentItem >= total) {
                currentItem = 1;
            }
            
            setTimeout(spy, interval)
        }
        
        spy();
    });
};
    
})(jQuery);



google.load("feeds", "1") //Load Google Ajax Feed API (version 1)

function rssdisplayer(divid, url, feedlimit, showoptions){
this.showoptions=showoptions || "" //get string of options to show ("date" and/or "description")
var feedpointer=new google.feeds.Feed(url) //create new instance of Google Ajax Feed API
feedpointer.setNumEntries(feedlimit) //set number of items to display
document.write('<div id="'+divid+'">Loading feed...</div>')
this.feedcontainer=document.getElementById(divid)
var displayer=this
feedpointer.load(function(r){displayer.formatoutput(r)}) //call Feed.load() to retrieve and output RSS feed
}


rssdisplayer.prototype.formatdate=function(datestr){
var itemdate=new Date(datestr)
return "<span class='Date'>"+itemdate.toLocaleString()+"</span>"
}


rssdisplayer.prototype.formatoutput=function(result){
if (!result.error){ //if RSS feed successfully fetched
var thefeeds=result.feed.entries //get all feed entries as a JSON array
var rssoutput=""
for (var i=0; i<thefeeds.length; i++){ //loop through entries
var itemtitle="<a href=\"" + thefeeds[i].link + "\">" + thefeeds[i].title + "</a>"
var itemdate=/date/i.test(this.showoptions)? this.formatdate(thefeeds[i].publishedDate) : ""
var itemdescription=/description/i.test(this.showoptions)? "<br />"+thefeeds[i].content : /snippet/i.test(this.showoptions)? "<br />"+thefeeds[i].contentSnippet  : ""
rssoutput+="<div>" + itemtitle + " " + itemdate + itemdescription + "</div>"
}
rssoutput+="</ul>"
this.feedcontainer.innerHTML=rssoutput
}
else //else, output error
alert("Error fetching feeds: "+result.error.message)
}

google.load("feeds", "2")