        $(document).ready(function() {
	try{
		$("input.phoneoverlay").mask("(999) 999-9999");
		$("input.stateoverlay").mask("aa");
		$("input.zipoverlay").mask("99999");
		$("input.dateoverlay").mask("99/99/9999");
		$("input.ssnoverlay").mask("999-99-9999");
	}
	catch(exception){}
	$('.oBodyCopy').each(function(){
		if($(this).html().toLowerCase().replace('<br>','').replace('<br/>','').replace('<br />','') == ''){
			$(this).remove();
		}
	});
	$(".backtotop").click(function() { $('html, body').animate({ scrollTop: 0 }, 'slow'); });
	
	$('#sidenav ul > li > ul').each(function(){
		if($(this).children('li').length==0)
			$(this).remove();
	});
	
	$('#sidenav ul > li').each(function(i){
		if($(this).attr('class')=="on" && $(this).children('ul').length>0){
			$(this).children('ul').fadeIn('fast');
		}
	});
	$('#sidenav ul > li > ul > li').each(function(i){
		if($(this).attr('class')=="on"){
			$(this).parent().fadeIn('fast');
			$(this).parent().parent().children('a:first').addClass('on');
		}
	});
	$('a.scrollto').click(function(){
		$('html,body').animate({scrollTop: $('a[name='+$(this).text()+']').offset().top},'slow');
	});
	
	try{
		if($('.skuQty[rel='+oRel+']').length > 0){
			var theText = "";
			$('.skuQty[rel='+oRel+']').val('1');
			if($("input[name='Amount']:checked").length>0 && $("input[name='Amount']:checked").attr('value').toLowerCase() == "other"){
				//$('.skuQty[rel='+oRel+']').val('1');
				theText = "Other";
			}else{
				theText = $("input[name='Amount']:checked").attr('value');
				//$('.skuQty[rel='+oRel+']').val($("input[name='Amount']:checked").attr('value'));
			}
			$('select.skufield[rel='+oRel+'] option:contains(' + theText + ')').attr('selected', 'selected');
			
			$("input[name='Amount']").each(function(){
				$(this).click(function(){
					if($("input[name='Amount']:checked").attr('value').toLowerCase() == "other" || $("input[name='Amount']:checked").attr('value').toLowerCase() == "major donor page other"){
						theText = "Other";
						$('.skuQty[rel='+oRel+']').val($("#otheramount").val());
						$("#otheramount").removeAttr("disabled");
						//$('.skuQty[rel='+oRel+']').val('1');
					}else{
						theText = $("input[name='Amount']:checked").attr('value');
						$('.skuQty[rel='+oRel+']').val('1');
						$("#otheramount").attr("disabled", "disabled"); 
						$("#otheramount").val('');
						//$('.skuQty[rel='+oRel+']').val($("input[name='Amount']:checked").attr('value'));
					}
					$('select.skufield[rel='+oRel+'] option:contains(' + theText + ')').attr('selected', 'selected');
				});
			});
			$('#otheramount').keyup(function() {
				try{$("input[name='Amount'][value='Major Donor Page Other']").attr('checked', true);}catch(exception){}
				try{$("input[name='Amount'][value='Other']").attr('checked', true);}catch(exception){}
				
				if($("input[name='Amount']:checked").attr('value').toLowerCase() == "other" || $("input[name='Amount']:checked").attr('value').toLowerCase() == "major donor page other"){
					$('.skuQty[rel='+oRel+']').val($("#otheramount").val());
				}else{
					$('.skuQty[rel='+oRel+']').val('1');
				}
			});
			//otheramount
		}
	}catch(exception){}
	
	if(!hasScrollbar())
		$('#backtotop').remove();
});

function hasScrollbar() {
    return (document.documentElement.scrollHeight > document.documentElement .clientHeight);
}

    
