// Javascript for tracking page hits
// Author: Nirav Patel
// Company: EMI Music UK & Ireland
// Date: 2007-05-25
// Version: 1.0
// Updated by: Marc George
// Updated: 2008-06-30
// Version: 1.03
// Copyright:  2007 (c) EMI Music UK & Ireland        
//<!--

  var debug = 0;
  var trackingerrors = 0;
  var trackingerrormessages = "No Error Messages";
  
  var globalaccountid = "2790423";
  
  var region_array = new Array();
  region_array[0] = "UKI";
  region_array[1] = "NA";
  region_array[2] = "INT";
  region_array[3] = "OTH";
  
  /*
    //NP 2007-11-07 - removed due to new region structure
  //SEA/ LAT/ EUR, 
  region_array[2] = "LAT";
  region_array[3] = "EUR";
  region_array[4] = "SEA";
  */
  // Label group name for each label
  var labelgroup_array = new Array();  
  labelgroup_array["EMI Records UK"] = "EMI";
  labelgroup_array["Heavenly"] = "EMI";
  labelgroup_array["Parlophone UK"] = "EMI";
  labelgroup_array["Apple Corps/Apple Records UK"] = "EMI";
  labelgroup_array["Regal UK"] = "EMI";
  labelgroup_array["Angel Music Group UK"] = "EMI";
  labelgroup_array["EMI Classics UK"] = "EMI";
  labelgroup_array["Charisma Records"] = "EMI";
  labelgroup_array["Abbey Road"] = "EMI";  
  
  labelgroup_array["EMI Classics"] = "EMI Classics Global";
  labelgroup_array["Virgin Classics"] = "EMI Classics Global";
  labelgroup_array["Relentless UK"] = "EMI";
  labelgroup_array["Virgin Records UK"] = "EMI";
  labelgroup_array["Mute UK"] = "EMI";

/* RM 2007-12-04 - Added EMI Corp; & EMI Cat Mktg for EMI Catalogue & Positiva */
  labelgroup_array["EMI Corporate"] = "EMI Corporate";
  labelgroup_array["EMI Catalogue UK"] = "EMI Cat Marketing";
  labelgroup_array["EMI TV"] = "EMI";
  labelgroup_array["Positiva UK"] = "EMI Cat Marketing";

/* RM 2007-12-06 - Added Capitol MG*/
  labelgroup_array["Capitol Records"] = "Capitol Music Group";
  labelgroup_array["Virgin Records"] = "Capitol Music Group";
  labelgroup_array["Imperial Records"] = "Capitol Music Group";
  labelgroup_array["Priority Records"] = "Capitol Music Group";

/* RM 2008-01-10 - Added CMG; EMI Canada; Blue Note Label Group & EMI Latin*/

  labelgroup_array["Credential Recordings"] = "EMI CMG";
  labelgroup_array["EMI Gospel"] = "EMI CMG";
  labelgroup_array["ForeFront Records"] = "EMI CMG";
  labelgroup_array["Worship Together"] = "EMI CMG";
  labelgroup_array["RETHINK Records"] = "EMI CMG";
  labelgroup_array["EMI CMG"] = "EMI CMG";
  labelgroup_array["BEC Records"] = "EMI CMG";
  labelgroup_array["Gotee Records"] = "EMI CMG";
  labelgroup_array["Tooth n Nail Records"] = "EMI CMG";
  labelgroup_array["Sparrow Records"] = "EMI CMG";
  labelgroup_array["EMI Argentina"] = "EMI Latin";
  labelgroup_array["EMI Chile"] = "EMI Latin";
  labelgroup_array["EMI Colombia"] = "EMI Latin";
  labelgroup_array["EMI Mexico"] = "EMI Latin";
  labelgroup_array["EMI Spain"] = "EMI Latin";
  labelgroup_array["EMI Televisa"] = "EMI Latin";
  labelgroup_array["Latin INT"] = "EMI Latin";
  labelgroup_array["Televisa EMI"] = "EMI Latin";
  labelgroup_array["EMI Canada"] = "EMI Canada";
  labelgroup_array["Canada Commercial"] = "EMI Canada";
  labelgroup_array["Canada Corporate"] = "EMI Canada";
  labelgroup_array["Blue Note Label Group"] = "Blue Note Label Group";
  labelgroup_array["Blue Note Records"] = "Blue Note Label Group";
  labelgroup_array["Manhattan Records"] = "Blue Note Label Group";
  labelgroup_array["Angel Records"] = "Blue Note Label Group";
  labelgroup_array["Narada Records"] = "Blue Note Label Group";
  labelgroup_array["Back Porch Records"] = "Blue Note Label Group";
  labelgroup_array["Higher Octave Records"] = "Blue Note Label Group";
  
  //25.March.2008 Added EMI Belgium - Marc George
  labelgroup_array["EMI Belgium"] = "EMI Belgium";
  
  //08.May.2008 Added Cap Nashville - MG
  labelgroup_array["Cap Nashville"] = "Cap Nashville";
  
  //15.May.2008 Added EMI France labels - MG
  labelgroup_array["Classique Jazz FR"] = "EMI France";
  labelgroup_array["Delabel Hostile FR"] = "EMI France";
  labelgroup_array["Junior Reset FR"] = "EMI France";
  labelgroup_array["Digital FR"] = "EMI France";
  labelgroup_array["Source FR"] = "EMI France";

  //03.June.2008 Added Capitol Studios - MG
  labelgroup_array["Capitol Studios"] = "EMI";
  
  //18 July 2008 Added Classics UK
  labelgroup_array["Classics UK"] = "EMI Classics Global";
  
  //12.Sep.2008 Added EMI Catalogue NA - MG   
  labelgroup_array["EMI Catalogue NA"] = "EMI Cat Marketing";
    
  // Label name from each tag id
  var label_array = new Array(); 

  label_array["abbey road"] = "Abbey Road";
  label_array["emi records"] = "EMI Records UK";
  label_array["emi records heavenly"] = "Heavenly";
  label_array["parlophone"] = "Parlophone UK";
  label_array["parlophone apple"] = "Apple Corps/Apple Records UK";
  label_array["parlophone regal"] = "Regal UK";
  label_array["angel"] = "Angel Music Group UK";
  label_array["angel charisma"] = "Charisma Records";

  label_array["emi classics"] = "EMI Classics";
  label_array["virgin classics"] = "Virgin Classics";
  label_array["relentless"] = "Relentless UK";
  label_array["virgin uk"] = "Virgin Records UK";
  label_array["mute"] = "Mute UK";

