var urlStringContentBase = "/printone/AjaxGenericHandler.aspx";

/*
Seny - 04/07/2009 - Localization of JavaScript messages
Calls an aspx page in ASYNC mode to get the localized string content
This can be called instead of the javascript alert. 
Usage: Call this to ALERT the localized value of a string to be used in JavaScript, ASYNCRONOUSLY
*/
function AsyncAlert(stringName)
{
    AsyncAlertFormat('',stringName,'');
}
/*
Seny - 04/07/2009 - Localization of JavaScript messages
Calls an aspx page in ASYNC mode to get the localized string content
This can be called instead of the javascript alert. 
Pass a messagePrefix and a messageSuffix if needed
Usage: Call this to ALERT the localized value of a string to be used in JavaScript, ASYNCRONOUSLY
*/
function AsyncAlertFormat(messagePrefix,stringName,messageSuffix)
{
    var paramDictionary = {
        string_name: stringName,
        w2p_ajaxRequestType: 'stringcontent'
    };
    var asyncRequest = new Ajax.Request(urlStringContentBase, 
        {
            method:'post',
            parameters : paramDictionary,
            onSuccess : function(transport) {                    
                // Success, update the images                    
                try {
                        var result = transport.responseText;
                        alert(messagePrefix+result+messageSuffix);
                } catch(e) 
                {
                    //alert("Unable to get Product Attributes:" + e);
                }
            },
            onException: function(req, exception) {
                //alert("Exception Occurred for Product Attributes Display: r\nDetails:\r\n\r\n" + exception);
                return false;
            },
            onFailure : function(transport) {
                //alert("some failure for Product Attributes...");
            }
        });
}

/*
NOTE: THIS WILL DO SYNCHRONOUSLY, so the browser may get locked for the time
Seny - 04/07/2009 - Localization of JavaScript messages
Calls an aspx page in SYNC mode to get the localized string content
Usage: Call this to get the localized value of a string to be used in JavaScript, SYNCRONOUSLY
*/
function GetStringContent(stringName)
{
    var stringValue = '';
    var paramDictionary = {
        string_name: stringName,
        w2p_ajaxRequestType: 'stringcontent'
    };
    var asyncRequest = new Ajax.Request(urlStringContentBase, 
        {
            method:'post',
            asynchronous: false,
            parameters : paramDictionary,
            onSuccess : function(transport) {                    
                // Success, update the images                    
                try {
                        stringValue =  transport.responseText;
                } catch(e) 
                {
                    //alert("Unable to get Product Attributes:" + e);
                }
            },
            onException: function(req, exception) {
                //alert("Exception Occurred for Product Attributes Display: r\nDetails:\r\n\r\n" + exception);
                return false;
            },
            onFailure : function(transport) {
                //alert("some failure for Product Attributes...");
            }
        });
    return stringValue;        
}