function limitText(c, b, a) {
	if (c.value.length > a) {
		c.value = c.value.substring(0, a);
	} else {
		b.value = a - c.value.length;
	}
}

function initInputs() {
	var a = document.getElementsByTagName("input");
	for (var b = 0; b < a.length; b++) {
		a[b].setAttribute("rel", a[b].defaultValue);
		a[b].onfocus = function() {
			if (this.value == this.getAttribute("rel") && this.getAttribute("type") != "submit" && this.getAttribute("type") != "reset") {
				this.value = "";
			} else {
				return false;
			}
		};
		a[b].onblur = function() {
			if (this.value == "" && this.getAttribute("type") != "submit" && this.getAttribute("type") != "reset") {
				this.value = this.getAttribute("rel");
			} else {
				return false;
			}
		};
		a[b].ondblclick = function() {
			this.value = this.getAttribute("rel");
		};
	}
}

$(document).ready(function() {
	$("#scroller").jScrollPane({
		showArrows: true,
		scrollbarWidth: 15,
		arrowSize: 16,
		dragMaxHeight: 80
	});
	$("#myrollover img").hover(function() {
		this.src = this.src.replace("_off", "_on");
	},
	function() {
		this.src = this.src.replace("_on", "_off");
	});
	$("#myrolloversubmit").hover(function() {
		this.src = this.src.replace("_off", "_on");
	},
	function() {
		this.src = this.src.replace("_on", "_off");
	});
});

function checkform() {
	if ($.trim($("#email").val()) == "") {
		alert("Please enter email.");
		return false;
	}
	if (!isEmail($.trim($("#email").val()))) {
		alert("Please enter email.");
		return false;
	}
	if ($.trim($("#pass").val()) == "") {
		alert("Please enter password.");
		return false;
	}
	return true;
}