/* RM 2007-12-04 - Added EMI Corp; & EMI Cat Mktg for EMI Catalogue & Positiva */
// MG 2008-06-30 - Added EMI TV  (for Now Music)
  label_array["emi corp"] = "EMI Corporate";
  label_array["emi catalogue"] = "EMI Catalogue UK";
  label_array["emi tv"] = "EMI TV";
  label_array["positiva"] = "Positiva UK";

/* RM 2007-12-06 - Added Capitol MG */
  label_array["capitol records"] = "Capitol Records";
  label_array["virgin records"] = "Virgin Records";
  label_array["imperial records"] = "Imperial Records";
  label_array["priority records"] = "Priority Records";

/* RM 2008-01-10 - Added CMG; EMI Canada; Blue Note Label Group & EMI Latin*/

  label_array["credential recordings"] = "Credential Recordings";
  label_array["emi gospel"] = "EMI Gospel";
  label_array["forefront records"] = "ForeFront Records";
  label_array["worship together"] = "Worship Together";
  label_array["rethink records"] = "RETHINK Records";
  label_array["emi cmg"] = "EMI CMG";
  label_array["bec recordings"] = "BEC Records";
  label_array["gotee records"] = "Gotee Records";
  label_array["tooth n nail records"] = "Tooth n Nail Records";
  label_array["sparrow records"] = "Sparrow Records";
  label_array["emi argentina"] = "EMI Argentina";
  label_array["emi chile"] = "EMI Chile";
  label_array["emi colombia"] = "EMI Colombia";
  label_array["emi mexico"] = "EMI Mexico";
  label_array["emi spain"] = "EMI Spain";
  label_array["emi televisa"] = "EMI Televisa";
  label_array["latin int"] = "Latin INT";
  label_array["televisa emi"] = "Televisa EMI";
  label_array["emi canada"] = "EMI Canada";
  label_array["canada commercial"] = "Canada Commercial";
  label_array["canada corporate"] = "Canada Corporate";

  label_array["blue note label group"] = "Blue Note Label Group";
  label_array["blue note records"] = "Blue Note Records";
  label_array["manhattan records"] = "Manhattan Records";
  label_array["angel records"] = "Angel Records";
  label_array["narada records"] = "Narada Records";
  label_array["back porch records"] = "Back Porch Records";
  label_array["higher octave records"] = "Higher Octave Records";
  
  label_array["emisuperstore"] = "EMI Records UK";  
  
  //25.March.2008 Added EMI Belgium - Marc George
  label_array["emi belgium"] = "EMI Belgium";  
  
  //08.May.2008 Added Cap Nashville - MG
  label_array["capnash"] = "Cap Nashville";
  
  //15.May.2008 Added Classique Jazz, Delabel Hostile, Junior Reset, Digital, Source a part of EMI France labelgroup - MG
  label_array["classique jazz fr"] = "Classique Jazz FR";
  label_array["delabel hostile fr"] = "Delabel Hostile FR"; 
  label_array["junior reset fr"] = "Junior Reset FR"; 
  label_array["digital fr"] = "Digital FR"; 
  label_array["source fr"] = "Source FR"; 
  
  //03.June.2008 Added Capitol Studios under Abbey Road labelgroup
  label_array["capitol studios"] = "Capitol Studios";
  
  //18 July 2008 Added Classics UK label resolving to EMI Classics Global labelgroup - MG
  label_array["classics uk"] = "Classics UK";
  
  //12.Sep.2008 Added EMI Catalogue NA - MG  
  label_array["emi catalogue na"] = "EMI Catalogue NA";

  // UA ID's for each label level google Analyitics account
  var UAID_array = new Array();
  UAID_array["emi records"] = "UA-2049798-1";
  UAID_array["emi records heavenly"] = "UA-2049798-1";
  UAID_array["parlophone"] = "UA-2034888-1";
  UAID_array["parlophone apple"] = "UA-2034888-1";
  UAID_array["parlophone regal"] = "UA-2034888-1";
  UAID_array["angel"] = "UA-2049791-1";
  UAID_array["angel classics uk"] = "UA-2049791-1";
  UAID_array["angel charisma"] = "UA-2049791-1";
  UAID_array["abbey road"] = "UA-3540764-1";
  
  UAID_array["emi classics"] = "UA-3008373-1";
  UAID_array["virgin classics"] = "UA-3008373-1";
  UAID_array["classics uk"] = "UA-3008373-1";
  UAID_array["relentless"] = "UA-2049814-1";
  UAID_array["virgin uk"] = "UA-2050642-1";
  UAID_array["mute"] = "UA-2050605-1";

