	function CheckActive( o, focus ) {
		if( focus && o.value == o.defaultValue )
			o.value = '';
		else if( !focus && o.value == '' )
			o.value = o.defaultValue;
	};

	function $_( ID ) {
		return document.getElementById( ID );
	};

	function submenu( o, SHOW ) {
		o.className	= SHOW ? 'show' : '';
	};

	var ANIM	= null;
	var num		= 0;
	var playing	= false;

	function _start() {
		if( $_('walls') ) {
			var walls	= $_('walls');
			var al		= $_( 'arr-left' );
			var ar		= $_( 'arr-right' );

			if( al )
			al.onclick	= function() {
				if( playing )
					return;

				playing		= true;

				CUR--;

				if( CUR < 0 )
					CUR = SLIDES.length - 1;

				var w		= $_('walls');
				var a		= document.createElement( 'a' );
				a.setAttribute( 'href', LINKS[CUR] );
				var img		= document.createElement( 'img' );
				img.setAttribute( 'src', SLIDES[CUR].src );
				img.setAttribute( 'alt', '' );
				a.appendChild( img );

				w.insertBefore( a, w.firstChild );
				walls.scrollLeft = 902;

				var from	= 902;
				var to		= 0;

				if( $_('active-dot') )
					$_('active-dot').setAttribute( 'id', '' );
				$_('dots').getElementsByTagName('span')[CUR].setAttribute( 'id', 'active-dot' );

				ANIM		= new Tween( walls, 'scrollLeft', Tween.strongEaseOut, from, to, .5, '' );
				ANIM.onMotionFinished	= function() {
					num--;
					playing		= false;
				};
				ANIM.start();
			};

			if( ar )
			ar.onclick	= function() {
				if( playing )
					return;

				playing		= true;

				CUR++;

				if( CUR >= SLIDES.length )
					CUR = 0;

				var w		= $_('walls');
				var a		= document.createElement( 'a' );
				a.setAttribute( 'href', LINKS[CUR] );
				var img		= document.createElement( 'img' );
				img.setAttribute( 'src', SLIDES[CUR].src );
				img.setAttribute( 'alt', '' );
				a.appendChild( img );

				w.appendChild( a );
				walls.scrollLeft = 0;

				var from	= walls.scrollLeft;
				var to		= (0 + 1) * 902;

				if( $_('active-dot') )
					$_('active-dot').setAttribute( 'id', '' );
				$_('dots').getElementsByTagName('span')[CUR].setAttribute( 'id', 'active-dot' );

				ANIM		= new Tween( walls, 'scrollLeft', Tween.strongEaseOut, from, to, .5, '' );
				ANIM.onMotionFinished	= function() {
					num++;
					w.removeChild( w.getElementsByTagName( 'a' )[0] );
					walls.scrollLeft -= 902;
					playing	= false;
				};
				ANIM.start();
			};
		}
	};

	var scrolls	= { 'cats': null, 'details': null };

	function scroll( ID, DIR ) {
		if( scrolls[ID] )
			window.clearInterval( scrolls[ID] );

		var o	= $_(ID);
		DIR		= (DIR == 'left' ? -1 : 1);

		scrolls[ ID ] = window.setInterval(
			function() {
				o.scrollLeft += DIR * 5;
			},
			1
		);
	};

	function stopscrol( ID ) {
		if( scrolls[ID] )
			window.clearInterval( scrolls[ID] );
	};
	function MP( url ) {
		$_('mainpic').src = 'http://www.europatour.com/upload/offers/thumbs/' + url;
	};

	


