<!--
/* 
	Define the prefix generated by server for a given control
*/		
function DefinePrefix(controlGeneratedName, controlName)
{
	var sPrefix;
	sPrefix = controlGeneratedName.substring(0,controlGeneratedName.indexOf(controlName));
	return sPrefix;
}

<!--					
/* Format float with wanted number of numbers after coma */
function FormatFloatXDec(lvFloat, nbDec)
{				
	//Converting into a number if it's not
	if(isNaN(lvFloat))
		lvFloat = ConvertStringToFloat(lvFloat);	

	lvFloat=((Math.round(lvFloat*100))/100);				

	xx = new String(lvFloat.toString());

	var iCount;
	var sComp = "";
	for(iCount=0;iCount<nbDec;iCount++)			
		sComp += "0";
	//Determining which separator is the decimal point
	var DecSep;
	if(xx.indexOf(",") != -1)
		DecSep = ",";
	else
		DecSep = ".";			
	
	//If the number is an int, we have to complete it
	if(xx.indexOf(",") == -1 && xx.indexOf(".") == -1)
		xx = new String(lvFloat.toString() + DecSep + sComp);
	else
		xx = new String(lvFloat.toString() + sComp);					

	//Manipulating the number so it acquires the correct format
	//Recuperating the position of the decimal separator
	iDecSep =  xx.indexOf(DecSep);
	//If the position is different from -1 it means that there is a separator
	//Then we go get the number of number after the separator according to nbDec Value.
	var ReturnString = iDecSep == -1 ? xx : xx.substring(0,iDecSep+nbDec+1);	
	
	var sFormatString = FormatFloatCultureFormat(ReturnString);

	return FormatThousandSeparator(sFormatString);
}

/* Get right decimal separator corresponding to the current culture stocked in input hidden*/
function FormatFloatCultureFormat(lvFloat)
{

			
	var DecSep = document.forms['frmMain'].elements["fhdCultureDecimalSeparator"].value;
	var sNumber = new String(lvFloat.toString());
	var fValue;
	
	if(DecSep == "," && sNumber.indexOf(".")!=-1)
		fValue = sNumber.slice(0, sNumber.indexOf(".")) + "," + sNumber.slice(sNumber.indexOf(".")+1, sNumber.length);
	else if(DecSep == "." && sNumber.indexOf(",")!=-1)
		fValue = sNumber.slice(0, sNumber.indexOf(",")) + "." + sNumber.slice(sNumber.indexOf(",")+1, sNumber.length);
	else
		fValue = sNumber;
    
    return fValue;
}

/* Replace . or , character in float number to have a correct number */
function ConvertStringToFloat(FloatValue)
{	
	/* WARNING : specific character which not equals to space character (CTR)*/
	var sSeparator = document.forms[0].elements["fhdCultureThousandSeparator"].value;
		
	var sFloatValue = FloatValue.toString();
	
	while(sFloatValue.indexOf(sSeparator) != -1)
		sFloatValue = sFloatValue.replace(sSeparator,"");
			
	var fValue;

	if(sFloatValue.indexOf(",") != -1 && isNaN(sFloatValue))
	{
		fValue = sFloatValue.slice(0, sFloatValue.indexOf(",")) + "." + sFloatValue.slice(sFloatValue.indexOf(",")+1, sFloatValue.length);
		
		if(!isNaN(fValue)){	return parseFloat(fValue);}
	}
	else if(sFloatValue.indexOf(".") != -1 && isNaN(sFloatValue))
	{
		fValue = sFloatValue.slice(0, sFloatValue.indexOf(".")) + "," + sFloatValue.slice(sFloatValue.indexOf(".")+1, sFloatValue.length);
		if(!isNaN(fValue)){return  parseFloat(fValue);}
	}
	else if(!isNaN(sFloatValue))
	{
		return parseFloat(sFloatValue);
	}
	return;
}		