/* RM 2007-12-04 - Added EMI Corp; & EMI Cat Mktg for EMI Catalogue & Positiva */
// MG 2008-06-30 - Added EMI TV (for Now Music)
  UAID_array["emi corp"] = "UA-3112855-1";
  UAID_array["emi catalogue"] = "UA-2050630-1";
  UAID_array["emi tv"] = "UA-2095459-1";
  UAID_array["positiva"] = "UA-2050630-1";

/* RM 2007-12-06 - Added Capitol MG labels*/
  UAID_array["capitol records"] = "UA-3167266-1";
  UAID_array["virgin records"] = "UA-3167266-1";
  UAID_array["imperial records"] = "UA-3167266-1";
  UAID_array["priority records"] = "UA-3167266-1";

/* RM 2008-01-10 - Added CMG; EMI Canada; Blue Note Label Group & EMI Latin*/

  UAID_array["credential recordings"] = "UA-3168104-1";
  UAID_array["emi gospel"] = "UA-3168104-1";
  UAID_array["forefront records"] = "UA-3168104-1";
  UAID_array["worship together"] = "UA-3168104-1";
  UAID_array["rethink records"] = "UA-3168104-1";
  UAID_array["emi cmg"] = "UA-3168104-1";
  UAID_array["bec recordings"] = "UA-3168104-1";
  UAID_array["gotee records"] = "UA-3168104-1";
  UAID_array["tooth n nail records"] = "UA-3168104-1";
  UAID_array["sparrow records"] = "UA-3168104-1";
  UAID_array["emi argentina"] = "UA-1151073-1";
  UAID_array["emi chile"] = "UA-1151073-1";
  UAID_array["emi colombia"] = "UA-1151073-1";
  UAID_array["emi mexico"] = "UA-1151073-1";
  UAID_array["emi spain"] = "UA-1151073-1";
  UAID_array["emi televisa"] = "UA-1151073-1";
  UAID_array["latin int"] = "UA-1151073-1";
  UAID_array["televisa emi"] = "UA-1151073-1";
  UAID_array["emi canada"] = "UA-3225979-1";
  UAID_array["canada commercial"] = "UA-3225979-1";
  UAID_array["canada corporate"] = "UA-3225979-1";
 
  UAID_array["blue note label group"] = "UA-3374247-1";
  UAID_array["blue note records"] = "UA-3374247-1";
  UAID_array["manhattan records"] = "UA-3374247-1";
  UAID_array["angel records"] = "UA-3374247-1";
  UAID_array["narada records"] = "UA-3374247-1";
  UAID_array["back porch records"] = "UA-3374247-1";
  UAID_array["higher octave records"] = "UA-3374247-1";
  
//25.March.2008 Added EMI Belgium - Marc George
  UAID_array["emi belgium"] = "UA-3964383-1";
  
//08.May.2008 Added Cap Nashville - MG
  UAID_array["capnash"] = "UA-4360143-1";
  
//15.May.2008 Added EMI France labels classique jazz, delabel hostile, junior reset, digital, source
  UAID_array["classique jazz fr"] = "UA-4425501-1";
  UAID_array["delabel hostile fr"] = "UA-4425501-1"; 
  UAID_array["junior reset fr"] = "UA-4425501-1"; 
  UAID_array["digital fr"] = "UA-4425501-1"; 
  UAID_array["source fr"] = "UA-4425501-1";

//03.June.2008 Added Capitol Studios UAID targetting the Abbey Road A/C - MG
  UAID_array["capitol studios"] = "UA-3540764-1";
  
//18.July.2008 Added Classics UK - MG
  UAID_array["classics uk"] = "UA-3008373-1"; 
  
