if (typeof(jQuery) != 'undefined') {			function JGetText(key, param) {		if (typeof(i18n_strings) != 'undefined' && key) {            if (typeof(key) != 'string') {                key = key.toString();            }            // Create the actual key from the key parameter (uppercase, spaces substituted with underscores)            var realkey = key.toUpperCase().replace(/\s/g, '_');            if (i18n_strings.hasOwnProperty(realkey)) {                var text = i18n_strings[realkey];                // Substitute placeholders with param text                if (typeof(param) == 'object') {                    jQuery.each(param, function(i, p) {						var re = new RegExp('#' + (i + 1), 'g')                        text = text.replace(re, p);                    });                } else if (typeof(param) == 'string') {                	text = text.replace(/#1/g, param);                }                return text;            }            return key;		}		return '';	}		function setLinksAttributes() {		$('a').each(function() {			// Set title to inner text if not present			var t = $(this).attr('title');			if (!t) {				t = $(this).text();				if (t) {					t = t.replace(/\s{2,}/g, ' ');				}			}			// Set target attribute and modify title of external links			if ($(this).hasClass('external_txt') || $(this).hasClass('external_img')) {				$(this).attr('target', '_blank');				if (t) {					t += ' ';				} else {					t = '';				}				t += '[' + JGetText('Opens a new window') + ']';			}			// Modify title of links with accesskey			var k = $(this).attr('accesskey');			if (k) {				if (t) {					t += ' ';				} else {					t = '';				}				t += '[' + JGetText('Access Key') + ': ' + k.toUpperCase() + ']';			}			// Set the title			if (t) {				$(this).attr('title', t);			}		});	}		function checkEmailAddress(s) {		var re = /^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$/;		return re.test(s);	}		function addValidationToForms() {		$('form').each(function() {			$(this).bind('submit', function() {				if (this.required) {					var requiredFields = new Array();					// Get all required fields					requiredFields = this.required.value.split(',');					if (requiredFields.length > 0) {						for (var i = 0; i < requiredFields.length; i++) {							var field = this.elements[requiredFields[i]];							if (field && field.type == 'text') {								var valid = true;								var label = $('#lab_' + field.id);								// Check if empty								if (field.value == '') {									var message = JGetText('REQUIRED_FIELD_EMPTY_MESSAGE_LINE_1', [label.text(), $(this).attr('title')]) + '\n\n' + JGetText('REQUIRED_FIELD_EMPTY_MESSAGE_LINE_2');									alert(message);									valid = false;									// Check email address								} else if (field.className == 'email' && !checkEmailAddress(field.value)) {									var message = JGetText('INVALID_EMAIL_MESSAGE_LINE_1', [label.text(), $(this).attr('title')]) + '\n\n' + JGetText('INVALID_EMAIL_MESSAGE_LINE_2');									alert(message);									valid = false;								}								if (!valid) {									field.focus();									return false;								}							}						}					}				}				return true;			});		});	}		function addTranslationToQuotes() {		// Get the lang attribute of the html tag element		var doclang = $('html').attr('lang');		if (!doclang) {			// Get the Language meta tag			$('meta').each(function() {				if ($(this).attr('http-equiv') == 'Content-Language') {					doclang = $(this).attr('content');					return false;				}			});		}		$('q').each(function() {			if ($(this).hasClass('translate')) {				// Change class name				$(this).addClass('clickable');				// Set title				$(this).attr('title', JGetText('Click to translate this text'));				// Get the element's lang attribute				var lang = $(this).attr('lang');				if (!lang) {					lang = 'en';				}				// Get the element's text and build the URI				var text = $(this).html();				text = text.replace(/\s{2,}/g, ' ');				text = text.replace(/\n|\r|\t/g, '');				var uri = 'http://translate.google.com/?hl=' + doclang + '&layout=2#' + lang + '|' + doclang + '|' + encodeURIComponent(text);				// Create new anchor element				var anchor = document.createElement('a');				// Set anchor's attributes				$(anchor).attr('href', uri);				$(anchor).addClass('iframe');				// Insert anchor around the element's text				$(this).wrapInner(anchor);			}		});	}		/*function detectGecko19Mac() {		// Detect Mac OS		if (navigator.platform.indexOf("Mac") != -1) {			// Detect Gecko engine v1.9.x o superiore			if (navigator.product == "Gecko" && navigator.userAgent.match("rv:1\.9")) {				return true;			}		}		return false;	}*/		function activateDropDownLanguageMenu() {		var closetimer = null;		var faded = false;		var langitem = $('#langselect');		if (langitem) {			var langmenu = langitem.find('ul.ddmenu');			if (langmenu) {				langmenu.removeClass('ddmenu');				langmenu.css({'visibility' : 'hidden', 'opacity' : '1'});				langitem.bind('mouseover', function() {					if (closetimer) {						window.clearTimeout(closetimer);						closetimer = null;					}					langmenu.css({'visibility' : 'visible', 'opacity' : '0'});					if (!faded) {						langmenu.animate({'opacity' : '1'}, 150, 'linear');						faded = true;					} else {						langmenu.css('opacity', '1');					}				});				langitem.bind('mouseout', function() {					closetimer = window.setTimeout(function() {						langmenu.animate({'opacity' : '0'}, 150, 'linear', function () {							langmenu.css({'visibility' : 'hidden', 'opacity' : '1'});							faded = false;						});					}, 300);				});			}		}	}		$(document).ready(function() {		/*if (detectGecko19Mac()) {			$("#maincontainer").addClass('ff3mac');		}*/		setLinksAttributes();		addValidationToForms();		addTranslationToQuotes();		activateDropDownLanguageMenu();	});}