/* Insert a separator for thousand */
function FormatThousandSeparator(lvFloat)
{
	/* WARNING : specific character which not equals to space character (CTR) */
	var sSeparator = document.forms[0].elements["fhdCultureThousandSeparator"].value;		
	
	var sDecSep = document.forms[0].elements["fhdCultureDecimalSeparator"].value;

	var sReturnedValue = "";

	var sNumber = "";
	var sDecimal = "";

	if(lvFloat.indexOf(sDecSep) != -1)
	{
		sNumber = lvFloat.substring(0, lvFloat.indexOf(sDecSep));
		sDecimal = lvFloat.substring(lvFloat.indexOf(sDecSep)+1, lvFloat.length);
	}
	else
		sNumber = lvFloat;

	var iCharacterNumber = 0;
	var sTmp = "";

	for(iCharacterNumber=(sNumber.length-1); iCharacterNumber>=0; iCharacterNumber--)
	{
		sReturnedValue = sNumber.substr(iCharacterNumber, 1) + sReturnedValue;

		sTmp = sReturnedValue;
		while(sTmp.indexOf(sSeparator) != -1 )
			sTmp = sTmp.replace(sSeparator,"");

		if((sTmp.length)%3 == 0 && iCharacterNumber!=0)
			sReturnedValue = sSeparator + sReturnedValue;
	}
	if(lvFloat.indexOf(sDecSep) != -1)
		sReturnedValue = sReturnedValue + sDecSep + sDecimal;

	return sReturnedValue;
}

/* Check if a field is complying with the regex */
function CheckField(sToValidate, sFormat)
{
	// Regular Expression
	Alpha = new RegExp('[^a-z^\' -]','gi');
	Num = new RegExp('[^0123456789]','gi');
	AlphaNum = new RegExp('[^0-9a-z éèêêîïàù?\']{1}','gi');
	Mail = new RegExp('^.+[@]{1}.+[\.]{1}.+$','i');

	switch(sFormat)
	{
		case 'Alpha' :
			return !Alpha.test(sToValidate);
			break;
			
		case 'Num' :
			return !Num.test(sToValidate);
			break;
			
		case 'Intgr' :
			if(Num.test(sToValidate))
			{
				if(sToValidate.indexOf('.') != -1 || sToValidate.indexOf(',') != -1)
					return true;
				else
					return false;
			}
			else
				return false;
			
			break;	
			
		case 'AlphaNum' :
			return !AlphaNum.test(sToValidate);
			break;
			
		case 'Mail' :
			return !Mail.test(sToValidate);
			break;										
	}
}


//******************************************
//		Cancel a PostBack on IE and Netscape	
//******************************************
function DisableEvent()
{	
	if (arguments.callee.caller.caller.arguments[0])
		arguments.callee.caller.caller.arguments[0].preventDefault();
	else
		event.returnValue = false;		
}
//-->

function SetSize(obj, width, height) 
{ 
	myImage = new Image(); 
	myImage.src = obj.src; 
	if (myImage.width>0 && myImage.height>0) 
	{ 
		var rate = 1; 
		if (myImage.width>width || myImage.height>height) 
		{ 
			if (width/myImage.width<height/myImage.height) 
			{ 
				rate = width/myImage.width; 
			} 
			else 
			{ 
				rate = height/myImage.height; 
			} 
		} 
			
		if (window.navigator!=null && window.navigator.appName!=null && window.navigator.appName == "Microsoft Internet Explorer") 
		{ 
			obj.style.zoom = rate; 
		} 
		else 
		{ 
			obj.width = myImage.width*rate; 
			obj.height = myImage.height*rate; 
		} 
	} 
} 


/**********RDC Common*********/
/**
 * @author weijie
 * @version: 1.0
 */
 
 
/***************************************************************************************************************************************/
/*   namespace    **********************************************************************************************************************/
/***************************************************************************************************************************************/
	if (typeof(rdcjs) == "undefined")
		_rdc = rdcjs = {};



/***************************************************************************************************************************************/
/*   utility    ************************************************************************************************************************/
/***************************************************************************************************************************************/
	_rdc.getRandomNumber = function(){
		var i = Math.round(100000*Math.random());
		return i;
	}
				
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	function ltrim(stringToTrim) {
		return stringToTrim.replace(/^\s+/,"");
	}
	function rtrim(stringToTrim) {
		return stringToTrim.replace(/\s+$/,"");
	}



