function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1500, function() {
            $active.removeClass('active last-active');
        });
}

// FRONT SHOW
var time;
var fShow = function(fS){
	if(fS==1){sFrame1();}
	if(fS==2){sFrame2();}
	if(fS==3){sFrame3();}
	fS++
	if(fS==4){fS=1;}
	time = setTimeout('fShow('+fS+')',5000);
};
var sFrame1 = function(){
	$('#tx3').animate({opacity:0}, 1000);
	$('#fs3').animate({opacity:0}, 1000);
	$('#fs1').animate({opacity:1}, 1000);
	$('#tx1').animate({opacity:0, marginLeft: "-30px"}, 1000) //delays next animation
		.animate({opacity:1, marginLeft: "0px"}, 1000); //animate text
};
var sFrame2 = function(){
	$('#tx1').animate({opacity:0}, 1000);
	$('#fs2').animate({opacity:1}, 1000);
	$('#tx2').animate({opacity:0, marginLeft: "30px"}, 1000) //delays next animation
		.animate({opacity:1, marginLeft: "0px"}, 1000); //animate text
};
var sFrame3 = function(){
	$('#tx2').animate({opacity:0}, 1000);
	$('#fs3').animate({opacity:1}, 1000);
	$('#fs2').animate({opacity:0}, 1000);
	$('#tx3').animate({opacity:0, marginLeft: "-30px"}, 1000) // delays next animation
		.animate({opacity:1, marginLeft: "0px"}, 1000); //animate text
};


// JQUERY
$(function(){
//	setInterval( "slideSwitch()", 5000 );
	
	$('#fs1').css({opacity:1});
	$('#tx1').css({opacity:0});
	$('#fs2').css({opacity:0});
	$('#tx2').css({opacity:0});
	$('#fs3').css({opacity:0});
	$('#tx3').css({opacity:0});


	fShow(1);
//	initialize();

});

// FORM CHECK
function checkform()
{
	if (document.feedback.FirstName.value == '')
	{
		alert('Your name is required');
		return false;
	}
	else if (document.feedback.LastName.value == '')
	{
		alert('Your name is required');
		return false;
	}
	else if (document.feedback.Address.value == '')
	{
		alert('Your Address is required');
		return false;
	}
	else if (document.feedback.City.value == '')
	{
		alert('Your City is required');
		return false;
	}
	else if (document.feedback.ZipCode.value == '')
	{
		alert('Your Zipcode is required');
		return false;
	}
	else if (document.feedback.Country.value == '')
	{
		alert('Your Country is required');
		return false;
	}
	else if (document.feedback.phone.value == '')
	{
		alert('Your Phone is required');
		return false;
	}
	else if (document.feedback.captcha.value == '')
	{
		alert('Type the characters you see in the image');
		return false;
	}
	else if (document.feedback.captcha.value != 'capreef')
	{
		alert('Type the characters you see in the image');
		return false;
	}
	return true;
}
