var featureList=[ "ajax2", "dialog", "calendar" ];


function InitSetisReady(){

	for( i = 0; i < document.forms.length;++i ){
		SDForm.FillFormSelOpts( document.forms[i] );
	} 
}

function init(){
	
	// this form uses the OAT framework
	OAT.Preferences.showAjax = false;
	OAT.Preferences.imagePath = "/_sd/images/oat/";	
	
	
	// Allocate a dialog to show loading process
	LoadDlog = new OAT.Dialog(  'Progress....' , 'Activity', {modal:1, buttons:0,width:OAT.Dom.getWH( 'Activity' )[0] + 20});
	LoadDlog.show(); // display it
	
	// Allocate an order complete dialog
	OrdComplete = new OAT.Dialog(  'Order Status....' , 'OrderComplete', { modal:1, 
																			buttons:0,
																			resize: false,
																			width:OAT.Dom.getWH( 'OrderComplete' )[0] + 20
																		});

		
	// use OAT's calander function for date picking in datedue filed
	tDate = new Date();	
	var c = new OAT.Calendar();
	c.weekStartIndex = 6;
	window.cal = c;
	var openRef = function(event) {
      var callback = function(date) {
          $("DateDue").value = date[1]+"/"+date[2]+"/"+date[0];
      }
      var coords = OAT.Dom.position("DateDue");
      var y = OAT.Browser.isIE ? tDate.getYear() : tDate.getYear() + 1900;
      c.show(coords[0],coords[1]+30,callback, [ y, tDate.getMonth() + 1 , tDate.getDate() ] );
	}
	OAT.Dom.attach("DateDue","click",openRef); 
  
  // initialize the form library
	SDForm.init();
	
}