/***************************************************************************************************************************************/
/*   element    ************************************************************************************************************************/
/***************************************************************************************************************************************/
	function $() {
		var elements = new Array();
		for (var i = 0; i < arguments.length; i++) {
			var element = arguments[i];
			if (typeof element == 'string')
				element = document.getElementById(element);
			if (arguments.length == 1)
				return element;
			elements.push(element);
		}
		return elements;
	}
	
	_rdc.insertAfter = function( referenceNode, newNode )
	{
		referenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );
	}
	
	_rdc.addEvent=function(elm, evType, fn, useCapture) {
		if (elm.addEventListener) {
			elm.addEventListener(evType, fn, useCapture);
			return true;
		}
		else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		}
		else {
			elm['on' + evType] = fn;
		}
	}
	
	_rdc.removeEvent = function(obj, evType, fn, useCapture){
		if (obj.removeEventListener){
			obj.removeEventListener(evType, fn, useCapture);
			return true;
		} else if (obj.detachEvent){
			var r = obj.detachEvent("on"+evType, fn);
			return r;
		} else {
			alert("Handler could not be removed");
		}
	}
	
	/* window 'load' attachment */
	_rdc.addLoadEvent = function(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		}
		else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
	}
	
	/* insert an element after a particular node */
	_rdc.insertAfter = function(parent, node, referenceNode) {
		parent.insertBefore(node, referenceNode.nextSibling);
	}
	
	_rdc.getElementsByClassName = function(className, tag, elm){
		var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
		var tag = tag || "*";
		var elm = elm || document;
		var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
		var returnElements = [];
		var current;
		var length = elements.length;
		for(var i=0; i<length; i++){
			current = elements[i];
			if(testClass.test(current.className)){
				returnElements.push(current);
			}
		}
		return returnElements;
	}
	
	
	_rdc.getElementWidth = function( el ){
		return _rdc.getElementWidthComplex( el, true, true );
	}
	
	
	_rdc.getElementHeight = function( el ){
		return _rdc.getElementHeightComplex( el, true, true );
	}
	
	
	_rdc.getElementWidthComplex = function ( el, includePadding, includeBorder ) {
		var width;
		el = (typeof(el) === "string") ? document.getElementById(el) : el;	
	    
		if (window.getComputedStyle) { // FF, Safari, Opera
			var style = document.defaultView.getComputedStyle(el, null);
			if (style.getPropertyValue("display") === "none")
				return 0;
			width = parseInt(style.getPropertyValue("width"));
	        
			if (/opera/i.test(navigator.userAgent)) {
				// opera includes the padding and border when reporting the width/height - subtract that out
				width -= parseInt(style.getPropertyValue("padding-left"));
				width -= parseInt(style.getPropertyValue("padding-right"));
				width -= parseInt(style.getPropertyValue("border-left-width"));
				width -= parseInt(style.getPropertyValue("border-right-width"));
			}
	        
			if (includePadding) {
				width += parseInt(style.getPropertyValue("padding-left"));
				width += parseInt(style.getPropertyValue("padding-right"));
			}
	        
			if (includeBorder) {
				width += parseInt(style.getPropertyValue("border-left-width"));
				width += parseInt(style.getPropertyValue("border-right-width"));
			}
		} else { // IE
			if (el.currentStyle["display"] === "none")
				return 0;
			var bRegex = /thin|medium|thick/; // regex for css border width keywords
			width = el.offsetWidth; // currently the width including padding + border
	        
			if (!includeBorder) {
				alert(includeBorder);
				var borderLeftCSS = el.currentStyle["borderLeftWidth"];
				var borderRightCSS = el.currentStyle["borderRightWidth"];
				var temp = document.createElement("DIV");
				if (el.offsetWidth > el.clientWidth && el.currentStyle["borderLeftStyle"] !== "none") {
					if (!bRegex.test(borderLeftCSS)) {
						temp.style.width = borderLeftCSS;
						el.parentNode.appendChild(temp);
						width -= Math.round(temp.offsetWidth);
						el.parentNode.removeChild(temp);
					} else if (bRegex.test(borderLeftCSS)) {
						temp.style.width = "10px";
						temp.style.border = borderLeftCSS + " " + el.currentStyle["borderLeftStyle"] + " #000000";
						el.parentNode.appendChild(temp);
						width -= Math.round((temp.offsetWidth-10)/2);
						el.parentNode.removeChild(temp);
					}
				}
				if (el.offsetWidth > el.clientWidth && el.currentStyle["borderRightStyle"] !== "none") {
					if (!bRegex.test(borderRightCSS)) {
						temp.style.width = borderRightCSS;
						el.parentNode.appendChild(temp);
						width -= Math.round(temp.offsetWidth);
						el.parentNode.removeChild(temp);
					} else if (bRegex.test(borderRightCSS)) {
						temp.style.width = "10px";
						temp.style.border = borderRightCSS + " " + el.currentStyle["borderRightStyle"] + " #000000";
						el.parentNode.appendChild(temp);
						width -= Math.round((temp.offsetWidth-10)/2);
						el.parentNode.removeChild(temp);
					}
				}
			}
	        
			if (!includePadding) {
				var paddingLeftCSS = el.currentStyle["paddingLeft"];
				var paddingRightCSS = el.currentStyle["paddingRight"];
				var temp = document.createElement("DIV");
				temp.style.width = paddingLeftCSS;
				el.parentNode.appendChild(temp);
				width -= Math.round(temp.offsetWidth);
				temp.style.width = paddingRightCSS;
				width -= Math.round(temp.offsetWidth);
				el.parentNode.removeChild(temp);
			}
		}
	    
		return width;
	}


	_rdc.getElementHeightComplex = function (  el, includePadding, includeBorder) {
		var height;
		el = (typeof(el) === "string") ? document.getElementById(el) : el;
	    
		if (window.getComputedStyle) { // FF, Safari, Opera
			var style = document.defaultView.getComputedStyle(el, null);
			if (style.getPropertyValue("display") === "none")
				return 0;
			height = parseInt(style.getPropertyValue("height"));
	        
			if (/opera/i.test(navigator.userAgent)) {
				// opera includes the padding and border when reporting the width/height - subtract that out
				height -= parseInt(style.getPropertyValue("padding-top"));
				height -= parseInt(style.getPropertyValue("padding-bottom"));
				height -= parseInt(style.getPropertyValue("border-top-width"));
				height -= parseInt(style.getPropertyValue("border-bottom-width"));
			}
	        
			if (includePadding) {
				height += parseInt(style.getPropertyValue("padding-top"));
				height += parseInt(style.getPropertyValue("padding-bottom"));
			}
	        
			if (includeBorder) {
				height += parseInt(style.getPropertyValue("border-top-width"));
				height += parseInt(style.getPropertyValue("border-bottom-width"));
			}
		} else { // IE
			if (el.currentStyle["display"] === "none")
				return 0;
			var bRegex = /thin|medium|thick/; // regex for css border width keywords
			height = el.offsetHeight; // currently the height including padding + border
	    
			if (!includeBorder) {
				var borderTopCSS = el.currentStyle["borderTopWidth"];
				var borderBottomCSS = el.currentStyle["borderBottomWidth"];
				var temp = document.createElement("DIV");
				if (el.offsetHeight > el.clientHeight && el.currentStyle["borderTopStyle"] !== "none") {
					if (!bRegex.test(borderTopCSS)) {
						temp.style.width = borderTopCSS;
						el.parentNode.appendChild(temp);
						height -= Math.round(temp.offsetWidth);
						el.parentNode.removeChild(temp);
					} else if (bRegex.test(borderTopCSS)) {
						temp.style.width = "10px";
						temp.style.border = borderTopCSS + " " + el.currentStyle["borderTopStyle"] + " #000000";
						el.parentNode.appendChild(temp);
						height -= Math.round((temp.offsetWidth-10)/2);
						el.parentNode.removeChild(temp);
					}
				}
				if (el.offsetHeight > el.clientHeight && el.currentStyle["borderBottomStyle"] !== "none") {
					if (!bRegex.test(borderBottomCSS)) {
						temp.style.width = borderBottomCSS;
						el.parentNode.appendChild(temp);
						height -= Math.round(temp.offsetWidth);
						el.parentNode.removeChild(temp);
					} else if (bRegex.test(borderBottomCSS)) {
						temp.style.width = "10px";
						temp.style.border = borderBottomCSS + " " + el.currentStyle["borderBottomStyle"] + " #000000";
						el.parentNode.appendChild(temp);
						height -= Math.round((temp.offsetWidth-10)/2);
						el.parentNode.removeChild(temp);
					}
				}
			}
	    
			if (!includePadding) {
				var paddingTopCSS = el.currentStyle["paddingTop"];
				var paddingBottomCSS = el.currentStyle["paddingBottom"];
				var temp = document.createElement("DIV");
				temp.style.width = paddingTopCSS;
				el.parentNode.appendChild(temp);
				height -= Math.round(temp.offsetWidth);
				temp.style.width = paddingBottomCSS;
				height -= Math.round(temp.offsetWidth);
				el.parentNode.removeChild(temp);
			}
		}
	    
		return height;
	}

	/*
	*
	* remove whitespace for the dom, so that document.documentElement.firstChild.nextSibling.firstChild can work. 
	* WARNING: this function can be slow. please use "prev", "next", "first", "last"... instead.
	*
	*/
	_rdc.cleanWhitespace = function( element ) {
		// If no element is provided, do the whole HTML document
		element = element || document;
		
		for (var i = 0; i < element.childNodes.length; i++) {
			var node = element.childNodes[i];
			if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
				element.removeChild(node);
		}
		
		for (var i = 0; i < element.childNodes.length; i++)
			_rdc.cleanWhitespace( element.childNodes[i] );
	}
	
	
	/*
	*
	* get the previous element ignore whitespace
	*
	*/
	_rdc.prev = function( elem ) {
		do {
			elem = elem.previousSibling;
		} while ( elem && elem.nodeType != 1 );
		
		return elem;
	}

	/*
	*
	* get the next element ignore whitespace
	*
	*/
	_rdc.next = function( elem ) {
		do {
			elem = elem.nextSibling;
		} while ( elem && elem.nodeType != 1 );
		
		return elem;
	}

	/*
	*
	* get the first child element ignore whitespace
	*
	*/	
	_rdc.first = function( elem ) {
		elem = elem.firstChild;
		return elem && elem.nodeType != 1 ? _rdc.next ( elem ) : elem;
	}
	
	/*
	*
	* get the last child element ignore whitespace
	*
	*/	
	_rdc.last = function( elem ) {
		elem = elem.lastChild;
		return elem && elem.nodeType != 1 ? _rdc.prev ( elem ) : elem;
	}

	/*
	*
	* get the parent element ignore whitespace
	*
	*/	
	_rdc.parent = function( elem, num ) {
		num = num || 1;
		for ( var i = 0; i < num; i++ )
			if ( elem != null ) 
				elem = elem.parentNode;
		return elem;
	}
	
