/*          (c) Holistic Research And Development Limited
            ---------------------------------------------------------------------------
            Programmer                            : Ruben Gatt
            Date Last Updated                     : 22.01.2009
            Module/Description                    : DNM JAVASCRIPT LIBRARY
            Version                               : 02.00.00
            Changes by                            : Ruben Gatt
            Changes done                          : 
            Status                                : OK
            ---------------------------------------------------------------------------*/


/*

 _______  .__   __. .___  ___.      ______   ______   .______       _______ 
|       \ |  \ |  | |   \/   |     /      | /  __  \  |   _  \     |   ____|
|  .--.  ||   \|  | |  \  /  |    |  ,----'|  |  |  | |  |_)  |    |  |__   
|  |  |  ||  . `  | |  |\/|  |    |  |     |  |  |  | |      /     |   __|  
|  '--'  ||  |\   | |  |  |  |    |  `----.|  `--'  | |  |\  \----.|  |____ 
|_______/ |__| \__| |__|  |__|     \______| \______/  | _| `._____||_______|


*/

//This is used in the DNM RAD Core:
function __DNMBack(eventArgument,myControl) {
var theform;
var control = document.getElementById(myControl);
if (window.navigator.appName.toLowerCase().indexOf('microsoft') > -1) {
theform = document.Form
}
else {
theform = document.forms['Form'];
} 
control.value = eventArgument; 
theform.submit();
}


//This is used in the DNM RAD Core:					 
function __DNMdoPostBack(eventArgument,myControl,delmyControl) {
var theform;
var control = document.getElementById(myControl);
var delcontrol = document.getElementById(delmyControl);
if (window.navigator.appName.toLowerCase().indexOf('microsoft') > -1) {
theform = document.Form;
}
else {
theform = document.forms['Form'];
}
control.value = eventArgument;
delcontrol.value = '';
theform.submit();
}


/*

 _______  .__   __. .___  ___.    .______    __    __  .______    __       __    ______ 
|       \ |  \ |  | |   \/   |    |   _  \  |  |  |  | |   _  \  |  |     |  |  /      |
|  .--.  ||   \|  | |  \  /  |    |  |_)  | |  |  |  | |  |_)  | |  |     |  | |  ,----'
|  |  |  ||  . `  | |  |\/|  |    |   ___/  |  |  |  | |   _  <  |  |     |  | |  |     
|  '--'  ||  |\   | |  |  |  |    |  |      |  `--'  | |  |_)  | |  `----.|  | |  `----.
|_______/ |__| \__| |__|  |__|    | _|       \______/  |______/  |_______||__|  \______|
                                                                                        
 _______  __    __  .__   __.   ______ .___________. __    ______   .__   __.      _______.
|   ____||  |  |  | |  \ |  |  /      ||           ||  |  /  __  \  |  \ |  |     /       |
|  |__   |  |  |  | |   \|  | |  ,----'`---|  |----`|  | |  |  |  | |   \|  |    |   (----`
|   __|  |  |  |  | |  . `  | |  |         |  |     |  | |  |  |  | |  . `  |     \   \    
|  |     |  `--'  | |  |\   | |  `----.    |  |     |  | |  `--'  | |  |\   | .----)   |   
|__|      \______/  |__| \__|  \______|    |__|     |__|  \______/  |__| \__| |_______/    
                                                                                         

*/

//This funcion will display the passed image
function dnm_onImgError(obj, img){
      obj.src=img;
}


//This function will open a popup using the paramaters sent by user.
function dnm_OpenCenterWindow(path,wndname,width,height,scrollbars,resizable) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;

    var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2;
    wndnew = window.open(path,wndname,'height='+height+',top='+yOffset+',width='+width+',left='+xOffset+',scrollbars='+scrollbars+',resizable='+resizable+'');
    wndnew.focus();
}

//This method is used to disable/enabled client side validators
//Note: only used when DNM RAD was coded with VS2003
function dnm_EnableValidator(valname,valhiddename,xtruefalse)
{
   
	ValidatorEnable(valname, xtruefalse);
	if (xtruefalse == true)
	{
		valhiddename.value = '0';
	}
	else
	{
		valhiddename.value = '1';
	}
}

