
<!--
	function rolloverImage(source, id)
	{
		//alert();
		document.getElementById(id).src = source;
	}
//-->

//added by soonlian on 16 Jun 2006:
// remarks: bookmark function
function wp_bookmarksite(title, url) {
	if (document.all) {
		window.external.AddFavorite(url, title);		
	}
	else if (window.sidebar) {
		window.sidebar.addPanel(title, url, "");
	}
}

//is empty check 
function IsEmpty(aTextField){
	if ((aTextField.value.length==0) || (aTextField.value==null)){
		return true;
	}
	else { return false; }
}
//is email valid check
function isValidEmail(strEmail){
	return (strEmail.indexOf(".") > 2) && (strEmail.indexOf("@") > 0); 
}

//is integer check
function isInteger(s){
	var i;
    for (i = 0; i < s.value.length; i++){   
        // Check that current character is number.
        var c = s.value.charAt(i);
        if (((c < "0") || (c > "9"))) return true;
    } 
    // All characters are numbers.
    return false; 
	}

//is date valid check
function isDayValid(month, day, year){
	var dtStr = month.value + '/' + day.value + '/' + year.value
	var dtCh = '/'
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)

	if (strDay.length < 1 || day < 1 || day > 31 || (month==2 && day > daysInFebruary(year)) || day > daysInMonth[month]){
		return true;
	} return false; 
	
}
//is year valid check
function isYearValid(month, day, year){
	var dtStr = month.value + '/' + day.value + '/' + year.value
	var dtCh = '/'
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	var minYear = "1910";
	var maxYear = "2006";
	strYr=strYear
	
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	
	if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear){
		return true;
	}

	return false; 
	
}

function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

//radio button
function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
   if (btn[i].checked) {cnt = i; i = -1;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}