$(document).ready(function(){
$('a[href*=#]').click(function() {
  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
  && location.hostname == this.hostname) {
	var $target = $(this.hash);
	$target = $target.length && $target
	|| $('[name=' + this.hash.slice(1) +']');
	if ($target.length) {
	  var targetOffset = $target.offset().top;
	  $('html,body')
	  .animate({scrollTop: targetOffset}, 1000);
	 return false;
	}
  }
});
});

$(function() {
	$("#BackToTop").scrollToTop();
});

Cufon.replace('.NewsletterItem h3', { 
	fontFamily: 'Calibri' ,
	hover: true
});
Cufon.replace('#LeftColumn li a', { 
	fontFamily: 'Calibri' ,
	hover: true
});
Cufon.replace('#Logo h1', { 
	fontFamily: 'Calibri' ,
	hover: true
});
Cufon.replace('#Logo h2', { 
	fontFamily: 'Calibri' ,
	hover: true
});
$(document).ready(function(){  
    $("#ReferralForm").validate();  
});  


$(document).ready(function(){
	// Add onclick handler to checkbox w/id checkme
	$("#referralshare").click(function(){
	// If checked
	if ($("#referralshare").is(":checked"))
	{
	    //show the hidden div
	    $("#ReferDetails").show("fast");
	    $("#ReferDetails input").addClass("required");
	}
	else
	{     
	    //otherwise, hide it
	    $("#ReferDetails").hide("fast");
	    $("#ReferDetails input").removeClass("required");
	}
	});
});


$(document).ready(function(){  
	// Add onclick handler to checkbox w/id checkme
	$("#oneyeardealcheck").click(function(){
	// If checked
	if ($("#oneyeardealcheck").is(":checked"))
	{
	    //show the hidden div
	    $("#dealoptions").show("fast");
	    $("#twoyeardeal").hide("fast");
	    $("#threeyeardeal").hide("fast");
	    $("#tenyeardeal").hide("fast");
	    $("#ddebit_joint").hide("fast");
	    $("#ddebit").hide("fast");
	    $("#dealquantity").addClass("required");
	    $("#ReferralShareWrap").hide("fast");
	}
	else
	{     
	    //otherwise, hide it
	    $("#dealoptions").hide("fast");
	    $("#twoyeardeal").show("fast");
	    $("#threeyeardeal").show("fast");
	    $("#tenyeardeal").show("fast");
	    $("#ddebit_joint").show("fast");
	    $("#ddebit").show("fast");
	    $("#dealquantity").removeClass("required");
	    $("#ReferralShareWrap").show("fast");
	}
	});
});

$(document).ready(function(){  
	// Add onclick handler to checkbox w/id checkme
	$("#twoyeardealcheck").click(function(){
	// If checked
	if ($("#twoyeardealcheck").is(":checked"))
	{
	    //show the hidden div
	    $("#dealoptions").show("fast");
	    $("#oneyeardeal").hide("fast");
	    $("#threeyeardeal").hide("fast");
	    $("#tenyeardeal").hide("fast");
	    $("#ddebit_joint").hide("fast");
	    $("#ddebit").hide("fast");
	    $("#dealquantity").addClass("required");
	}
	else
	{     
	    //otherwise, hide it
	    $("#dealoptions").hide("fast");
	    $("#oneyeardeal").show("fast");
	    $("#threeyeardeal").show("fast");
	    $("#tenyeardeal").show("fast");
	    $("#ddebit_joint").show("fast");
	    $("#ddebit").show("fast");
	    $("#dealquantity").removeClass("required");
	}
	});
});

$(document).ready(function(){  
	// Add onclick handler to checkbox w/id checkme
	$("#threeyeardealcheck").click(function(){
	// If checked
	if ($("#threeyeardealcheck").is(":checked"))
	{
	    //show the hidden div
	    $("#dealoptions").show("fast");
	    $("#oneyeardeal").hide("fast");
	    $("#twoyeardeal").hide("fast");
	    $("#tenyeardeal").hide("fast");
	    $("#ddebit_joint").hide("fast");
	    $("#ddebit").hide("fast");
	    $("#dealquantity").addClass("required");
	}
	else
	{     
	    //otherwise, hide it
	    $("#dealoptions").hide("fast");
	    $("#oneyeardeal").show("fast");
	    $("#twoyeardeal").show("fast");
	    $("#tenyeardeal").show("fast");
	    $("#ddebit_joint").show("fast");
	    $("#ddebit").show("fast");
	    $("#dealquantity").removeClass("required");
	}
	});
});

$(document).ready(function(){  
	// Add onclick handler to checkbox w/id checkme
	$("#tenyeardealcheck").click(function(){
	// If checked
	if ($("#tenyeardealcheck").is(":checked"))
	{
	    //show the hidden div
	    $("#dealoptions").show("fast");
	    $("#oneyeardeal").hide("fast");
	    $("#twoyeardeal").hide("fast");
	    $("#threeyeardeal").hide("fast");
	    $("#ddebit_joint").hide("fast");
	    $("#ddebit").hide("fast");
	    $("#dealquantity").addClass("required");
	}
	else
	{     
	    //otherwise, hide it
	    $("#dealoptions").hide("fast");
	    $("#oneyeardeal").show("fast");
	    $("#twoyeardeal").show("fast");
	    $("#threeyeardeal").show("fast");
	    $("#ddebit_joint").show("fast");
	    $("#ddebit").show("fast");
	    $("#dealquantity").removeClass("required");
	}
	});
});

$(document).ready(function(){  
	// Add onclick handler to checkbox w/id checkme
	$("#ddebitcheck").click(function(){
	// If checked
	if ($("#ddebitcheck").is(":checked"))
	{
	    //show the hidden div
	    $("#oneyeardeal").hide("fast");
	    $("#twoyeardeal").hide("fast");
	    $("#threeyeardeal").hide("fast");
	    $("#tenyeardeal").hide("fast");
	    $("#ddebit_joint").hide("fast");
	}
	else
	{     
	    //otherwise, hide it
	    $("#oneyeardeal").show("fast");
	    $("#twoyeardeal").show("fast");
	    $("#threeyeardeal").show("fast");
	    $("#tenyeardeal").show("fast");
	    $("#ddebit_joint").show("fast");
	}
	});
});


$(document).ready(function(){  
	// Add onclick handler to checkbox w/id checkme
	$("#ddebitcheck_joint").click(function(){
	// If checked
	if ($("#ddebitcheck_joint").is(":checked"))
	{
	    //show the hidden div
	    $("#oneyeardeal").hide("fast");
	    $("#twoyeardeal").hide("fast");
	    $("#threeyeardeal").hide("fast");
	    $("#tenyeardeal").hide("fast");
	    $("#ddebit").hide("fast");
	    $("#ReferDetailsDD").show("fast");
	    $("#ReferDetailsDD input").addClass("required");
	}
	else
	{     
	    //otherwise, hide it
	    $("#oneyeardeal").show("fast");
	    $("#twoyeardeal").show("fast");
	    $("#threeyeardeal").show("fast");
	    $("#tenyeardeal").show("fast");
	    $("#ddebit").show("fast");
	    $("#ReferDetailsDD").hide("fast");
	    $("#ReferDetailsDD input").removeClass("required");
	}
	});
});
 