//This function connects all the functions that needs to run when the window.onload events fires.
function dnm_connectOnLoad(newF) {

    var prevF=window.onload;
	var func = function()
		{
			if ( prevF !== undefined && prevF )
				prevF();
			newF(); 
		};
    window.onload=func;
}



//This function is mainly used for tooltips in dnm, it will hide the tooltip control
function dnm_tooltipblur(ccontrol)
{
	document.getElementById(ccontrol).style.display = "none";

}


//Use this function to clear a dropdown value
function dnm_clearDropdown(dropdown)
{
	for (x = dropdown.length-1; x >= 0; x--)
	{
		dropdown.options[x] = null;
	}

}

//Use this function to get a dropdown value
function dnm_getDropdownValue(dropdown)
{
	for(var i=0; i<dropdown.options.length; i++)
    {
        if(dropdown.options[i].selected)
        {
            return dropdown.options[i].value;
        }
    }

}

//Use this function to minimize and maximize a div
function dnm_SectionMaxMin(oBtn, sContentID,sMaxIcon,sMinIcon)
{
    //alert(sContentID);
	var oContent = dnm_findObjWithClientId(sContentID);
	//alert(oContent);
	if (oContent != null)
	{
		
		if (oContent.style.display == 'none')
		{
			oBtn.src = sMinIcon;				
			oContent.style.display = '';
			//dnn.setVar(oBtn.id + ':exp', 1);
		}
		else
		{
			oBtn.src = sMaxIcon;				
			oContent.style.display = 'none';
			//dnn.setVar(oBtn.id + ':exp', 0);
		}
		return true;	//cancel postback
	}
	return false;	//failed so do postback
}

function dnm_findObjWithClientId(Id)
{
    var ctrls = document.getElementsByTagName("body")[0].getElementsByTagName("*");
    for (var count = 0; count < ctrls.length ; count ++) 
    {
        var index = ctrls[count].id.indexOf(Id);
        if(index != -1)
        {
            if((ctrls[count].id.length - index) == Id.length)
            {
                return ctrls[count];
            }
        }
    }
    return null;
}

//Will remove any additional text that is greater than the limit amount
function dnm_checkfieldsize(field, length) {

   if (field.value.length > length) {
       var temp2 = field.value.substring(0,length);
       field.value = temp2;
   }
}


/*
            DNM AJAX FUNCTION
            ---------------------------------------------------------------------------
            (c) Holistic Research And Development Limited
            ---------------------------------------------------------------------------
            Programmer                            : Luke Rocco
            Date Last Updated                     : 22.01.2009
            Module/Description                    : DNM Ajax Functions 
            Version                               : 01.00.00
            Changes by                            : Ruben Gatt
            Changes done                          : 
            Status                                : OK
            ---------------------------------------------------------------------------

*/

var targetURL = "";
var targPage = "DataRequest.aspx";
var requestObject = null;

// Function Handling the OnChange event of an Element 
function dnm_OnChangeHandler(_trgUrl,parentclientid,clientid,dnm_table,dnm_text,dnm_value,dnm_filter,multi,usedefault,defaultvalue,targetdefault, targetdefaultvalue, targetdefaulttext) {
	var Filtering = "";
	targetURL = "";
	targetURL = _trgUrl + targPage;
	if (multi)
	{
		var selectedvalue;
		var selObj;
		selObj = document.getElementById(parentclientid);
		for (var i = 0; i < selObj.length; i++) 
		{
			if (selObj.options[i].selected)
			{
				if (Filtering == "")
				{
					Filtering = dnm_filter.replace("{selectedvalue}",selObj.options[i].value);
					
				}
				else
				{
					Filtering += " OR " + dnm_filter.replace("{selectedvalue}",selObj.options[i].value);
				}
			}

		}
		
		//alert('multi');
	}
	else
	{
	    //alert('no multi');
	    //alert(dnm_filter);
	   
	    //alert(parentclientid);
	    //alert(dnm_getDropdownValue(document.getElementById(parentclientid)));
		selectedvalue = dnm_getDropdownValue(document.getElementById(parentclientid));
	    // alert(selectedvalue);
	    // alert(dnm_filter.replace("{selectedvalue}",selectedvalue));
	     //alert(dnm_filter.replace(/{selectedvalue}/g,selectedvalue);
		Filtering = dnm_filter.replace("{selectedvalue}",selectedvalue);
	}
	//alert(Filtering);
	if (usedefault)
	{
		
		dnm_PrepareRequest('',clientid,dnm_table,dnm_text,dnm_value,Filtering,defaultvalue,targetdefault, targetdefaultvalue, targetdefaulttext,targetdefault);
		
	}
	else
	{
		dnm_PrepareRequest('',clientid,dnm_table,dnm_text,dnm_value,Filtering,defaultvalue,targetdefault, targetdefaultvalue, targetdefaulttext,targetdefault);
	}
}//OnChange_Handler

