function setPaypalButton(selectedIndex) {
  selectedIndex = parseInt(selectedIndex);

  $("#divPaypalButtons a").hide();
  if (selectedIndex > 0) {
    var buttonIndex = selectedIndex - 1;
    $("#divPaypalButtons a:eq(" + buttonIndex + ")").show()
  }
}

$(document).ready(
	function() {

		// Open links with rel="external" in new window - like ye ole' target="_blank"
		$('a[rel="external"]').click(function() {window.open( $(this).attr('href') ); return false;});
		
	  // code for paypal button on form
	  var jq_ddlParticipationLevel = $("#ddlParticipationLevel");

	  if (jq_ddlParticipationLevel.length > 0) {
	    setPaypalButton(jq_ddlParticipationLevel.attr("selectedIndex"));

	    jq_ddlParticipationLevel.change(function () {
	      setPaypalButton($(this).attr("selectedIndex"));
	    });
	  }
	  		
		// PNG Fix IE6
		DD_belatedPNG.fix('body.internal .connect h1 a');
		DD_belatedPNG.fix('body.home .homecontent h1 a');
		DD_belatedPNG.fix('.flickr-more a');
		DD_belatedPNG.fix('body.internal #footer h2');
		DD_belatedPNG.fix('div.connect_widget_button_count_nub');
		


		// Zebra-stripe data tables
		$("table.data tbody").each(function() {
			$(this).removeClass("odd even");
			$("tr:odd", this).addClass("odd");
			$("tr:even", this).addClass("even");
		});


		// Initialize Lightbox
		$(".lightbox").lightbox();
		
		//Styling OL
         $("ol li").each(function (index) {
                    $(this).wrapInner("<span />");
           });
		   
		   //Add class of active
		   $("ul.mainnav li.active a").addClass("active") 
		
	
		    // find all the input elements with title attributes
			$('input[title!=""]').hint();



	}
);

