
	var page1 = Class.create(abstractOrderPage, {
		
		initialize: function($super, container, controller){
			$super(container, controller);
			this.instID = 'page1.' + parseInt(Math.random()*1000000);
		},
		
		save : function(callBack){
			if (this.controller.orderID){
				callBack();
				return;
			}
			// create new Order;
			if (!callBack) callBack = function(){}
			
			var func = (function(req){
				this.setOrderID(req, callBack);
			}).bind(this)

			var wpsRPC = new wps.rpc;
			wpsRPC.debug=true;
			wpsRPC.createCall('order', func);
			wpsRPC.call('createOrder', 'userID='+this.controller.userID, 'productID='+this.controller.productID);
		},
		
		setOrderID : function(req, callBack){
			var orderID = req.responseJSON.orderID;
			this.controller.orderID = orderID;
			callBack();
		}

	})