//12.Sep.2008 Added EMI Catalogue NA - MG
  UAID_array["emi catalogue na"] = "UA-5594679-1";
    
  var isocountry_array = new Array();
  isocountry_array[0] = "AX"; /* AALAND ISLANDS */
  isocountry_array[1] = "AF"; /* AFGHANISTAN */
  isocountry_array[2] = "AL"; /* ALBANIA */
  isocountry_array[3] = "DZ"; /* ALGERIA */
  isocountry_array[4] = "AS"; /* AMERICAN SAMOA */
  isocountry_array[5] = "AD"; /* ANDORRA */
  isocountry_array[6] = "AO"; /* ANGOLA */
  isocountry_array[7] = "AI"; /* ANGUILLA */
  isocountry_array[8] = "AQ"; /* ANTARCTICA */
  isocountry_array[9] = "AG"; /* ANTIGUA AND BARBUDA */
  isocountry_array[10] = "AR"; /* ARGENTINA */
  isocountry_array[11] = "AM"; /* ARMENIA */
  isocountry_array[12] = "AW"; /* ARUBA */
  isocountry_array[13] = "AU"; /* AUSTRALIA */
  isocountry_array[14] = "AT"; /* AUSTRIA */
  isocountry_array[15] = "AZ"; /* AZERBAIJAN */
  isocountry_array[16] = "BS"; /* BAHAMAS */
  isocountry_array[17] = "BH"; /* BAHRAIN */
  isocountry_array[18] = "BD"; /* BANGLADESH */
  isocountry_array[19] = "BB"; /* BARBADOS */
  isocountry_array[20] = "BY"; /* BELARUS */
  isocountry_array[21] = "BE"; /* BELGIUM */
  isocountry_array[22] = "BZ"; /* BELIZE */
  isocountry_array[23] = "BJ"; /* BENIN */
  isocountry_array[24] = "BM"; /* BERMUDA */
  isocountry_array[25] = "BT"; /* BHUTAN */
  isocountry_array[26] = "BO"; /* BOLIVIA */
  isocountry_array[27] = "BA"; /* BOSNIA AND HERZEGOWINA */
  isocountry_array[28] = "BW"; /* BOTSWANA */
  isocountry_array[29] = "BV"; /* BOUVET ISLAND */
  isocountry_array[30] = "BR"; /* BRAZIL */
  isocountry_array[31] = "IO"; /* BRITISH INDIAN OCEAN TERRITORY */
  isocountry_array[32] = "BN"; /* BRUNEI DARUSSALAM */
  isocountry_array[33] = "BG"; /* BULGARIA */
  isocountry_array[34] = "BF"; /* BURKINA FASO */
  isocountry_array[35] = "BI"; /* BURUNDI */
  isocountry_array[36] = "KH"; /* CAMBODIA */
  isocountry_array[37] = "CM"; /* CAMEROON */
  isocountry_array[38] = "CA"; /* CANADA */
  isocountry_array[39] = "CV"; /* CAPE VERDE */
  isocountry_array[40] = "KY"; /* CAYMAN ISLANDS */
  isocountry_array[41] = "CF"; /* CENTRAL AFRICAN REPUBLIC */
  isocountry_array[42] = "TD"; /* CHAD */
  isocountry_array[43] = "CL"; /* CHILE */
  isocountry_array[44] = "CN"; /* CHINA */
  isocountry_array[45] = "CX"; /* CHRISTMAS ISLAND */
  isocountry_array[46] = "CC"; /* COCOS (KEELING) ISLANDS */
  isocountry_array[47] = "CO"; /* COLOMBIA */
  isocountry_array[48] = "KM"; /* COMOROS */
  isocountry_array[49] = "CD"; /* CONGO, Democratic Republic of (was Zaire) */
  isocountry_array[50] = "CG"; /* CONGO, Republic of */
  isocountry_array[51] = "CK"; /* COOK ISLANDS */
  isocountry_array[52] = "CR"; /* COSTA RICA */
  isocountry_array[53] = "CI"; /* COTE D'IVOIRE */
  isocountry_array[54] = "HR"; /* CROATIA (local name: Hrvatska) */
  isocountry_array[55] = "CU"; /* CUBA */
  isocountry_array[56] = "CY"; /* CYPRUS */
  isocountry_array[57] = "CZ"; /* CZECH REPUBLIC */
  isocountry_array[58] = "DK"; /* DENMARK */
  isocountry_array[59] = "DJ"; /* DJIBOUTI */
  isocountry_array[60] = "DM"; /* DOMINICA */
  isocountry_array[61] = "DO"; /* DOMINICAN REPUBLIC */
  isocountry_array[62] = "EC"; /* ECUADOR */
  isocountry_array[63] = "EG"; /* EGYPT */
  isocountry_array[64] = "SV"; /* EL SALVADOR */
  isocountry_array[65] = "GQ"; /* EQUATORIAL GUINEA */
  isocountry_array[66] = "ER"; /* ERITREA */
  isocountry_array[67] = "EE"; /* ESTONIA */
  isocountry_array[68] = "ET"; /* ETHIOPIA */
  isocountry_array[69] = "FK"; /* FALKLAND ISLANDS (MALVINAS) */
  isocountry_array[70] = "FO"; /* FAROE ISLANDS */
  isocountry_array[71] = "FJ"; /* FIJI */
  isocountry_array[72] = "FI"; /* FINLAND */
  isocountry_array[73] = "FR"; /* FRANCE */
  isocountry_array[74] = "GF"; /* FRENCH GUIANA */
  isocountry_array[75] = "PF"; /* FRENCH POLYNESIA */
  isocountry_array[76] = "TF"; /* FRENCH SOUTHERN TERRITORIES */
  isocountry_array[77] = "GA"; /* GABON */
  isocountry_array[78] = "GM"; /* GAMBIA */
  isocountry_array[79] = "GE"; /* GEORGIA */
  isocountry_array[80] = "DE"; /* GERMANY */
  isocountry_array[81] = "GH"; /* GHANA */
  isocountry_array[82] = "GI"; /* GIBRALTAR */
  isocountry_array[83] = "GR"; /* GREECE */
  isocountry_array[84] = "GL"; /* GREENLAND */
  isocountry_array[85] = "GD"; /* GRENADA */
  isocountry_array[86] = "GP"; /* GUADELOUPE */
  isocountry_array[87] = "GU"; /* GUAM */
  isocountry_array[88] = "GT"; /* GUATEMALA */
  isocountry_array[89] = "GN"; /* GUINEA */
  isocountry_array[90] = "GW"; /* GUINEA-BISSAU */
  isocountry_array[91] = "GY"; /* GUYANA */
  isocountry_array[92] = "HT"; /* HAITI */
  isocountry_array[93] = "HM"; /* HEARD AND MC DONALD ISLANDS */
  isocountry_array[94] = "HN"; /* HONDURAS */
  isocountry_array[95] = "HK"; /* HONG KONG */
  isocountry_array[96] = "HU"; /* HUNGARY */
  isocountry_array[97] = "IS"; /* ICELAND */
  isocountry_array[98] = "IN"; /* INDIA */
  isocountry_array[99] = "ID"; /* INDONESIA */
  isocountry_array[100] = "IR"; /* IRAN (ISLAMIC REPUBLIC OF) */
  isocountry_array[101] = "IQ"; /* IRAQ */
  isocountry_array[102] = "IE"; /* IRELAND */
  isocountry_array[103] = "IL"; /* ISRAEL */
  isocountry_array[104] = "IT"; /* ITALY */
  isocountry_array[105] = "JM"; /* JAMAICA */
  isocountry_array[106] = "JP"; /* JAPAN */
  isocountry_array[107] = "JO"; /* JORDAN */
  isocountry_array[108] = "KZ"; /* KAZAKHSTAN */
  isocountry_array[109] = "KE"; /* KENYA */
  isocountry_array[110] = "KI"; /* KIRIBATI */
  isocountry_array[111] = "KP"; /* KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF */
  isocountry_array[112] = "KR"; /* KOREA, REPUBLIC OF */
  isocountry_array[113] = "KW"; /* KUWAIT */
  isocountry_array[114] = "KG"; /* KYRGYZSTAN */
  isocountry_array[115] = "LA"; /* LAO PEOPLE'S DEMOCRATIC REPUBLIC */
  isocountry_array[116] = "LV"; /* LATVIA */
  isocountry_array[117] = "LB"; /* LEBANON */
  isocountry_array[118] = "LS"; /* LESOTHO */
  isocountry_array[119] = "LR"; /* LIBERIA */
  isocountry_array[120] = "LY"; /* LIBYAN ARAB JAMAHIRIYA */
  isocountry_array[121] = "LI"; /* LIECHTENSTEIN */
  isocountry_array[122] = "LT"; /* LITHUANIA */
  isocountry_array[123] = "LU"; /* LUXEMBOURG */
  isocountry_array[124] = "MO"; /* MACAU */
  isocountry_array[125] = "MK"; /* MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF */
  isocountry_array[126] = "MG"; /* MADAGASCAR */
  isocountry_array[127] = "MW"; /* MALAWI */
  isocountry_array[128] = "MY"; /* MALAYSIA */
  isocountry_array[129] = "MV"; /* MALDIVES */
  isocountry_array[130] = "ML"; /* MALI */
  isocountry_array[131] = "MT"; /* MALTA */
  isocountry_array[132] = "MH"; /* MARSHALL ISLANDS */
  isocountry_array[133] = "MQ"; /* MARTINIQUE */
  isocountry_array[134] = "MR"; /* MAURITANIA */
  isocountry_array[135] = "MU"; /* MAURITIUS */
  isocountry_array[136] = "YT"; /* MAYOTTE */
  isocountry_array[137] = "MX"; /* MEXICO */
  isocountry_array[138] = "FM"; /* MICRONESIA, FEDERATED STATES OF */
  isocountry_array[139] = "MD"; /* MOLDOVA, REPUBLIC OF */
  isocountry_array[140] = "MC"; /* MONACO */
  isocountry_array[141] = "MN"; /* MONGOLIA */
  isocountry_array[142] = "MS"; /* MONTSERRAT */
  isocountry_array[143] = "MA"; /* MOROCCO */
  isocountry_array[144] = "MZ"; /* MOZAMBIQUE */
  isocountry_array[145] = "MM"; /* MYANMAR */
  isocountry_array[146] = "NA"; /* NAMIBIA */
  isocountry_array[147] = "NR"; /* NAURU */
  isocountry_array[148] = "NP"; /* NEPAL */
  isocountry_array[149] = "NL"; /* NETHERLANDS */
  isocountry_array[150] = "AN"; /* NETHERLANDS ANTILLES */
  isocountry_array[151] = "NC"; /* NEW CALEDONIA */
  isocountry_array[152] = "NZ"; /* NEW ZEALAND */
  isocountry_array[153] = "NI"; /* NICARAGUA */
  isocountry_array[154] = "NE"; /* NIGER */
  isocountry_array[155] = "NG"; /* NIGERIA */
  isocountry_array[156] = "NU"; /* NIUE */
  isocountry_array[157] = "NF"; /* NORFOLK ISLAND */
  isocountry_array[158] = "MP"; /* NORTHERN MARIANA ISLANDS */
  isocountry_array[159] = "NO"; /* NORWAY */
  isocountry_array[160] = "OM"; /* OMAN */
  isocountry_array[161] = "PK"; /* PAKISTAN */
  isocountry_array[162] = "PW"; /* PALAU */
  isocountry_array[163] = "PS"; /* PALESTINIAN TERRITORY, Occupied */
  isocountry_array[164] = "PA"; /* PANAMA */
  isocountry_array[165] = "PG"; /* PAPUA NEW GUINEA */
  isocountry_array[166] = "PY"; /* PARAGUAY */
  isocountry_array[167] = "PE"; /* PERU */
  isocountry_array[168] = "PH"; /* PHILIPPINES */
  isocountry_array[169] = "PN"; /* PITCAIRN */
  isocountry_array[170] = "PL"; /* POLAND */
  isocountry_array[171] = "PT"; /* PORTUGAL */
  isocountry_array[172] = "PR"; /* PUERTO RICO */
  isocountry_array[173] = "QA"; /* QATAR */
  isocountry_array[174] = "RE"; /* REUNION */
  isocountry_array[175] = "RO"; /* ROMANIA */
  isocountry_array[176] = "RU"; /* RUSSIAN FEDERATION */
  isocountry_array[177] = "RW"; /* RWANDA */
  isocountry_array[178] = "SH"; /* SAINT HELENA */
  isocountry_array[179] = "KN"; /* SAINT KITTS AND NEVIS */
  isocountry_array[180] = "LC"; /* SAINT LUCIA */
  isocountry_array[181] = "PM"; /* SAINT PIERRE AND MIQUELON */
  isocountry_array[182] = "VC"; /* SAINT VINCENT AND THE GRENADINES */
  isocountry_array[183] = "WS"; /* SAMOA */
  isocountry_array[184] = "SM"; /* SAN MARINO */
  isocountry_array[185] = "ST"; /* SAO TOME AND PRINCIPE */
  isocountry_array[186] = "SA"; /* SAUDI ARABIA */
  isocountry_array[187] = "SN"; /* SENEGAL */
  isocountry_array[188] = "CS"; /* SERBIA AND MONTENEGRO */
  isocountry_array[189] = "SC"; /* SEYCHELLES */
  isocountry_array[190] = "SL"; /* SIERRA LEONE */
  isocountry_array[191] = "SG"; /* SINGAPORE */
  isocountry_array[192] = "SK"; /* SLOVAKIA */
  isocountry_array[193] = "SI"; /* SLOVENIA */
  isocountry_array[194] = "SB"; /* SOLOMON ISLANDS */
  isocountry_array[195] = "SO"; /* SOMALIA */
  isocountry_array[196] = "ZA"; /* SOUTH AFRICA */
  isocountry_array[197] = "GS"; /* SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS */
  isocountry_array[198] = "ES"; /* SPAIN */
  isocountry_array[199] = "LK"; /* SRI LANKA */
  isocountry_array[200] = "SD"; /* SUDAN */
  isocountry_array[201] = "SR"; /* SURINAME */
  isocountry_array[202] = "SJ"; /* SVALBARD AND JAN MAYEN ISLANDS */
  isocountry_array[203] = "SZ"; /* SWAZILAND */
  isocountry_array[204] = "SE"; /* SWEDEN */
  isocountry_array[205] = "CH"; /* SWITZERLAND */
  isocountry_array[206] = "SY"; /* SYRIAN ARAB REPUBLIC */
  isocountry_array[207] = "TW"; /* TAIWAN */
  isocountry_array[208] = "TJ"; /* TAJIKISTAN */
  isocountry_array[209] = "TZ"; /* TANZANIA, UNITED REPUBLIC OF */
  isocountry_array[210] = "TH"; /* THAILAND */
  isocountry_array[211] = "TL"; /* TIMOR-LESTE */
  isocountry_array[212] = "TG"; /* TOGO */
  isocountry_array[213] = "TK"; /* TOKELAU */
  isocountry_array[214] = "TO"; /* TONGA */
  isocountry_array[215] = "TT"; /* TRINIDAD AND TOBAGO */
  isocountry_array[216] = "TN"; /* TUNISIA */
  isocountry_array[217] = "TR"; /* TURKEY */
  isocountry_array[218] = "TM"; /* TURKMENISTAN */
  isocountry_array[219] = "TC"; /* TURKS AND CAICOS ISLANDS */
  isocountry_array[220] = "TV"; /* TUVALU */
  isocountry_array[221] = "UG"; /* UGANDA */
  isocountry_array[222] = "UA"; /* UKRAINE */
  isocountry_array[223] = "AE"; /* UNITED ARAB EMIRATES */
  isocountry_array[224] = "GB"; /* UNITED KINGDOM */
  isocountry_array[225] = "US"; /* UNITED STATES */
  isocountry_array[226] = "UM"; /* UNITED STATES MINOR OUTLYING ISLANDS */
  isocountry_array[227] = "UY"; /* URUGUAY */
  isocountry_array[228] = "UZ"; /* UZBEKISTAN */
  isocountry_array[229] = "VU"; /* VANUATU */
  isocountry_array[230] = "VA"; /* VATICAN CITY STATE (HOLY SEE) */
  isocountry_array[231] = "VE"; /* VENEZUELA */
  isocountry_array[232] = "VN"; /* VIET NAM */
  isocountry_array[233] = "VG"; /* VIRGIN ISLANDS (BRITISH) */
  isocountry_array[234] = "VI"; /* VIRGIN ISLANDS (U.S.) */
  isocountry_array[235] = "WF"; /* WALLIS AND FUTUNA ISLANDS */
  isocountry_array[236] = "EH"; /* WESTERN SAHARA */
  isocountry_array[237] = "YE"; /* YEMEN */
  isocountry_array[238] = "ZM"; /* ZAMBIA */
  isocountry_array[239] = "ZW"; /* ZIMBABWE */
  isocountry_array[240] = "WO"; /*World/Other */
  
  /*MG 25 Feb 08 - revised pagename array to allow for user-configurable second variables*/
  /*///////////////////
  "videos video" becomes "videos " (trailing space)  
  "photos photo" becomes "photos " (trailing space)
  "link sitename" becomes "link"
  "forums post" becomes "forums " (trailing space)  
  */
  
  var pagename_array = new Array();  
  pagename_array[0] = "widget poll"; /* Tag each item (i.e. games, polls, competitions etc) with the relevant name */
  pagename_array[1] = "widget game"; /* Tag each item (i.e. games, polls, competitions etc) with the relevant name */
  pagename_array[2] = "widget"; /* Interactive content  */
  pagename_array[3] = "videos "; /* All individual video links should be tagged with videos followed by the actual video name. */
  pagename_array[4] = "videos"; /* Videos */
  pagename_array[5] = "sign up start"; /* Newsletter/ Registration/Data capture start */
  pagename_array[6] = "sign up end"; /* Data capture confirmation */
  pagename_array[7] = "shop"; /* Shop (i.e. merchandise) */
  pagename_array[8] = "photos "; /* All individual photo links should be tagged with photos followed by the actual photo name. */
  pagename_array[9] = "photos"; /* Photos or Gallery  */
  pagename_array[10] = "other download"; /* Non-music downloads (non-commercial) */
  pagename_array[11] = "other"; /* Other - Used any pages not covered in this list */
  pagename_array[12] = "news"; /* News */
  pagename_array[13] = "music track"; /* Tag each file with a name. */
  pagename_array[14] = "music free"; /* Music* downloads (non-commercial) */
  pagename_array[15] = "music"; /* Music downloads (commercial) */
  pagename_array[16] = "mobile"; /* Mobile */
  pagename_array[17] = "member area"; /* Premium content/ members only area */
  pagename_array[18] = "link"; /* External Links */
  pagename_array[19] = "home"; /* Home page */
  pagename_array[20] = "forums "; /* All individual links should be prefixed with forums followed by the link name. */
  pagename_array[21] = "forums"; /* Forum or message boards */
  pagename_array[22] = "events"; /* Tours and concerts */
  pagename_array[23] = "discography"; /* Music or Discography */
  pagename_array[24] = "diary"; /* Diary */
  pagename_array[25] = "blog entry"; /* All blog posts & journal entries should be prefixed with the entry name/ number */
  pagename_array[26] = "blog"; /* Blog/ Journal */
  pagename_array[27] = "biography"; /* Biography */

  
 /* RM 2007-12-18 - Added recordstore & digitalstores*/
    
  var ecommerce_array = new Array();
  ecommerce_array[0] = ".7digital.";
  ecommerce_array[1] = ".emisuperstore.";
  ecommerce_array[2] = ".recordstore.";
  ecommerce_array[3] = ".digitalstores.";
  
  // Checks to see if
 
  if (typeof(_uff) != undefined)
  {
  //  _ff=0;
	_uff = 0; // Reset tracker for second account
  }
  
