/*
================================================================================
                                 /\          /\                                 
                                /  \        /  \                                
                               /    \      /    \                               
                              /      \    /      \                              
                             /        \  /        \                             
                            /         / /          \                            
                           /         / /            \                           
                          /         / /              \                          
                         /       /\/ /       /\       \                         
                        /       /   /       /  \       \                        
                       /       /   /       /    \       \                       
                      /       /   /       / /\   \       \                      
                     /       /   /       / /  \   \       \                     
                    /       /   /       / /    \   \       \                    
                   /       /   /       / /      \   \       \                   
                  /       /   /       /  \       \   \       \                  
                  \       \   \       \  /       /   /       /                  
                   \       \   \       \/       /   /       /                   
                    \       \   \              /   /       /                    
                     \       \   \            /   /       /                     
                      \       \   \          /   /       /                      
                       \       \   \        /   /       /                       
                        \       \   \      /   /       /                        
                         \       \   \    /   /       /                         
                          \       \   \  /   /       /                          
                           \       \   \/   /       /                           
                            \       \      /       /                            
                             \       \    /       /                             
                              \       \  /       /                              
                               \       \/       /                               
                                \              /                                
                                 \            /                                 
                                  \          /                                  
                                   \        /                                   
                                    \      /                                    
                                     \    /                                     
                                      \  /                                      
                                       \/                                       
================================================================================
L     i     b     r     a     r     y                  t     i     t     l     e
================================================================================
*/
// Aplication settings
// ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

// trace highlight color
var pedidoColor = "#f00";
var fileCanvasDivision = "monta_parcelamento.asp";

// Global variables
// ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

// =============================================================================
function callPaymentMethod(pedidoQueryString){
	/*
	Purpose: request the payment.
	Inputs:  paymentFormId: integer, COD_FORMA from DB;
	Return:  undefined.
	*/
	trace("Function callPaymentMethod('" + pedidoQueryString + "')", pedidoColor);
	
	requestDocument(
		fileCanvasDivision + pedidoQueryString,
		showPaymentMethod
	);

	// exit function
	return showPaymentMethod;
}

// =============================================================================
function showPaymentMethod(){
	/*
	Purpose: insert the payment canvas into the interface.
	Inputs:  none;
	Return:  undefined.
	*/
	trace("Function showPaymentMethod()", pedidoColor);
	
	var canvasCode = getDocument("text");
	if ( canvasCode != null ) {
		document.getElementById("canvasPaymentDetails").innerHTML = canvasCode;
	}

	if( document.getElementsByName("rdParc") != undefined ){
		var radios = document.getElementsByName("rdParc");
		if( radios[0] != undefined )
			radios[0].click(); 
	}

	/*
	if( document.getElementsByName('cod_parcelamento')[0] != undefined ){
		document.getElementById('x_cod_parcelamento').value = document.getElementsByName('cod_parcelamento')[0].value;
	}else{
		document.getElementById('x_cod_parcelamento').value = "";
		document.getElementById('x_parcela').value = "";
	}
	*/

	// exit function
	return undefined;
}

// =============================================================================
function myFunction(){
	/*
	Purpose: what the procedure does (not how).
	Inputs:  argument name: data type, explanation;
	Return:  data type, explanation of the value returned.
	*/
	trace("Function myFunction()", pedidoColor);
	
	// ...
	
	// exit function
	return undefined;
}
// =============================================================================
