if(document.location.href.indexOf("languageCode") >= 0) {


var xa = location.href

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

var lc = gup( 'languageCode' );
var lctext = "languageCode="
var lccomplete = lctext+lc

var newcode = "languageCode=EN"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/EN.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=DE"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/DE.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=ES"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/ES.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=FR"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/FR.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=IT"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/IT.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=CS"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/CS.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=CS"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/CN.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=JA"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/JA.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=KO"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/KO.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=PT"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/PT.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=EL"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/EL.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=RO"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/RO.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=RU"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/RU.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var newcode = "languageCode=NL"
str = xa.replace(lccomplete, newcode);
document.write("<a href=\"")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/NL.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")
}

else if(document.location.href.indexOf("BrowseByCountry") >= 0 || document.location.href.indexOf("HotelNameSearch") >= 0){

var c = location.href
var code = "?languageCode=EN"
var komplet = c+code

document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/EN.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=DE"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/DE.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=ES"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/ES.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=FR"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/FR.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=IT"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/IT.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=CS"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/CS.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=CN"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/CN.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=JA"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/JA.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=KO"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/KO.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=PT"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/PT.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=EL"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/EL.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=RO"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/RO.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=RU"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/RU.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

var code = "?languageCode=NL"
var komplet = c+code
document.write("<a href=\"")
document.write(komplet)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/NL.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

}

else {
var x = location.pathname

str = x.replace('/fr/',"/");
str = str.replace('/en/',"/");
str = str.replace('/ro/',"/");
str = str.replace('/de/',"/");
str = str.replace('/es/',"/");
str = str.replace('/it/',"/");
str = str.replace('/cs/',"/");
str = str.replace('/cn/',"/");
str = str.replace('/ja/',"/");
str = str.replace('/ko/',"/");
str = str.replace('/pt/',"/");
str = str.replace('/el/',"/");
str = str.replace('/ru/',"/");
str = str.replace('/nl/',"/");


document.write("<a href=\"http://hotel.myhotelcompare.com")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/EN.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("de")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/DE.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("es")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/ES.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("fr")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/FR.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("it")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/IT.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("cs")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/CS.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("cn")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/CN.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("ja")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/JA.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("ko")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/KO.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("pt")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/PT.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("el")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/EL.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("ro")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/RO.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("ru")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/RU.gif\" border=\"0\">")
document.write("</a>")
document.write(" ")

document.write("<a href=\"http://hotel.myhotelcompare.com/")
document.write("nl")
document.write(str)
document.write("\">")
document.write("<img src=\"http://www.myhotelcompare.com/flags/NL.gif\" border=\"0\">")
document.write("</a>")

}