$(document).ready(function() {

           $('#AjaxCampaignSolution').click(function() {

               var static_page_id = $(this).attr("rel");

               var static_page_id_string ="";

               $('.AjaxCampaignSolutionIDs').each(function (i) {
                    //do something with this and data
                    if (this.checked) {

                            static_page_id_string = static_page_id_string+ $(this).val() + ",";
                    }
               });

               if(static_page_id_string=="") {
                    top.location.href='why_brickfish_approach.php';
               } else {
                    top.location.href='why_brickfish_approach.php?campaign_solution_ids='+static_page_id_string;
                   
               }
               
              

      });


     var icpForm5300 = document.getElementById('icpsignup5300');

     if (document.location.protocol === "https:") {
	 icpForm5300.action = "https://app.icontact.com/icp/signup.php";
     }



 });

 function verifyRequired5300() {

	if (document.getElementById("fields_email").value == "" || document.getElementById("fields_email").value == "Enter your email") {
		document.getElementById("fields_email").focus();
		alert("The Email field is required.");
		return false;
	} else {
               document.forms[0].submit();
        }

	return true;
}


function Slidebox(slideTo,autoPlay){
    var animSpeed=1000; //animation speed
    var easeType='easeInOutExpo'; //easing type
	var sliderWidth=$('#slidebox').width();
	var leftPosition=$('#slidebox .container').css("left").replace("px", "");
	if( !$("#slidebox .container").is(":animated")){
		if(slideTo=='next'){ //next
			if(autoPlay=='stop'){
				clearInterval(autoPlayTimer);
			}
			if(leftPosition==-slideboxTotalContent){
				$('#slidebox .container').animate({left: 0}, animSpeed, easeType); //reset
				$('#slidebox .thumbs a:first-child').removeClass('thumb').addClass('selected_thumb');
				$('#slidebox .thumbs a:last-child').removeClass('selected_thumb').addClass('thumb');
			} else {
				$('#slidebox .container').animate({left: '-='+sliderWidth}, animSpeed, easeType); //next
				$('#slidebox .thumbs .selected_thumb').next().removeClass('thumb').addClass('selected_thumb');
				$('#slidebox .thumbs .selected_thumb').prev().removeClass('selected_thumb').addClass('thumb');
			}
		} else if(slideTo=='previous'){ //previous
			if(autoPlay=='stop'){
				clearInterval(autoPlayTimer);
			}
			if(leftPosition=='0'){
				$('#slidebox .container').animate({left: '-'+slideboxTotalContent}, animSpeed, easeType); //reset
				$('#slidebox .thumbs a:last-child').removeClass('thumb').addClass('selected_thumb');
				$('#slidebox .thumbs a:first-child').removeClass('selected_thumb').addClass('thumb');
			} else {
				$('#slidebox .container').animate({left: '+='+sliderWidth}, animSpeed, easeType); //previous
				$('#slidebox .thumbs .selected_thumb').prev().removeClass('thumb').addClass('selected_thumb');
				$('#slidebox .thumbs .selected_thumb').next().removeClass('selected_thumb').addClass('thumb');
			}
		} else {
			var slide2=(slideTo-1)*sliderWidth;
			if(leftPosition!=-slide2){
				clearInterval(autoPlayTimer);
				$('#slidebox .container').animate({left: -slide2}, animSpeed, easeType); //go to number
				$('#slidebox .thumbs .selected_thumb').removeClass('selected_thumb').addClass('thumb');
				var selThumb=$('#slidebox .thumbs a').eq((slideTo-1));
				selThumb.removeClass('thumb').addClass('selected_thumb');
			}
		}
	}
}
