function sumUpTotal() {

	var cost = 0, x = jQuery('#collectConData :input[cost]');
	
	jQuery(x).each(function (i) {
		if (x[i].checked) {
			thisCost = parseInt(x[i].getAttribute('cost'), 10);
			cost = cost + thisCost;
		}
	});
	jQuery('#total').attr("value", cost + ",- DKK");
}

jQuery.noConflict();
jQuery(document).ready(function(){

	if (jQuery("#init").length > 0) {
		
		jQuery("#login").hide();
		
		jQuery("#eidoBrugerYes").click(function(){
			jQuery("#login").fadeIn();
		});
		
	}

	if (jQuery("#acts, #entry, #comments, #totalCounter, #total").length > 0 ) {
	
		jQuery("#total").value = 0 + ",- DKK";
		
		jQuery("#collectConData :input").change(function () { sumUpTotal(this); });

		jQuery("#entry, #comments").hide();
		
		jQuery("#chooseActivities").click( function () { 
			jQuery("#acts").fadeOut("fast", function () { jQuery("#entry").fadeIn() })
		});

		jQuery("#chooseEntryFee").click( function () { 
			jQuery("#entry").fadeOut("fast", function () { jQuery("#comments").fadeIn() })
		});

	}
	
	if (jQuery("#password").length > 0) {
		jQuery("#password")[0].type = "text";
		jQuery("#password").focus(function (evt) { if (evt.target.type == "password") evt.target.type = "text";} );
		jQuery("#password").blur(function (evt) { if (evt.target.type == "text") evt.target.type = "password";} );
	}
	
});