/***************************************************************************************************************************************/
/*   mouse position    *****************************************************************************************************************/
/***************************************************************************************************************************************/
	_rdc.mouseX = function(e) {
		var posx = 0;
		if (!e) var e = window.event;
		if ( e.pageX ) 	{
			posx = e.pageX;
		}
		else if (e.clientX ) 	{
			posx = e.clientX + document.body.scrollLeft
				+ document.documentElement.scrollLeft;
		}
		
		return posx;
	}
	
	_rdc.mouseY = function(e) {
		var posy = 0;
		if (!e) var e = window.event;
		if ( e.pageY ) 	{
			posy = e.pageY;
		}
		else if ( e.clientY ) 	{
			posy = e.clientY + document.body.scrollTop
				+ document.documentElement.scrollTop;
		}
		
		return posy;
	}
		
/***************************************************************************************************************************************/
/*   size    ***************************************************************************************************************************/
/***************************************************************************************************************************************/
	/* Gets the full width/height because it's different for most browsers.*/
	_rdc.getViewportHeight = function() {
		if (window.innerHeight!=window.undefined) return window.innerHeight;
		if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
		if (document.body) return document.body.clientHeight; 

		return window.undefined; 
	}
	
	_rdc.getViewportWidth = function() {
		var offset = 17;
		var width = null;
		if (window.innerWidth!=window.undefined) return window.innerWidth; 
		if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; 
		if (document.body) return document.body.clientWidth; 
	}

	/**
	* Gets the real scroll top
	*/
	_rdc.getScrollTop = function() {
		if (self.pageYOffset) // all except Explorer
		{
			return self.pageYOffset;
		}
		else if (document.documentElement && document.documentElement.scrollTop)
			// Explorer 6 Strict
		{
			return document.documentElement.scrollTop;
		}
		else if (document.body) // all other Explorers
		{
			return document.body.scrollTop;
		}
	}
	
	_rdc.getScrollLeft = function() {
		if (self.pageXOffset) // all except Explorer
		{
			return self.pageXOffset;
		}
		else if (document.documentElement && document.documentElement.scrollLeft)
			// Explorer 6 Strict
		{
			return document.documentElement.scrollLeft;
		}
		else if (document.body) // all other Explorers
		{
			return document.body.scrollLeft;
		}
	}



