function cfg_slide(  ) {
	
	this.el_id				= 1;
	this.thumb_show_time	= 350;
	this.thumb_hide_time		= 350;
	
	this.img_show_time		= 350;
	this.img_hide_time		= 350;
	
	this.item_per_page		= 4;
	this.slide_time			= 4000;
	
	this.slide_on			= 1;
	this.counter 			= 0;
}

cfs = new cfg_slide();

//setTimeout( 'slide_on();', cfs.slide_time );
setTimeout( 'slide_on();', 10 );

function slide_on()
{
	if( cfs.slide_on )
	{
		cfs.counter += 100;
		if( cfs.counter > cfs.slide_time )
		{
			cfs.counter = 0;
			new_id = cfs.el_id;
			new_id++;		
			if ( new_id > cfs.item_per_page )
			{
				new_id = 1;
			}		
			thumb_over( new_id );
			//thumb_click( new_id );
			if ( new_id != cfs.el_id ) 
			{		
				img_toggle( new_id );		
				text_id = 'slide_text_' + cfs.el_id;
				thumb_show( cfs.el_id );
				text_out( text_id );
				cfs.el_id	= new_id;
			}
		}
	}
	setTimeout( 'slide_on(  );', 100 );
}

/*function slide_on(  ) 
{	
	if ( cfs.slide_on ) 
	{		
		new_id = cfs.el_id;
		new_id++;		
		if ( new_id > cfs.item_per_page )
		{
			new_id = 1;
		}		
		thumb_over( new_id );
		//thumb_click( new_id );
		if ( new_id != cfs.el_id ) 
		{		
			img_toggle( new_id );		
			text_id = 'slide_text_' + cfs.el_id;
			thumb_show( cfs.el_id );
			text_out( text_id );
			cfs.el_id	= new_id;
		}
	}
	setTimeout( 'slide_on(  );', cfs.slide_time );
}*/

function thumb_over( id )
{
	text_id = 'slide_text_' + id;
	if ( id != cfs.el_id )
	{	
		thumb_hide( id );
		text_over( text_id );
	}
}

function thumb_out( id ) 
{
	text_id = 'slide_text_' + id;
	if ( id != cfs.el_id ) 
	{	
		thumb_show( id );
		text_out( text_id );
	}

	cfs.counter = 0;
	cfs.slide_on = 1;
	//setTimeout( 'slide_on(  );', cfs.slide_time );
}

function thumb_click( id ) 
{
	cfs.slide_on = 0;	
	if ( id != cfs.el_id ) 
	{	
		img_toggle( id );	
		text_id = 'slide_text_' + cfs.el_id;
		thumb_show( cfs.el_id );
		text_out( text_id );
		cfs.el_id = id;
	}
}

function img_over()
{
	cfs.slide_on = 0;	
}

function img_out()
{
	cfs.counter = 0;
	cfs.slide_on = 1;	
}

function thumb_hide( id )
 {	
	el_id	= 'cover_' + id;	
	$( "#" + el_id ).animate( {opacity: "hide"}, cfs.thumb_hide_time );
}

function thumb_show( id ) 
{	
	el_id	= 'cover_' + id;	
	$( "#" + el_id ).animate( {opacity: "show"}, cfs.thumb_show_time );
}

function text_over( el_id )
{
	if ( document.getElementById( el_id ) )
	 {	
		document.getElementById( el_id ).className = 'thumb_text_over';
	}
}

function text_out( el_id ) 
{
	if ( document.getElementById( el_id ) ) 
	{	
		document.getElementById( el_id ).className = 'thumb_text_out';
	}
}

function img_toggle( id )
{
	el_hide	= 'img_' + cfs.el_id;
	el_show	= 'img_' + id;
	img_hide( el_hide );
	//setTimeout( 'img_show( "' + el_show + '" );', cfs.img_hide_time );
	img_show( el_show );
}

function img_hide( el_id )
{
	document.getElementById(el_id).style.zIndex=0;
	$( "#" + el_id ).animate( { opacity: "hide" }, cfs.img_hide_time );
}

function img_show( el_id )
{
	document.getElementById(el_id).style.zIndex=1;
	$( "#" + el_id ).animate( { opacity: "show" }, cfs.img_show_time );
}