//	Open new window at center screen
//	Funtion name:	newWindow
//	Parameter: 		url-> new window url 
//					name-> new window name 
//					rs-> new window resizable (yes/no)
//					sc-> new window scrollbars (yes/no)	
//					w-> new window width		
//					h->	new window hieght
//					att-> others additional window features	
//	Usage:			newWindow('url','subWin','yes','yes','400','400','menubar,status')
//
//	LAST UPDATE:	TiongLK			22/09/03	allow user do direct printing in Mozilla & Netscape
//	PREV UPDATE:	Albert Ling		28/07/01	center the new window and add in att

	function newWindow(url, name, rs, sc, w, h, att, delay_to_prt) 
	{
    	var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
    
	    winprops = 'resizable='+rs+',scrollbars='+sc+',width='+w+',height='+h+',top='+wint+',left='+winl+''
		winfeatures = winprops + ',' + att;
		newWin = window.open(url, name, winfeatures);
		newWin.focus();

		if(delay_to_prt) {		
			setTimeout("if(newWin && newWin.open && !newWin.closed) newWin.print();",delay_to_prt*1000);	
			}
 	}


