
var country = "<a href=\"javascript:toggleLayer('selectcountry');\" title=\"Select Country\"><img class=\"flag\" src=\"http://images.linkcentre.com/flags/" + display_flag + ".gif\" alt=\"" + display_flag + "\" /> Change Country </li></ul><div id=\"selectcountry\"><ul><li><a href=\"javascript:checkCookie('');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/un.gif\" alt=\"ALL\" /> World Wide</a></li><li><a href=\"javascript:checkCookie('au');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/au.gif\" alt=\"AU\" /> Austrailia</a></li><li><a href=\"javascript:checkCookie('ca');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/ca.gif\" alt=\"CA\" /> Canada</a></li><li><a href=\"javascript:checkCookie('cn');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/cn.gif\" alt=\"CN\" /> China</a></li><li><a href=\"javascript:checkCookie('fr');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/fr.gif\" alt=\"FR\" /> France</a></li><li><a href=\"javascript:checkCookie('de');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/de.gif\" alt=\"DE\" /> Germany</a></li><li><a href=\"javascript:checkCookie('in');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/in.gif\" alt=\"IN\" /> India</a></li><li><a href=\"javascript:checkCookie('ie');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/ie.gif\" alt=\"IE\" /> Ireland</a></li><li><a href=\"javascript:checkCookie('nl');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/nl.gif\" alt=\"NL\" /> Netherlands</a></li><li><a href=\"javascript:checkCookie('it');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/it.gif\" alt=\"IT\" /> Italy</a></li><li><a href=\"javascript:checkCookie('pl');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/pl.gif\" alt=\"PL\" /> Poland</a></li><li><a href=\"javascript:checkCookie('es');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/es.gif\" alt=\"ES\" /> Spain</a></li><li><a href=\"javascript:checkCookie('se');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/se.gif\" alt=\"SE\" /> Sweden</a></li><li><a href=\"javascript:checkCookie('uk');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/uk.gif\" alt=\"UK\" /> United Kingdom</a></li><li><a href=\"javascript:checkCookie('us');\"> <img class=\"flag\" src=\"http://images.linkcentre.com/flags/us.gif\" alt=\"US\" /> United States</a></li><li style=\"text-align:right\"><form name=\"country\" onsubmit=\"country_two(this.form);\" method=\"post\" ><br /><span style=\"color:#fff;\">enter another county code</span><br /><input type=\"text\" name=\"f\" id=\"f\" size=\"2\" maxlength=\"2\"  /><input type=\"submit\" value=\"enter country\" /><br /><span style=\"color:#fff;\">e.g. NZ for New Zealand</span></li></ul></div></form>";

function country_two (form) {
	
var x = document.getElementById('f').value.replace(/[^a-zA-Z 0-9]+/g,'');
var q;

checkCookie(x);
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";domain=.linkcentre.com;path=/;expires="+exdate.toGMTString())
}

function checkCookie(value)
{
country=getCookie('LC')
if (country!=null && country!=""){
setCookie('LC',value,365)
}
else 
  {
  setCookie('LC',value,365)
  if (country!=null && country!="")
    {
    setCookie('LC',value,365)
    }
  }
  if (q) {
  	
  		window.location='./?q=' + q
  	
  	} else {
  
		window.location='./'
	}
}

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
} 

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}



document.write(country)
