
var COUNTRY = "us";
var LOCALE = "us";

var translateList = {
    'Please enter your email': "Please enter your email",
    'Please enter your full name': "Please enter your full name",
    'Please enter your new password': "Please enter your new password",
    'Password should be more than 6 chars': "Password should be more than 6 chars",
    'Password should contain only English chars': "Password should contain only English chars",
    'Please confirm your password': "Please confirm your password",
    'Password do not match confirmation': "Password do not match confirmation",
    'Please enter country': "Please enter country",
    'Please enter your model': "Please enter your model",

    'post review': "post review",
    'Review text': "Review text",
    'Continue': "Continue",
    'CLOSE': "CLOSE",
    'Personal use': "Personal use",
    'Home based business ': "Home based business ",
    'Business': "Business",
    'Personal use': "Personal use",
    'Administrative Assistant': "Administrative Assistant",
    'Business Professional': "Business Professional",
    'CAD/CAM Professional': "CAD/CAM Professional",
    'Chief Information Officer (CIO)': "Chief Information Officer (CIO)",
    'Company Owner': "Company Owner",
    'Department Head': "Department Head",
    'Engineer/Technical': "Engineer/Technical",
    'Facilities Manager': "Facilities Manager",
    'Finance/Accounting Professional': "Finance/Accounting Professional",
    'Financial Officer/CFO': "Financial Officer/CFO",
    'Graphic Art Professional': "Graphic Art Professional",
    'IT Strategist': "IT Strategist",
    'Marketing Professional': "Marketing Professional",
    'MIS/IT Group/Department Manager': "MIS/IT Group/Department Manager",
    'Management Information Systems': "Management Information Systems",
    'Information Technology Professional': "Information Technology Professional",
    'Office Manager': "Office Manager",
    'Purchasing Manager': "Purchasing Manager",
    'Sales Professional': "Sales Professional",
    'Service/Support/Help Desk': "Service/Support/Help Desk",
    'Software Developer': "Software Developer",

    'Mr': "Mr",
    'Mrs': "Mrs"};

function __() {

    var args = $A(arguments);

    //Bad syntax:
    if (0 == $A(arguments).size()) {
        // error_log("Incorrect call of lang function, see debug below:" .print_r(debug_backtrace(),true));
        return ;
    }

    var str = translateList[args[0] ] ? translateList[args[0] ]: args[0] ;

    //Easy way 1 arg, just output:
    if ( 1 == args.size()) {
        return str;
    }

    //Array got, we'll use printf syntax:
    //  unset(args[0]); //remove 1st element, 'cause it's gotted string
    delete(args[0]);
    args = args.flatten();
    return sprintf(str, args);
}

        function sprintf()
        {
            if (!arguments || arguments.length < 1 || !RegExp)
            {
                return;
            }
            var str = arguments[0];
            var re = /([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/;
            var a = b = [], numSubstitutions = 0, numMatches = 0;
            while (a = re.exec(str))
            {
                var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4];
                var pPrecision = a[5], pType = a[6], rightPart = a[7];

                //alert(a + '\n' + [a[0], leftpart, pPad, pJustify, pMinLength, pPrecision);

                numMatches++;
                if (pType == '%')
                {
                    subst = '%';
                }
                else
                {
                    numSubstitutions++;
                    if (numSubstitutions >= arguments.length)
                    {
                        alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\nfor the number of substitution parameters in string (' + numSubstitutions + ' so far).');
                    }
                    var param = arguments[numSubstitutions];
                    var pad = '';
                           if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1);
                      else if (pPad) pad = pPad;
                    var justifyRight = true;
                           if (pJustify && pJustify === "-") justifyRight = false;
                    var minLength = -1;
                           if (pMinLength) minLength = parseInt(pMinLength);
                    var precision = -1;
                           if (pPrecision && pType == 'f') precision = parseInt(pPrecision.substring(1));
                    var subst = param;
                           if (pType == 'b') subst = parseInt(param).toString(2);
                      else if (pType == 'c') subst = String.fromCharCode(parseInt(param));
                      else if (pType == 'd') subst = parseInt(param) ? parseInt(param) : 0;
                      else if (pType == 'u') subst = Math.abs(param);
                      else if (pType == 'f') subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision): parseFloat(param);
                      else if (pType == 'o') subst = parseInt(param).toString(8);
                      else if (pType == 's') subst = param;
                      else if (pType == 'x') subst = ('' + parseInt(param).toString(16)).toLowerCase();
                      else if (pType == 'X') subst = ('' + parseInt(param).toString(16)).toUpperCase();
                }
                str = leftpart + subst + rightPart;
            }
            return str;
        }
