/**
 * Functions related to registering suppliers
 */

//Create the Register namespace RGT
if (KM.RGT == null || typeof(KM.RGT) != "object") { KM.RGT = new Object();}

KM.RGT = {

	/**
	 * Initiate the popup to verify the supplier is an activity operator
	 */
	 
	 /* DEPRECIATED popup
	initPopup: function() {

        $('form#SupplierRegisterForm').submit(function(){
        	
        	//If dialog is not open and has not been opened, then open
        	if (!$('#ask').dialog('isOpen') && !$('input#SupplierIsOperator').val()) {
        		$('#ask').dialog('open');
                return false;
        	}
            
        });

		$('#ask').dialog({
			modal: true,
			resizable: false,
			autoOpen: false,
			title: 'Please Verify',
			width: 380,
			open: function(event, ui) {
				//Remove the x in the top right
				$('.ui-dialog-titlebar-close').css('display', 'none');
				
				//Set the handlers on the buttons
				$('input#operator_yes').click(function(){
					$('input#SupplierSupplierTypeId').val('1');
					$('form#SupplierRegisterForm').submit();
				});
				
				$('input#operator_no').click(function(){
					$('input#SupplierSupplierTypeId').val('0');
					$('form#SupplierRegisterForm').submit();
				});
			}
		});

	}
	*/
};

$(document).ready(function(){
	//KM.RGT.initPopup();
});

