function setvisible(objectid) {
	document.getElementById(objectid).style.visibility = 'visible';
}

function sethidden(objectid) {
	document.getElementById(objectid).style.visibility = 'hidden';
}

function FormatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
		num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num + '.' + cents);
}
function validEmail(email) {
	invalidChars = "/:,;"
	if(email == "")
		return false;
	for(i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		if(email.indexOf(badChar,0) > -1)
			return false;
	}
	atPos = email.indexOf("@",1)
	if(atPos == -1)
		return false;
	if(email.indexOf("@", atPos+1) != -1)
		return false;
	periodPos = email.indexOf(".", atPos)
	if(periodPos == -1)
		return false;
	if(periodPos+3 > email.length)
		return false;
	return true;
}
function validPassword(password) {
	validChars = "!@$%^&*()-_=+[]?";
	foundSpecialChar = false;
	foundDigit = false;
	if(password.length < 8)
		return false
	for(i=0; i<validChars.length; i++) {
		goodChar = validChars.charAt(i);
		if(password.indexOf(goodChar,0) > -1)
			foundSpecialChar = true;
	}
	for(j=0; j<password.length; j++) {
		for(k=0; k<=9; k++) {
			if(parseInt(password.charAt(j)) == k)
				foundDigit = true; 
		}
	}
	if(!foundSpecialChar || !foundDigit)
		return false;
	return true;
}
function validPassword2(s) {
	var chars1 = /[A-Za-z]/;	// allow alphabets
	var chars2 = /[0-9]/;		// allow numbers
	
    if((s.length < 8) || (s.length > 15)){
		return false;
	}else if(!(chars1.test(s) && chars2.test(s))){
		return false;
	}else{
		return true;
	}
}