function activateTranslationMode(baseNode) {
	var base = baseNode || document.body;
	var nodes = base.childNodes;
	for (var i = 0; i < nodes.length; i++) {
		var node = $(nodes[i]);
		switch (node.tagName) {
		    case 'SPAN':
		        if (node.getAttribute('trns') || node.getAttribute('mtrns') || node.getAttribute('htrns')) {
		            var title = "";
		            if (node.getAttribute('trns')) title += node.getAttribute('trns');
		            if (node.getAttribute('mtrns')) {
		                if (title.length > 0) title += ",";
		                title += node.getAttribute('mtrns');
		            }
		            if (node.getAttribute('htrns')) {
		                if (title.length > 0) title += ",";
		                title += node.getAttribute('htrns');
		            }
		            var imageElm = new Element('img', { src: 'http://artogfx.cloud2.artodata.com/sitegfx/r2/icons/icon_bullet_r2.gif', border: '0', width: '10px', height: '10px', title: title });
		            imageElm.observe('click', function(e, trns, mtrns, htrns) {
		                var querystring = '';
		                var id;
		                if (trns) {
		                    querystring = '?visible=' + trns;
		                    id = trns;
		                }
		                if (mtrns) {
		                    id = mtrns;
		                    if (querystring == '') {
		                        querystring = '?multiple=' + mtrns;
		                    } else {
		                        querystring += '&multiple=' + mtrns;
		                    }
		                }
		                if (htrns) {
		                    id = htrns;
		                    if (querystring == '') {
		                        querystring = '?hidden=' + htrns;
		                    } else {
		                        querystring += '&hidden=' + htrns;
		                    }
		                }
		                //		                if (translator) {
		                //		                    if (querystring.match('&') || querystring.match(',')) {
		                //		                        Arto.OpenTranslatorLanguagePopUp('', '', '', querystring + "&onsite=1");
		                //		                    }
		                //		                    else {
		                //		                        Arto.OpenTranslatorLanguagePopUp(id + "&onsite=1", '', '', '');
		                //		                    }
		                //		                } else {
		                if (querystring.match('&') || querystring.match(',')) {
		                    Arto.OpenUserLanguagePopUp('', querystring);
		                }
		                else {
		                    Arto.OpenUserLanguagePopUp(id);
		                }
		                //}
		                Event.stop(e);
		            } .bindAsEventListener(this, node.getAttribute('trns'), node.getAttribute('mtrns'), node.getAttribute('htrns')));
		            node.insert({ top: imageElm });
		        }
		        break;
			case 'IFRAME':
				try {
					activateTranslationMode(node.contentWindow.document.body);
				} catch (e) { }
				break;
		}
		if (node.childNodes.length > 0) {
			activateTranslationMode(node);
		}
	}
}


function arTrns(trns, mtrns, htrns, translator) {
    var querystring = '';
    if (trns) {
        querystring = '?visible=' + trns;
    }
    if (mtrns) {
        if (querystring == '') {
            querystring = '?multiple=' + mtrns;
        } else {
            querystring += '&multiple=' + mtrns;
        }
    }
    if (htrns) {
        if (querystring == '') {
            querystring = '?hidden=' + htrns;
        } else {
            querystring += '&hidden=' + htrns;
        }
    }
    if (translator) {
        alert('isTranslator: ' + querystring + '&onsite=1');
    } else {
        alert('!isTranslator: ' + querystring);
    }
   }

try {
} catch (e) {}
