$(document).ready(function(){

function forms()
{
	if($('form textarea').length==0 || $('form .boxfield').length==0)	{	return true;	}
	
	$('form textarea').each(	
		function()	
		{
			if(!$(this).closest('p.input_element').hasClass('textarea')){	$(this).closest('p.input_element').addClass('textarea');	}
			}
		);
	$('form .boxfield').each(	
		function()	
		{
			if(!$(this).closest('p.input_element').hasClass('multiplec'))	{	$(this).closest('p.input_element').addClass('multiplec');	}
		}
	);
}
setTimeout(forms, 50);

function slideSwitch()
{
	var $active=$('#slideshow li.active');
	
	if($active.length==0)	
		$active = $('#slideshow li:last');	
	
	var $next=$active.next().length?$active.next():$('#slideshow li:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 600, function() {$active.removeClass('active last-active');});
}

setInterval(slideSwitch, 3000);

});

/*
$(function() {
    $('#slideshow').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 6000,
        pager:  '#nav',
		slideExpr: 'img'
    });
});*/
