/**
 *		parseStringToBoolean()
 *
 *		Compares the value of a string, makes it boolean.
 *		NOTE: "1" will return TRUE.
 *
 *		@param			String		String
 *		@return			Boolean
 **/
function parseStringToBoolean( strString )
{
	// Reverse values, check for a ZERO.
	return ( strString.indexOf( "0" ) == -1 ? true : false );
}


/**
 *		Geeft HTML voor een status icon terug
 **/
function getHtmlIcon( fIsOkayIcon )
{
	// Okay-icon?
	if ( fIsOkayIcon ) {
		return '<img class="clean" src="../../../../../res/static/img/icon-okay.png" alt="success" /> ';
	} else {
		return '<img class="clean" src="../../../../../res/static/img/icon-error.png" alt="error" /> ';
	}
}


/**
 *		getXmlChildElementValue()
 *
 *		Retreives the values of a child element in a XML document.
 *
 *
 *		@param			XML			XML Document
 *		@param			String		Iterative Element
 *		@param			String		Child Element
 *		@return			String		Child value
 **/
function getXmlChildElementValue( XmlDocument, strIterativeElement, strChildElement )
{
	// Placeholder for value
	var strChildValue = "";
	
	// Find root element
	$( XmlDocument ).find( strIterativeElement ).each(function() 
	{ 	
		// Find child element
		var strValue = $(this).find( strChildElement ).text();
		
		// Trim value
		strValue = jQuery.trim( strValue );
		
		// Set value
		strChildValue = strValue;
	}); 
	
	// Return found value
	return strChildValue;
}


/**
 *		Sends an AJAX request. 
 *		Callback is processed through parameter ( ptrCallback ).
 **/
function dispatchAjaxRequest( strPostUrl, strData, strDataType, ptrCallback )
{
	// Perform AJAX request
	$.ajax({
		type: "POST",
		url: strPostUrl,
		data: strData,
		dataType: strDataType,
		success: function( response ) {
			// Perform callback, argument is response text
			ptrCallback( response );
		}
	});
}
