function hidePasswordInterval() {
		
	setTimeout(hidePassword,100);
	
}

function hidePassword() {
	
	document.forms[0].password.disabled = true;	
	document.forms[0].submitButton.disabled = true;
	
	//document.getElementById("password").style.backgroundImage = "none";
	//document.getElementById("password").style.bgColor = "#FF0000";	
	//document.getElementById("submitButton").style.bgColor = "#FFCCCC";
	
}

function focusChange(id,value) {

	//document.getElementById(id).style.color = "#353535";
	//document.getElementById(id).style.borderColor = "#626262";
	//document.getElementById(id).style.backgroundImage = "none";
	//document.getElementById(id).style.backgroundColor = "#FFFFFF";

	if (document.getElementById(id).value == value) {
		document.getElementById(id).value = "";
	}
	
}

function blurChange(id,value) {
	
	//document.getElementById(id).style.color = "#626262";
	//document.getElementById(id).style.borderColor = "#CCCCCC";
	//document.getElementById(id).style.backgroundImage = "url(images/genericForm/inputRepeat.jpg)";
	//document.getElementById(id).style.backgroundColor = "#EEEEEE";
	
	if (document.getElementById(id).value == "") {
		document.getElementById(id).value = value;
	}
	
}

function focusChangePassword(thisElement) {
	
	//document.getElementById(thisElement.id).style.color = "#353535";
	//document.getElementById(thisElement.id).style.borderColor = "#626262";
	//document.getElementById(thisElement.id).style.backgroundImage = "none";
	//document.getElementById(thisElement.id).style.backgroundColor = "#FFFFFF";
	
	if (document.getElementById(thisElement.id).value == "Password:") {
		thisElement.parentNode.innerHTML = "<input type='password' name='password' id='password' value='' onFocus='focusChangePassword(this);' onBlur='blurChangePassword(this)' />";

		setTimeout("document.forms[0].password.focus()",100);
	}
	
}

function blurChangePassword(thisElement) {
	
	//document.getElementById(thisElement.id).style.color = "#626262";
	//document.getElementById(thisElement.id).style.borderColor = "#CCCCCC";
	//document.getElementById(thisElement.id).style.backgroundImage = "url(images/genericForm/inputRepeat.jpg)";
	//document.getElementById(thisElement.id).style.backgroundColor = "#EEEEEE";
	
	if (document.getElementById(thisElement.id).value == "") {
		thisElement.parentNode.innerHTML = "<input type='text' name='password' id='password' value='Password:' onFocus='focusChangePassword(this);' onBlur='blurChangePassword(this)'  />";
	}
	
}

function focusChangePasswordError(thisElement) {
	
	//document.getElementById(thisElement.id).style.color = "#353535";
	//document.getElementById(thisElement.id).style.borderColor = "#626262";
	//document.getElementById(thisElement.id).style.backgroundImage = "none";
	//document.getElementById(thisElement.id).style.backgroundColor = "#FFFFFF";
	
	if (document.getElementById(thisElement.id).value == "Password:") {
		thisElement.parentNode.innerHTML = "<input type='password' name='password' id='password' value='' style='margin: 0 auto;' onFocus='focusChangePasswordError(this);' onBlur='blurChangePasswordError(this)' />";

		setTimeout("document.forms[0].password.focus()",100);
	}
	
}

function blurChangePasswordError(thisElement) {
	
	//document.getElementById(thisElement.id).style.color = "#626262";
	//document.getElementById(thisElement.id).style.borderColor = "#CCCCCC";
	//document.getElementById(thisElement.id).style.backgroundImage = "url(images/genericForm/inputRepeat.jpg)";
	//document.getElementById(thisElement.id).style.backgroundColor = "#EEEEEE";
	
	if (document.getElementById(thisElement.id).value == "") {
		thisElement.parentNode.innerHTML = "<input type='text' name='password' id='password' value='Password:' style='margin: 0 auto;' onFocus='focusChangePasswordError(this);' onBlur='blurChangePasswordError(this)' />";
	}
	
}

$(document).ready(function() {

	$("#tbs li ").click(function(){
		
		var whichId = $(this).attr("id");
		
		if(whichId == "forYou"){
			
			$("#forYou").removeClass("forYouOff").addClass("forYouOn");
			
			$("#forYourOrganisation").removeClass("forYourOrganisationOn").addClass("forYourOrganisationOff");
			
			$("#forYouCopy").show();
			
			$("#forYourOrganisationCopy").hide();
			
		}else{
			
			$("#forYourOrganisation").removeClass("forYourOrganisationOff").addClass("forYourOrganisationOn");
			
			$("#forYou").removeClass("forYouOn").addClass("forYouOff");
			
			$("#forYourOrganisationCopy").show();
			
			$("#forYouCopy").hide();
		}
	
	});		

	
	$("#signUpForm input").focus(function() {

		$(this).siblings("label").fadeOut(200);

	})

	$("#signUpForm input").blur(function() {

		if ($(this).val() == "") {

			$(this).siblings("label").fadeIn(200);

		}

	});
	
	$("#signUpFormOrg input").focus(function() {

		$(this).siblings("label").fadeOut(200);

	})

	$("#signUpFormOrg input").blur(function() {

		if ($(this).val() == "") {

			$(this).siblings("label").fadeIn(200);

		}

	});

	$("#signUpFormOrg textarea").focus(function() {

		$(this).siblings("label").fadeOut(200);

	})

	$("#signUpFormOrg textarea").blur(function() {

		if ($(this).val() == "") {

			$(this).siblings("label").fadeIn(200);

		}

	});

});
