



function formShade(el,notify) {
	$('div.alert',el).remove();
	$(el).fadeOut(400, function() {
		if (notify !== undefined && notify != '') {
			$(el).before('<div class="notify">'+notify+'</div>');
		}
	});
}
function formReveal(el,str,kf) {
	$('div.notify').remove();
	$(el)
		.fadeOut(200,function() {
			if (kf===true) {
				$(this).prepend(str);
			} else {	
				$(this).html(str);
			}
		})
		.fadeIn(400);
}



$.fn.hoverImg=function(o,b) {
	var cls = (o===undefined)?'hov':o;
	var src = $(this).attr('src');
	var hsrc = src.replace(/(.png$|.jpg$|.gif$)/i,'_'+cls+'$1');
	var bsrc = (b===undefined)?false:src.replace(/(.png$|.jpg$|.gif$)/i,'_'+cls+'b$1');
	
	if ($.browser.msie) {
		$(this).hover(function(){this.src=hsrc;},function(){this.src=src;});
	} else {
		var $p = $(this).parent();
		if ($p.css('position')=='static') {
			//console.warn('Check the parent container\'s CSS position for "'+src+'"');
			$(this).hover(function(){this.src=hsrc;},function(){this.src=src;});
		} else {
		$p.append('<span class="hover" style="background:transparent url('+hsrc+') no-repeat center top"></span>').hover(
			function() {
				$('span.hover',this).stop().animate({opacity:1},500,'easeOutSine');
			},
			function() {
				$('span.hover',this).stop().animate({opacity:0},500,'easeOutExpo');
			});
		}
	}
}
$.fn.hoverBg=function(h,i,r) {
	if ($.browser.msie) {
		$(this).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});
	} else {
		if ($(this).css('position')=='static') {
			//console.warn('Check the parent container\'s CSS position.');
			$(this).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});
		} else {
			$(this).append('<span class="hover" style="position:absolute;z-index:0;"></span>');
			if (i !== undefined) $('span.hover',this).css('background','transparent url('+i+') no-repeat center top');
			if (i !== undefined && r !== undefined) $('span.hover',this).css('background','transparent url('+i+') repeat-'+r+' center top')
			if (h !== undefined) $('span.hover',this).css('backgroundColor','#'+h);
			$(this).hover(
				function() {
					$('span.hover',this).stop().animate({opacity:1},100,'easeOutSine');
				},
				function() {
					$('span.hover',this).stop().animate({opacity:0},100,'easeOutExpo');
				}
			);
		}
	}
}