// Function Hanlding the Request Object's Reponse 
function dnm_HandleResponse(clientid) {
    
	if (requestObject.readyState == 4)
	{
	    
		document.getElementById(clientid).innerHtml = requestObject.responseText;
		
		//alert ();
	}
	
}//HandleResponse

function dnm_PrepareRequest(postVariables,clientid,dnm_table,dnm_text,dnm_value,dnm_filter,defaultvalue,targetdefault, targetdefaultvalue, targetdefaulttext,targetusedefault)
{
	dnm_GetHTTPObject();
	var xtargetURL;
	var isSelect;
	
	
	

   String.prototype.startsWith = function(str) {return (this.match("^"+str)==str)}
   
   if (dnm_filter.startsWith("SELECT"))
   {
      isSelect = true;
      dnm_filter = dnm_filter.replace("SELECT","");
   }

    xtargetURL = targetURL+"?dnm_table="+dnm_table+"&dnm_text="+dnm_text+"&dnm_value="+dnm_value+"&dnm_filter="+dnm_filter+"&dnm_defaultvalue="+targetdefaultvalue+"&dnm_defaulttext="+targetdefaulttext+"&dnm_usedefault="+targetusedefault;
	
	requestObject.open("GET", xtargetURL, true);		
	//requestObject.open("POST", targetURL, true);		

	//requestObject.onreadystatechange = dnm_HandleResponse(clientid);
	requestObject.onreadystatechange = function()
	{
		if (requestObject.readyState == 4)
		{
			//this.getElementById(clientid).innerHTML = '';
			
			dnm_CreateXMLDocument( requestObject.responseText,clientid,isSelect);
		}//if
	}
	
	//requestObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   	//requestObject.setRequestHeader("Content-length", postVariables.length);
	//requestObject.send(postVariables);	
	
	requestObject.send(null);	
}//PrepareRequest

// Function returning a valid HTTP Request Object 
function dnm_GetHTTPObject() {
	requestObject = null;
	
	if (window.ActiveXObject)
		requestObject = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		requestObject = new XMLHttpRequest();	
	
	return requestObject;
}//GetHTTPObject

function dnm_CreateXMLDocument(xmlText,clientid,isSelect) 
{
	var xmlDoc = null;
	
	try 
	{
		if (window.ActiveXObject)//Internet Explorer
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.async="false";
			xmlDoc.loadXML(xmlText);
			
		}//if
		else if (window.XMLHttpRequest)
		{
			parser=new DOMParser();
	    	xmlDoc=parser.parseFromString(xmlText,"text/xml");	    
	    	
		}//else if
		
		dnm_ParseXML(xmlDoc,clientid,isSelect);
	}//try
	catch ( ex )
	{
		alert( ex.message );
	}//catch
	
	return( xmlDoc );
	
}//LoadXMLString



