






	
$(document).ready(function() {
	
	/* see if anything is previously checked and reflect that in the view*/
	$(".checklist input:checked").parent().addClass("selected");
	
	/* handle the user selections */
	$(".checklist .checkbox-select").click(
		function(event) {
			event.preventDefault();
			$(this).parent().addClass("selected");
			$(this).parent().find(":checkbox").attr("checked","checked");
		}
	);
	
	$(".checklist .checkbox-deselect").click(
		function(event) {
			event.preventDefault();
			$(this).parent().removeClass("selected");
			$(this).parent().find(":checkbox").removeAttr("checked");
		}
	);

	$("body").ready(function(){
		$("#loading").hide("drop", { direction: "left" }, 500);

		$(".bod").show("drop", { direction: "right" }, 500);
		
	});

	$("#regsubmit").click(function () {
	
		$(".bod").hide("drop", { direction: "left" }, 500);
		$("#loading").show("drop", { direction: "right" }, 500);
	});
	

	$("#logsubmit").click(function () {
	
		$("#loginForm").hide("drop", { direction: "left" }, 500);
		$("#loading").show("drop", { direction: "right" }, 500);
	});

	
	$("#login").click(function () {
	
		$("#registerform").hide("blind", 600);
		$("#loginForm").show("blind", 600);
	});
		
	$("#register").click(function () {
	
		$("#loginForm").hide("blind", 600);
		$("#registerform").show("blind", 600);
	});
		
			
});

addEvent(window, 'load', init, false);

function init() {
    var formInputs = document.getElementsByTagName('input');
    for (var i = 0; i < formInputs.length; i++) {
        var theInput = formInputs[i];
        
        if (theInput.type == 'text' && theInput.className.match(/\breginput\b/)) {  
            /* Add event handlers */          
            addEvent(theInput, 'focus', clearDefaultText, false);
            addEvent(theInput, 'blur', replaceDefaultText, false);

            /* Save the current value */
            if (theInput.value != '') {
                theInput.defaultText = theInput.value;
            }
        }
    }
}


function clearDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == target.defaultText) {
        target.value = '';
    }
}

function replaceDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == '' && target.defaultText) {
        target.value = target.defaultText;
    }
}



function think() {
  $(".bod").hide("drop", { direction: "left" }, 500);
  $("#loading").show("drop", { direction: "right" }, 500);
  }



