// JavaScript Document

function initPassword() {	
	if (document.getElementById("password").value.length == 0) {
		document.getElementById("passwordWatermark").style.display = "inline";
		document.getElementById("passwordWatermark").value = "Password";
		document.getElementById("password").style.display = "none";
	}
}

function focusPasswordWatermark() {
	document.getElementById("passwordWatermark").style.display = "none";
	document.getElementById("password").style.display = "inline";
	document.getElementById("password").focus();
}

function focusPassword() {
	document.getElementById("passwordWatermark").style.display = "none";
	document.getElementById("password").style.display = "inline";
}

function restoreWatermark() {
	if (document.getElementById("password").value.length == 0) {
		document.getElementById("passwordWatermark").style.display = "inline";
		document.getElementById("password").style.display = "none";
	}
}

function hideWatermark(objname) {
	obj = document.getElementById(objname);
	if (obj.value == "Username") { 
		obj.value = "";
		obj.style.color = "#000000";
	}
}

function showWatermark(objname) { 
	obj = document.getElementById(objname);
	if (obj.value == "") {
		obj.value = "Username";
		obj.style.color = "#888888";
	}
}

function miniEnterSubmit(e, frm) { 
	var pressedKey = document.all ? window.event.keyCode : e.which;
	var btnID = $("goButton']").attr("id").val();
	btnID = replaceChar(btnID, "_", "$", false);
	if (pressedKey == 13) {
		__doPostBack(btnID, '');
	} else { 
		return true;
	}
}

var theImages = new Array("image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg");

function showImage(){
	document.write('<img src="./images/' + theImages[Math.floor(Math.random() * theImages.length)] + '" />');
}

var banners = new Array("home_banner1.jpg", "home_banner2.jpg", "home_banner3.jpg");

function showBanner(){
	document.write('<img src="./images/' + banners[Math.floor(Math.random() * banners.length)] + '" />');
}

function showTable(id) {
	document.getElementById(id).style.display = "inline";	
}

function hideTable(id) {
	document.getElementById(id).style.display = "none";	
}
