$(document).ready(function() {
	
		var innerhtml = '';
		var reg = new RegExp('satisfaction_index');
		var has_si ='';
		
		// more and less buttons
		$('.more').click(function(event){
			event.preventDefault();
			
			if($(this).next().size()==0)
			{
				innerhtml = $(this).parent().next().html();
			}
			else
			{
				innerhtml = $(this).next().html();
			}
			
			has_si = reg.exec(innerhtml);

			if (
				(jQuery.browser.msie 
				&& jQuery.browser.version == '6.0'
				&& (has_si  == 'satisfaction_index')
				)
				||
				(jQuery.browser.opera && (has_si  == 'satisfaction_index'))
				)
			{
				var html = $(this)
					.next().css('display', 'block')
					.prev().hide()
					.next().append(' <a href="" class="less">Close</a>');
				
				$(html)
				.find('.less')
				.click(function(event){
					event.preventDefault();
					$(this)
						.hide()
						.parent()
						.css('display', 'none')
						.prev().show();
					});
			}

			else 
			{
				if($(this).next().size()==0)
				{
					$(this)
						.parent().next().show('slow')
						.prev().hide()
						.next().append(' <a href="" class="less">Close</a>');
						
					$('.less').click(function(event){
						event.preventDefault();
						$(this)
							.hide()
							.parent().hide('slow').prev().show();
					});
				}
				else
				{
					$(this)
						.next().show('slow')
						.prev().hide()
						.next().append(' <a href="" class="less">Close</a>');
					$('.less').click(function(event){
						event.preventDefault();
						$(this)
							.hide()
							.parent().hide('slow').prev().show();
					});
				}
			}
		});
 });

 $(window).load(function() {
	$('.slideshow1').append( $('.slideshow1').next().html() ); $('.slideshow1').next().remove();
	$('.slideshow2').append( $('.slideshow2').next().html() ); $('.slideshow2').next().remove();
	$('.slideshow3').append( $('.slideshow3').next().html() ); $('.slideshow3').next().remove();
	
	$('.slideshow1').cycle({ 
		    fx:     'fade', 
			speed:	4000,
		    timeout: 8000, 
		    delay: -2000 
	});
		 
	$('.slideshow2').cycle({ 
		    fx:     'fade', 
			speed:	4000,
		    timeout: 8000, 
		    delay: -2000 
	});
	
	$('.slideshow3').cycle({ 
		    fx:     'fade', 
			speed:	4000,
		    timeout: 16000, 
		    delay: -2000 
	});
	
 });
 
 
 