		function GetDate(CtrlName)    
	{
	      /****************************************************
	       Use Javascript method (window.open) to PopUp a new window    
	       which contain a Calendar Control. In the meantime, we'll    
	       pass the Parent Form Name and Request Control Name in the QueryString!      
	       *****************************************************/        
	       //alert ('url:' + url);
	       //alert ('pName:' + pName);
	       //alert ('CtrlName:' + CtrlName);
		//ChildWindow = window.open(url, pName, "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");    
		ChildWindow = window.open('/msas/Pages/Administration/popupCalender.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=yes,status=yes,resizable=yes");    
	}   
		    
	function CheckWindow()   
	{      
		// If the ChildWindow has never been opened it will be undefined, and will result
		// in a javascript error when the page unload method attempts to close it.
		// To prevent this from happening, check before closing that it isnt undefined.
		
		if (typeof ChildWindow != 'undefined')
			ChildWindow.close();   
	}

	


	// code for doing popups
	var popUpWin=0;
	function popUpWindow(URLStr, left, top, width, height)
	{
		if(popUpWin)
		{
			if(!popUpWin.closed) popUpWin.close();
		}
		
		//		if (!popUpWin.opener) popUpWin.opener=self;
		//		}
		
		popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+',height='+height+',left='+left+', top='+top+'');
	}
	// end of code for doing popups	


	function showDate() 
	{
		// Array of day names
		var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

		// Array of month Names
		var monthNames = new Array(
		"January","February","March","April","May","June","July","August","September","October","November","December");

		var now = new Date();
		
		theDate = new Date();
		theYear = theDate.getYear();
		if (theYear<1900) theYear=theYear+1900;

		document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + theYear);		
	}

	
	function doBookmark() 
	{
		var ver = navigator.appName
		var num = parseInt(navigator.appVersion)
		var currentURL = document.location;
		if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
    		window.external.AddFavorite(document.URL,document.title);
		}
  		else {
    		alert("To bookmark this page, click OK, and then press Ctrl-D");
  		}
	}


	function goback()
	{
	   parent.history.back();
	}


	function loadCalender()
	{
		var now = new Date();
		var thisYear = now.getFullYear();
		var thisMonth = 1 + now.getMonth();
		var calenderURL = '/msas/diary/' + thisYear;
		if (thisMonth < 10) {
			calenderURL += '0' + thisMonth + '_calender.html';
		} else {
			calenderURL +=  thisMonth + '_calender.html';
		}
		window.location = calenderURL;
	}