function dnm_ParseXML(xmlDoc,clientid,isSelect)
{
		
		
		//=================
		
		var rootElement = xmlDoc.documentElement;		
	
		var node, nodeValue, nodeText;
		var found = false;
		
		if (isSelect)
		{
		    
		            for(var i=0; i<document.getElementById(clientid).options.length; i++)
                     {      
                        found = false;
                        for ( var x = 0; x < rootElement.childNodes.length; x++ )
		                {
			                node = rootElement.childNodes[x];
    			            //alert('HOLY CRAP0');
			                if ( node.firstChild != null )
			                {
				                nodeText = node.firstChild.nodeValue;
				                nodeValue = node.getAttribute('value');
                				
				              // alert('HOLY CRAP1');
                          //  alert("NODE VALUE" + nodeValue);
                          //  alert("DOC VALUE"+ document.getElementById(clientid).options[i].value);
                                if(document.getElementById(clientid).options[i].value == nodeValue)
                                {
                                  //  alert('HOLY CRAP2');
                                   document.getElementById(clientid).options[i].selected = true;
                                   found = true;
                                }
                                
                            }
                            node = null;
		                    nodeValue = null;
		                    nodeText = null;
                               
                         }
                         
                         if (found == false)
                         {
                            document.getElementById(clientid).options[i].selected = false;
                         }
                    }
                
                 
		
		}
		else
		{
		    dnm_clearDropdown(document.getElementById(clientid));
		    for ( var i = 0; i < rootElement.childNodes.length; i++ )
		    {
			    node = rootElement.childNodes[i];
    			
			    if ( node.firstChild != null )
			    {
			       
				    nodeText = node.firstChild.nodeValue;
				    nodeValue = node.getAttribute('value');
    				//alert("NODE VALUE" + nodeValue);
				    //document.getElementById(clientid).appendChild(node);
                    //alert(nodeText + " , " + nodeValue);	
				    document.getElementById(clientid).options[i] = new Option(nodeText,nodeValue);
			    }//if
    			
			    node = null;
			    nodeValue = null;
			    nodeText = null;
		    }//for
		}
		

	
}//ParseXML

/*

            DNM TOOLTIP FUNCTIONS                                                                               
            (c) Holistic Research And Development Limited
            ---------------------------------------------------------------------------
            Programmer                            : Ruben Gatt
            Date Last Updated                     : 22.01.2009
            Module/Description                    : DNM Tooltip Control
            Version                               : 01.00.00
            Changes by                            : Ruben Gatt
            Changes done                          : 
            Status                                : OK
            ---------------------------------------------------------------------------


*/

function dnm_findPosition(e,obj,control,dnm_ToolTip)
{
	var cont_top = dnm_calc_top(control);
	var cont_left = dnm_calc_left(control);
	cont_left += control.offsetWidth;
	cont_left += 10;
	
	obj.style.left = cont_left  + "px";
	obj.style.top = cont_top + "px";
	obj.style.display = 'inline';
	obj.innerHTML = dnm_ToolTip;
}

var x=0,y=0;
function getMousePosition(e)
{
return e.pageX ? {'x':e.pageX, 'y':e.pageY} : {'x':e.clientX + document.documentElement.scrollLeft + document.body.scrollLeft, 'y':e.clientY + document.documentElement.scrollTop + document.body.scrollTop};
}

function showMousePos(e,obj)
{
if (!e) e = event; // make sure we have a reference to the event
var mp = getMousePosition(e);
x=mp.x;
y=mp.y;

obj.style.left = x + "px";
obj.style.top = y + "px";


}

function dnm_calc_top(o) {
var l = o.offsetTop;
var p = o.offsetParent;


while (p!= null) 
{
	l += p.offsetTop;
	p = p.offsetParent;
}

} 

function dnm_calc_top(o) {
var l = o.offsetTop;
var p = o.offsetParent;


while (p!= null) 
{
	l += p.offsetTop;
	p = p.offsetParent;
}
return l;
} 


function dnm_calc_left(o) {
var l = o.offsetLeft;
var p = o.offsetParent;


while (p != null) 
{
	l += p.offsetLeft;
	p = p.offsetParent;
}
return l;
} 




/*
 
            DNMDATE CONTROL
            (c) Holistic Research And Development Limited
            ---------------------------------------------------------------------------
            Programmer                            : Luke Rocco
            Date Last Updated                     : 22.01.2009
            Module/Description                    : DNM Date Control 
            Version                               : 01.00.00
            Changes by                            : Ruben Gatt
            Changes done                          : 
            Status                                : OK
            ---------------------------------------------------------------------------


*/

var allowPast = true;
var dateformat = "dd/MM/yyyy";

function dnm_AllowPast( flag )
{
	allowPast = flag;
}//dnm_AllowPast

