// From Prototype
Object.extend = function(destination, source) {
  for (var property in source)
	destination[property] = source[property];
  return destination;
};

$ = function(id) {
  return document.getElementById(id);
};

//initialize strings for localization
String.English  = String.English  || {};
String.French   = String.French   || {};
String.German   = String.German   || {};
String.Japanese = String.Japanese || {};

  document.Browser = {
	IE:     navigator.userAgent.indexOf('MSIE') > -1,
	Opera:  navigator.userAgent.indexOf('Opera') > -1,
	WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
	Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
	MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/),
	Safari:navigator.userAgent.indexOf('Safari') > -1,
	Firefox:navigator.userAgent.indexOf('Firefox') > -1
  };
  
  document.Platform = {
	isMac: !!(navigator.appVersion.match(/(Macintosh|Mac OS X)/)),
	isWin: !!(navigator.appVersion.match(/(Windows)/)),
	browser: (document.Browser.IE ? 'ie' : ((document.Browser.Opera) ? 'opera' : ((document.Browser.Safari) ? 'safari' : ((document.Browser.Firefox || document.Browser.Gecko) ? 'firefox' : '') ) ) )
  };

  function addBrowserNameToBody() {
	 if(document.Platform.browser.toLowerCase() == "ie"){
		 if(navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE') + 5,1) < 7)
			 document.location.href = "/internetexplorer";
	 }
  }