
function popUp3(url){
	sealWin=window.open(url,"win",'toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=400,height=400');
	self.name = "mainWin";
}

function PadDigits(n, totalDigits) { 
	n = n.toString(); 
	var pd = ''; 
	if (totalDigits > n.length) { 
		for (i=0; i < (totalDigits-n.length); i++) 
		{ 
			pd += '0'; 
		} 
	} 
	return pd + n.toString(); 
}

$(document).ready(function() {

	$("#other_amount").focus(function(){
		$("#other_donation_amount").attr("checked","checked");
	});

	$("#mapInit").click(function(){
		$("#Map").html('<iframe src="http://share.findmespot.com/shared/faces/viewspots.jsp?glId=02ut0LzC2YAep6Lp9yzniKVYZBSjGhk5m" width="630" height="580"></iframe>');
	});

	$("#whosDonated").click(function(){
		$(this).removeClass("scrollerTab").addClass("scrollerTabOn");
		$("#whosTweeting").removeClass("scrollerTabOn").addClass("scrollerTab");
		$("#scrollerDonated").slideDown("fast");
		$("#scrollerTweeting").slideUp("fast");
	});
	$("#whosTweeting").click(function(){
		$(this).removeClass("scrollerTab").addClass("scrollerTabOn");
		$("#whosDonated").removeClass("scrollerTabOn").addClass("scrollerTab");
		$("#scrollerTweeting").slideDown("fast");
		$("#scrollerDonated").slideUp("fast");
	});

	$("#navBruce").click(function(){
		$("#navBruce").hide();
		$("#navRun").show();
		$("#infoRun").hide("fast");
		$("#infoBruce").show("fast");
	});
	$("#navRun").click(function(){
		$("#navRun").hide();
		$("#navBruce").show();
		$("#infoBruce").hide("fast");
		$("#infoRun").show("fast");
	});

	var $panels = $('#slider .scrollContainer > div');
	var $container = $('#slider .scrollContainer');
	var horizontal = true;
	if (horizontal) {
	  $panels.css({
	    'float' : 'left',
	    'position' : 'relative' // IE fix to ensure overflow is hidden
	  });
	  $container.css('width', $panels[0].offsetWidth * $panels.length);
	}
	var $scroll = $('#slider .scroll').css('overflow', 'hidden');
	function selectNav() {
	  $(this)
	    .parents('table:first')
	      .find('a')
	        .removeClass('selected')
	      .end()
	    .end()
	    .addClass('selected');
	}
	$('#slider .navigation').find('a').click(selectNav);
	function trigger(data) {
	  var el = $('#slider .navigation').find('a[href$="' + data.id + '"]').get(0);
	  selectNav.call(el);
	  if (data.id) {
		  window.location.hash = '#' + data.id;
	  }
	  window.scrollTo(0,0);
	}
	if (window.location.hash) {
	  trigger({ id : window.location.hash.substr(1) });
	} else {
	  $('.navigation a:first').click();
	}
	var offset = parseInt((horizontal ? 
	  $container.css('paddingTop') : 
	  $container.css('paddingLeft')) 
	  || 0) * -1;
	var scrollOptions = {
	  target: $scroll, // the element that has the overflow
	  items: $panels,
	  navigation: '.navigation a',
	  axis: 'x',
	  onAfter: trigger, // our final callback
	  offset: offset,
	  duration: 500,
	  easing: 'swing'
	};
	$('#slider').serialScroll(scrollOptions);
	$.localScroll(scrollOptions);
	scrollOptions.duration = 1;
	$.localScroll.hash(scrollOptions);

	$(".navigation a.donate").hover(function(){
		$(this).css("background","url(images/transBlack.png) transparent");
	}, function(){
		$(this).css("background","");
	});

	var xmlDocument = '<?xml version="1.0"?><BlogTalkRadioRequest command="GetRecordingsForCinchFeed" deviceId="" sequence="" ><GetRecordingsForCinchFeed><sessionId></sessionId><accountId></accountId><feedURL>http://www.cinchcast.com/usrun</feedURL><offset></offset><count>1</count></GetRecordingsForCinchFeed></BlogTalkRadioRequest>';
	$.ajax({
		url: "http://www.cinchcast.com/usrun",
		type: "GET",
		success: function(msg){
   			alert(msg);
		}
	});

});