function dnm_SetCalendarDate ( yearControl, monthControl, dayControl, date , dumpControl, caller ,format)
{
	var year = null;
	var month = null;
	var day = null;
	
	if ( (format !== undefined ) && (format !== null))
	{
		dateformat = format;
	}
	//alert(date);
	//alert(format);
	//alert(caller);
	if ( date === undefined )
	{
		date = new Date();
	}//if
	else if ( date === null )
	{
		if ( (( caller === undefined ) || ( caller === null )) == false ) 
		{
			if ( caller == 'dump' )
				date = dnm_RetrieveDate( dumpControl );//new Date ( dumpControl.value );
			else if ( caller == 'now' )
				date = new Date();
			else if ( caller == 'start' )
			{
				date = dnm_RetrieveDate ( dumpControl );
			}
		}//if
		else
		{
			date = new Date();
			
			year = parseInt( yearControl.value );
			if ( isNaN( year ) )
				year = new Date().getFullYear();
			if (year < 0001 || year > 9999)
			{
			    //alert(year);
			    year = new Date().getFullYear();
			}
			month = monthControl.options.selectedIndex;
			
			dnm_PopulateMonthList ( monthControl , year );
			monthControl.options.selectedIndex = month;
			
			day = dayControl.options[ dayControl.options.selectedIndex ].value;
			
			var maxMonth = monthControl.options[month].value;
			
			if ( day > maxMonth )
				day = maxMonth;
			
			date.setFullYear ( year, month, day );
		}//else
	}//if
	
	if ( allowPast == false )
		if ( ( date - new Date() ) < 0 )
			date = new Date();

	year = date.getFullYear();
	month = date.getMonth();
	day = date.getDate();
	
	//alert(date);
	//alert('year' + year);
	//alert('month' + month);
	//alert('day' + day);
	
	
	yearControl.value = year;
		
	dnm_PopulateMonthList ( monthControl , year );
	monthControl.options.selectedIndex = month;
	
	var monthMax = monthControl.options[month].value;
	dnm_PopulateDayList ( dayControl , monthMax );
	dayControl.options.selectedIndex = ( day - 1 );
	
	if ( ( dumpControl === undefined ) == false )
		DumpDate( dumpControl, year, month, day );
	
}//dnm_SetCalendarDate

function DumpDate( dumpControl, year, month , day )
{
	var format ; //"dd/MM/yyyy hh:mm:ss"
	
	format = dateformat;
	//DATE FORMATTING
	format = format.replace( 'dd' , dnm_GetDoubleDigit( day ) );
	format = format.replace( 'd' , dnm_GetDoubleDigit( day ) );
	format = format.replace( 'MM' , dnm_GetDoubleDigit ( month + 1) );
	format = format.replace( 'M' , dnm_GetDoubleDigit ( month + 1 ) );
	format = format.replace( 'yyyy' , year );
	
	/*
	//TIME FORMATTING
	format = format.replace( 'hh' , hours );
	format = format.replace( 'mm' , minutes );
	format = format.replace( 'ss' , seconds );
	*/
		
	dumpControl.value = format;
	
}//DumpDate