// Validation functions
function IsECommerce(strString)
{
  // Loop list of 
    
  for (var i = 0; i < ecommerce_array.length; i++)
  {     
    if (strString.toLowerCase().match(ecommerce_array[i])!=null)
	{	 
	  return true;	  
	}
  }
  return false;
}


//  check for valid numeric strings	
function IsNumeric(strString)
{
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (var i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}
 
  
function DebugMode(mode)
{
  if (mode!=null && mode!="")
  {
    if (mode=="1" || mode=="true")
	{
	  debug = 1;
	}
	else
	{
	  debug = 0;
	}
  }  
}


  
function Trackit (labelaccountid, region, country, labelgroup, label, artist, pagename)
{
//   alert("Trackit (labelaccountid("+labelaccountid+"), region("+region+"), country("+country+"), labelgroup("+labelgroup+"), label("+label+"), artist("+artist+"), pagename("+pagename+"))");
  
  //Constants 
   var errors = 0;
   var errormessages = "No error messages";
   //ISO 3166 
   //Validate Paramaters
   
   // Global acount should be set in the included javascript
   if (globalaccountid==null || globalaccountid=="" || globalaccountid.length == 0)
   {
     if (debug ==1 ) alert("Missing global account id account id!!!");
	 errormessages += "#Missing global account id account id!!!";
	 errors++;
   }
   
   // Label account ID should be included as a paramater
   if (labelaccountid==null || labelaccountid=="" || labelaccountid.length == 0)
   {
     if (debug ==1 ) alert("Missing label account id!!!");
	 errormessages += "#Missing label account id!!!";
	 errors++;	 
   }
   
   var matched = 0;
   
   // Region id should be  be included as a paramater
   if (region==null || region=="" || region.length == 0)
   {
     if (debug ==1 ) alert("Missing region id!!!");
	 errormessages += "#Missing region id!!!";	 
	 errors++;	 
   }
   else
   {
     //Region 
     if (region.toUpperCase() == "SEA" || 
       region.toUpperCase() == "LAT" || 
	   region.toUpperCase() == "EUR")
     {
       region = "INT";
	   matched = 1;
     }
     else
     {
       
       for (var i = 0; i < region_array.length; i++)
       {     
     
         if (region_array[i] == region.toUpperCase())
	     {	 
	       matched = 1;
	       i = region_array.length;
	     }
       }
       if (matched != 1)
       {
         if (debug ==1 ) alert("Invalid region id("+region+")");
	     errormessages += "#Invalid region id("+region+")";	
	     errors++;	 
       }
     }
   }
   
   //   Country validation
   if (country==null || country=="" || country.length == 0)
   {
     if (debug ==1 ) alert("Missing country code eg. GB, US, FR, DE etc..!!!");
	 errormessages += "#Missing country code eg. GB, US, FR, DE etc..!!!";	
	 errors++;	 
   }

   matched = 0;
   for (var i = 0; i < isocountry_array.length; i++)
   {   
     if (isocountry_array[i] == country.toUpperCase())
	 {
	   matched = 1;
	   i = isocountry_array.length;
	 }
   }
   if (matched != 1)
   {
     if (debug ==1 ) alert("Invalid ISO country code("+country+")");
	 errormessages += "#Invalid ISO country code("+country+")";	
	 errors++;	 
   }
	
   // This maybe optional
   if (labelgroup==null || labelgroup=="" || labelgroup.length == 0)
   {
     if (debug ==1 ) alert("Missing label account id!!!");
	 errormessages += "#Missing label account id!!!";		 
	 errors++;	 
   }
   
   if (artist==null || artist=="" || artist.length == 0)
   {
     if (debug ==1 ) alert("Missing artist/site name!!!");
	 errormessages += "#Missing artist/site name!!!";		 
	 errors++;	 
   }
   
   if (pagename==null || pagename=="" || pagename.length == 0)
   {
     alert("Missing page name!!!");
	 errormessages += "#Missing page name!!!";		 
	 errors++;	 
   }
   var matched = 0;
   for (var i = 0; i < pagename_array.length; i++)
   {
     if (pagename.toString().toLowerCase().search(pagename_array[i]) == 0)
	 {
	   matched = 1;
	   i = pagename_array.length;
	 }
   }
   if (matched != 1)
   {
     if (debug ==1 ) alert("Invalid Page Name("+pagename_array+")");
	 errormessages += "#Invalid Page Name("+pagename_array+")";	
	 errors++;	 
   }   
     // Reset flag
   _ff=0;


   if(labelaccountid.toString().toUpperCase().match("UA-")!=null)
   {
	  labelaccountid = labelaccountid.toUpperCase();
   }
   else if (labelaccountid.length > 1)
   {
      //alert("Hlloe1 = labelaccountid" + labelaccountid);
      labelaccountid = "UA-"+labelaccountid+"-1";
   } 
   else if (labelaccountid == "0")
   {
   //alert("Hlloe2 labelaccountid=" + labelaccountid);
      if (label==null || label=="" || label.length == 0)
	  {
	  //alert("Hlloe3a label= " + label);
	    alert("Label name!!!");
	    errormessages += "#Label Tag name!!!";		 
	    errors++;	 
	  }
	  else
	  {
	     //alert("Hlloe3b labelaccountid= " +label.toLowerCase()); 
	     labelaccountid = UAID_array[label.toLowerCase()];	
		
		 if (labelaccountid.toString().match("UA-")!=null)
		 {	
		 //alert("Hlloe4 labelaccountid=" + labelaccountid );
		   // Set the correct label group and label paramaters

		   labelgroup = labelgroup_array[label_array[label.toLowerCase()]];
		   label = label_array[label.toLowerCase()];		 
		 }		 
	  }
   }
   
   
   // Global level tracking
   _uacct = "UA-"+globalaccountid+"-1";
     
   // Check for 7digital or emisuperstore
   if (IsECommerce(document.location.host) == true)
   {
     //Appends ecommerce paramter to the data sent
	 if (debug ==1 ) alert("Submiting to Google - urchinTracker("+document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**" + labelgroup.toUpperCase() + "**" + label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**"  + pagename.toString().toLowerCase() + "**" + "EMI Commercial" + "**" +")");
     urchinTracker(document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**" + labelgroup.toUpperCase() + "**"+ label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**"  + pagename.toString().toLowerCase() + "**" + "EMI Commercial" + "**");	 
   }
   else
   {
     if (debug ==1 ) alert("Submiting to Google - urchinTracker("+document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**" + labelgroup.toUpperCase() + "**" + label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**"  + pagename.toString().toLowerCase() +")");   
     urchinTracker(document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**" + labelgroup.toUpperCase() + "**"+ label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**"  + pagename.toString().toLowerCase() + "**");
   }
	

    // Set the account id for the Label
   _uacct = labelaccountid
	
   // Reset flag
   //_ff=0;
   _uff = 0; // Reset tracker for second account
   
   //Label level tracking
   
   //ecommerce
   if (IsECommerce(document.location.host) == true){
   
   if (debug ==1) alert("Submiting to Google - urchinTracker("+document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**" + label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**" + pagename.toString().toLowerCase() + "**" + document.location.pathname+ "**" + "EMI Commercial" + "**" + ")");
      
   urchinTracker(document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**"+ label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**" + pagename.toString().toLowerCase() + "**" + document.location.pathname + "**" + "EMI Commercial" + "**");  
   
   } else {
	//not ecommerce
	    if (debug ==1) alert("Submiting to Google - urchinTracker("+document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**" + label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**" + pagename.toString().toLowerCase() + "**" + document.location.pathname+")");
   
   urchinTracker(document.location.host + "**" + region.toString().toUpperCase() + "**" + country.toUpperCase() + "**"+ label.toUpperCase() + "**" + artist.toString().toLowerCase() + "**" + pagename.toString().toLowerCase() + "**" + document.location.pathname); 
	   
   }
   
   trackingerrors = errors;
   trackingerrormessages = errormessages;
   if (debug ==1)
   {
     alert(errormessages);
   }
}

function Trackit2 (region, country, labelgroup, label, artist, pagename)
{
//   alert("Trackit (region("+region+"), country("+country+"), labelgroup("+labelgroup+"), label("+label+"), artist("+artist+"), pagename("+pagename+"))");
   Trackit ("0", region, country, labelgroup, label, artist, pagename);
}

/*
                        
Example of tracking function 
                   //<!-- Header -->
                   <script type="text/javascript" src="http://www.emihosting.com/tools/js/tracking/trackit.js"></script>
		//<!-- Header -->		   
				   
                   // <!-- Body -->
	         <script type="text/javascript">			 
	         //<!-- <![CDATA[
		    // Check the function has loaded properly			 
                        if (window.Trackit)  
		     {
			   //Call tracking function --Trackit2 (region, country, labelgroup, label, artist, pagename)
                                Trackit2("UKI","GB","EMI","EMI CATALOGUE","Now Music","HOME");
                         }
		  //  ]]>  -->			  
                  </script>
	       // <!-- Body -->

*/
//-->