/***************************************************************************************************************************************/
/*   hide and show    ******************************************************************************************************************/
/***************************************************************************************************************************************/
/*---------primarily for disable a tr, it is Recursive-----------*/	
	//public
	_rdc.disableElementByDefault = function(){
		_rdc.disableElementByClassName( "elementToBeDisabled" );
	}
	
	_rdc.disableElementByClassName = function( tag ){
		var elemsCanDisable = getElementsByClassName( tag,"" );
		for( var i = 0; i < elemsCanDisable.length; i++){
			_rdc.disableElementRecursive( elemsCanDisable[i] );
		}
	}
	
	_rdc.disableElementRecursive = function( elem ){
		if( elem.nodeType == 3) //text node
			return;
		//alert(elem.tagName);
		if( elem.tagName && elem.tagName.toUpperCase() == "A" ){
			elem.setAttribute( "href", "#" );
			elem.style.cursor = "default";
			elem.onclick = function(){return false;};
		}
		
		if( elem.tagName && elem.tagName.toUpperCase() == "INPUT" && elem.type.toUpperCase() == "IMAGE" ){
			elem.parentNode.removeChild(elem);
		}
	
		try{
			elem.style.color = "#ccc";
		}catch(ex){
		
		}
		
		try{
			elem.disabled = true;
		}
		catch(ex){
			
		}
		for( var i = 0; i < elem.childNodes.length; i++ ){
			_rdc.disableElementRecursive(elem.childNodes[i]);
		}
	}
	
	
