// JavaScript Document
$(document).ready(function() {
	var $children = $('div.social-wrap ul li');
	for(var i = 0, l = $children.length; i < l; i += 3) {
		$children.slice(i, i+3).wrapAll('<div class="menuRow"></div>');
	}
	
	
	var $children = $('.mailchimp-wrap .mailchimp label');
	for(var i = 0, l = $children.length; i < l; i += 1) {
		$children.slice(i, i+1).wrapAll('<div class="mailformRow"></div>');
	}
	
	
});

$(function() {
	$(".preFooter a:last").addClass('lastItem');
	$('.menuRow li:last').addClass('lastItem');
	$('.social-wrap .menuRow:last').addClass('lastItem');
});

$(document).ready(function() {


			$(".rsswidget").fancybox({
				'titleShow'			: false,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'padding'			: 0,
				'margin'			: 0
			});


		 var result = new Array( 0, 0, 0);
		 //links are in headers
		 $('.boxChek').attr('checked', false);
		 	
		 $('.boxChek').change(function(){
			var value = $(this).attr('value'); 
			
		  if($(this).attr('checked') == 'checked'){
				result[value-1] = 1;
			}else{ 
				result[value-1] = 0;
			}
			console.log(result.toString());
		 });
		 
		 $('.signupRSSbtn').click(function(){
			 if(result == '1,0,0'){
				 window.open(link_1);
			 }
			 
			 if(result == '0,1,0'){
				 window.open(link_2);
			 }
			 
			 if(result == '0,0,1'){
				 window.open(link_3);
			 }
			 
			 if(result == '1,1,0'){
				window.open(link_4);
			 }
			 
			 if(result == '1,0,1'){
				 window.open(link_5);
			 }
			 
			 if(result == '0,1,1'){
				 window.open(link_6);
			 }
			 
			 if(result == '1,1,1'){
				 window.open(link_7);
			 }
		 });
		 
		 
  	 
 	});
