(function(undefined) {
/* local var and method */
/* object prototype */
/* public method and attribute */
/**
* funzioni di navigazione
*/
$$.navigator = {};
$$.navigator.goto = function(customConfig) {
customConfig = (typeof customConfig == 'object')?customConfig:{};
var config = {
url: 'https://www.aquasystems.it',
method: 'get',
lang: $$.curlang,
params: {}
};
config = $.extend(config, customConfig);
if(config.method == 'seo') {
var url = config.url;
var sep = '/';
for(var attr in config.params) {
url += sep + config.params[attr];
sep = '/';
}
if(config.lang!='') {
url += sep + config.lang;
}
document.location.href = url;
}
if(config.method == 'get') {
var url = config.url;
var sep = '?';
for(var attr in config.params) {
url += sep + config.params[attr];
sep = '&';
}
document.location.href = url;
}
if(config.method == 'post') {
var url = config.url;
if($("#fw-nav-form").length == 1) {
$("#fw-nav-form").remove();
}
var postFormHTML = '';
postFormHTML += '';
$('body').append(postFormHTML);
$("#fw-nav-form").submit();
}
}
/* alias in the main namespace */
$$.goto = $$.navigator.goto;
})();