function center(object) {
	$(object).css({ marginLeft : ($(window).width()/2) - ($(object).width()/2) });
	$(object).css({ marginTop : ($(window).height()/2) - ($(object).height()/2)});	
}

function validator(type,subject) {
	switch(type) {		
		case "email":
			if(subject.match(/.*@.*\..*/))
				return true;				
			break;			
		case "password":
			if(subject.length>6)
				return true;
			break;
	}	
	return false;
}

function jumpTo(element) {
	if(element) {
		var position = $("#"+element).offset();
		if(position) {
			window.scrollTo(position.left,position.top);
		}
	}
}


function clearField(element) {
	if($(element).attr("clearField")) {
		$(element).bind("focus",function() {
			if(element.value == $(element).attr("clearField")) {
				savedValues[$(element).parent()+$(element).attr("name")] = $(element).attr("clearField");
				element.value = '';				
			}
		});
		$(element).bind("blur",function() {
			if(element.value=="") {
				element.value = savedValues[$(element).parent()+$(element).attr("name")];			
			}
		});
	}	
}