function msover(btnid) {

	if (document.images) {
	
		imageobj = document.images[btnid]
		
		oldsrc = imageobj.src
		newsrc = oldsrc.substring(0,oldsrc.length-6) + "on.gif"
		imageobj.src = newsrc
	}

}

function msout(btnid) {

	if (document.images) {
	
		imageobj = document.images[btnid]
		
		oldsrc = imageobj.src
		newsrc = oldsrc.substring(0,oldsrc.length-6) + "of.gif"
		imageobj.src = newsrc
	}

}


//This function will autocorrect street names
function autocorrect(Str)
{
	//Performs a search and replace operation 
	// /gi - global case insensitive search
	// \b  - match by word boundary
	// \s  - match space
	// +   - match one for more occurrences
	
	//Got to do this first because of the period
	Str = Str.replace(/\bST\.\s/gi,"SAINT "); //take and give 1 space
	
	//Get rid of all illegal characters
	Str = Str.replace(/[^\s\w\d]+/gi,"");
	
	//Replace abbreviations
	Str = Str.replace(/\bAVE\b/gi,"AVENUE");
	Str = Str.replace(/\bAYE\b/gi,"AYER RAJAH EXPRESSWAY");
	Str = Str.replace(/\bBKE\b/gi,"BUKIT TIMAH EXPRESSWAY");
	Str = Str.replace(/\bBLVD\b/gi,"BOULEVARD");
	Str = Str.replace(/\bBT\b/gi,"BUKIT");
	Str = Str.replace(/\bCL\b/gi,"CLOSE");
	Str = Str.replace(/\bCRES\b/gi,"CRESENT");
	Str = Str.replace(/\bCT\b/gi,"COURT");
	Str = Str.replace(/\bCTE\b/gi,"CENTRAL EXPRESSWAY");
	Str = Str.replace(/\bCTR\b/gi,"CENTRE");
	Str = Str.replace(/\bCTRL\b/gi,"CENTRAL");
	Str = Str.replace(/\bDR\b/gi,"DRIVE");
	Str = Str.replace(/\bECP\b/gi,"EAST COAST PARKWAY");
	//Str = Str.replace(/\bE'WAY\b/gi,"EXPRESSWAY");
	Str = Str.replace(/\bEST\b/gi,"EST");
	Str = Str.replace(/\bGDN\b/gi,"GARDEN");
	Str = Str.replace(/\bHTS\b/gi,"HEIGHTS");
	Str = Str.replace(/\bGR\b/gi,"GROVE");
	Str = Str.replace(/\bIND\b/gi,"INDUSTRIAL");
	Str = Str.replace(/\bJLN\b/gi,"JALAN");
	Str = Str.replace(/\bKG\b/gi,"KAMPONG");
	Str = Str.replace(/\bKJE\b/gi,"KRANJI EXPRESSWAY");
	Str = Str.replace(/\bLN\b/gi,"LANE");
	Str = Str.replace(/\bLK\b/gi,"LINK");
	Str = Str.replace(/\bLOR\b/gi,"LORONG");
	Str = Str.replace(/\bMT\b/gi,"MOUNT");
	Str = Str.replace(/\bNTH\b/gi,"NORTH");
	Str = Str.replace(/\bP\s/gi,"PULAU ");
	Str = Str.replace(/\bPK\b/gi,"PARK");
	Str = Str.replace(/\bPL\b/gi,"PLACE");
	Str = Str.replace(/\bPT\b/gi,"POINT");
	Str = Str.replace(/\bRD\b/gi,"ROAD");
	Str = Str.replace(/\bS\s/gi,"SUNGEI ");
	Str = Str.replace(/\bSLE\b/gi,"SELETAR EXPRESSWAY");
	Str = Str.replace(/\bSQ\b/gi,"SQUARE");
	Str = Str.replace(/\bST\b/gi,"STREET");
	Str = Str.replace(/\bSTH\b/gi,"SOUTH");
	Str = Str.replace(/\bTER\b/gi,"TERRACE");
	Str = Str.replace(/\bTG\b/gi,"TANJONG");
	Str = Str.replace(/\bTPE\b/gi,"TAMPINES EXPRESSWAY");
	Str = Str.replace(/\bUPP\b/gi,"UPPER");
	
	
	//To get rid of any additional spaces
	Str = Str.replace(/\s\s+/g," ");
	
	//This must be last (b'cos of the hyhen)
	Str = Str.replace(/\bPIE\b/gi,"PAN-ISLAND EXPRESSWAY");
	
	//Trim the 1st and last blank space
	Str = Str.replace(/^\s\b/,"");
	Str = Str.replace(/\s$/,"");
	
	return Str;
}


//Suppress all error messages.
window.onerror=null


//This funtion will pop up a calendar for user to pick a date
function calpopup(lnk)
{
    window.open(lnk, "calendar", "height=250,width=250,scrollbars=no,toolbar = no,location = no,status = no,menubar = no,resizable = no")
}
