//Author: Nilesh Ghorpade
//This java script file will have the functions that will be required for achieving
//globalization of the java script files. 


function formatMessage(msg, arguments, counter) {
  token = "{" + counter;
  i = msg.indexOf(token);
  r = "";
  if (i == -1) return msg;
  r += msg.substring(0,i) + arguments[counter];
  if ( i + token.length + 1 < msg.length) {
	r += formatMessage(msg.substring(i + token.length + 1, msg.length), arguments, counter+1);

  }
  return r;
  }

//----------------------------------------------
// function to check non ascii characters
//----------------------------------------------
function checkAscii(str)
{
   for (var i = 0; i < str.length; i += 1)
   {
       if(str.charCodeAt(i)>127)
       {
	  alert(MSG_ONLY_ASCII_CHARACTERS_ALLOWED)
	  return false
       }
   }
   return true;
}
