    //---------------------------------------------------------------+
   //Authors: gerry
  //
 //
//---------------------------------------------------------------+
/**
 *	used : a checkBox control the checkBoxs whick all in a div targ
 *  @param string divControl
 *  @param string controlButton
 */
function getCheck( /*string*/ divControl, /*string*/ controlButton ) {
	myElement = document.getElementById(divControl).getElementsByTagName("input");
	myControl = document.getElementById(controlButton);
	var j = 0;  // get the number of checkbox in div control
	
	for (var i = 0; i <= myElement.length-1; i++) {	
		if (controlButton != null) {  // control the checkbox on/off
				if (myElement.item(i).type == 'checkbox')	myElement.item(i).checked = myControl.checked;		
		} else {                  // get the number of checkbox which is on
				if (myElement.item(i).checked == true && myElement.item(i).id != 'checkbox') j++;				
		}
	}
	return j;		
}

/**
 * trim the blank which left and right string
 * @param strTrim string which need to trim
 */
String.prototype.trim = function() {
	reExtraSpace = /^\s*(.*?)\s*$/;
	return this.replace(reExtraSpace, "$1");
}

/**
 * get a control by its id 
 * @param {Object} string control's id
 */
function $(/*string*/ control) {
	return document.getElementById(control);
}

/**
 *	used : document.getElementById() logogram
 *	@param string divControl  the div's ID  
 */
function V(/*string*/ divControl, /*bool*/ istrim) {
	// if istrim is empty return trim
	if (istrim == null) 
		return $(divControl).value.trim();
	else
		return $(divControl).value;
}