﻿//trackin
  var wmx_string, wmx_thisURL, wmx_title, strCountry, strPage;  
  wmx_string  = document.referrer; 
  wmx_thisURL = document.URL; 
  
  strCountry = document.URL.substring(document.URL.indexOf("http://")+7, document.URL.length -1);
  strCountry = strCountry.substr(0, strCountry.indexOf("."));
  strCountry = strCountry.toUpperCase();
  
  strPage = document.URL.substring(document.URL.lastIndexOf("/", document.URL.length) +1, document.URL.length - 1);
  strPage = strPage.substr(0, strPage.indexOf("."));
  strPage = strPage.toUpperCase();
  wmx_title   = strCountry + "_" + strPage;
  if(wmx_title == "")
  {
      wmx_title = wmx_thisURL;
      var nIndex = wmx_title.indexOf("?");
      if(nIndex != -1)
      {
          wmx_title = wmx_title.substring(0, nIndex);
      }
      nIndex = wmx_title.indexOf("#");
      if(nIndex != -1)
      {
          wmx_title = wmx_title.substring(0, nIndex);
      }
      nIndex = wmx_title.lastIndexOf("/");
      if(nIndex != -1)
      {
          var nLen  = wmx_title.length;
          wmx_title = wmx_title.substring(nIndex+1, nLen);
      }
  }  
  if (navigator.userAgent.indexOf("IE")> -1)  
  {
      document.write("<div style='display:none'>");  
      document.write("<img height=1 width=1 border=0 SRC='http://track.asus.com/web_serviceU/counter/counter.aspx?client="+wmx_client_id+"&campaign="+wmx_campaign_id+"&url="+escape(wmx_string)+"&pname="+escape(wmx_title)+"&this_url="+escape(wmx_thisURL)+"'> </div>"); 
  } 
  else
  {
      document.write("<layer visibility=hide>");  
      document.write("<img height=1 width=1 border=0 SRC='http://track.asus.com/web_serviceU/counter/counter.aspx?client="+wmx_client_id+"&campaign="+wmx_campaign_id+"&url="+escape(wmx_string)+"&pname="+escape(wmx_title)+"&this_url="+escape(wmx_thisURL)+"'> </layer>");  
  }
  
  
  /* 2008年改版後將2007年的換掉
  if(document.body.clientWidth-786>0)
{
	document.write('<DIV id=Layer1 style="Z-INDEX: 1; LEFT: 7px; WIDTH: 164px; POSITION: absolute; TOP: 92px; left:' + parseInt((document.body.clientWidth - 786)/2+4) + 'px">');
}
else
{
	document.write('<DIV id=Layer1 style="Z-INDEX: 1; LEFT: 7px; WIDTH: 150px; POSITION: absolute; TOP: 96px; left:4px">');
}
//document.write('<DIV id=Layer1 style="Z-INDEX: 1; LEFT: 7px; WIDTH: 2px; POSITION: absolute; TOP: 92px; HEIGHT: 25px">')

document.write('<select name="country" onChange="location=this.options[this.selectedIndex].value" class="sel_box">');
//document.write(' <option value="#" selected>Region/Country</option>');
if(strCountry == "WWW")
    document.write('<option value="http://www.worldgamemaster.org" selected>Global</option>');
else 
    document.write(' <option value="http://www.worldgamemaster.org" >Global</option>');

if(strCountry == "AU")
    document.write(' <option value="http://au.worldgamemaster.org" selected>Australia</option>');
else 
    document.write(' <option value="http://au.worldgamemaster.org" >Australia</option>');
   
if(strCountry == "NORDIC") 
    document.write(' <option value="http://nordic.worldgamemaster.org" selected>Nordic</option>');
else
    document.write(' <option value="http://nordic.worldgamemaster.org" >Nordic</option>'); 

if(strCountry == "PT") 
    document.write(' <option value="http://pt.worldgamemaster.org" selected>Portugal</option>');
else
    document.write(' <option value="http://pt.worldgamemaster.org" >Portugal</option>');
   
if(strCountry == "TR")  
    document.write(' <option value="http://tr.worldgamemaster.org" selected>Turkey</option>');
else
    document.write(' <option value="http://tr.worldgamemaster.org" >Turkey</option>');
   
if(strCountry == "TW")  
    document.write(' <option value="http://tw.worldgamemaster.org" selected>Taiwan</option>');
else 
    document.write(' <option value="http://tw.worldgamemaster.org" >Taiwan</option>');

if(strCountry == "UK")     
    document.write(' <option value="http://uk.worldgamemaster.org" selected>United Kingdom</option>');
else
    document.write(' <option value="http://uk.worldgamemaster.org" >United Kingdom</option>'); 
    
document.write('</select>');
document.write('</DIV>');
*/

var objSelect = document.getElementById("SelArea");
var i = 0;
//objSelect = "<select name=\"country\" onChange=\"location=this.options[this.selectedIndex].value\" class=\"sel_box\">";
objSelect.onChange = "location=this.options[this.selectedIndex].value";

objSelect.add(new Option("Global", "http://www.worldgamemaster.org"));
if(strCountry == "WWW")
    objSelect.options[i].selected = true;
else
    objSelect.options[i].selected = false;
i++;

objSelect.add(new Option("Indonesia", "http://id.worldgamemaster.org"));
if(strCountry == "ID")
    objSelect.options[i].selected = true;
else 
    objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Middle East", "http://ae.worldgamemaster.org"));
if(strCountry == "AE")
    objSelect.options[i].selected = true;
else 
    objSelect.options[i].selected = false;
i++;


objSelect.add(new Option("Australia", "http://au.worldgamemaster.org"));
if(strCountry == "AU")
    objSelect.options[i].selected = true;
else 
    objSelect.options[i].selected = false;
i++; 


objSelect.add(new Option("Czech Republic", "http://www.asusweb.cz/wgt/"));
if(strCountry == "CZ")
    objSelect.options[i].selected = true;
else 
    objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Nordic", "http://www.dreamhack.se"));
if(strCountry == "NORDIC") 
    objSelect.options[i].selected = true;
else
    objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Philippines", "http://ph.worldgamemaster.org"));
if(strCountry == "PH") 
     objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Portugal", "http://pt.worldgamemaster.org"));
if(strCountry == "PT") 
     objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Romania", "http://ro.worldgamemaster.org"));
if(strCountry == "RO") 
     objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 
/*
objSelect.add(new Option("Turkey", "http://tr.worldgamemaster.org"));
if(strCountry == "TR")  
    objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 
*/   

objSelect.add(new Option("Singapore", "http://sg.worldgamemaster.org"));
if(strCountry == "SG")  
    objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Taiwan", "http://tw.worldgamemaster.org"));
if(strCountry == "TW")  
    objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 

objSelect.add(new Option("Thailand", "http://th.worldgamemaster.org"));
if(strCountry == "TH")  
    objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 
/*
objSelect.add(new Option("United Kingdom", "http://uk.worldgamemaster.org"));
if(strCountry == "UK")     
    objSelect.options[i].selected = true;
else
     objSelect.options[i].selected = false;
i++; 
*/
