// Modified by Echizen
var target = new Array();
var targetURLs = new Array();
// Predefine your target country here
var targetCountry = ['All', 'UK', 'US', 'ID', 'ETC'];
// Define two multidimensional array,
// Useful for multiple target url for each predefined target country
for (i=0; i < targetCountry.length; i++)
target[targetCountry[i]] = new Array();
// Add your target url here, use 2 multidimensional array format
target['All'][0] = "http://default";
target['UK'][0] = "http://uk/";
target['US'][0] = "http://us/0";
target['US'][1] = "http://us/1";
target['US'][2] = "http://us/2";
target['ID'][0] = "http://id/";
// etc
var visitorCountryCode = geoip_country_code();
//var redirectURLs = target[visitorCountryCode];
// Randomize the target URL
var redirectCount = target[visitorCountryCode].length;
var randomnum = Math.floor(Math.random() * redirectCount);
var redirectURL = target[visitorCountryCode][randomnum];
// Process redirection
if( redirectURL == null ) redirectURL = target['All'][0];
if( redirectURL ) window.top.location.href = redirectURL;