var days = new Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

function PBmenuses(menuItem) {
	var dd = (menuItem!="")?menuItem.getElementsByTagName("dd")[0]:false;
	var navbar = document.getElementById("navbar");
	var dl = navbar.getElementsByTagName("dl")
	for (var i = 0; i<dl.length; i++) {
		ddx = dl[i].getElementsByTagName("dd")[0]
		if (ddx) {ddx.style.display='none';}
	}
	if (dd) {dd.style.display='block';}
}

function PBver(ver) {
	var info = document.getElementById("fcontent");
	if (info) {info.style.display=(ver==1)?'block':'none';}
}

function amtDays(month, year) {
	if (2== month) return ((0 == year % 4) && (0 != (year % 100))) || (0 == year % 400) ? 29 : 28;
	else return days[month];
}

function swapImg (imgID, imgURL){
	var imgID = document.getElementById(imgID);
	imgID.src = imgURL;
}

function isValidEmailAddress(address){
	if((address.lenght < 7)||									
		(address.indexOf("@") < 1)||							
		(address.indexOf("@") != address.lastIndexOf("@"))||
		(address.indexOf("@") + 3 > address.lastIndexOf("."))||	
		(address.indexOf("@.") > -1)||	
		(address.indexOf(".@") > -1)||	
		(address.indexOf("..") > -1)||
		(address.lastIndexOf(".") > address.length - 3)){
		return(false);
	}
	return(true);
}

function isEmpty(itemID){
	thValue = document.getElementById(itemID).value;
	if(thValue == "" || thValue == undefined){
		return(true);
	}
	return(false);
}