/*------------------------------------------------------------------
This function will return the required property
------------------------------------------------------------------*/
function getRequiredParam_JD(input, num){
	input = input + '';
	var properties = new Array();
	properties = input.split("|");
	return properties[num];
}


/*------------------------------------------------------------------
This function will trim a string
------------------------------------------------------------------*/
function trim_JD(string){
  return string.replace(/\s+/g,'');
}


/*------------------------------------------------------------------
This function will return the number of properties specified for
an option.
------------------------------------------------------------------*/
function getNumInputs_JD(input){
	input = input + '';
	var properties = new Array();
	properties = input.split("|");
	
	var i = 0;
	while(properties[i] != undefined){
		i++;
	}
	return i;
}

/*------------------------------------------------------------------
This function encodes variables ready for URL transfer
------------------------------------------------------------------*/
function urlencode_JD(str)
{
    str = str.replace(/\+/g,String.fromCharCode(8));
    str = escape(str);
    str = str.replace(/\%20/g,"+");
    str = str.replace(/\%08/g,"%2B");
    return str;
}

function randomFromTo(from, to){
       return Math.floor(Math.random() * (to - from + 1) + from);
    }