/*--------------------*/

	//public
	_rdc.hideAndDisableAllPossible = function(){
		_rdc.disableElementWithTag();
		_rdc.hideElementWithTag();
		_rdc.disablePossiableElements();
	}
	
	//public
	//call sample: hideAndDisableAllPossibleShowButtons(["btn1","btn2"]);
	_rdc.hideAndDisableAllPossibleShowButtons = function( args ){
		for( var i = 0; i < args.length; i++ ){
			if($(args[i]))
				$(args[i]).style.display = "";
		}
	}

	/*for hide and show element*/
	_rdc.disableElementWithTag = function(){
		var elemsCanDisable = getElementsByClassName("canDisable","");
		for( var i = 0; i < elemsCanDisable.length; i++){
			elemsCanDisable[i].disabled = true;
		}
	}
	
	_rdc.hideElementWithTag = function(){
		var elemsCanDisable = getElementsByClassName("canHide","");
		for( var i = 0; i < elemsCanDisable.length; i++){
			elemsCanDisable[i].style.display = "none";
		}
	}
	
	_rdc.disablePossiableElements = function(){
		var elemsInput = document.getElementsByTagName( "input" );
		for( var i = 0; i < elemsInput.length; i++){
			if(elemsInput[i].getAttribute("skipDisable"))
				continue;
			elemsInput[i].disabled = true;
		}
		
		var elemsSelect = document.getElementsByTagName( "select" );
		for( var i = 0; i < elemsSelect.length; i++){
			if(elemsInput[i].getAttribute("skipDisable"))
				continue;
			elemsSelect[i].disabled = true;
		}
		
		var elemsTextarea = document.getElementsByTagName( "textarea" );
		for( var i = 0; i < elemsTextarea.length; i++){
			if(elemsInput[i].getAttribute("skipDisable"))
				continue;
			elemsTextarea[i].disabled = true;
		}
		
	}

	/*end of hide and show*/


	
/***************************************************************************************************************************************/
/*   debuging    ***********************************************************************************************************************/
/***************************************************************************************************************************************/
	_rdc.PageConsole = function(){};
	_rdc.PageConsole.writeln =  function( message, divId, emphasis ){
		if($("console")){
			var divStr = divId?divId:"";
			var result =  " " + divStr + " "+message+"<br />";
			if(emphasis) result = "<span style='font-weight:bold;'>" +result +"</span>"
			$("console").innerHTML +=result;
		}
	};
	
	_rdc.PageConsole.clear =  function(){
		if($("console")){
			$("console").innerHTML ="";
		}
	};



