{
    var google = "http://www.google.com/translate?hl=sv&ie=ISO-8859-1&langpair=sv|";
    var uri = encodeURIComponent("http://www.peabprocess.se" + location.pathname);

    // redirect on domain
    var hostname = location.hostname;
	 if (hostname.indexOf("translate") >= 0) {
        var params = "&" + location.search.substring(1);
		  var i = params.indexOf("&u=");
		  var j = params.indexOf("&", i+3);
		  if (j > i) {
			 uri = params.substring(i+3, j);
		  } else {
			 uri = params.substring(i+3);
		  }
	 } else if (hostname.indexOf("peabprocess.com") >= 0 || hostname.indexOf("askalon.com") >= 0) {
        location.replace(google + "en&u=" + uri);
    } else if (hostname.indexOf("peabprocess.dk") >= 0 || hostname.indexOf("askalon.dk") >= 0) {
        uri = encodeURIComponent(location.href);
//        location.replace(google + "da&u=" + uri);
    } else if (hostname.indexOf("peabprocess.fi") >= 0 || hostname.indexOf("askalon.fi") >= 0) {
        uri = encodeURIComponent(location.href);
//        location.replace(google + "fi&u=" + uri);
    } else if (hostname.indexOf("peabprocess.se") >= 0 || hostname.indexOf("askalon.se") >= 0) {
        uri = encodeURIComponent(location.href);
    }

    // write google flags
	 var imgStyle = "border:0px;height:30px;width:50px;margin:5px 5px;";
	 //document.write("<h4><span class='rubrik'>Automatic translations by Google:<br /></h4>");
	 document.write("<br/><img alt='Google Translate' style='border:0px;' src='http://www.google.com/intl/en/images/logos/translate_logo.gif' /><br/>");
	 /*
    document.write("<a title='danska' target='_top' href='http://www.peabprocess.dk" +
                "'><img style='" + imgStyle + "' src='/bilder/lang_dk.png' alt='danska' /></a>");
					 */
    document.write("<a title='Dansk' target='_top' href='" + google + "da&u=" + uri +
                "'><img style='" + imgStyle + "' src='/bilder/lang_da.png' alt='Dansk' /></a>");
    document.write("<a title='English' target='_top' href='" + google + "en&u=" + uri +
                "'><img style='" + imgStyle + "' src='/bilder/lang_en.png' alt='English' /></a>");
    document.write("<a title='Suomi' target='_top' href='" + google + "fi&u=" + uri +
                "'><img style='" + imgStyle + "' src='/bilder/lang_fi.png' alt='Suomi' /></a>");
    document.write("<a title='Svenska' target='_top' href='" + decodeURIComponent(uri) +
                "'><img style='" + imgStyle + "' src='/bilder/lang_sv.png' alt='Svenska' /></a>");
	 document.write("</span>");
};