function dnm_RetrieveDate ( dumpControl )
{
	// VERY PRONE FOR ERROR WHEN USING DIFFERENT REGIONAL SETTINGS!!!
	
	//alert('dumpControl - ' + dumpControl.value);
	var dateVal = dumpControl.value;
	var ph = '';
	var tempnuminput = '';
		
	//alert("Value" + dateVal);
	ph = dateVal.indexOf ('/');
	//alert ('ph' + ph);
	tempnuminput = dateVal.substr ( 0 , ph );
	if (tempnuminput.substr(0,1) == '0')
	{
	    tempnuminput = tempnuminput.substr(1,1);
	}
	var v1 = parseInt ( tempnuminput );
		
	dateVal = dateVal.substr( ph+1 , dateVal.length ); 
	
	//alert ('v2 dateVal' + dateVal);
	
	ph = dateVal.indexOf ('/');
	
	//alert ('ph' + ph);
	//alert ('v2 substr: ' + dateVal.substr ( 0 , ph ));
	//alert ('v2 parseInt: ' + parseInt( dateVal.substr ( 0 , ph ),16 ));
	
	tempnuminput = dateVal.substr ( 0 , ph );
	if (tempnuminput.substr(0,1) == '0')
	{
	    tempnuminput = tempnuminput.substr(1,1);
	}
	var v2 = parseInt( tempnuminput);
			
	dateVal = dateVal.substr( ph + 1 , dateVal.length ); 	
	
	//alert ('v3 dateVal' + dateVal);
	var v3 = parseInt ( dateVal.substr ( 0 , dateVal.length ) );

    //alert('date format : ' + dateformat);
	//alert('v1:' + v1);
    //alert('v2:' + v2);
    //alert('v3:' + v3);
	
	if( isNaN( v1 ) || isNaN( v2 ) || isNaN( v3 ) )
		return new Date();
	else
	{
		var y,m,d;
		
		switch ( dateformat )
		{
			case "MM/dd/yyyy":
				y = v3;
				m = v1;
				d = v2;
				break;
			case "M/d/yyyy":
				y = v3;
				m = v1;
				d = v2;
				break;
			case "M/dd/yyyy":
				y = v3;
				m = v1;
				d = v2;
				break;
			case "dd/MM/yyyy":
				y = v3;
				m = v2;
				d = v1;
				break;
			case "yyyy/MM/dd":
				y = v1;
				m = v2;
				d = v3;
				break;
			default:
				y = v3;
				m = v2;
				d = v1;
				break;
		}//switch
		m = m - 1;
		//alert(dateformat);
		//alert('year' + y);
	    //alert('month' + m);
	    //alert('day' + d);
	    //alert(dateformat);
    	
		return new Date ( y , m , d );	
	}//else
	
/*
	var dateVal = dumpControl.value;
	var ph = '';
		
	ph = dateVal.indexOf ('/');
	var d = parseInt ( dateVal.substr ( 0 , ph ) );
		
	dateVal = dateVal.substr( ph+1 , dateVal.length ); 
	
	ph = dateVal.indexOf ('/');
	var m = parseInt( dateVal.substr ( 0 , ph ) );
			
	dateVal = dateVal.substr( ph + 1 , dateVal.length ); 	
	var y = parseInt ( dateVal.substr ( 0 , dateVal.length ) );

	m -= 1;
	
	if( isNaN( y ) || isNaN( m ) || isNaN( d ) )
		return new Date();
	else
		return new Date ( y , m , d );	
*/
}//dnm_RetrieveDate

// Function used to populate a ComboBox control with the list of Months and their respective duration
function dnm_PopulateMonthList ( control , year )
{
	var monthNames = new Array ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
	var monthValues = dnm_GenerateMonthList ( year );

	control.options.length = 0;
	
	for ( var i = 0; i < 12; i++ )
	{
		var optControl = document.createElement('option');
		var optValue = document.createTextNode( monthNames[ i ] );
		
		optControl.setAttribute ( 'value', monthValues[ i ] );
		optControl.appendChild ( optValue );
		
		control.appendChild ( optControl );
	}//for
	
}//dnm_PopulateMonthList

// Function used to populate a ComboBox control with the list of Days
function dnm_PopulateDayList ( control , monthMax )
{
	
	control.options.length = 0;
	
	for ( var i = 1; i <= monthMax; i++ )
	{
		var optControl = document.createElement('option');
		var optValue = document.createTextNode( dnm_GetDoubleDigit( i ) );
		
		optControl.setAttribute ( 'value', dnm_GetDoubleDigit( i ) );
		optControl.appendChild ( optValue );
		
		control.appendChild ( optControl );		
	}//for
	
}//dnm_PopulateDayList

//Function used to retrieve a list of months and their duration
function dnm_GenerateMonthList( year )
{	
	var year = parseInt ( year );
	var february = ( ( ((year%4) == 0) && ( ( ( ( year%100 ) == ( year%400 )  ) == 0 ) || ( ( year%100 ) != 0 ) ) ) ? 29 : 28 );
	return new Array ( 31, february, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
}//dnm_GenerateMonthList

function dnm_GetDoubleDigit ( value )
{
	strVal = String( value );
	
	if ( strVal.length == 1 )
		strVal = "0" + strVal;
	else if ( strVal.length == 0 )
		strVal = "00";
	
	return strVal;
	  
}//dnm_GetDoubleDigit
	
//=============================================================================================
//===========================================END OF FILE ======================================
//=============================================================================================