/***************************************************************************************************************************************/
/*   query string    *******************************************************************************************************************/
/***************************************************************************************************************************************/
	_rdc.PageQuery = function(q) {
		if (q.length > 1) this.q = q.substring(1, q.length);
		else this.q = null;
		this.keyValuePairs = new Array();
		if (q) {
			for (var i = 0; i < this.q.split("&").length; i++) {
				this.keyValuePairs[i] = this.q.split("&")[i];

			}

		}
		this.getKeyValuePairs = function() {
			return this.keyValuePairs;
		}
		this.getValue = function(s) {
			for (var j = 0; j < this.keyValuePairs.length; j++) {
				if (this.keyValuePairs[j].split("=")[0] == s)
				return this.keyValuePairs[j].split("=")[1];

			}
			return false;

		}
		this.getParameters = function() {
			var a = new Array(this.getLength());
			for (var j = 0; j < this.keyValuePairs.length; j++) {
				a[j] = this.keyValuePairs[j].split("=")[0];

			}
			return a;

		}
		this.getLength = function() {
			return this.keyValuePairs.length;
		}

	}
	
	_rdc.queryString = function(key) {
		var page = new _rdc.PageQuery(window.location.search);
		return unescape(page.getValue(key));

	}



/***************************************************************************************************************************************/
/*   cookie    *************************************************************************************************************************/
/***************************************************************************************************************************************/
	//------------------------------------
	// getExpDate
	_rdc.getExpDate = function(days,hours,minutes){
		var expDate=new Date();
		if(typeof days=="number"&&typeof hours=="number"&&typeof hours=="number"){
			expDate.setDate(expDate.getDate()+parseInt(days));
			expDate.setHours(expDate.getHours()+parseInt(hours));
			expDate.setMinutes(expDate.getMinutes()+parseInt(minutes));
			return expDate.toGMTString();
		} else return "";
	}
	 
	//------------------------------------
	// getCookieVal
	_rdc.getCookieVal = function(offset){
		var endstr=document.cookie.indexOf(";",offset);
		if(endstr==-1) endstr=document.cookie.length;
		return unescape(document.cookie.substring(offset,endstr));
	}
	 
	//------------------------------------
	// getCookie
	_rdc.getCookie = function(name){
		var arg=name+"=";
		var alen=arg.length;
		var clen=document.cookie.length;
		var i=0;
		while(i<clen){
			var j=i+alen;
			if(document.cookie.substring(i,j)==arg) return _rdc.getCookieVal(j);
			i=document.cookie.indexOf(" ",i)+1;
			if(i==0)break;
		}  
		return "";
	}
	 
	//------------------------------------
	// setCookie
	_rdc.setCookie = function(name,value,expires,path,domain,secure){
		document.cookie=name+"="+escape(value)+((expires)? "; expires="+expires : "")+((path)? "; path="+path : "")+((domain)? "; domain="+domain : "")+((secure)? "; secure" : "");
	}
	 
	//------------------------------------
	// deleteCookie
	_rdc.deleteCookie = function(name,path,domain){
		if(_rdc.getCookie(name)) document.cookie=name+"="+((path)? "; path="+path : "")+((domain)? "; domain="+domain : "")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}



/***************************************************************************************************************************************/
/*   css    ****************************************************************************************************************************/
/***************************************************************************************************************************************/
	//------------------------------------
	// HasClass
	_rdc.hasClass = function(el,cl){
		if((el.className===null)||(typeof el=='undefined')) return false;
		var classes=el.className.split(" ");
		for(i in classes){
			if(classes[i]==cl) return true;
		}
		return false;
	}
	 
	//------------------------------------
	// AddClass
	_rdc.addClass = function(el,cl){
		if((hasClass(el,cl))||(typeof el=='undefined')) return;
		el.className+=" "+cl;
	}
	 
	//------------------------------------
	// RemoveClass
	_rdc.removeClass = function(el,cl){
		if(typeof el=='undefined')return;
		if(el.className===null)return;
		var classes=el.className.split(" ");
		var result=[];
		for(i in classes){
			if(classes[i] !=cl) result[result.length]=classes[i];
		}
		el.className=result.join(" ");
	}