$(function() {
	
	
	
	/// Make External Links open in New Windows
	$('a[href^=http]').addClass('new-window');
	$('a[href^=http://www.kristiforcongress.com]').removeClass('new-window');
	if ($('a.new-window').length) {
		$('a.new-window').attr('target','_blank');
	}
	
	
	
	// Make Buttons Submit Forms (IE <= 7 Only)
	if ($.browser.msie && $.browser.version <= 7) {
		$('form button').click(function() {
			$(this).parents('form').submit();
		});
	}
	
	
	
	// Navigation Hover Effect
	$('ul#nav li:not(.sel)').hoverBg('','/cr/images/nav_bg_o5.png','x');
	
	
	
	// Feature Rotation
	if ($('div#feature ul').length) {
		if ($('div#feature ul li').length > 1) {
			$('div#feature ul').cycle({
				timeout:4000,
				speed:500,
				fx:'fade',
				cleartype:!$.support.opacity,
				pager:'.ctrl div.anchors',
				pagerAnchorBuilder:function() {
					return '<a href="#"></a>';
				},
				pagerClick: function() {
					$('div#feature ul').cycle('pause').addClass('paused');
					$('div#feature div.ctrl div.toggle').addClass('paused');
				},
				after: function() {
				}
			});
			$('div#feature ul li').click(function() {
				$('div#feature ul').cycle('pause').addClass('paused');
				$('div#feature div.ctrl div.toggle').removeClass('on').addClass('off');
			});
			$('div#feature div.ctrl div.toggle a').click(function() {
				if ($('div#feature ul.paused').length) {
					$(this).removeClass('off').addClass('on');
					$('div#feature ul').cycle('resume').removeClass('paused');
				} else {
					$(this).removeClass('on').addClass('off');
					$('div#feature ul').cycle('pause').addClass('paused');
				}
				return false;
			});
		} else {
			$('div#feature ul li').show();
			$('div#feature div.ctrl').hide();
		}
	}
	
	
	
	// BG Pulse Test
	$('div#sidebar-issues ul li').hoverBg('f7faec');
	$('div#sidebar-categories ul li').hoverBg('f7faec');
	
	
	
	// Hoverable Images
	if ($('.hoverable').length) {
		$('.hoverable').each(function() {$(this).hoverImg('o');});
	}
	
	
	
	// Validate & Handle Volunteer Form
	if ($('form.volunteer').length) {
		
		// Define Validation
		var volunteerVal = {
			debug:true,
			rules: {
				fname:'required',
				lname:'required',
				zip:'required',
				email: {
					required:true,
					email:true
				},
				phone: {
					required: {
						depends: function(e) {
							return $('form.volunteer input#volunteer-sms-sub:checked').length;
						}
					}
				}
			},
			errorClass:'invalid',
			highlight:function(e,ec) {
				$(e).addClass(ec);
			},
			unhighlight:function(e,ec) {
				$(e).removeClass(ec);
				$(e).siblings('span.error').remove();
			},
			submitHandler:function(f) {
				formShade(f);
				$.ajax({
					type:'POST',
					url:'/cr/php/processor.php',
					dataType:'json',
					data:{
						action:'volunteer',
						jssub:'1',
						fname:$('input#volunteer-fname',f).val(),
						lname:$('input#volunteer-lname',f).val(),
						addr1:$('input#volunteer-addr1',f).val(),
						addr2:$('input#volunteer-addr2',f).val(),
						city:$('input#volunteer-city',f).val(),
						state:$('select#volunteer-state',f).val(),
						zip:$('input#volunteer-zip',f).val(),
						email:$('input#volunteer-email',f).val(),
						'em-sub':$('input#volunteer-em-sub:checked',f).length,
						mobile_phone:$('input#volunteer-phone',f).val(),
						'sms-sub':$('input#volunteer-sms-sub:checked',f).length,
						code_44:$('input#volunteer-task-phone:checked',f).length,
						code_45:$('input#volunteer-task-letters:checked',f).length,
						code_1:'1',
						code_47:$('input#volunteer-task-signs:checked',f).length,
						code_48:$('input#volunteer-task-sticker:checked',f).length,
						code_49:$('input#volunteer-task-office:checked',f).length,
						code_50:$('input#volunteer-task-sign:checked',f).length,
						code_46:$('input#volunteer-task-em:checked',f).length,
						code_51:$('input#volunteer-task-dtd:checked',f).length
					},
					success:function(json) {
						var m = '';
						if (json.success) {
							m = '<div class="alert"><h1>Thanks for your interest.</h1><p>'+json.msg+'</p></div>';
						} else {
							m = '<div class="alert"><h1>There was a problem sending your message.</h1><p>'+json.msg+'</p></div>';
						}
						formReveal(f,m);
					},
					error:function(x,t,e) {
						formReveal(f,'<div class="alert"><h1>There was a problem sending your message. Please try again later.</h1></div>');
					}
				});
			},
			invalidHandler: function(f,v) {
			},
			errorPlacement: function(err,el) {
				var fn = $(el).siblings('span.title').text();
				$(el).siblings('span.error').remove();
				if(!$(el).siblings('span.error').length) {
					$(el).after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
				}
			}
		};
		$('form.volunteer').validate(volunteerVal);
		
		// Mask Phone & Zip Input
		$('form.volunteer input#volunteer-phone').mask("999 999-9999",{placeholder:" "});
		$('form.volunteer input#volunteer-zip').mask("99999",{placeholder:" "});
		
	}
	
	
	
	// Validate & Handle Contact Form
	if ($('form.contact').length) {
		
		// Define Validation
		var contactVal = {
			debug:true,
			rules: {
				fname:'required',
				lname:'required',
				zip:'required',
				email: {
					required:true,
					email:true
				},
				phone: {
					required: {
						depends: function(e) {
							return $('form.contact input#contact-sms-sub:checked').length;
						}
					}
				},
				message:'required'
			},
			errorClass:'invalid',
			highlight:function(e,ec) {
				$(e).addClass(ec);
			},
			unhighlight:function(e,ec) {
				$(e).removeClass(ec);
				$(e).siblings('span.error').remove();
			},
			submitHandler:function(f) {
				formShade(f);
				$.ajax({
					type:'POST',
					url:'/cr/php/processor.php',
					dataType:'json',
					data:{
						action:'contact',
						jssub:'1',
						fname:$('input#contact-fname',f).val(),
						lname:$('input#contact-lname',f).val(),
						addr1:$('input#contact-addr1',f).val(),
						addr2:$('input#contact-addr2',f).val(),
						city:$('input#contact-city',f).val(),
						state:$('select#contact-state',f).val(),
						zip:$('input#contact-zip',f).val(),
						email:$('input#contact-email',f).val(),
						'em-sub':$('input#contact-em-sub:checked',f).length,
						mobile_phone:$('input#contact-phone',f).val(),
						'sms-sub':$('input#contact-sms-sub:checked',f).length,
						message:$('textarea#contact-message',f).val()
					},
					success:function(json) {
						var m = '';
						if (json.success) {
							m = '<div class="alert"><h1 class="page-title">Thanks for your interest.</h1><p>'+json.msg+'</p></div>';
						} else {
							m = '<div class="alert"><h1 class="page-title">There was a problem sending your message.</h1><p>'+json.msg+'</p></div>';
						}
						formReveal(f,m);
					},
					error:function(x,t,e) {
						formReveal(f,'<div class="alert"><h1 class="page-title">There was a problem sending your message.</h1></div>');
					}
				});
			},
			invalidHandler: function(f,v) {
			},
			errorPlacement: function(err,el) {
				var fn = $(el).siblings('span.title').text();
				$(el).siblings('span.error').remove();
				if(!$(el).siblings('span.error').length) {
					$(el).after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
				}
			}
		};
		$('form.contact').validate(contactVal);
		
		// Mask Phone & Zip Input
		$('form.contact input#contact-phone').mask("999 999-9999",{placeholder:" "});
		$('form.contact input#contact-zip').mask("99999",{placeholder:" "});
		
	}
	
	
	
	// Validate & Handle Contribution Form
	if($('form.contribute').length) {
		
		// Show Custom $ Field & Store Value
		$('input#contribute-amt-other').data('cdata',{cval:''});
		$('ul.payment li.amounts ul li input[type=radio]').click(function() {
			if ($(this).is('#contribute-amt-other')) {
				$('ul.payment li.amounts ul li.other span.title').html('$ <input type="text" name="amt-custom" title="Please enter an amount to contribute." value="" id="contribute-amt-custom" />');
				$('input#contribute-amt-custom').val($('input#contribute-amt-other').data('cdata').cval);
				$('input#contribute-amt-custom').focus();
			} else {
				if ($('input#contribute-amt-custom').length) {
					$('input#contribute-amt-other').data('cdata',{cval:$('input#contribute-amt-custom').val()});
				}
				$('ul.payment li.amounts ul li.other span.title').html('Other...');
			}
		});
		
		// Enable Recurring
		$('input#contribute-recurr').click(function() {
			if ($('input#contribute-recurr:checked').length) {
				$('li.recurring select').attr('disabled','');
			} else {
				$('li.recurring select').attr('disabled','disabled');
			}
		});
		
		// Define Validation
		var contributeVal = {
			onkeyup:false,
			debug:true,
			rules: {
				fname:'required',
				lname:'required',
				email: {
					required: true,
					email: true
					},
				phone:'required',
				addr1:'required',
				city:'required',
				zip:'required',
				occupation:'required',
				employer:'required',
				cc: {
					creditcard3: function(){ return '#contribute-cc-type'; }
				},
				//amt: 'required',
				amt: {
					required: {
						depends: function(e) {
							return ($('input#contribute-amt-other:checked').length && $('input#contribute-amt-custom').val() != '')? false: true;
						}
					}
				},
				'amt-custom': {
					required: {
						depends: function(e) {
							return ($('input#contribute-amt-other:checked').length)?true:false;
						}
					},
					number:true
				},
				cvv2: {
					required: true,
					number: true
				},
				'ack-1':'required',
				'ack-2':'required'
			},
			errorClass:'invalid',
			highlight:function(e,ec) {
				$(e).addClass(ec);
			},
			unhighlight:function(e,ec) {
				$(e).removeClass(ec);
				$(e).siblings('span.error').remove();
				if ($(e).attr('name') == 'amt' || $(e).attr('name') == 'amt-custom')
				{
					$('form.contribute ul.payment li.amounts > span.error').remove();
				}
			},
			submitHandler:function(f) {
				$('h1.thanks-title',f).remove();
				formShade(f,'<h1>Processing Contribution...</h1>');
				$.ajax({
					type:'POST',
					url:'/cr/php/processor.php',
					dataType:'json',
					data:{
						action:'contribute',
						jssub:'1',
						fname:$('input#contribute-fname',f).val(),
						lname:$('input#contribute-lname',f).val(),
						addr1:$('input#contribute-addr1',f).val(),
						city:$('input#contribute-city',f).val(),
						state:$('select#contribute-state',f).val(),
						zip:$('input#contribute-zip',f).val(),
						phone:$('input#contribute-phone',f).val(),
						email:$('input#contribute-email',f).val(),
						occupation:$('input#contribute-occupation',f).val(),
						employer:$('input#contribute-employer',f).val(),
						amt:($('input#contribute-amt-other:checked').length)? $('input#contribute-amt-custom',f).val(): $('input[name=amt]:checked').val(),
						cc:$('input#contribute-cc',f).val(),
						cvv2:$('input#contribute-cvv2',f).val(),
						'exp-m':$('select#contribute-exp-m',f).val(),
						'exp-y':$('select#contribute-exp-y',f).val(),
						recurring:($('input#contribute-recurr:checked').length)? 1: 0,
						source:$('input#contribute-source',f).val(),
						periodicity:$('select#contribute-periodicity',f).val()
					},
					success:function(json) {
						var m = '';
						var show_form = false;
						if (json.success) {
							m = '<div class="alert"><h1>Thanks for your support!</h1><p>'+json.msg+'</p></div>';
						} else {
							m = '<div class="alert"><h1>There was a problem contributing.</h1><p>'+json.msg+'</p></div>';
							show_form = true;
						}
						formReveal(f,m,show_form);
					},
					error:function(x,t,e) {
						formReveal(f,'<div class="alert"><h1>There was a problem contributing.</h1></div>',true);
					}
				});
				// formReveal(f,'<div class="alert"><h1>There was a problem contributing.</h1></div>');
			},
			invalidHandler: function(f,v) {
			},
			errorPlacement: function(err,el) {
				if ( $(el).attr('name') == 'amt' )
				{
					$('form.contribute ul.payment li.amounts > span.error').remove();
					if (!$('form.contribute ul.payment li.amounts span.error').length) {
						$('form.contribute ul.payment li.amounts').append('<span class="error">Please provide a <strong>contribution amount</strong>.</span>');
					}
				} else {
					var fn = $(el).siblings('span.title').text();
					if ( fn == '' && $(el).is('.city') ) {
						fn = 'city';
					}
					if ( fn == '' ) {
						fn = $(el).attr('name');
					}
					$(el).siblings('span.error').remove();
					if(!$(el).siblings('span.error').length) {
						if ( fn == 'city' )
						{
							$(el).siblings('select#contribute-state').after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
						} else if ( fn == 'amt-custom' ) {
							$(el).after('<span class="error">Please provide a <br><strong>contribution amount</strong>.</span>');
						} else if ( fn == 'ack-1' || fn == 'ack-2' ) {
							$(el).after('<span class="error">Please check the box to confirm that you <strong>agree</strong> to the following:</span>');
						} else {
							$(el).after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
						}
					}
				}
			}
		};
		$('form.contribute').validate(contributeVal);
		
		// Mask CC Input
		// $('form.contribute input#contribute-cc').mask("9999 9999 9999 9999",{placeholder:" "});
		
		// Mask Phone & Zip Input
		$('form.contribute input#contribute-phone').mask("999 999-9999",{placeholder:" "});
		$('form.contribute input#contribute-zip').mask("99999",{placeholder:" "});
		
	}
	
	
	
	// Validate & Handle Email Subscription Form
	if ($('form.em-sub').length) {
		
		// Toggle SMS Subscription
		$('form.em-sub input#em-sms-sub').click(function() {
			if ($(this).is(':checked')) {
				$('form.em-sub ul li.sms').slideDown(400,function() {
					$('form.em-sub ul li.sms input').focus();
				});
			} else {
				$('form.em-sub ul li.sms').slideUp(200,function() {
					$('form.em-sub ul li.sms input').val('');
				});
			}
		});
		
		// Validate Email Subscription Form
		var emSubVal = {
			debug:true,
			rules: {
				fname:'required',
				lname:'required',
				email: {
					required:true,
					email:true
				},
				zip:'required',
				mobile: {
					required: {
						depends: function(e) {
							return $('form.em-sub input#em-sms-sub:checked').length;
						}
					}
				}
			},
			errorClass:'invalid',
			highlight:function(e,ec) {
				$(e).addClass(ec);
			},
			unhighlight:function(e,ec) {
				$(e).removeClass(ec);
				$(e).siblings('span.error').remove();
			},
			submitHandler:function(f) {
				$('form.em-sub').wrap('<div style="height:348px;background:#e3e8d0;"></div>');
				formShade(f);
				$.ajax({
					type:'POST',
					url:'/cr/php/processor.php',
					dataType:'json',
					data:{
						action:'em-sub',
						jssub:'1',
						fname:$('input#em-sub-fname',f).val(),
						lname:$('input#em-sub-lname',f).val(),
						email:$('input#em-sub-email',f).val(),
						zip:$('input#em-sub-zip',f).val(),
						mobile_phone:$('input#em-sub-mobile',f).val(),
						'em-sub':'1',
						'sms-sub':$('form.em-sub input#em-sms-sub:checked').length
					},
					success:function(json) {
						var m = '';
						if (json.success) {
							m = '<div class="alert"><h1>Thanks for your interest.</h1><p>'+json.msg+'</p></div>';
						} else {
							m = '<div class="alert"><h1>There was a problem subscribing.</h1><p>'+json.msg+'</p></div>';
						}
						formReveal(f,m);
					},
					error:function(x,t,e) {
						formReveal(f,'<div class="alert"><h1>There was a problem subscribing.</h1></div>');
					}
				});
			},
			invalidHandler: function(f,v) {
			},
			errorPlacement: function(err,el) {
				var fn = $(el).siblings('span.title').text();
				$(el).siblings('span.error').remove();
				if(!$(el).siblings('span.error').length) {
					$(el).after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
				}
			}
		};
		$('form.em-sub').validate(emSubVal);
		
		// Mask Phone # and Zip Input
		$('form.em-sub input#em-sub-mobile').mask("999-999-9999",{placeholder:" "});
		$('form.em-sub input#em-sub-zip').mask("99999",{placeholder:""});
	}
	
	
	
	// Validate & Handle Email Subscription Form
	if ($('form.static').length) {
		
		// Validate Email Subscription Form
		var statSubVal = {
			debug:true,
			rules: {
				fname:'required',
				lname:'required',
				email: {
					required:true,
					email:true
				},
				zip:'required'
			},
			errorClass:'invalid',
			highlight:function(e,ec) {
				$(e).addClass(ec);
			},
			unhighlight:function(e,ec) {
				$(e).removeClass(ec);
				$(e).siblings('span.error').remove();
			},
			submitHandler:function(f) {
				//$('form.static').wrap('<div style="height:348px;background:#e4e1d6;"></div>');
				if (!$('input#static-hp-rsvp',f).length) {
					formShade(f);
				}
				$.ajax({
					type:'POST',
					url:'/cr/php/processor.php',
					dataType:'json',
					data:{
						action:'static',
						staction:($('input#static-code',f).length)?$('input#static-code',f).val():'',
						'stat-form-camp':($('input#stat-form-camp',f).length)?$('input#stat-form-camp',f).val():'',
						'stat-form-src':($('input#stat-form-src',f).length)?$('input#stat-form-src',f).val():'',
						jssub:'1',
						fname:$('input#static-fname',f).val(),
						lname:$('input#static-lname',f).val(),
						email:$('input#static-email',f).val(),
						phone:($('input#static-phone',f).length)?$('input#static-phone',f).val():'',
						zip:$('input#static-zip',f).val(),
						'hp-rsvp':($('input#static-hp-rsvp',f).length)?'1':'',
						'hp-option':($('input:radio:checked',f).length)?$('input:radio:checked',f).val():''
					},
					success:function(json) {
						var m = '';
						if (json.success) {
							if (!$('input#static-hp-rsvp',f).length) {
								m = '<h2>Sign the Petition</h2><div class="alert"><h1>Thanks for your interest.</h1><p>'+json.msg+'</p></div>';
								window.location = '/contribute/';
							} else {
								window.location = '/video-chat-rsvp-success/';
							}
						} else {
							if (!$('input#static-hp-rsvp',f).length) {
								m = '<h2>Sign the Petition</h2><div class="alert"><h1>There was a problem signing the petition. Please try again later.</h1><p>'+json.msg+'</p></div>';
							}
						}
						if (!$('input#static-hp-rsvp',f).length) {
							formReveal(f,m);
						}
					},
					error:function(x,t,e) {
						if (!$('input#static-hp-rsvp',f).length) {
							formReveal(f,'<h2>Sign the Petition</h2><div class="alert"><h1>There was a problem signing the petition. Please try again later.</h1></div>');
						}
					}
				});
			},
			invalidHandler: function(f,v) {
			},
			errorPlacement: function(err,el) {
				var fn = $(el).siblings('span.title').text();
				$(el).siblings('span.error').remove();
				if(!$(el).siblings('span.error').length) {
					$(el).after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
				}
			}
		};
		$('form.static').validate(statSubVal);
		
		// Mask Zip Input
		$('form.static input#static-zip').mask("99999",{placeholder:""});
	}
	
	
	
	// Validate & Handle Email Subscription Form
	if ($('form.sign-up').length) {
		
		// Validate Email Subscription Form
		var suSubVal = {
			debug:true,
			rules: {
				location:'required',
				fname:'required',
				lname:'required',
				email: {
					required:true,
					email:true
				},
				zip:'required'
			},
			errorClass:'invalid',
			highlight:function(e,ec) {
				$(e).addClass(ec);
			},
			unhighlight:function(e,ec) {
				$(e).removeClass(ec);
				$(e).siblings('span.error').remove();
			},
			submitHandler:function(f) {
				//$('form.sign-up').wrap('<div style="height:348px;background:#e4e1d6;"></div>');
				formShade(f);
				$.ajax({
					type:'POST',
					url:'/cr/php/processor.php',
					dataType:'json',
					data:{
						action:'static',
						staction:'kentucky-first',
						location:($('select#su-location',f).length)?$('select#su-location',f).val():'',
						jssub:'1',
						fname:$('input#su-fname',f).val(),
						lname:$('input#su-lname',f).val(),
						email:$('input#su-email',f).val(),
						phone:($('input#su-phone',f).length)?$('input#su-phone',f).val():'',
						zip:$('input#su-zip',f).val()
					},
					success:function(json) {
						var m = '';
						if (json.success) {
							m = '<h2>Sign Up to Attend <br />A Tour Event</h2><div class="alert"><p>Thanks for your signing up! We\'ll see you there!</p></div>';
						} else {
							m = '<h2>Sign Up to Attend <br />A Tour Event</h2><div class="alert"><p>There was a problem signing up. Please try again later.</p></div>';
						}
						formReveal(f,m);
					},
					error:function(x,t,e) {
						formReveal(f,'<h2>Sign Up to Attend <br />A Tour Event</h2><div class="alert"><p>There was a problem signing up. Please try again later.</p></div>');
					}
				});
			},
			invalidHandler: function(f,v) {
			},
			errorPlacement: function(err,el) {
				var fn = $(el).siblings('span.title').text();
				$(el).siblings('span.error').remove();
				if(!$(el).siblings('span.error').length) {
					$(el).after('<span class="error">Please provide your <strong>'+fn+'</strong>.</span>');
				}
			}
		};
		$('form.sign-up').validate(suSubVal);
		
		// Mask Zip Input
		$('form.sign-up input#static-zip').mask("99999",{placeholder:""});
	}
	
	
	
	$('span.reg-link a').click(function() {
			var id = $(this).attr('class');
			$('form.sign-up select#su-location').val(id);
		});
	
	
	
	// Posts Link & Hover State
	//$('div#content div#latest-posts div.post').hoverBg('f2f0eb','/cr/images/post_bg.png');
	$('div#content div#latest-posts div.post').click(function() {
		window.location = $('p.read-more a',this).attr('href');
	});
	
	
	
	// Posts Link & Hover State
	//$('div#content div#news div.post').hoverBg('f2f0eb','/cr/images/post_bg.png');
	$('div#content div#news div.post').click(function() {
		window.location = $('p.read-more a',this).attr('href');
	});
	
	
	
	// Issues Link & Hover State
	//$('div#content div#issues div.issue').hoverBg('f2f0eb');
	$('div#content div#issues div.issue').click(function() {
		window.location = $('p.read-more a',this).attr('href');
	});
	
	
	
	// MP3 Handling
	if ($('a.mp3').length) {
		$('a.mp3').media({mp3Player:'/cr/swf/player.swf',bgColor:'transparent'});
	}
	
	
	
	// Buttons Hover
	$('button').hover(function(){$(this).addClass('hov');},function(){$(this).removeClass('hov');});
	
});
