	/*
	 * Cms
	 */

	$().ready(function () {
		cmsObj = new Cms();
	});
	
	var Cms		= {};
	var cmsObj = null;
	Cms = PTM.extend({
	    init: function(){
			this._super();
			
			this.ui = {};
			this.resetUi();
		},
		resetUi: function(){
			setInterval( "cmsObj.slideSwitch()", 5000 );
		},
		slideSwitch: function() {
		    var $active = $('#head_banner_slideshow IMG.active');

		    if ( $active.length == 0 ) $active = $('#head_banner_slideshow IMG:last');

		    var $next =  $active.next().length ? $active.next()
		        : $('#head_banner_slideshow IMG:first');

		    $active.addClass('last-active');

		    $next.css({opacity: 0.0})
		        .addClass('active')
		        .animate({opacity: 1.0}, 1000, function() {
		            $active.removeClass('active last-active');
		        });
		},
		submitForm: function(e){
			$("#"+e).submit();
		}
	});