	$(function() {

		// d4grid-tabs
		$("div.d4grid-18068-tabholder input[type='submit']").attr('value', '');
		$('div.d4grid-18068-tabnav a').click(function() {
			thisTab = parseInt($(this).attr('rel'))+1;
			if ( thisTab == 1 ) { otherTab = 2; } else { otherTab = 1; }
			if ( $("div.d4grid-18068-tab-" + thisTab + " input#form-fillin-field-100").attr('value') != $("div.d4grid-18068-tab-" + otherTab + " input#form-fillin-field-100").attr('value') ) {
				$("div.d4grid-18068-tab-" + thisTab + " input#form-fillin-field-100").attr('value', $("div.d4grid-18068-tab-" + otherTab + " input#form-fillin-field-100").attr('value'));
				if ( $("div.d4grid-18068-tab-" + thisTab + " input#form-fillin-field-100").attr('value') != "Sähköpostiosoite..." ) {
					$("div.d4grid-18068-tab-" + thisTab + " input#form-fillin-field-100").css('color', '#333');
				}
				else {
					$("div.d4grid-18068-tab-" + thisTab + " input#form-fillin-field-100").css('color', '#999');
				}
			}
		});
	
		// slideshow
		$('#slideshow') 
			.before('<div id="slideshow-pager">') 
			.cycle({
				cleartype:  1, // enable cleartype corrections
				fx:     'fade', 
				timeout: 6000, 
				pager:  '#slideshow-pager' 
			});
		$('#slideshow-pager a').click(function() {
			$('#slideshow').cycle('pause');
		});
	});