/***************************************************************************************************************************************/
/*   ajax    ***************************************************************************************************************************/
/***************************************************************************************************************************************/
	_rdc.ajaxObject = function(url, callbackFunction) {
	  var that=this;      
	  this.updating = false;
	  this.abort = function() {
	    if (that.updating) {
	      that.updating=false;
	      that.AJAX.abort();
	      that.AJAX=null;
	    }
	  }
	  this.update = function(passData,postMethod) { 
	    if (that.updating) { return false; }
	    that.AJAX = null;                          
	    if (window.XMLHttpRequest) {              
	      that.AJAX=new XMLHttpRequest();              
	    } else {                                  
	      that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
	    }                                             
	    if (that.AJAX==null) {                             
	      return false;                               
	    } else {
	      that.AJAX.onreadystatechange = function() {
	        if (that.AJAX.readyState==4) {             
	          that.updating=false;                
	          that.callback(that.AJAX.responseText,that.AJAX.status,that.AJAX.responseXML);        
	          that.AJAX=null;                                         
	        }                                                      
	      }                                                        
	      that.updating = new Date();                              
	      if (/post/i.test(postMethod)) {
	        var uri=urlCall+'?'+that.updating.getTime();
	        that.AJAX.open("POST", uri, true);
	        that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	        that.AJAX.send(passData);
	      } else {
	        var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime()); 
	        that.AJAX.open("GET", uri, true);                             
	        that.AJAX.send(null);                                         
	      }              
	      return true;                                             
	    }                                                                           
	  }
	  var urlCall = url;        
	  this.callback = callbackFunction || function () { };
	}

/***************************************************************************************************************************************/
/*   browser    ************************************************************************************************************************/
/*   USAGE:     ************************************************************************************************************************/
/* 
   _rdc.BrowserDetect.init();
   alert( _rdc.BrowserDetect.browser + _rdc.BrowserDetect.version + _rdc.BrowserDetect.OS );
*/
/***************************************************************************************************************************************/
	_rdc.BrowserDetect = {
		init: function () {
			this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
			this.version = this.searchVersion(navigator.userAgent)
				|| this.searchVersion(navigator.appVersion)
				|| "an unknown version";
			this.OS = this.searchString(this.dataOS) || "an unknown OS";
		},
		searchString: function (data) {
			for (var i=0;i<data.length;i++)	{
				var dataString = data[i].string;
				var dataProp = data[i].prop;
				this.versionSearchString = data[i].versionSearch || data[i].identity;
				if (dataString) {
					if (dataString.indexOf(data[i].subString) != -1)
						return data[i].identity;
				}
				else if (dataProp)
					return data[i].identity;
			}
		},
		searchVersion: function (dataString) {
			var index = dataString.indexOf(this.versionSearchString);
			if (index == -1) return;
			return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
		},
		dataBrowser: [
			{ 	string: navigator.userAgent,
				subString: "OmniWeb",
				versionSearch: "OmniWeb/",
				identity: "OmniWeb"
			},
			{
				string: navigator.vendor,
				subString: "Apple",
				identity: "Safari"
			},
			{
				prop: window.opera,
				identity: "Opera"
			},
			{
				string: navigator.vendor,
				subString: "iCab",
				identity: "iCab"
			},
			{
				string: navigator.vendor,
				subString: "KDE",
				identity: "Konqueror"
			},
			{
				string: navigator.userAgent,
				subString: "Firefox",
				identity: "Firefox"
			},
			{
				string: navigator.vendor,
				subString: "Camino",
				identity: "Camino"
			},
			{		// for newer Netscapes (6+)
				string: navigator.userAgent,
				subString: "Netscape",
				identity: "Netscape"
			},
			{
				string: navigator.userAgent,
				subString: "MSIE",
				identity: "Explorer",
				versionSearch: "MSIE"
			},
			{
				string: navigator.userAgent,
				subString: "Gecko",
				identity: "Mozilla",
				versionSearch: "rv"
			},
			{ 		// for older Netscapes (4-)
				string: navigator.userAgent,
				subString: "Mozilla",
				identity: "Netscape",
				versionSearch: "Mozilla"
			}
		],
		dataOS : [
			{
				string: navigator.platform,
				subString: "Win",
				identity: "Windows"
			},
			{
				string: navigator.platform,
				subString: "Mac",
				identity: "Mac"
			},
			{
				string: navigator.platform,
				subString: "Linux",
				identity: "Linux"
			}
		]

	};
	






