

f2f_areaArray = new Array();

goldArray=new Array();
//goldArray[0]=new Array('5','1','1');
//goldArray[1]=new Array('5','5','5');
//goldArray[2]=new Array('5','10','10');
//goldArray[3]=new Array('5','20','20');
//goldArray[4]=new Array('5','50','50');
//goldArray[5]=new Array('5','100','100');
//goldArray[6]=new Array('5','200','200');
//goldArray[7]=new Array('5','300','300');
//goldArray[8]=new Array('5','800','800');
//goldArray[9]=new Array('5','1000','1000');
//goldArray[10]=new Array('5','1500','1500');
//goldArray[11]=new Array('5','2000','2000');
//goldArray[12]=new Array('5','2500','2500');
//goldArray[13]=new Array('5','3000','3000');
//goldArray[14]=new Array('5','5000','5000');
//goldArray[15]=new Array('5','10000','10000');

//goldArray[16]=new Array('8','1','1');
//goldArray[17]=new Array('8','5','5');
//goldArray[18]=new Array('8','10','10');
//goldArray[19]=new Array('8','20','20');
//goldArray[20]=new Array('8','50','50');
//goldArray[21]=new Array('8','100','100');
//goldArray[22]=new Array('8','200','200');
//goldArray[23]=new Array('8','300','300');
//goldArray[24]=new Array('8','500','500');
//goldArray[25]=new Array('8','1000','1000');
//goldArray[26]=new Array('8','1500','1500');
//goldArray[27]=new Array('8','2000','2000');
//goldArray[28]=new Array('8','2500','2500');
//oldArray[29]=new Array('8','3000','3000');
//goldArray[30]=new Array('8','5000','5000');
//goldArray[31]=new Array('8','10000','10000');


goldArray[1]=new Array('5','800','800');
goldArray[2]=new Array('5','1000','1000');
goldArray[3]=new Array('5','1300','1300');
goldArray[4]=new Array('5','1500','1500');
goldArray[5]=new Array('5','1800','1800');
goldArray[6]=new Array('5','2000','2000');
goldArray[7]=new Array('5','2500','2500');
goldArray[8]=new Array('5','3000','3000');
goldArray[9]=new Array('5','3500','3500');
goldArray[10]=new Array('5','4000','4000');
goldArray[11]=new Array('5','4500','4500');
goldArray[12]=new Array('5','5000','5000');
goldArray[13]=new Array('5','6000','6000');
goldArray[14]=new Array('5','7000','7000');
goldArray[15]=new Array('5','8000','8000');
goldArray[16]=new Array('5','9000','9000');
goldArray[17]=new Array('5','10000','10000');

goldArray[18]=new Array('8','500','500');
goldArray[19]=new Array('8','800','800');
goldArray[20]=new Array('8','1000','1000');
goldArray[21]=new Array('8','1300','1300');
goldArray[22]=new Array('8','1500','1500');
goldArray[23]=new Array('8','1800','1800');
goldArray[24]=new Array('8','2000','2000');
goldArray[25]=new Array('8','2500','2500');
goldArray[26]=new Array('8','3000','3000');
goldArray[27]=new Array('8','3500','3500');
goldArray[28]=new Array('8','4000','4000');
goldArray[29]=new Array('8','4500','4500');
goldArray[30]=new Array('8','5000','5000');
goldArray[31]=new Array('8','6000','6000');
goldArray[32]=new Array('8','7000','7000');
goldArray[33]=new Array('8','8000','8000');
goldArray[34]=new Array('8','9000','9000');
goldArray[35]=new Array('8','10000','10000');






deliver = new Array();
gamearea_d = new Array();
gamearea_d[0]= new Array();
deliver[0]=new Array();
gamearea_d[1]= new Array();
deliver[1]=new Array();
gamearea_d[2]= new Array();
deliver[2]=new Array();
gamearea_d[3]= new Array();
deliver[3]=new Array();
gamearea_d[4]= new Array();
deliver[4]=new Array();
gamearea_d[5]= new Array();
deliver[5]=new Array();
gamearea_d[5][0] = "Aegwynn";
deliver[5][0]= "22";
deliver[5][1]= "17";
gamearea_d[5][1] = "Aerie Peak";
deliver[5][2]= "12";
deliver[5][3]= "15";
gamearea_d[5][2] = "Agamaggan";
deliver[5][4]= "23";
deliver[5][5]= "10";
gamearea_d[5][3] = "Aggramar";
deliver[5][6]= "14";
deliver[5][7]= "24";
gamearea_d[5][4] = "Akama";
deliver[5][8]= "26";
deliver[5][9]= "26";
gamearea_d[5][5] = "Alexstrasza";
deliver[5][10]= "28";
deliver[5][11]= "11";
gamearea_d[5][6] = "Alleria";
deliver[5][12]= "30";
deliver[5][13]= "12";
gamearea_d[5][7] = "Altar of Storms";
deliver[5][14]= "15";
deliver[5][15]= "15";
gamearea_d[5][8] = "Alterac Mountains";
deliver[5][16]= "28";
deliver[5][17]= "8";
gamearea_d[5][9] = "Aman'Thul";
deliver[5][18]= "20";
deliver[5][19]= "13";
gamearea_d[5][10] = "Andorhal";
deliver[5][20]= "14";
deliver[5][21]= "6";
gamearea_d[5][11] = "Anetheron";
deliver[5][22]= "14";
deliver[5][23]= "25";
gamearea_d[5][12] = "Antonidas";
deliver[5][24]= "24";
deliver[5][25]= "11";
gamearea_d[5][13] = "Anub'arak";
deliver[5][26]= "15";
deliver[5][27]= "5";
gamearea_d[5][14] = "Anvilmar";
deliver[5][28]= "26";
deliver[5][29]= "30";
gamearea_d[5][15] = "Arathor";
deliver[5][30]= "18";
deliver[5][31]= "17";
gamearea_d[5][16] = "Archimonde";
deliver[5][32]= "17";
deliver[5][33]= "26";
gamearea_d[5][17] = "Area 52";
deliver[5][34]= "28";
deliver[5][35]= "9";
gamearea_d[5][18] = "Argent Dawn";
deliver[5][36]= "6";
deliver[5][37]= "11";
gamearea_d[5][19] = "Arthas";
deliver[5][38]= "29";
deliver[5][39]= "27";
gamearea_d[5][20] = "Arygos";
deliver[5][40]= "7";
deliver[5][41]= "26";
gamearea_d[5][21] = "Auchindoun";
deliver[5][42]= "8";
deliver[5][43]= "7";
gamearea_d[5][22] = "Azgalor";
deliver[5][44]= "8";
deliver[5][45]= "19";
gamearea_d[5][23] = "Azjol-Nerub";
deliver[5][46]= "17";
deliver[5][47]= "6";
gamearea_d[5][24] = "Azshara";
deliver[5][48]= "22";
deliver[5][49]= "6";
gamearea_d[5][25] = "Azuremyst";
deliver[5][50]= "15";
deliver[5][51]= "6";
gamearea_d[5][26] = "Baelgun";
deliver[5][52]= "8";
deliver[5][53]= "24";
gamearea_d[5][27] = "Balnazzar";
deliver[5][54]= "26";
deliver[5][55]= "28";
gamearea_d[5][28] = "Barthilas";
deliver[5][56]= "5";
deliver[5][57]= "10";
gamearea_d[5][29] = "Black Dragonflight";
deliver[5][58]= "29";
deliver[5][59]= "26";
gamearea_d[5][30] = "Blackhand";
deliver[5][60]= "10";
deliver[5][61]= "16";
gamearea_d[5][31] = "Blackrock";
deliver[5][62]= "13";
deliver[5][63]= "22";
gamearea_d[5][32] = "Blackwater Raiders";
deliver[5][64]= "12";
deliver[5][65]= "10";
gamearea_d[5][33] = "Blackwing Lair";
deliver[5][66]= "26";
deliver[5][67]= "13";
gamearea_d[5][34] = "Blade's Edge";
deliver[5][68]= "17";
deliver[5][69]= "25";
gamearea_d[5][35] = "Bladefist";
deliver[5][70]= "10";
deliver[5][71]= "20";
gamearea_d[5][36] = "Bleeding Hollow";
deliver[5][72]= "20";
deliver[5][73]= "14";
gamearea_d[5][37] = "Blood Furnace";
deliver[5][74]= "22";
deliver[5][75]= "23";
gamearea_d[5][38] = "Bloodhoof";
deliver[5][76]= "28";
deliver[5][77]= "8";
gamearea_d[5][39] = "Bloodscalp";
deliver[5][78]= "24";
deliver[5][79]= "20";
gamearea_d[5][40] = "Bonechewer";
deliver[5][80]= "10";
deliver[5][81]= "8";
gamearea_d[5][41] = "Boulderfist";
deliver[5][82]= "21";
deliver[5][83]= "14";
gamearea_d[5][42] = "Borean Tundra";
deliver[5][84]= "28";
deliver[5][85]= "17";
gamearea_d[5][43] = "Bronzebeard";
deliver[5][86]= "11";
deliver[5][87]= "28";
gamearea_d[5][44] = "Burning Blade";
deliver[5][88]= "23";
deliver[5][89]= "10";
gamearea_d[5][45] = "Burning Legion";
deliver[5][90]= "23";
deliver[5][91]= "29";
gamearea_d[5][46] = "Caelestrasz";
deliver[5][92]= "22";
deliver[5][93]= "6";
gamearea_d[5][47] = "Cairne";
deliver[5][94]= "20";
deliver[5][95]= "29";
gamearea_d[5][48] = "Cenarion Circle";
deliver[5][96]= "11";
deliver[5][97]= "16";
gamearea_d[5][49] = "Cenarius";
deliver[5][98]= "11";
deliver[5][99]= "23";
gamearea_d[5][50] = "Cho'gall";
deliver[5][100]= "10";
deliver[5][101]= "17";
gamearea_d[5][51] = "Chromaggus";
deliver[5][102]= "12";
deliver[5][103]= "26";
gamearea_d[5][52] = "Coilfang";
deliver[5][104]= "26";
deliver[5][105]= "30";
gamearea_d[5][53] = "Crushridge";
deliver[5][106]= "18";
deliver[5][107]= "24";
gamearea_d[5][54] = "Daggerspine";
deliver[5][108]= "7";
deliver[5][109]= "12";
gamearea_d[5][55] = "Dalaran";
deliver[5][110]= "13";
deliver[5][111]= "13";
gamearea_d[5][56] = "Dalvengyr";
deliver[5][112]= "15";
deliver[5][113]= "30";
gamearea_d[5][57] = "Dark Iron";
deliver[5][114]= "22";
deliver[5][115]= "12";
gamearea_d[5][58] = "Darkspear";
deliver[5][116]= "17";
deliver[5][117]= "29";
gamearea_d[5][59] = "Darrowmere";
deliver[5][118]= "10";
deliver[5][119]= "9";
gamearea_d[5][60] = "Dath'Remar";
deliver[5][120]= "8";
deliver[5][121]= "28";
gamearea_d[5][61] = "Dawnbringer";
deliver[5][122]= "7";
deliver[5][123]= "25";
gamearea_d[5][62] = "Deathwing";
deliver[5][124]= "30";
deliver[5][125]= "23";
gamearea_d[5][63] = "Demon Soul";
deliver[5][126]= "23";
deliver[5][127]= "10";
gamearea_d[5][64] = "Dentarg";
deliver[5][128]= "9";
deliver[5][129]= "30";
gamearea_d[5][65] = "Destromath";
deliver[5][130]= "29";
deliver[5][131]= "15";
gamearea_d[5][66] = "Dethecus";
deliver[5][132]= "17";
deliver[5][133]= "11";
gamearea_d[5][67] = "Detheroc";
deliver[5][134]= "10";
deliver[5][135]= "12";
gamearea_d[5][68] = "Doomhammer";
deliver[5][136]= "10";
deliver[5][137]= "23";
gamearea_d[5][69] = "Draenor";
deliver[5][138]= "6";
deliver[5][139]= "13";
gamearea_d[5][70] = "Dragonblight";
deliver[5][140]= "30";
deliver[5][141]= "14";
gamearea_d[5][71] = "Dragonmaw";
deliver[5][142]= "21";
deliver[5][143]= "15";
gamearea_d[5][72] = "Drak'Tharon";
deliver[5][144]= "14";
deliver[5][145]= "12";
gamearea_d[5][73] = "Drak'thul";
deliver[5][146]= "23";
deliver[5][147]= "26";
gamearea_d[5][74] = "Draka";
deliver[5][148]= "10";
deliver[5][149]= "28";
gamearea_d[5][75] = "Drakkari";
deliver[5][150]= "5";
deliver[5][151]= "14";
gamearea_d[5][76] = "Dreadmaul";
deliver[5][152]= "26";
deliver[5][153]= "7";
gamearea_d[5][77] = "Drenden";
deliver[5][154]= "8";
deliver[5][155]= "25";
gamearea_d[5][78] = "Dunemaul";
deliver[5][156]= "26";
deliver[5][157]= "27";
gamearea_d[5][79] = "Durotan";
deliver[5][158]= "30";
deliver[5][159]= "30";
gamearea_d[5][80] = "Duskwood";
deliver[5][160]= "27";
deliver[5][161]= "29";
gamearea_d[5][81] = "Earthen Ring";
deliver[5][162]= "15";
deliver[5][163]= "13";
gamearea_d[5][82] = "Echo Isles";
deliver[5][164]= "9";
deliver[5][165]= "20";
gamearea_d[5][83] = "Eitrigg";
deliver[5][166]= "21";
deliver[5][167]= "14";
gamearea_d[5][84] = "Eldre'Thalas";
deliver[5][168]= "13";
deliver[5][169]= "22";
gamearea_d[5][85] = "Elune";
deliver[5][170]= "22";
deliver[5][171]= "13";
gamearea_d[5][86] = "Emerald Dream";
deliver[5][172]= "6";
deliver[5][173]= "12";
gamearea_d[5][87] = "Eonar";
deliver[5][174]= "23";
deliver[5][175]= "15";
gamearea_d[5][88] = "Eredar";
deliver[5][176]= "20";
deliver[5][177]= "15";
gamearea_d[5][89] = "Executus";
deliver[5][178]= "11";
deliver[5][179]= "25";
gamearea_d[5][90] = "Exodar";
deliver[5][180]= "13";
deliver[5][181]= "11";
gamearea_d[5][91] = "Farstriders";
deliver[5][182]= "9";
deliver[5][183]= "8";
gamearea_d[5][92] = "Feathermoon";
deliver[5][184]= "14";
deliver[5][185]= "12";
gamearea_d[5][93] = "Fenris";
deliver[5][186]= "29";
deliver[5][187]= "9";
gamearea_d[5][94] = "Firetree";
deliver[5][188]= "9";
deliver[5][189]= "29";
gamearea_d[5][95] = "Fizzcrank";
deliver[5][190]= "9";
deliver[5][191]= "5";
gamearea_d[5][96] = "Frostmane";
deliver[5][192]= "27";
deliver[5][193]= "19";
gamearea_d[5][97] = "Frostmourne";
deliver[5][194]= "13";
deliver[5][195]= "5";
gamearea_d[5][98] = "Frostwolf";
deliver[5][196]= "8";
deliver[5][197]= "29";
gamearea_d[5][99] = "Galakrond";
deliver[5][198]= "15";
deliver[5][199]= "17";
gamearea_d[5][100] = "Garithos";
deliver[5][200]= "21";
deliver[5][201]= "6";
gamearea_d[5][101] = "Garona";
deliver[5][202]= "25";
deliver[5][203]= "22";
gamearea_d[5][102] = "Garrosh";
deliver[5][204]= "14";
deliver[5][205]= "17";
gamearea_d[5][103] = "Ghostlands";
deliver[5][206]= "7";
deliver[5][207]= "29";
gamearea_d[5][104] = "Gilneas";
deliver[5][208]= "28";
deliver[5][209]= "13";
gamearea_d[5][105] = "Gnomeregan";
deliver[5][210]= "24";
deliver[5][211]= "11";
gamearea_d[5][106] = "Gorefiend";
deliver[5][212]= "20";
deliver[5][213]= "28";
gamearea_d[5][107] = "Gorgonnash";
deliver[5][214]= "14";
deliver[5][215]= "29";
gamearea_d[5][108] = "Greymane";
deliver[5][216]= "10";
deliver[5][217]= "13";
gamearea_d[5][109] = "Grizzly Hills";
deliver[5][218]= "7";
deliver[5][219]= "14";
gamearea_d[5][110] = "Gul'dan";
deliver[5][220]= "11";
deliver[5][221]= "11";
gamearea_d[5][111] = "Gundrak";
deliver[5][222]= "14";
deliver[5][223]= "7";
gamearea_d[5][112] = "Gurubashi";
deliver[5][224]= "26";
deliver[5][225]= "23";
gamearea_d[5][113] = "Hakkar";
deliver[5][226]= "7";
deliver[5][227]= "30";
gamearea_d[5][114] = "Haomarush";
deliver[5][228]= "21";
deliver[5][229]= "18";
gamearea_d[5][115] = "Hellscream";
deliver[5][230]= "16";
deliver[5][231]= "11";
gamearea_d[5][116] = "Hydraxis";
deliver[5][232]= "19";
deliver[5][233]= "10";
gamearea_d[5][117] = "Hyjal";
deliver[5][234]= "29";
deliver[5][235]= "29";
gamearea_d[5][118] = "Icecrown";
deliver[5][236]= "23";
deliver[5][237]= "6";
gamearea_d[5][119] = "Illidan";
deliver[5][238]= "28";
deliver[5][239]= "20";
gamearea_d[5][120] = "Jaedenar";
deliver[5][240]= "14";
deliver[5][241]= "21";
gamearea_d[5][121] = "Jubei'Thos";
deliver[5][242]= "26";
deliver[5][243]= "30";
gamearea_d[5][122] = "Kael'thas";
deliver[5][244]= "19";
deliver[5][245]= "10";
gamearea_d[5][123] = "Kalecgos";
deliver[5][246]= "28";
deliver[5][247]= "25";
gamearea_d[5][124] = "Kargath";
deliver[5][248]= "18";
deliver[5][249]= "30";
gamearea_d[5][125] = "Kel'Thuzad";
deliver[5][250]= "8";
deliver[5][251]= "25";
gamearea_d[5][126] = "Khadgar";
deliver[5][252]= "11";
deliver[5][253]= "18";
gamearea_d[5][127] = "Khaz Modan";
deliver[5][254]= "27";
deliver[5][255]= "7";
gamearea_d[5][128] = "Khaz'goroth";
deliver[5][256]= "10";
deliver[5][257]= "30";
gamearea_d[5][129] = "Kil'Jaeden";
deliver[5][258]= "6";
deliver[5][259]= "27";
gamearea_d[5][130] = "Kilrogg";
deliver[5][260]= "17";
deliver[5][261]= "17";
gamearea_d[5][131] = "Kirin Tor";
deliver[5][262]= "8";
deliver[5][263]= "6";
gamearea_d[5][132] = "Korgath";
deliver[5][264]= "22";
deliver[5][265]= "6";
gamearea_d[5][133] = "Korialstrasz";
deliver[5][266]= "30";
deliver[5][267]= "14";
gamearea_d[5][134] = "Kul Tiras";
deliver[5][268]= "7";
deliver[5][269]= "27";
gamearea_d[5][135] = "Laughing Skull";
deliver[5][270]= "30";
deliver[5][271]= "17";
gamearea_d[5][136] = "Lethon";
deliver[5][272]= "18";
deliver[5][273]= "26";
gamearea_d[5][137] = "Lightbringer";
deliver[5][274]= "16";
deliver[5][275]= "7";
gamearea_d[5][138] = "Lightning's Blade";
deliver[5][276]= "6";
deliver[5][277]= "14";
gamearea_d[5][139] = "Lightninghoof";
deliver[5][278]= "27";
deliver[5][279]= "20";
gamearea_d[5][140] = "Llane";
deliver[5][280]= "14";
deliver[5][281]= "5";
gamearea_d[5][141] = "Lothar";
deliver[5][282]= "14";
deliver[5][283]= "20";
gamearea_d[5][142] = "Madoran";
deliver[5][284]= "18";
deliver[5][285]= "10";
gamearea_d[5][143] = "Maelstrom";
deliver[5][286]= "23";
deliver[5][287]= "24";
gamearea_d[5][144] = "Magtheridon";
deliver[5][288]= "10";
deliver[5][289]= "24";
gamearea_d[5][145] = "Maiev";
deliver[5][290]= "20";
deliver[5][291]= "22";
gamearea_d[5][146] = "Mal'Ganis";
deliver[5][292]= "10";
deliver[5][293]= "23";
gamearea_d[5][147] = "Malfurion";
deliver[5][294]= "23";
deliver[5][295]= "27";
gamearea_d[5][148] = "Malorne";
deliver[5][296]= "25";
deliver[5][297]= "23";
gamearea_d[5][149] = "Malygos";
deliver[5][298]= "11";
deliver[5][299]= "28";
gamearea_d[5][150] = "Mannoroth";
deliver[5][300]= "20";
deliver[5][301]= "10";
gamearea_d[5][151] = "Medivh";
deliver[5][302]= "15";
deliver[5][303]= "8";
gamearea_d[5][152] = "Misha";
deliver[5][304]= "6";
deliver[5][305]= "27";
gamearea_d[5][153] = "Mok'Nathal";
deliver[5][306]= "10";
deliver[5][307]= "7";
gamearea_d[5][154] = "Moon Guard";
deliver[5][308]= "10";
deliver[5][309]= "7";
gamearea_d[5][155] = "Moonrunner";
deliver[5][310]= "22";
deliver[5][311]= "19";
gamearea_d[5][156] = "Mug'thol";
deliver[5][312]= "8";
deliver[5][313]= "5";
gamearea_d[5][157] = "Muradin";
deliver[5][314]= "9";
deliver[5][315]= "22";
gamearea_d[5][158] = "Nagrand";
deliver[5][316]= "11";
deliver[5][317]= "27";
gamearea_d[5][159] = "Nathrezim";
deliver[5][318]= "15";
deliver[5][319]= "16";
gamearea_d[5][160] = "Nazgrel";
deliver[5][320]= "21";
deliver[5][321]= "5";
gamearea_d[5][161] = "Nazjatar";
deliver[5][322]= "8";
deliver[5][323]= "26";
gamearea_d[5][162] = "Ner'zhul";
deliver[5][324]= "23";
deliver[5][325]= "26";
gamearea_d[5][163] = "Nesingwary";
deliver[5][326]= "23";
deliver[5][327]= "18";
gamearea_d[5][164] = "Nordrassil";
deliver[5][328]= "18";
deliver[5][329]= "29";
gamearea_d[5][165] = "Norgannon";
deliver[5][330]= "16";
deliver[5][331]= "7";
gamearea_d[5][166] = "Onyxia";
deliver[5][332]= "9";
deliver[5][333]= "27";
gamearea_d[5][167] = "Perenolde";
deliver[5][334]= "11";
deliver[5][335]= "10";
gamearea_d[5][168] = "Proudmoore";
deliver[5][336]= "23";
deliver[5][337]= "16";
gamearea_d[5][169] = "Quel'dorei";
deliver[5][338]= "13";
deliver[5][339]= "29";
gamearea_d[5][170] = "Quel'Thalas";
deliver[5][340]= "19";
deliver[5][341]= "30";
gamearea_d[5][171] = "Ragnaros";
deliver[5][342]= "18";
deliver[5][343]= "22";
gamearea_d[5][172] = "Ravencrest";
deliver[5][344]= "5";
deliver[5][345]= "23";
gamearea_d[5][173] = "Ravenholdt";
deliver[5][346]= "13";
deliver[5][347]= "12";
gamearea_d[5][174] = "Rexxar";
deliver[5][348]= "19";
deliver[5][349]= "24";
gamearea_d[5][175] = "Rivendare";
deliver[5][350]= "24";
deliver[5][351]= "9";
gamearea_d[5][176] = "Runetotem";
deliver[5][352]= "24";
deliver[5][353]= "27";
gamearea_d[5][177] = "Sargeras";
deliver[5][354]= "5";
deliver[5][355]= "17";
gamearea_d[5][178] = "Saurfang";
deliver[5][356]= "22";
deliver[5][357]= "23";
gamearea_d[5][179] = "Scarlet Crusade";
deliver[5][358]= "30";
deliver[5][359]= "10";
gamearea_d[5][180] = "Scilla";
deliver[5][360]= "22";
deliver[5][361]= "16";
gamearea_d[5][181] = "Sen'Jin";
deliver[5][362]= "13";
deliver[5][363]= "26";
gamearea_d[5][182] = "Sentinels";
deliver[5][364]= "12";
deliver[5][365]= "19";
gamearea_d[5][183] = "Shadow Council";
deliver[5][366]= "6";
deliver[5][367]= "5";
gamearea_d[5][184] = "Shadowmoon";
deliver[5][368]= "5";
deliver[5][369]= "14";
gamearea_d[5][185] = "Shadowsong";
deliver[5][370]= "29";
deliver[5][371]= "19";
gamearea_d[5][186] = "Shandris";
deliver[5][372]= "14";
deliver[5][373]= "16";
gamearea_d[5][187] = "Shattered Halls";
deliver[5][374]= "11";
deliver[5][375]= "14";
gamearea_d[5][188] = "Shattered Hand";
deliver[5][376]= "8";
deliver[5][377]= "20";
gamearea_d[5][189] = "Shu'halo";
deliver[5][378]= "22";
deliver[5][379]= "23";
gamearea_d[5][190] = "Silver Hand";
deliver[5][380]= "13";
deliver[5][381]= "15";
gamearea_d[5][191] = "Silvermoon";
deliver[5][382]= "28";
deliver[5][383]= "6";
gamearea_d[5][192] = "Sisters of Elune";
deliver[5][384]= "12";
deliver[5][385]= "28";
gamearea_d[5][193] = "Skullcrusher";
deliver[5][386]= "18";
deliver[5][387]= "29";
gamearea_d[5][194] = "Skywall";
deliver[5][388]= "21";
deliver[5][389]= "18";
gamearea_d[5][195] = "Smolderthorn";
deliver[5][390]= "9";
deliver[5][391]= "12";
gamearea_d[5][196] = "Spinebreaker";
deliver[5][392]= "30";
deliver[5][393]= "18";
gamearea_d[5][197] = "Spirestone";
deliver[5][394]= "8";
deliver[5][395]= "11";
gamearea_d[5][198] = "Staghelm";
deliver[5][396]= "6";
deliver[5][397]= "9";
gamearea_d[5][199] = "Steamwheedle Cartel";
deliver[5][398]= "11";
deliver[5][399]= "7";
gamearea_d[5][200] = "Stonemaul";
deliver[5][400]= "19";
deliver[5][401]= "10";
gamearea_d[5][201] = "Stormrage";
deliver[5][402]= "22";
deliver[5][403]= "28";
gamearea_d[5][202] = "Stormreaver";
deliver[5][404]= "21";
deliver[5][405]= "28";
gamearea_d[5][203] = "Stormscale";
deliver[5][406]= "12";
deliver[5][407]= "25";
gamearea_d[5][204] = "Suramar";
deliver[5][408]= "18";
deliver[5][409]= "29";
gamearea_d[5][205] = "Tanaris";
deliver[5][410]= "18";
deliver[5][411]= "26";
gamearea_d[5][206] = "Terenas";
deliver[5][412]= "14";
deliver[5][413]= "15";
gamearea_d[5][207] = "Terokkar";
deliver[5][414]= "28";
deliver[5][415]= "21";
gamearea_d[5][208] = "Thaurissan";
deliver[5][416]= "13";
deliver[5][417]= "15";
gamearea_d[5][209] = "The Forgotten Coast";
deliver[5][418]= "20";
deliver[5][419]= "30";
gamearea_d[5][210] = "The Scryers";
deliver[5][420]= "29";
deliver[5][421]= "25";
gamearea_d[5][211] = "The Underbog";
deliver[5][422]= "11";
deliver[5][423]= "29";
gamearea_d[5][212] = "The Venture Co";
deliver[5][424]= "12";
deliver[5][425]= "15";
gamearea_d[5][213] = "Thorium Brotherhood";
deliver[5][426]= "9";
deliver[5][427]= "14";
gamearea_d[5][214] = "Thrall";
deliver[5][428]= "19";
deliver[5][429]= "16";
gamearea_d[5][215] = "Thunderhorn";
deliver[5][430]= "16";
deliver[5][431]= "7";
gamearea_d[5][216] = "Thunderlord";
deliver[5][432]= "21";
deliver[5][433]= "8";
gamearea_d[5][217] = "Tichondrius";
deliver[5][434]= "5";
deliver[5][435]= "12";
gamearea_d[5][218] = "Tortheldrin";
deliver[5][436]= "5";
deliver[5][437]= "12";
gamearea_d[5][219] = "Trollbane";
deliver[5][438]= "7";
deliver[5][439]= "18";
gamearea_d[5][220] = "Turalyon";
deliver[5][440]= "11";
deliver[5][441]= "20";
gamearea_d[5][221] = "Twisting Nether";
deliver[5][442]= "14";
deliver[5][443]= "20";
gamearea_d[5][222] = "Uldaman";
deliver[5][444]= "5";
deliver[5][445]= "11";
gamearea_d[5][223] = "Uldum";
deliver[5][446]= "11";
deliver[5][447]= "14";
gamearea_d[5][224] = "Undermine";
deliver[5][448]= "22";
deliver[5][449]= "26";
gamearea_d[5][225] = "Ursin";
deliver[5][450]= "13";
deliver[5][451]= "20";
gamearea_d[5][226] = "Uther";
deliver[5][452]= "20";
deliver[5][453]= "19";
gamearea_d[5][227] = "Vashj";
deliver[5][454]= "18";
deliver[5][455]= "27";
gamearea_d[5][228] = "Vek'nilash";
deliver[5][456]= "29";
deliver[5][457]= "23";
gamearea_d[5][229] = "Velen";
deliver[5][458]= "11";
deliver[5][459]= "18";
gamearea_d[5][230] = "Warsong";
deliver[5][460]= "8";
deliver[5][461]= "22";
gamearea_d[5][231] = "Whisperwind";
deliver[5][462]= "21";
deliver[5][463]= "25";
gamearea_d[5][232] = "WildHammer";
deliver[5][464]= "26";
deliver[5][465]= "21";
gamearea_d[5][233] = "Windrunner";
deliver[5][466]= "7";
deliver[5][467]= "26";
gamearea_d[5][234] = "Winterhoof";
deliver[5][468]= "29";
deliver[5][469]= "9";
gamearea_d[5][235] = "Wyrmrest Accord";
deliver[5][470]= "14";
deliver[5][471]= "10";
gamearea_d[5][236] = "Ysera";
deliver[5][472]= "24";
deliver[5][473]= "23";
gamearea_d[5][237] = "Ysondre";
deliver[5][474]= "25";
deliver[5][475]= "25";
gamearea_d[5][238] = "Zangarmarsh";
deliver[5][476]= "30";
deliver[5][477]= "6";
gamearea_d[5][239] = "Zul'jin";
deliver[5][478]= "8";
deliver[5][479]= "21";
gamearea_d[5][240] = "Zuluhed";
deliver[5][480]= "27";
deliver[5][481]= "16";
gamearea_d[6]= new Array();
deliver[6]=new Array();
gamearea_d[7]= new Array();
deliver[7]=new Array();
gamearea_d[8]= new Array();
deliver[8]=new Array();
gamearea_d[8][0] = "Aegwynn";
deliver[8][0]= "11";
deliver[8][1]= "17";
gamearea_d[8][1] = "Aerie Peak";
deliver[8][2]= "5";
deliver[8][3]= "25";
gamearea_d[8][2] = "Agamaggan";
deliver[8][4]= "14";
deliver[8][5]= "30";
gamearea_d[8][3] = "Aggramar";
deliver[8][6]= "18";
deliver[8][7]= "20";
gamearea_d[8][4] = "Ahn'Qiraj";
deliver[8][8]= "17";
deliver[8][9]= "21";
gamearea_d[8][5] = "Al'Akir";
deliver[8][10]= "12";
deliver[8][11]= "8";
gamearea_d[8][6] = "Alexstrasza";
deliver[8][12]= "16";
deliver[8][13]= "7";
gamearea_d[8][7] = "Alleria";
deliver[8][14]= "25";
deliver[8][15]= "18";
gamearea_d[8][8] = "Alonsus";
deliver[8][16]= "29";
deliver[8][17]= "23";
gamearea_d[8][9] = "Aman'Thul";
deliver[8][18]= "22";
deliver[8][19]= "13";
gamearea_d[8][10] = "Ambossar";
deliver[8][20]= "28";
deliver[8][21]= "16";
gamearea_d[8][11] = "Anachronos";
deliver[8][22]= "6";
deliver[8][23]= "23";
gamearea_d[8][12] = "Anetheron";
deliver[8][24]= "11";
deliver[8][25]= "5";
gamearea_d[8][13] = "Antonidas";
deliver[8][26]= "25";
deliver[8][27]= "14";
gamearea_d[8][14] = "Anub'arak";
deliver[8][28]= "22";
deliver[8][29]= "21";
gamearea_d[8][15] = "Arak-arahm";
deliver[8][30]= "26";
deliver[8][31]= "28";
gamearea_d[8][16] = "Arathi";
deliver[8][32]= "8";
deliver[8][33]= "26";
gamearea_d[8][17] = "Arathor";
deliver[8][34]= "22";
deliver[8][35]= "17";
gamearea_d[8][18] = "Archimonde";
deliver[8][36]= "25";
deliver[8][37]= "9";
gamearea_d[8][19] = "Area 52";
deliver[8][38]= "7";
deliver[8][39]= "12";
gamearea_d[8][20] = "Argent Dawn";
deliver[8][40]= "26";
deliver[8][41]= "15";
gamearea_d[8][21] = "Arthas";
deliver[8][42]= "15";
deliver[8][43]= "12";
gamearea_d[8][22] = "Arygos";
deliver[8][44]= "18";
deliver[8][45]= "10";
gamearea_d[8][23] = "Aszune";
deliver[8][46]= "26";
deliver[8][47]= "16";
gamearea_d[8][24] = "Auchindoun";
deliver[8][48]= "28";
deliver[8][49]= "18";
gamearea_d[8][25] = "Azjol-Nerub";
deliver[8][50]= "25";
deliver[8][51]= "26";
gamearea_d[8][26] = "Azshara";
deliver[8][52]= "29";
deliver[8][53]= "26";
gamearea_d[8][27] = "Azuremyst";
deliver[8][54]= "19";
deliver[8][55]= "10";
gamearea_d[8][28] = "Baelgun";
deliver[8][56]= "27";
deliver[8][57]= "13";
gamearea_d[8][29] = "Balnazzar";
deliver[8][58]= "20";
deliver[8][59]= "18";
gamearea_d[8][30] = "Blackhand";
deliver[8][60]= "30";
deliver[8][61]= "15";
gamearea_d[8][31] = "Blackmoore";
deliver[8][62]= "15";
deliver[8][63]= "8";
gamearea_d[8][32] = "Blackrock";
deliver[8][64]= "11";
deliver[8][65]= "7";
gamearea_d[8][33] = "Blade's Edge";
deliver[8][66]= "21";
deliver[8][67]= "5";
gamearea_d[8][34] = "Bladefist";
deliver[8][68]= "12";
deliver[8][69]= "23";
gamearea_d[8][35] = "Bloodfeather";
deliver[8][70]= "13";
deliver[8][71]= "8";
gamearea_d[8][36] = "Bloodhoof";
deliver[8][72]= "8";
deliver[8][73]= "24";
gamearea_d[8][37] = "Bloodscalp";
deliver[8][74]= "15";
deliver[8][75]= "21";
gamearea_d[8][38] = "Blutkessel";
deliver[8][76]= "29";
deliver[8][77]= "10";
gamearea_d[8][39] = "Boulderfist";
deliver[8][78]= "7";
deliver[8][79]= "27";
gamearea_d[8][40] = "Bronze Dragonflight";
deliver[8][80]= "23";
deliver[8][81]= "27";
gamearea_d[8][41] = "Bronzebeard";
deliver[8][82]= "23";
deliver[8][83]= "22";
gamearea_d[8][42] = "Burning Blade";
deliver[8][84]= "23";
deliver[8][85]= "11";
gamearea_d[8][43] = "Burning Legion";
deliver[8][86]= "27";
deliver[8][87]= "20";
gamearea_d[8][44] = "Burning Steppes";
deliver[8][88]= "20";
deliver[8][89]= "17";
gamearea_d[8][45] = "C'Thun";
deliver[8][90]= "7";
deliver[8][91]= "20";
gamearea_d[8][46] = "Chamber of Aspects";
deliver[8][92]= "27";
deliver[8][93]= "18";
gamearea_d[8][47] = "Chants éternels";
deliver[8][94]= "23";
deliver[8][95]= "7";
gamearea_d[8][48] = "Cho'gall";
deliver[8][96]= "20";
deliver[8][97]= "13";
gamearea_d[8][49] = "Chromaggus";
deliver[8][98]= "8";
deliver[8][99]= "28";
gamearea_d[8][50] = "Colinas Pardas";
deliver[8][100]= "6";
deliver[8][101]= "16";
gamearea_d[8][51] = "Confrérie du Thorium";
deliver[8][102]= "5";
deliver[8][103]= "10";
gamearea_d[8][52] = "Conseil des Ombres";
deliver[8][104]= "9";
deliver[8][105]= "16";
gamearea_d[8][53] = "Crushridge";
deliver[8][106]= "27";
deliver[8][107]= "7";
gamearea_d[8][54] = "Culte de la Rive noire";
deliver[8][108]= "21";
deliver[8][109]= "29";
gamearea_d[8][55] = "Daggerspine";
deliver[8][110]= "30";
deliver[8][111]= "14";
gamearea_d[8][56] = "Dalaran";
deliver[8][112]= "26";
deliver[8][113]= "22";
gamearea_d[8][57] = "Dalvengyr";
deliver[8][114]= "6";
deliver[8][115]= "19";
gamearea_d[8][58] = "Darkmoon Faire";
deliver[8][116]= "28";
deliver[8][117]= "29";
gamearea_d[8][59] = "Darksorrow";
deliver[8][118]= "8";
deliver[8][119]= "18";
gamearea_d[8][60] = "Darkspear";
deliver[8][120]= "15";
deliver[8][121]= "10";
gamearea_d[8][61] = "Das Konsortium";
deliver[8][122]= "7";
deliver[8][123]= "11";
gamearea_d[8][62] = "Das Syndikat";
deliver[8][124]= "23";
deliver[8][125]= "26";
gamearea_d[8][63] = "Deathwing";
deliver[8][126]= "13";
deliver[8][127]= "13";
gamearea_d[8][64] = "Defias Brotherhood";
deliver[8][128]= "9";
deliver[8][129]= "16";
gamearea_d[8][65] = "Dentarg";
deliver[8][130]= "10";
deliver[8][131]= "11";
gamearea_d[8][66] = "Der abyssische Rat";
deliver[8][132]= "28";
deliver[8][133]= "11";
gamearea_d[8][67] = "Der Mithrilorden";
deliver[8][134]= "16";
deliver[8][135]= "6";
gamearea_d[8][68] = "Der Rat von Dalaran";
deliver[8][136]= "22";
deliver[8][137]= "12";
gamearea_d[8][69] = "Destromath";
deliver[8][138]= "9";
deliver[8][139]= "13";
gamearea_d[8][70] = "Dethecus";
deliver[8][140]= "11";
deliver[8][141]= "8";
gamearea_d[8][71] = "Die Aldor";
deliver[8][142]= "22";
deliver[8][143]= "7";
gamearea_d[8][72] = "Die Arguswacht";
deliver[8][144]= "25";
deliver[8][145]= "23";
gamearea_d[8][73] = "Die ewige Wacht";
deliver[8][146]= "21";
deliver[8][147]= "23";
gamearea_d[8][74] = "Die Nachtwache";
deliver[8][148]= "21";
deliver[8][149]= "24";
gamearea_d[8][75] = "Die Silberne Hand";
deliver[8][150]= "11";
deliver[8][151]= "5";
gamearea_d[8][76] = "Die Todeskrallen";
deliver[8][152]= "30";
deliver[8][153]= "14";
gamearea_d[8][77] = "Doomhammer";
deliver[8][154]= "11";
deliver[8][155]= "23";
gamearea_d[8][78] = "Draenor";
deliver[8][156]= "9";
deliver[8][157]= "20";
gamearea_d[8][79] = "Dragonblight";
deliver[8][158]= "6";
deliver[8][159]= "14";
gamearea_d[8][80] = "Dragonmaw";
deliver[8][160]= "6";
deliver[8][161]= "11";
gamearea_d[8][81] = "Drak'thul";
deliver[8][162]= "20";
deliver[8][163]= "30";
gamearea_d[8][82] = "Drek'Thar";
deliver[8][164]= "18";
deliver[8][165]= "6";
gamearea_d[8][83] = "Dun Modr";
deliver[8][166]= "6";
deliver[8][167]= "9";
gamearea_d[8][84] = "Dun Morogh";
deliver[8][168]= "14";
deliver[8][169]= "10";
gamearea_d[8][85] = "Dunemaul";
deliver[8][170]= "17";
deliver[8][171]= "20";
gamearea_d[8][86] = "Durotan";
deliver[8][172]= "14";
deliver[8][173]= "9";
gamearea_d[8][87] = "Earthen Ring";
deliver[8][174]= "22";
deliver[8][175]= "9";
gamearea_d[8][88] = "Echsenkessel";
deliver[8][176]= "27";
deliver[8][177]= "13";
gamearea_d[8][89] = "Eitrigg";
deliver[8][178]= "28";
deliver[8][179]= "18";
gamearea_d[8][90] = "Eldre'Thalas";
deliver[8][180]= "6";
deliver[8][181]= "8";
gamearea_d[8][91] = "Elune";
deliver[8][182]= "18";
deliver[8][183]= "6";
gamearea_d[8][92] = "Emerald Dream";
deliver[8][184]= "18";
deliver[8][185]= "25";
gamearea_d[8][93] = "Emeriss";
deliver[8][186]= "24";
deliver[8][187]= "23";
gamearea_d[8][94] = "Eonar";
deliver[8][188]= "15";
deliver[8][189]= "25";
gamearea_d[8][95] = "Eredar";
deliver[8][190]= "6";
deliver[8][191]= "17";
gamearea_d[8][96] = "Executus";
deliver[8][192]= "6";
deliver[8][193]= "22";
gamearea_d[8][97] = "Exodar";
deliver[8][194]= "16";
deliver[8][195]= "19";
gamearea_d[8][98] = "Festung der Stürme";
deliver[8][196]= "24";
deliver[8][197]= "17";
gamearea_d[8][99] = "Forscherliga";
deliver[8][198]= "24";
deliver[8][199]= "7";
gamearea_d[8][100] = "Frostmane";
deliver[8][200]= "22";
deliver[8][201]= "10";
gamearea_d[8][101] = "Frostmourne";
deliver[8][202]= "22";
deliver[8][203]= "6";
gamearea_d[8][102] = "Frostwhisper";
deliver[8][204]= "15";
deliver[8][205]= "14";
gamearea_d[8][103] = "Frostwolf";
deliver[8][206]= "11";
deliver[8][207]= "11";
gamearea_d[8][104] = "Garona";
deliver[8][208]= "22";
deliver[8][209]= "8";
gamearea_d[8][105] = "Garrosh";
deliver[8][210]= "24";
deliver[8][211]= "24";
gamearea_d[8][106] = "Genjuros";
deliver[8][212]= "12";
deliver[8][213]= "12";
gamearea_d[8][107] = "Ghostlands";
deliver[8][214]= "25";
deliver[8][215]= "26";
gamearea_d[8][108] = "Gilneas";
deliver[8][216]= "6";
deliver[8][217]= "19";
gamearea_d[8][109] = "Gorgonnash";
deliver[8][218]= "18";
deliver[8][219]= "17";
gamearea_d[8][110] = "Grim Batol";
deliver[8][220]= "13";
deliver[8][221]= "19";
gamearea_d[8][111] = "Gul'dan";
deliver[8][222]= "29";
deliver[8][223]= "15";
gamearea_d[8][112] = "Hakkar";
deliver[8][224]= "11";
deliver[8][225]= "14";
gamearea_d[8][113] = "Haomarush";
deliver[8][226]= "30";
deliver[8][227]= "30";
gamearea_d[8][114] = "Hellfire";
deliver[8][228]= "26";
deliver[8][229]= "23";
gamearea_d[8][115] = "Hellscream";
deliver[8][230]= "6";
deliver[8][231]= "18";
gamearea_d[8][116] = "Hyjal";
deliver[8][232]= "29";
deliver[8][233]= "24";
gamearea_d[8][117] = "Illidan";
deliver[8][234]= "20";
deliver[8][235]= "13";
gamearea_d[8][118] = "Jaedenar";
deliver[8][236]= "7";
deliver[8][237]= "26";
gamearea_d[8][119] = "Kael'thas";
deliver[8][238]= "20";
deliver[8][239]= "25";
gamearea_d[8][120] = "Karazhan";
deliver[8][240]= "30";
deliver[8][241]= "13";
gamearea_d[8][121] = "Kargath";
deliver[8][242]= "18";
deliver[8][243]= "11";
gamearea_d[8][122] = "Kazzak";
deliver[8][244]= "21";
deliver[8][245]= "13";
gamearea_d[8][123] = "Kel'Thuzad";
deliver[8][246]= "7";
deliver[8][247]= "23";
gamearea_d[8][124] = "Khadgar";
deliver[8][248]= "27";
deliver[8][249]= "20";
gamearea_d[8][125] = "Khaz Modan";
deliver[8][250]= "9";
deliver[8][251]= "10";
gamearea_d[8][126] = "Khaz'goroth";
deliver[8][252]= "9";
deliver[8][253]= "7";
gamearea_d[8][127] = "Kil'Jaeden";
deliver[8][254]= "20";
deliver[8][255]= "15";
gamearea_d[8][128] = "Kilrogg";
deliver[8][256]= "17";
deliver[8][257]= "19";
gamearea_d[8][129] = "Kirin Tor";
deliver[8][258]= "15";
deliver[8][259]= "12";
gamearea_d[8][130] = "Kor'gall";
deliver[8][260]= "12";
deliver[8][261]= "17";
gamearea_d[8][131] = "Krag'jin";
deliver[8][262]= "26";
deliver[8][263]= "11";
gamearea_d[8][132] = "Krasus";
deliver[8][264]= "10";
deliver[8][265]= "15";
gamearea_d[8][133] = "Kul Tiras";
deliver[8][266]= "19";
deliver[8][267]= "13";
gamearea_d[8][134] = "Kult der Verdammten";
deliver[8][268]= "10";
deliver[8][269]= "8";
gamearea_d[8][135] = "La Croisade écarlate";
deliver[8][270]= "7";
deliver[8][271]= "10";
gamearea_d[8][136] = "Laughing Skull";
deliver[8][272]= "17";
deliver[8][273]= "21";
gamearea_d[8][137] = "Les Clairvoyants";
deliver[8][274]= "17";
deliver[8][275]= "7";
gamearea_d[8][138] = "Les Sentinelles";
deliver[8][276]= "29";
deliver[8][277]= "19";
gamearea_d[8][139] = "Lightbringer";
deliver[8][278]= "26";
deliver[8][279]= "25";
gamearea_d[8][140] = "Lightning's Blade";
deliver[8][280]= "8";
deliver[8][281]= "30";
gamearea_d[8][141] = "Lordaeron";
deliver[8][282]= "30";
deliver[8][283]= "12";
gamearea_d[8][142] = "Los Errantes";
deliver[8][284]= "7";
deliver[8][285]= "20";
gamearea_d[8][143] = "Lothar";
deliver[8][286]= "23";
deliver[8][287]= "19";
gamearea_d[8][144] = "Madmortem";
deliver[8][288]= "9";
deliver[8][289]= "7";
gamearea_d[8][145] = "Magtheridon";
deliver[8][290]= "27";
deliver[8][291]= "16";
gamearea_d[8][146] = "Mal'Ganis";
deliver[8][292]= "19";
deliver[8][293]= "23";
gamearea_d[8][147] = "Malfurion";
deliver[8][294]= "22";
deliver[8][295]= "25";
gamearea_d[8][148] = "Malorne";
deliver[8][296]= "7";
deliver[8][297]= "11";
gamearea_d[8][149] = "Malygos";
deliver[8][298]= "7";
deliver[8][299]= "13";
gamearea_d[8][150] = "Mannoroth";
deliver[8][300]= "14";
deliver[8][301]= "10";
gamearea_d[8][151] = "Marécage de Zangar";
deliver[8][302]= "18";
deliver[8][303]= "27";
gamearea_d[8][152] = "Mazrigos";
deliver[8][304]= "27";
deliver[8][305]= "30";
gamearea_d[8][153] = "Medivh";
deliver[8][306]= "30";
deliver[8][307]= "25";
gamearea_d[8][154] = "Minahonda";
deliver[8][308]= "19";
deliver[8][309]= "25";
gamearea_d[8][155] = "Molten Core";
deliver[8][310]= "20";
deliver[8][311]= "22";
gamearea_d[8][156] = "Moonglade";
deliver[8][312]= "25";
deliver[8][313]= "20";
gamearea_d[8][157] = "Mug'thol";
deliver[8][314]= "30";
deliver[8][315]= "27";
gamearea_d[8][158] = "Nagrand";
deliver[8][316]= "9";
deliver[8][317]= "22";
gamearea_d[8][159] = "Nathrezim";
deliver[8][318]= "16";
deliver[8][319]= "13";
gamearea_d[8][160] = "Naxxramas";
deliver[8][320]= "25";
deliver[8][321]= "13";
gamearea_d[8][161] = "Nazjatar";
deliver[8][322]= "25";
deliver[8][323]= "14";
gamearea_d[8][162] = "Nefarian";
deliver[8][324]= "6";
deliver[8][325]= "16";
gamearea_d[8][163] = "Neptulon";
deliver[8][326]= "8";
deliver[8][327]= "9";
gamearea_d[8][164] = "Ner'zhul";
deliver[8][328]= "22";
deliver[8][329]= "11";
gamearea_d[8][165] = "Nera'thor";
deliver[8][330]= "17";
deliver[8][331]= "6";
gamearea_d[8][166] = "Nethersturm";
deliver[8][332]= "17";
deliver[8][333]= "5";
gamearea_d[8][167] = "Nordrassil";
deliver[8][334]= "29";
deliver[8][335]= "13";
gamearea_d[8][168] = "Norgannon";
deliver[8][336]= "5";
deliver[8][337]= "29";
gamearea_d[8][169] = "Nozdormu";
deliver[8][338]= "8";
deliver[8][339]= "19";
gamearea_d[8][170] = "Onyxia";
deliver[8][340]= "23";
deliver[8][341]= "23";
gamearea_d[8][171] = "Outland";
deliver[8][342]= "11";
deliver[8][343]= "18";
gamearea_d[8][172] = "Perenolde";
deliver[8][344]= "13";
deliver[8][345]= "10";
gamearea_d[8][173] = "Proudmoore";
deliver[8][346]= "15";
deliver[8][347]= "18";
gamearea_d[8][174] = "Quel'Thalas";
deliver[8][348]= "28";
deliver[8][349]= "26";
gamearea_d[8][175] = "Ragnaros";
deliver[8][350]= "26";
deliver[8][351]= "23";
gamearea_d[8][176] = "Rajaxx";
deliver[8][352]= "9";
deliver[8][353]= "21";
gamearea_d[8][177] = "Rashgarroth";
deliver[8][354]= "6";
deliver[8][355]= "11";
gamearea_d[8][178] = "Ravencrest";
deliver[8][356]= "6";
deliver[8][357]= "10";
gamearea_d[8][179] = "Ravenholdt";
deliver[8][358]= "15";
deliver[8][359]= "24";
gamearea_d[8][180] = "Rexxar";
deliver[8][360]= "16";
deliver[8][361]= "27";
gamearea_d[8][181] = "Runetotem";
deliver[8][362]= "26";
deliver[8][363]= "28";
gamearea_d[8][182] = "Sanguino";
deliver[8][364]= "28";
deliver[8][365]= "25";
gamearea_d[8][183] = "Sargeras";
deliver[8][366]= "11";
deliver[8][367]= "28";
gamearea_d[8][184] = "Saurfang";
deliver[8][368]= "23";
deliver[8][369]= "14";
gamearea_d[8][185] = "Scarshield Legion";
deliver[8][370]= "17";
deliver[8][371]= "16";
gamearea_d[8][186] = "Sen'jin";
deliver[8][372]= "7";
deliver[8][373]= "23";
gamearea_d[8][187] = "Shadowmoon";
deliver[8][374]= "29";
deliver[8][375]= "15";
gamearea_d[8][188] = "Shadowsong";
deliver[8][376]= "29";
deliver[8][377]= "13";
gamearea_d[8][189] = "Shattered Halls";
deliver[8][378]= "29";
deliver[8][379]= "27";
gamearea_d[8][190] = "Shattered Hand";
deliver[8][380]= "9";
deliver[8][381]= "25";
gamearea_d[8][191] = "Shattrath";
deliver[8][382]= "19";
deliver[8][383]= "14";
gamearea_d[8][192] = "Shen'dralar";
deliver[8][384]= "15";
deliver[8][385]= "20";
gamearea_d[8][193] = "Silvermoon";
deliver[8][386]= "20";
deliver[8][387]= "17";
gamearea_d[8][194] = "Sinstralis";
deliver[8][388]= "25";
deliver[8][389]= "30";
gamearea_d[8][195] = "Skullcrusher";
deliver[8][390]= "10";
deliver[8][391]= "11";
gamearea_d[8][196] = "Spinebreaker";
deliver[8][392]= "27";
deliver[8][393]= "6";
gamearea_d[8][197] = "Sporeggar";
deliver[8][394]= "8";
deliver[8][395]= "24";
gamearea_d[8][198] = "Steamwheedle Cartel";
deliver[8][396]= "27";
deliver[8][397]= "14";
gamearea_d[8][199] = "Stonemaul";
deliver[8][398]= "22";
deliver[8][399]= "19";
gamearea_d[8][200] = "Stormrage";
deliver[8][400]= "24";
deliver[8][401]= "9";
gamearea_d[8][201] = "Stormreaver";
deliver[8][402]= "30";
deliver[8][403]= "27";
gamearea_d[8][202] = "Stormscale";
deliver[8][404]= "28";
deliver[8][405]= "29";
gamearea_d[8][203] = "Sunstrider";
deliver[8][406]= "12";
deliver[8][407]= "26";
gamearea_d[8][204] = "Suramar";
deliver[8][408]= "11";
deliver[8][409]= "10";
gamearea_d[8][205] = "Sylvanas";
deliver[8][410]= "22";
deliver[8][411]= "16";
gamearea_d[8][206] = "Taerar";
deliver[8][412]= "30";
deliver[8][413]= "11";
gamearea_d[8][207] = "Talnivarr";
deliver[8][414]= "25";
deliver[8][415]= "14";
gamearea_d[8][208] = "Tarren Mill";
deliver[8][416]= "26";
deliver[8][417]= "15";
gamearea_d[8][209] = "Teldrassil";
deliver[8][418]= "26";
deliver[8][419]= "21";
gamearea_d[8][210] = "Temple noir";
deliver[8][420]= "14";
deliver[8][421]= "6";
gamearea_d[8][211] = "Terenas";
deliver[8][422]= "27";
deliver[8][423]= "11";
gamearea_d[8][212] = "Terokkar";
deliver[8][424]= "8";
deliver[8][425]= "5";
gamearea_d[8][213] = "Terrordar";
deliver[8][426]= "30";
deliver[8][427]= "30";
gamearea_d[8][214] = "The Maelstrom";
deliver[8][428]= "15";
deliver[8][429]= "22";
gamearea_d[8][215] = "The Sha'tar";
deliver[8][430]= "18";
deliver[8][431]= "8";
gamearea_d[8][216] = "The Venture Co";
deliver[8][432]= "26";
deliver[8][433]= "18";
gamearea_d[8][217] = "Theradras";
deliver[8][434]= "30";
deliver[8][435]= "23";
gamearea_d[8][218] = "Thrall";
deliver[8][436]= "17";
deliver[8][437]= "11";
gamearea_d[8][219] = "Throk'Feroth";
deliver[8][438]= "19";
deliver[8][439]= "23";
gamearea_d[8][220] = "Thunderhorn";
deliver[8][440]= "16";
deliver[8][441]= "11";
gamearea_d[8][221] = "Tichondrius";
deliver[8][442]= "9";
deliver[8][443]= "16";
gamearea_d[8][222] = "Tirion";
deliver[8][444]= "17";
deliver[8][445]= "30";
gamearea_d[8][223] = "Todeswache";
deliver[8][446]= "25";
deliver[8][447]= "13";
gamearea_d[8][224] = "Trollbane";
deliver[8][448]= "14";
deliver[8][449]= "21";
gamearea_d[8][225] = "Turalyon";
deliver[8][450]= "29";
deliver[8][451]= "24";
gamearea_d[8][226] = "Twilight's Hammer";
deliver[8][452]= "22";
deliver[8][453]= "26";
gamearea_d[8][227] = "Twisting Nether";
deliver[8][454]= "30";
deliver[8][455]= "26";
gamearea_d[8][228] = "Tyrande";
deliver[8][456]= "26";
deliver[8][457]= "30";
gamearea_d[8][229] = "Uldaman";
deliver[8][458]= "25";
deliver[8][459]= "10";
gamearea_d[8][230] = "Ulduar";
deliver[8][460]= "22";
deliver[8][461]= "13";
gamearea_d[8][231] = "Uldum";
deliver[8][462]= "14";
deliver[8][463]= "17";
gamearea_d[8][232] = "Un'Goro";
deliver[8][464]= "27";
deliver[8][465]= "14";
gamearea_d[8][233] = "Varimathras";
deliver[8][466]= "10";
deliver[8][467]= "13";
gamearea_d[8][234] = "Vashj";
deliver[8][468]= "21";
deliver[8][469]= "25";
gamearea_d[8][235] = "Vek'lor";
deliver[8][470]= "6";
deliver[8][471]= "7";
gamearea_d[8][236] = "Vek'nilash";
deliver[8][472]= "6";
deliver[8][473]= "10";
gamearea_d[8][237] = "Vol'jin";
deliver[8][474]= "18";
deliver[8][475]= "19";
gamearea_d[8][238] = "Warsong";
deliver[8][476]= "10";
deliver[8][477]= "13";
gamearea_d[8][239] = "Wildhammer";
deliver[8][478]= "28";
deliver[8][479]= "19";
gamearea_d[8][240] = "Wrathbringer";
deliver[8][480]= "29";
deliver[8][481]= "27";
gamearea_d[8][241] = "Xavius";
deliver[8][482]= "13";
deliver[8][483]= "21";
gamearea_d[8][242] = "Ysera";
deliver[8][484]= "22";
deliver[8][485]= "13";
gamearea_d[8][243] = "Ysondre";
deliver[8][486]= "16";
deliver[8][487]= "18";
gamearea_d[8][244] = "Zenedar";
deliver[8][488]= "13";
deliver[8][489]= "10";
gamearea_d[8][245] = "Zirkel des Cenarius";
deliver[8][490]= "24";
deliver[8][491]= "30";
gamearea_d[8][246] = "Zul'jin";
deliver[8][492]= "19";
deliver[8][493]= "7";
gamearea_d[8][247] = "Zuluhed";
deliver[8][494]= "17";
deliver[8][495]= "15";
gamearea_d[8][248] = "Азурегос";
deliver[8][496]= "17";
deliver[8][497]= "23";
gamearea_d[8][249] = "Борейская тундра";
deliver[8][498]= "23";
deliver[8][499]= "7";
gamearea_d[8][250] = "Вечная Песня";
deliver[8][500]= "17";
deliver[8][501]= "24";
gamearea_d[8][251] = "Гордунни";
deliver[8][502]= "9";
deliver[8][503]= "19";
gamearea_d[8][252] = "Гром";
deliver[8][504]= "30";
deliver[8][505]= "23";
gamearea_d[8][253] = "Дракономор";
deliver[8][506]= "7";
deliver[8][507]= "9";
gamearea_d[8][254] = "Король-лич";
deliver[8][508]= "5";
deliver[8][509]= "5";
gamearea_d[8][255] = "Пиратская бухта";
deliver[8][510]= "24";
deliver[8][511]= "29";
gamearea_d[8][256] = "Подземье";
deliver[8][512]= "27";
deliver[8][513]= "6";
gamearea_d[8][257] = "Свежеватель Душ";
deliver[8][514]= "19";
deliver[8][515]= "18";
gamearea_d[8][258] = "Седогрив";
deliver[8][516]= "15";
deliver[8][517]= "5";
gamearea_d[8][259] = "Страж Смерти";
deliver[8][518]= "5";
deliver[8][519]= "23";
gamearea_d[8][260] = "Разувий";
deliver[8][520]= "11";
deliver[8][521]= "24";
gamearea_d[8][261] = "Термоштепсель";
deliver[8][522]= "22";
deliver[8][523]= "25";
gamearea_d[8][262] = "Ткач Смерти";
deliver[8][524]= "27";
deliver[8][525]= "9";
gamearea_d[8][263] = "Ясеневый лес";
deliver[8][526]= "9";
deliver[8][527]= "13";


     function getCountryCode(country){
     // get selected country
     var not_ustel = document.getElementById("not_ustel");
	 var ustel = document.getElementById("ustel"); 
	 
	 var usatel1 = document.getElementById("usa_tel1");
	 var usatel2 = document.getElementById("usa_tel2");
	 var usatel3 = document.getElementById("usa_tel3");
	 var notusetel = document.getElementById("not_use_tel");
	 
	 if(country == "US") {
		 countryCode = '1';
	 	 not_ustel.style.display="none";
		 ustel.style.display="";
		 notusetel.value="";
	 } else {
	 	 not_ustel.style.display="";
		 ustel.style.display="none";
		 usatel1.value="";
		 usatel2.value="";
		 usatel3.value="";
	 }
	 if(country == "AD") countryCode = '33';
     if(country == "AE") countryCode = '971';
     if(country == "AF") countryCode = '93';
     if(country == "AG") countryCode = '809';
     if(country == "AI") countryCode = '809';
     if(country == "AL") countryCode = '355';
     if(country == "AM") countryCode = '7';
     if(country == "AN") countryCode = '599';
     if(country == "AO") countryCode = '244';
     if(country == "AR") countryCode = '54';
     if(country == "AT") countryCode = '43';
     if(country == "AU") countryCode = '61';
     if(country == "AW") countryCode = '297';
     if(country == "AZ") countryCode = '7';
     if(country == "BA") countryCode = '387';
     if(country == "BB") countryCode = '809';
     if(country == "BD") countryCode = '880';
     if(country == "BE") countryCode = '32';
     if(country == "BF") countryCode = '226';
     if(country == "BG") countryCode = '359';
     if(country == "BH") countryCode = '973';
     if(country == "BI") countryCode = '257';
     if(country == "BJ") countryCode = '229';
     if(country == "BM") countryCode = '809';
     if(country == "BN") countryCode = '673';
     if(country == "BO") countryCode = '591';
     if(country == "BR") countryCode = '55';
     if(country == "BS") countryCode = '809';
     if(country == "BT") countryCode = '975';
     if(country == "BW") countryCode = '267';
     if(country == "BY") countryCode = '7';
     if(country == "BZ") countryCode = '501';
     if(country == "CA") countryCode = '1';
     if(country == "CF") countryCode = '236';
     if(country == "CG") countryCode = '242';
     if(country == "CH") countryCode = '41';
     if(country == "CI") countryCode = '225';
     if(country == "CL") countryCode = '56';
     if(country == "CM") countryCode = '237';
     if(country == "CN") countryCode = '86';
     if(country == "CO") countryCode = '57';
     if(country == "CR") countryCode = '506';
     if(country == "CU") countryCode = '53';
     if(country == "CV") countryCode = '238';
     if(country == "CY") countryCode = '357';
     if(country == "CZ") countryCode = '420';
     if(country == "DE") countryCode = '49';
     if(country == "DJ") countryCode = '253';
     if(country == "DK") countryCode = '45';
     if(country == "DM") countryCode = '809';
     if(country == "DO") countryCode = '809';
     if(country == "DZ") countryCode = '213';
     if(country == "EC") countryCode = '593';
     if(country == "EE") countryCode = '7';
     if(country == "EG") countryCode = '20';
     if(country == "EH") countryCode = '212';
     if(country == "ER") countryCode = '291';
     if(country == "ES") countryCode = '34';
     if(country == "ET") countryCode = '251';
     if(country == "FO") countryCode = '298';
	 if(country == "FI") countryCode = '358';
     if(country == "FJ") countryCode = '679';
     if(country == "FM") countryCode = '691';
     if(country == "FR") countryCode = '33';
     if(country == "GA") countryCode = '220';
     if(country == "GE") countryCode = '7';
     if(country == "GF") countryCode = '594';
     if(country == "GH") countryCode = '233';
     if(country == "GM") countryCode = '220';
     if(country == "GN") countryCode = '224';
     if(country == "GP") countryCode = '590';
     if(country == "GQ") countryCode = '240';
     if(country == "GR") countryCode = '30';
     if(country == "GT") countryCode = '502';
     if(country == "GW") countryCode = '245';
     if(country == "GY") countryCode = '592';
     if(country == "HK") countryCode = '852';
     if(country == "HN") countryCode = '504';
     if(country == "HR") countryCode = '385';
     if(country == "HT") countryCode = '509';
     if(country == "HU") countryCode = '36';
     if(country == "ID") countryCode = '62';
     if(country == "IE") countryCode = '353';
     if(country == "IL") countryCode = '972';
     if(country == "IN") countryCode = '91';
     if(country == "IQ") countryCode = '964';
     if(country == "IR") countryCode = '98';
     if(country == "IS") countryCode = '354';
     if(country == "IT") countryCode = '39';
     if(country == "JM") countryCode = '809';
     if(country == "JO") countryCode = '962';
     if(country == "JP") countryCode = '81';
     if(country == "KP") countryCode = '850';
     if(country == "LA") countryCode = '856';
     if(country == "MK") countryCode = '389';
     if(country == "ML") countryCode = '223';
     if(country == "MQ") countryCode = '596';
     if(country == "KE") countryCode = '254';
     if(country == "KG") countryCode = '7';
     if(country == "KH") countryCode = '855';
     if(country == "KI") countryCode = '686';
     if(country == "KM") countryCode = '269';
     if(country == "KR") countryCode = '82';
     if(country == "KW") countryCode = '965';
     if(country == "KZ") countryCode = '7';
     if(country == "LB") countryCode = '961';
     if(country == "LC") countryCode = '809';
     if(country == "LI") countryCode = '41';
     if(country == "LK") countryCode = '94';
     if(country == "LR") countryCode = '231';
     if(country == "LS") countryCode = '266';
     if(country == "LT") countryCode = '7';
     if(country == "LU") countryCode = '352';
     if(country == "LV") countryCode = '7';
     if(country == "LY") countryCode = '218';
     if(country == "MA") countryCode = '212';
     if(country == "MC") countryCode = '33';
     if(country == "MD") countryCode = '7';
     if(country == "MG") countryCode = '261';
     if(country == "MM") countryCode = '95';
     if(country == "MN") countryCode = '976';
     if(country == "MR") countryCode = '222';
     if(country == "MS") countryCode = '809';
     if(country == "MT") countryCode = '356';
     if(country == "MU") countryCode = '230';
     if(country == "MX") countryCode = '52';
     if(country == "MY") countryCode = '60';
     if(country == "MZ") countryCode = '258';
     if(country == "NA") countryCode = '264';
     if(country == "NC") countryCode = '687';
     if(country == "NE") countryCode = '227';
     if(country == "NG") countryCode = '234';
     if(country == "NI") countryCode = '505';
     if(country == "NL") countryCode = '31';
     if(country == "NO") countryCode = '47';
     if(country == "NP") countryCode = '977';
     if(country == "NU") countryCode = '683';
     if(country == "NZ") countryCode = '64';
     if(country == "OM") countryCode = '968';
     if(country == "PA") countryCode = '507';
     if(country == "PE") countryCode = '51';
     if(country == "PF") countryCode = '689';
     if(country == "PG") countryCode = '675';
     if(country == "PH") countryCode = '63';
     if(country == "PK") countryCode = '92';
     if(country == "PL") countryCode = '48';
     if(country == "PR") countryCode = '1-787';
     if(country == "PT") countryCode = '351';
     if(country == "PY") countryCode = '595';
     if(country == "QA") countryCode = '974';
     if(country == "RO") countryCode = '40';
     if(country == "RU") countryCode = '7';
     if(country == "RW") countryCode = '250';
     if(country == "SA") countryCode = '966';
     if(country == "SC") countryCode = '248';
     if(country == "SD") countryCode = '249';
     if(country == "SE") countryCode = '46';
     if(country == "SG") countryCode = '65';
     if(country == "SI") countryCode = '386';
     if(country == "SK") countryCode = '421';
     if(country == "SL") countryCode = '232';
     if(country == "SN") countryCode = '221';
     if(country == "SO") countryCode = '252';
     if(country == "SR") countryCode = '597';
     if(country == "SV") countryCode = '503';
     if(country == "SZ") countryCode = '268';
     if(country == "TD") countryCode = '235';
     if(country == "TG") countryCode = '228';
     if(country == "TH") countryCode = '66';
     if(country == "TJ") countryCode = '7';
     if(country == "TK") countryCode = '690';
     if(country == "TM") countryCode = '7';
     if(country == "TN") countryCode = '216';
     if(country == "TO") countryCode = '676';
     if(country == "TR") countryCode = '90';
     if(country == "TT") countryCode = '809';
     if(country == "TW") countryCode = '886';
     if(country == "TZ") countryCode = '255';
     if(country == "UA") countryCode = '7';
     if(country == "UG") countryCode = '256';
     if(country == "UK") countryCode = '44';
     if(country == "US") countryCode = '1';
     if(country == "UY") countryCode = '598';
     if(country == "UZ") countryCode = '7';
     if(country == "VA") countryCode = '39';
     if(country == "VE") countryCode = '58';
     if(country == "VG") countryCode = '809';
     if(country == "VI") countryCode = '1-340';
     if(country == "VN") countryCode = '84';
     if(country == "VU") countryCode = '678';
     if(country == "YE") countryCode = '967';
     if(country == "YT") countryCode = '269';
     if(country == "YU") countryCode = '389';
     if(country == "ZA") countryCode = '27';
     if(country == "ZM") countryCode = '260';
     if(country == "ZW") countryCode = '263';

     document.goldForm.countryCode.value = countryCode;
     if(country != "US")document.goldForm.countryCode.focus();
     }


function changeGoldnum(serverarea)
{
	theform.goldnum.length = 0;
	for(z=0; z<goldArray.length; z++)
	{
		if (goldArray[z][0] == serverarea)
		{
			if (goldArray[z][1]==goldnums_selected){
				theform.goldnum.options[theform.goldnum.length] = new Option(goldArray[z][1], goldArray[z][2], true, true);
			}
			else{
				theform.goldnum.options[theform.goldnum.length] = new Option(goldArray[z][1], goldArray[z][2]);
			}
		}
	}
}

function changeArea(serverarea)
{
    var thefrom;
    serverarea_num = serverarea;
    theform = document.sellgold;
	theform.servername.length = 0;
	goldnum_default_sign = true;  //每次重新载入，设默认值
	/*
	if (typeof(document.all.extra_gold)!="undefined") {
		document.all.extra_gold.innerHTML = serverarea==5 ? '50' : '100';
	}
	
	if (typeof(document.getElementById("of_f2f_desc")!="undefined")){
		document.getElementById("of_f2f_desc").style.display = serverarea==5 ? 'none' : '';
	}
	*/
	if (serverarea==5){
		document.getElementById("pricelist_name").innerHTML = ">2000G EXTRA OFF!";
	}else{
		document.getElementById("pricelist_name").innerHTML = ">3000G EXTRA OFF!"
	}
	theform.servername.options[0] = new Option("Choose Your Realm (Server)", "");
    for (i=0; i<areaArray.length; i++)
    {
    	if (areaArray[i][0] == serverarea)
    	{
    		var servername_len = theform.servername.length;
    		theform.servername.options[servername_len] = new Option(areaArray[i][1], areaArray[i][2]);
    		if (servernames_selected!=''){
    			//alert(servernames_selected);
    			//alert(areaArray[i][2]);
    			if (servernames_selected==areaArray[i][2]){
    				theform.servername.options[servername_len].selected = true;
    			}
    		}
    	}
    }
    
    changeGoldnum(serverarea);
}
// ColdFusion JavaScript functions for cfform client-side validation

var _CF_loaded=0;

function _CF_signalLoad()
{
	_CF_loaded = 1;
}


function _CF_onError(form_object, input_object, object_value, error_message)
{
	alert(error_message);
	return false;	
}


function _CF_hasValue(obj, obj_type)
{
	if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
		if (obj.value.length == 0) 
	  		return false;
		else 
	  		return true;
	}
	else if (obj_type == "SELECT")
	{
		for (i=0; i < obj.length; i++)
		{
			if (obj.options[i].selected)
				return true;
		}
	   	return false;	
	}
	else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{
		if (obj.checked)
			return true;
		else
	   		return false;	
	}
	else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{
		for (i=0; i < obj.length; i++)
		{
			if (obj[i].checked)
				return true;
		}
	   	return false;	
	}
}


function _CF_checkdate(object_value)
{
	if (object_value.length == 0)
		return true;

	isplit = object_value.indexOf('/');

	if (isplit == -1 || isplit == object_value.length)
		return false;

	sMonth = object_value.substring(0, isplit);

	if (sMonth.length == 0)
		return false;

	isplit = object_value.indexOf('/', isplit + 1);

	if (isplit == -1 || (isplit + 1 ) == object_value.length)
		return false;

	sDay = object_value.substring((sMonth.length + 1), isplit);

	if (sDay.length == 0)
		return false;

	sYear = object_value.substring(isplit + 1);

	if (!_CF_checkinteger(sMonth))
		return false;
	else if (!_CF_checkrange(sMonth, 1, 12))
		return false;
	else if (!_CF_checkinteger(sYear))
		return false;
	else if (!_CF_checkrange(sYear, 0, 9999))
		return false;
	else if (!_CF_checkinteger(sDay))
		return false;
	else if (!_CF_checkday(sYear, sMonth, sDay))
		return false;
	else
		return true;
}


function _CF_checkeurodate(object_value)
{
	if (object_value.length == 0)
		return true;

	isplit = object_value.indexOf('/');

	if (isplit == -1)
		isplit = object_value.indexOf('.');

	if (isplit == -1 || isplit == object_value.length)
		return false;

	sDay = object_value.substring(0, isplit);

	monthSplit = isplit + 1;

	isplit = object_value.indexOf('/', monthSplit);

	if (isplit == -1)
		isplit = object_value.indexOf('.', monthSplit);

	if (isplit == -1 ||  (isplit + 1 )  == object_value.length)
		return false;

	sMonth = object_value.substring((sDay.length + 1), isplit);

	sYear = object_value.substring(isplit + 1);

	if (!_CF_checkinteger(sMonth))
		return false;
	else
	if (!_CF_checkrange(sMonth, 1, 12))
		return false;
	else
	if (!_CF_checkinteger(sYear))
		return false;
	else
	if (!_CF_checkrange(sYear, 0, null))
		return false;
	else
	if (!_CF_checkinteger(sDay))
		return false;
	else
	if (!_CF_checkday(sYear, sMonth, sDay))
		return false;
	else
		return true;
}


function _CF_checkday(checkYear, checkMonth, checkDay)
{
	maxDay = 31;

	if (checkMonth == 4 || checkMonth == 6 ||
		checkMonth == 9 || checkMonth == 11)
		maxDay = 30;
	else if (checkMonth == 2)
	{
		if (checkYear % 4 > 0)
			maxDay =28;
		else if (checkYear % 100 == 0 && checkYear % 400 > 0)
			maxDay = 28;
		else
			maxDay = 29;
	}

	return _CF_checkrange(checkDay, 1, maxDay);
}


function _CF_checkinteger(object_value)
{
	if (object_value.length == 0)
		return true;

	var decimal_format = ".";
	var check_char = object_value.indexOf(decimal_format);

	if (check_char == -1)
		return _CF_checknumber(object_value);
	else
		return false;
}


function _CF_numberrange(object_value, min_value, max_value)
{
	if (min_value != null)
	{
		if (object_value < min_value)
			return false;
	}

	if (max_value != null)
	{
		if (object_value > max_value)
			return false;
	}

	return true;
}


function _CF_checknumber(object_value)
{
	if (object_value.length == 0)
		return true;

	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

	check_char = start_format.indexOf(object_value.charAt(0));

	if (check_char == 1)
		decimal = true;
	else if (check_char < 1)
		return false;

	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i));
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
		}
		else if (trailing_blank)
			return false;
		else
			digits = true;
	}	

	return true
}


function _CF_checkrange(object_value, min_value, max_value)
{
	if (object_value.length == 0)
		return true;

	if (!_CF_checknumber(object_value))
		return false;
	else
		return (_CF_numberrange((eval(object_value)), min_value, max_value));

	return true;
}


function _CF_checktime(object_value)
{
	if (object_value.length == 0)
		return true;

	isplit = object_value.indexOf(':');

	if (isplit == -1 || isplit == object_value.length)
		return false;

	sHour = object_value.substring(0, isplit);
	iminute = object_value.indexOf(':', isplit + 1);

	if (iminute == -1 || iminute == object_value.length)
		sMin = object_value.substring((sHour.length + 1));
	else
		sMin = object_value.substring((sHour.length + 1), iminute);

	if (!_CF_checkinteger(sHour))
		return false;
	else if (!_CF_checkrange(sHour, 0, 23))
		return false;

	if (!_CF_checkinteger(sMin))
		return false;
	else
	if (!_CF_checkrange(sMin, 0, 59))
		return false;

	if (iminute != -1)
	{
		sSec = object_value.substring(iminute + 1);

		if (!_CF_checkinteger(sSec))
			return false;
		else if (!_CF_checkrange(sSec, 0, 59))
			return false;	
	}

	return true;
}


function _CF_checkphone(object_value)
{
	if (object_value.length == 0)
		return true;

	if (object_value.length != 12)
		return false;

	if (!_CF_checknumber(object_value.substring(0,3)))
		return false;
	else if (!_CF_numberrange((eval(object_value.substring(0,3))), 100, 1000))
		return false;

	if (object_value.charAt(3) != "-" && object_value.charAt(3) != " ")
		return false

	if (!_CF_checknumber(object_value.substring(4,7)))
		return false;
	else if (!_CF_numberrange((eval(object_value.substring(4,7))), 100, 1000))
		return false;

	if (object_value.charAt(7) != "-" && object_value.charAt(7) != " ")
		return false;

	if (object_value.charAt(8) == "-" || object_value.charAt(8) == "+")
		return false;
	else
		return (_CF_checkinteger(object_value.substring(8,12)));
}


function _CF_checkzip(object_value)
{
	if (object_value.length == 0)
		return true;

	if (object_value.length != 5 && object_value.length != 10)
		return false;

	if (object_value.charAt(0) == "-" || object_value.charAt(0) == "+")
		return false;

	if (!_CF_checkinteger(object_value.substring(0,5)))
		return false;

	if (object_value.length == 5)
		return true;

	if (object_value.charAt(5) != "-" && object_value.charAt(5) != " ")
		return false;

	if (object_value.charAt(6) == "-" || object_value.charAt(6) == "+")
		return false;

	return (_CF_checkinteger(object_value.substring(6,10)));
}


function _CF_checkcreditcard(object_value)
{
	if (object_value.length == 0)
		return true;
	var white_space = " -";
	var creditcard_string="";
	var check_char;

	for (var i = 0; i < object_value.length; i++)
	{
		check_char = white_space.indexOf(object_value.charAt(i));
		if (check_char < 0)
			creditcard_string += object_value.substring(i, (i + 1));
	}	

	if (creditcard_string.length < 13 || creditcard_string.length > 19)
		return false;

	if (creditcard_string.charAt(0) == "+")
		return false;

	if (!_CF_checkinteger(creditcard_string))
		return false;

	var doubledigit = creditcard_string.length % 2 == 1 ? false : true;
	var checkdigit = 0;
	var tempdigit;

	for (var i = 0; i < creditcard_string.length; i++)
	{
		tempdigit = eval(creditcard_string.charAt(i));

		if (doubledigit)
		{
			tempdigit *= 2;
			checkdigit += (tempdigit % 10);

			if ((tempdigit / 10) >= 1.0)
				checkdigit++;

			doubledigit = false;
		}
		else
		{
			checkdigit += tempdigit;
			doubledigit = true;
		}
	}	
	return (checkdigit % 10) == 0 ? true : false;
}


function _CF_checkssc(object_value)
{
	var white_space = " -+.";
	var ssc_string="";
	var check_char;

	if (object_value.length == 0)
		return true;

	if (object_value.length != 11)
		return false;

	if (object_value.charAt(3) != "-" && object_value.charAt(3) != " ")
		return false;

	if (object_value.charAt(6) != "-" && object_value.charAt(6) != " ")
		return false;

	for (var i = 0; i < object_value.length; i++)
	{
		check_char = white_space.indexOf(object_value.charAt(i));
		if (check_char < 0)
			ssc_string += object_value.substring(i, (i + 1));
	}

	if (ssc_string.length != 9)
		return false;

	if (!_CF_checkinteger(ssc_string))
		return false;

	return true;
}


function _CF_setFormParam( strFormName, strParamName, strParamValue )
{
	var strObjName = "document." + strFormName + "." + strParamName;
	var obj = eval( strObjName );
	obj.value = strParamValue;
	return true;
}


function _CF_checkregex(object_value, regex)
{
	return regex.test(object_value);
}

function checkEmail(email){
var emailPattern = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
if (emailPattern.test(email)==false)
	return false
else
	return true;
}

//设置下列菜单默认值
function setOptionValue(obj_id, obj_value){
	var els = document.getElementById(obj_id);
    for(var i=0;i<els.options.length;i++)
    {
        if(els.options[i].value==obj_value)
        {
            els.options[i].selected = true;
            break;
        }
    }
}

function check_form(form_name) {
	/*
  	if (submitted == true) {
    	alert("send form,please wait...");
    	return false;
  	}*/

	var _CF_this=form_name;
	
	//alert();
	//if(_CF_this.order_num.value==''){
		//alert("Please write down your order ID");
		//return false;
	//}
	
	if(_CF_this.servername.value==''){
		alert("Please choose your Realm (Server)");
		return false;
	}
	
	if(_CF_this.faction.value==''){
		alert("Please choose your Faction");
		return false;
	}

	if  (!_CF_hasValue(_CF_this.charactername, "TEXT" ))
	{
		if  (!_CF_onError(_CF_this, _CF_this.charactername, _CF_this.charactername.value, "Please fill your game character name for the instant delivery."))
		{
			return false;
		}
	}

	if (!_CF_checkregex(_CF_this.charactername.value,/^[^,\.'\"\*\?\+@#$&!\-_]+$/)) 
	{
		alert("The character name should be composed of alphabetic letter only.");
		_CF_this.charactername.focus();
		return false;
	}

/***
if (typeof(_CF_this.coupon_code)!='undefined' && _CF_this.coupon_code.value!=''){
			alert("Invalid Coupon Code\n\nMineWoW Coupon Code is unique to every in-game email that we deliver and it can be used ONLY ONCE.\nThere are a couple of reasons that the Coupon Code is Invalid:\n\n1) Your have entered incorrectly. Please enter the code carefully and try again.\n\n2) You in-game email has been read by someone else other than yourself and the someone else has used \nit to purchase gold from us. Please check with Blizzard to see if you account has been unauthorizedly used.\n\n3) You forgot that you have used this code before. You have to ask some of your other friends to see if\nthey can spare their own Coupon Code for you to use.");
			return false;
	}
****/
	if  (!_CF_hasValue(_CF_this.customers_name, "TEXT" ))
	{
		if  (!_CF_onError(_CF_this, _CF_this.customers_name, _CF_this.customers_name.value, "Please fill your name."))
		{
			return false;
		}
	}


	if  (!_CF_hasValue(_CF_this.customers_email_address, "TEXT" ))
	{
		if  (!_CF_onError(_CF_this, _CF_this.customers_email_address, _CF_this.customers_email_address.value, "Please fill your email address."))
		{
			return false;
		}
	}
	
	if(!checkEmail(_CF_this.customers_email_address.value)){
		alert("Invalid Email Format");
		return false;
	}

	if( !( ( (_CF_hasValue(_CF_this.usa_tel1, "TEXT") && _CF_checkinteger(_CF_this.usa_tel1.value))
	          && (_CF_hasValue(_CF_this.usa_tel2, "TEXT") && _CF_checkinteger(_CF_this.usa_tel2.value))
	          && (_CF_hasValue(_CF_this.usa_tel3, "TEXT") && _CF_checkinteger(_CF_this.usa_tel3.value)) )
	     ||( (_CF_hasValue(_CF_this.countryCode, "TEXT") && _CF_checkinteger(_CF_this.countryCode.value)) 
	        && (_CF_hasValue(_CF_this.not_use_tel, "TEXT")  && _CF_checkinteger(_CF_this.not_use_tel.value)) ) ) )
	{
		alert("Please fill in your telephone number, with which in order for us  to confirm your order.");
		return false;
	}
    return true;
}

function viewTestMail(){
	testMail.style.display="block"
}

function hiddenTestMail(){
	testMail.style.display="none"
}

discounts_num_all = new Array(50000,40000,30000,20000,15000,10000,9000,8000,7000,6000,5000,4500,4000,3000,2000,1500,1000,800,0);
//discounts_num_all = new Array(10000,9000,8000,7000,6000,5000,4500,4000,3500,3000,2500,2000,1800,1500,1300,1000,800,500);

function onload_price()
{

	servername=global_servername;
	faction=global_faction;
	theform = document.sellgold;

	//window.alert(servername);

	//选定两个值

	var slength = theform.servername.options.length;
	//window.alert(slength);

	for(var i=0;i<slength;i++)
	{

		if(theform.servername.options[i].value==servername)
		{
			theform.servername.options[i].selected = true;
			break;
		}

	}


	var flength = theform.faction.options.length;

	for(var i=0;i<flength;i++)
	{

		if(theform.faction.options[i].text==faction)
		{
			theform.faction.options[i].selected = true;
			break;
		}

	}

	changeprice();
}


var goldnum_default_sign = true;   //是否打开默认接近usd99的数值
var eu_div_offset_sign = false;    //是否打开欧服偏移量
var ccode_txt_value = '';
function changeprice()
{
	var i,area_id,tmpname,servername_id,faction_id,servername_value,goldnum_value;

	theform = document.sellgold;

	sel_1 = theform.serverarea;

	sel_2 = theform.servername;

	sel_3 = theform.faction;

	sel_4 = theform.goldnum;

	area_id = sel_1.selectedIndex;
	for(i = 0; i < sel_1.length; i++)
	{
		if(sel_1[i].checked)
		{
			area_id=sel_1[i].value;
			break;
		}
	}

	document.getElementById('txt_allgoldprice').style.textDecoration='none';

	if (document.getElementById('txt_allgoldprice2')){
		document.getElementById('txt_allgoldprice2').value='';
		document.getElementById('txt_allgoldprice2').style.display='none';
	}
	if (document.getElementById('span_firsttime')) document.getElementById('span_firsttime').innerHTML='';
	if (document.getElementById("dis_info_us_div")) document.getElementById("dis_info_us_div").style.paddingLeft='0px';
	if (document.getElementById("dis_info_eu_div")) document.getElementById("dis_info_eu_div").style.paddingLeft='0px';


	servername_id = sel_2.selectedIndex;
	faction_id = sel_3.selectedIndex;
	gold_num=sel_4.value;

	if(servername_id>0){
		servername_id=servername_id-1;
	}

	if(faction_id>0){
		faction_id=faction_id-1;
	}

	//第一次打开获取默认值
	if (goldnum_default_sign && sel_2.selectedIndex!=0 && sel_3.selectedIndex!=0){
		goldnum_default_sign = false;
		//gold_num = area_id==5 ? 1000 : 1000;
		gold_num = goldnums_selected;
		setOptionValue("goldnum", gold_num);
		//		gold_num = onload_getGoldNum(area_id,servername_id,faction_id);
		//alert(gold_num);
	}
	//文字显示 欧服多货币显示
	document.getElementById("dis_info_us_div").style.display = "none";
	document.getElementById("dis_info_eu_div").style.display = "none";
	document.getElementById("currency_amount_div").style.display = "none";
	if (document.getElementById("currency_amount_div2")) document.getElementById("currency_amount_div2").style.display = "none";
	eu_div_offset_sign = false;

	//增加对于 5%用户的处理
	var discount_user= document.cookie.indexOf('isfirsttime')!=-1;

	var discount_ok=false;


	if (sel_2.selectedIndex!=0 && sel_3.selectedIndex!=0){
		if (area_id==5){
			//美服也显示多货币
			document.getElementById("currency_amount_div").style.display = "";
			if (document.getElementById("currency_amount_div2")) document.getElementById("currency_amount_div2").style.display = "";

			var gold_num_new2=2000;
			if (discount_user) gold_num_new2=1500;

			if (gold_num<gold_num_new2) {
				if (!discount_user) document.getElementById("dis_info_us_div").style.display = "";
				discount_ok=false;
			}else if(discount_user){
				document.getElementById("dis_info_us_div").style.display = "";
				document.getElementById("dis_info_us_div").innerHTML = "<b>5%</b> first-timer discount is granted to you by MineWoW";
				discount_ok=true;
			}
		}else{
			document.getElementById("currency_amount_div").style.display = "";
			if (document.getElementById("currency_amount_div2")) document.getElementById("currency_amount_div2").style.display = "";

			var gold_num_new=3000;
			if (discount_user) gold_num_new=2000;

			if (gold_num<gold_num_new) {
				if (!discount_user) document.getElementById("dis_info_eu_div").style.display = "";
				discount_ok=false;
			}else if(discount_user){
				document.getElementById("dis_info_eu_div").style.display = "";
				document.getElementById("dis_info_eu_div").innerHTML = "<b>5%</b> first-timer discount is granted to you by MineWoW";
				discount_ok=true;

			}
			eu_div_offset_sign = true;
		}
	}

	setgoldpricelist(area_id,servername_id,faction_id,gold_num);
	setgoldprice(area_id,servername_id,faction_id,gold_num,discount_ok);
	judgeTrade(area_id,servername_id,faction_id,gold_num);
	showAhServer(area_id,sel_2.value,sel_3.value);
	if(document.getElementById('coupon_code').value.length>0 || document.getElementById('coupon_code').value!=ccode_txt_value) {
		show_mesbytype('coupon');
		setgoldprice(area_id,servername_id,faction_id,gold_num,discount_ok);
	}
	ccode_txt_value = document.getElementById('coupon_code').value;
}

function showAhServer(area,servername,faction){
	var obj1=document.getElementById('dmethod1');
	var obj2=document.getElementById('dmethod2');
	if (!obj1 || !obj2) return true;
	var flag=area+"|||"+servername+"|||"+faction;
	if (ahserver && ahserver[flag]==1){
		obj1.style.display='block';
		obj2.style.display='block';
	}else{
		obj1.style.display='none';
		obj2.style.display='none';
	}
}

/*
是否显示面对面交易按钮
*/
function judgeTrade(area_id,servername_id,faction_id,gold_num)
{
	theform = document.sellgold;
	if (theform.f2f_trade==null) return false;
	if (typeof(f2f_areaArray)!='undefined'){
		//		if (gold_num>50 && sellgold.servername.selectedIndex>0 && sellgold.faction.selectedIndex>0){
		if (theform.servername.selectedIndex>0 && theform.faction.selectedIndex>0){
			tmpnum = servername_id*2+faction_id;
			//面对面测试用的服务器
			if (typeof(f2f_areaArray[area_id])!="undefined"){
				if (f2f_areaArray[area_id][tmpnum]=="1"){
					theform.f2f_trade.value = 1;
					//					document.all['sel_trade'].style.display='';
					return true;
				}
			}
		}
		//document.all['sel_trade'].style.display='none';
	}
	theform.f2f_trade.value = 0;
	return false;
}

//function displayF2F(tvalue){
//	if(tvalue==1){
//		document.all['f2f_div'].className = "gl02";
//		document.all['f2f_desc'].style.display = "";
//		document.all['ingame_div'].className = "gl040";
//		document.all['ingame_desc'].style.display = "none";
//		document.all['f2f_title'].style.display="";
//		//document.all['f2f_trade_div'].style.display='';
//		sellgold.x_charname.value = '';
//		sellgold.x_charname.disabled = false;
//	}else{
//		//document.all['f2f_trade_div'].style.display='none';
//		document.all['f2f_div'].className = "gl020";
//		document.all['f2f_desc'].style.display = "none";
//		document.all['ingame_div'].className = "gl04";
//		document.all['ingame_desc'].style.display = "";
//		document.all['f2f_title'].style.display="none";
//		sellgold.x_charname.disabled = true;
//	}
//}
//

function setgoldpricelist (area_id,servername_id,faction_id,gold_num)
{
	theform = document.sellgold;
	tmpnum = servername_id*2+faction_id;

	if(theform.servername.selectedIndex!=0&&theform.faction.selectedIndex!=0)
	{
		for(ii=0;ii<discounts_num_all.length;ii++)
		{
			tmp_goldnum = discounts_num_all[ii];
			tmp_discount=getdiscount(tmp_goldnum);
		//	alert(tmp_goldnum+","+tmp_discount);
			//alert(goldprice[area_id][tmpnum]+",sp="+special_price);
			if(goldprice[area_id][tmpnum]<=special_price) tmp_discount=1;
//			alert(tmp_goldnum+","+tmp_discount);

	
			//如果用户是商户，特别处理

			if(customer_level==1){
				tmp_discount = tmp_discount*customer_reseller_discount;
			}

			if ((goldprice[area_id]) && (goldprice[area_id][tmpnum]))
			{

				tmp_txt_goldprice=Math.round(goldprice[area_id][tmpnum]*tmp_discount*100000)/100000;
                
			} else {

				tmp_txt_goldprice=Math.round(0.69*tmp_discount*100000)/100000;
			

			}

			if (theform.elements["txt_goldprice"+tmp_goldnum])
			{
				theform.elements["txt_goldprice"+tmp_goldnum].value = getGoldAmount(tmp_txt_goldprice, tmp_goldnum);
			}
			//break;
		}

	} else {

		for(ii=0;ii<discounts_num_all.length;ii++)
		{
			tmp_goldnum = discounts_num_all[ii];

			if (theform.elements["txt_goldprice"+tmp_goldnum])
			{
				theform.elements["txt_goldprice"+tmp_goldnum].value = '0.0000';
			}
		}
	}
}

var final_amount=0;
var final_unitprice=0;
function setgoldprice(area_id,servername_id,faction_id,gold_num, discount_ok)
{

	var txt_goldprice_obj=document.getElementById("txt_goldprice");
	var txt_allgoldprice_obj=document.getElementById("txt_allgoldprice");

	var txt_allgoldprice_obj2=document.getElementById("txt_allgoldprice2");

	var stock_obj=document.getElementById("stock");
	//var deliver_obj=document.getElementById("deliver");
	var stock_img_obj=document.getElementById("stock_img");
	//var deliver_img_obj=document.getElementById("deliver_img");
	var price_original_obj = document.getElementById("price_original");
	var price_discount_obj = document.getElementById("price_discount");
	var you_save_obj = document.getElementById("you_save");

	theform = document.sellgold;

	if(theform.servername.selectedIndex!=0 && theform.faction.selectedIndex!=0){
		//alert("area_id="+area_id+",sid="+servername_id+",faction_id="+faction_id);
		tmpnum = servername_id*2+faction_id;
		discount=getdiscount(gold_num);
		//alert(discount);
		//如果用户是商户，特别处理
		if(customer_level==1)
		{
			discount=discount*customer_reseller_discount;
		}

		if ((goldprice[area_id]) && (goldprice[area_id][tmpnum]))
		{
			//特价服务器不折扣
			if(goldprice[area_id][tmpnum]<=special_price) discount=1;
			txt_goldprice=Math.round(goldprice[area_id][tmpnum]*discount*100000)/100000;
			txt_stock=stock[area_id][tmpnum];
			txt_deliver=deliver[area_id][tmpnum];

			var price_nodiscount = Math.round(goldprice[area_id][tmpnum]*100000)/100000;
			document.getElementById("allgoldprice_nodiscount").value=price_nodiscount; //用于优惠券计算
			if(document.getElementById('coupon_code').value.length>0) show_mesbytype('coupon');
		} else {
			txt_goldprice=Math.round(0.69*discount*100000)/100000;
			var price_nodiscount = Math.round(0.69*100000)/100000;
		}

		var txt_goldprice_f = formatGoldPrice(txt_goldprice);
		var txt_price_nodiscount = formatGoldPrice(price_nodiscount);
		txt_goldprice_obj.value = "$ "+txt_goldprice_f+" USD/gold";

		allgoldprice = getGoldAmount(txt_goldprice, gold_num);

		txt_allgoldprice_obj.size=11;
		txt_allgoldprice_obj.value=+allgoldprice;
		txt_allgoldprice_obj.size=txt_allgoldprice_obj.value.length;
       
		if (price_original_obj){
			var discount_amount,discount_goldprice;
			if (final_amount>0 && final_amount<allgoldprice){
				discount_amount = final_amount;
				discount_goldprice = final_unitprice;
			}else{
				discount_amount = allgoldprice;
				discount_goldprice = txt_goldprice_f;
			}
			txt_price_discount = '$ '+discount_amount.toFixed(2)+' ($ '+discount_goldprice+'/gold)';
			
			allgoldprice_original = getGoldAmount(price_nodiscount, gold_num);
			price_original_obj.innerHTML = '$ '+allgoldprice_original+' ($ '+txt_price_nodiscount+'/gold)';
			if (discount_amount>allgoldprice_original){
				var you_save_amount = '00.00';
				var you_save_off = '00.00';
			}else{
				var you_save_amount = Math.round((allgoldprice_original-discount_amount)*100)/100;
				you_save_amount = you_save_amount.toFixed(2).toString();
				var you_save_off = Math.round(you_save_amount*10000/allgoldprice_original)/100;
			}
			you_save_obj.innerHTML = '$ '+you_save_amount+' ('+you_save_off+'% OFF)';
			price_discount_obj.innerHTML = txt_price_discount;
		}
		
		//window.status=txt_allgoldprice_obj.value;
		if (discount_ok && txt_allgoldprice_obj2){
			txt_allgoldprice_obj.style.textDecoration='line-through';
			txt_allgoldprice_obj2.value="$ "+Math.round(allgoldprice*95)/100+" USD";;
			document.getElementById('txt_allgoldprice2').style.display='';
			txt_allgoldprice_obj2.size=txt_allgoldprice_obj2.value.length;

			txt_allgoldprice_obj2.style.color='red';
			if (document.getElementById('span_firsttime')) document.getElementById('span_firsttime').innerHTML='<br />';
			if (document.getElementById("dis_info_us_div")) document.getElementById("dis_info_us_div").style.paddingLeft='165px';
			if (document.getElementById("dis_info_eu_div")) document.getElementById("dis_info_eu_div").style.paddingLeft='165px';
		}else{
			txt_allgoldprice_obj.style.textDecoration='none';
			if (txt_allgoldprice_obj2) txt_allgoldprice_obj2.value='';
			if (document.getElementById('txt_allgoldprice2')) document.getElementById('txt_allgoldprice2').style.display='none';
			if (document.getElementById('span_firsttime')) document.getElementById('span_firsttime').innerHTML='';
			if (document.getElementById("dis_info_us_div")) document.getElementById("dis_info_us_div").style.paddingLeft='0px';
			if (document.getElementById("dis_info_eu_div")) document.getElementById("dis_info_eu_div").style.paddingLeft='0px';

			if (document.cookie.indexOf('MineWoW_test_page')!=-1
			&& document.getElementById("dis_info_eu_div")) document.getElementById("dis_info_eu_div").style.paddingLeft='165px';
		}


		//Delivery record of yesterday on this server
		if (document.getElementById('hiddeneta') && document.getElementById('hiddeneta').value == 'show'){
			stock_obj.innerHTML="Yesterday, we delivered <strong class=\"red\">"+txt_stock+"</strong> gold on this server";
		} else{
			stock_obj.innerHTML="Currently, we have <strong class=\"red\">"+txt_stock+"</strong> gold on this server";
		}
		//deliver_obj.innerHTML=txt_deliver;
		tmp_width=txt_stock/30000*470;
		if (tmp_width>470){
			tmp_width=470;
		}
		stock_img_obj.style.width=tmp_width+"px";
		//deliver_img_obj.style.width=txt_deliver/30*400+"px";

		var ca_obj=document.getElementById("currency_amount");
		var ca_obj2=document.getElementById("currency_amount2");
		var servername_value = sel_2.options[sel_2.selectedIndex].text;
		//		if (typeof(ca_obj)!="undefined" && servername_value.indexOf('(US)')==-1){
		if (ca_obj){
			var eur_amount = usd2eur[0] + " "+ Math.round(txt_goldprice*gold_num*usd2eur[1]*100)/100 + " EUR";
			var gbp_amount = usd2gbp[0] + " "+ Math.round(txt_goldprice*gold_num*usd2gbp[1]*100)/100 + " GBP";
			var eur_amount2 = usd2eur[0] + " "+ Math.round(txt_goldprice*gold_num*usd2eur[1]*100*0.95)/100 + " EUR";
			var gbp_amount2 = usd2gbp[0] + " "+ Math.round(txt_goldprice*gold_num*usd2gbp[1]*100*0.95)/100 + " GBP";

			//			ca_obj.value = "( "+eur_amount+"; "+gbp_amount+" )";
			ca_obj.value = eur_amount+"; "+gbp_amount;
			ca_obj.size=ca_obj.value.length;

			if (discount_ok && ca_obj2){
				ca_obj.style.textDecoration='line-through';
				ca_obj2.value = eur_amount2+"; "+gbp_amount2;
				ca_obj2.size=ca_obj2.value.length;
				ca_obj2.style.display='';
				ca_obj2.style.color='red';
			}else{
				ca_obj.style.textDecoration='none';
				if (ca_obj2) ca_obj2.value = '';
				if (ca_obj2) ca_obj2.style.display='none';
			}
		}
	}else{
		txt_goldprice_obj.value = "Choose your realm and faction";
		txt_allgoldprice_obj.value="Choose your realm and faction";
		txt_allgoldprice_obj.size=txt_allgoldprice_obj.value.length;
		ca_obj=document.getElementById("currency_amount");
		ca_obj.value="";

		if (price_original_obj){
			price_original_obj.innerHTML = 'Choose your realm and faction';
			price_discount_obj.innerHTML = 'Choose your realm and faction';
			you_save_obj.innerHTML = 'Choose your realm and faction';
		}
		//stock_obj.innerHTML="Real-Time WoW Gold Stock Status";

		//Delivery record of yesterday on this server
		if (document.getElementById('hiddeneta') && document.getElementById('hiddeneta').value == 'show'){
			stock_obj.innerHTML="Select your server to see our WoW gold delivery record and estimated time of arrival";
		} else{
			stock_obj.innerHTML="Real-Time WoW Gold Stock Status";
		}

		//deliver_obj.innerHTML="-";
		stock_img_obj.style.width="0px";
		//deliver_img_obj.style.width="0px";

		ca_obj.style.textDecoration='none';
		if (ca_obj2) ca_obj2.value = '';
		if (ca_obj2) ca_obj2.style.display='none';

		if(document.getElementById('coupon_code').value.length>0) show_mesbytype('coupon');
	}
	 document.getElementById("price_discount_all").value= getGoldAmount(price_nodiscount, gold_num);
}

function formatGoldPrice(txt_goldprice){
	if(txt_goldprice<0.005){
		txt_goldprice=0.005;
	}

	return txt_goldprice.toFixed(5).toString();
}

function getGoldAmount(goldprice, goldnum){
	var amount=Math.round(goldprice*goldnum*100);

	if(amount%10==0){
		amount=amount-1;
	}

	amount=amount/100;
	
	return amount;
}

function getdiscount(gold_num){

	discount=1;

	for(i=0;i<discounts_num.length;i++){

		if(gold_num>=discounts_num[i]){

			discount=discounts[i];

			break;
		}
	}

	//取最小的折扣
	if(discount>member_customer_price){
		discount=member_customer_price;
	}

	return discount;
}

function changespecialprice(){
	goldnum=document.sellgold.goldnum.value;
	goldprice=document.sellgold.goldprice.value;
	allgoldprice=(Math.round(goldprice*goldnum*100)-1)/100;
	txt_allgoldprice_obj.value="$ "+allgoldprice+" USD";
	txt_allgoldprice_obj.size=txt_allgoldprice_obj.value.length;
}

//初如化，用于先择服务器区域
function select_serverarea(){

	var doc=document.sellgold;

	if(serverarea_num==5){
		doc.serverarea[0].checked=true;
		changeArea(5);
	}

	if(serverarea_num==8)
	{
		doc.serverarea[1].checked=true;
		changeArea(8);
	}

}

function displayBbsSubscription()
{
	var obj,ss_v;
	obj = document.getElementById('bbs_ss');
	if (document.sellgold.subscription.checked) {
		ss_v = 1;
	}
	else{
		ss_v = 0;
	}
	if(obj.style.display=='none' && ss_v==1)
	{
		obj.style.display='';
		obj.disabled = false;
		return;
	}
	else if(obj.style.display=='' && ss_v==0)
	{
		obj.style.display='none';
		document.sellgold.username.value='';
		document.sellgold.password.value='';
		obj.disabled = true;
	}
}

var bbsuser_valid = false;
var bbsuser;
var popinfo = true;
function chkBbsUserValid()
{
	var obj;
	obj = document.sellgold.username;
	if (typeof(obj)!="undefined"){
		bbsuser = obj.value;
		if (obj.value==''){
			alert('Please enter your MMOMaven username.');
			bbsuser_valid = false;
			return false;
		}

		//var return_code = XMLHttpLoadFile('http://www.MineWoW.com/mmomaven_validuser.php?username='+obj.value);
		var return_code = XMLHttpLoadFile('/mmomaven_validuser.php?username='+obj.value);

		if (return_code=='800') {
			if (popinfo){
				alert('That username is NOT in use.');
			}
			bbsuser_valid = true;
			return true;
		}
		else if (return_code=='802') {
			alert('That username is already in use.');

		}
		else if (return_code=='803') {
			alert('Error: the minimum username length is 3 and the maximum username length is 14.');
		}
		obj.focus();
		bbsuser_valid = false;
		return false;
	}
}

function XMLHttpLoadFile(url)
{
	var httpRequest;
	if (typeof(XMLHttpRequest) != 'undefined') {
		httpRequest = new XMLHttpRequest();
	}
	else if (typeof(ActiveXObject) != 'undefined') {
		httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
	}
	if (httpRequest) {
		//异步
		//        httpRequest.open('GET', url, true);
		//        httpRequest.onreadystatechange = function () {
		//            if (httpRequest.readyState == 4) {
		//                if (httpRequest.status == 200) {
		//                    return httpRequest.responseText;
		//                }
		//            }
		//        };
		//同步
		httpRequest.open('GET', url, false);
		httpRequest.send(null);
		if(httpRequest.status == 200)
		{
			var textInfo = httpRequest.responseText;
			return textInfo;
		}
	}
	return '';
}

function displayWorldcup()
{
	var obj;
	var goldNum;
	var team;
	obj = document.all['worldcup'];
	team = document.all['team'];
	goldNum = document.all['goldnum'];
	if(obj.style.display=='none' && goldNum.value>=500)
	{
		if(confirm('NOTE: During the FIFA World Cup, you can join the MineWoW Goal for Gold “WoW-Cup” THE PREDICTOR Sweepstake Contest Giveaway to win WoW Gold if the purchase is 500 g or above. Please go to http://www.MineWoW.com/contest.php to learn more! '))
		{
			obj.style.display='';
			obj.disabled = false;
		}
		return;
	}
	else if(obj.style.display=='' && goldNum.value<500)
	{
		obj.style.display='none';
		obj.disabled = true;
		team.value='';
	}
}


//彩池
function displayPricePod()
{
	var obj;
	var goldNum;
	obj = document.all['pricepod'];
	goldNum = document.all['goldnum'];

	if (typeof(obj)=='undefined')return;

	if (obj.style.display=='none' && goldNum.value>=100){
		obj.style.display='';
	}
	else if(obj.style.display=='' && goldNum.value<100)
	{
		obj.style.display='none';
		document.all['pricepod_goldnum'].value = 0;
	}

	if (goldNum.value>=100){
		changePricegoldnum();
	}
	//alert(document.all['pricepod_goldnum'].value);
}

function changePricegoldnum(){
	var obj;
	var goldNum;
	obj = document.all['pricepod'];
	goldNum = document.all['goldnum'];
	if (goldNum.value>=100){
		document.all['pricepod_goldnum'].value = goldNum.value * 0.05;
	}
}

function GetValueChoose(el)
{
	//取得第一个元素的name,搜索这个元素组
	var tmpels = document.getElementsByName(el);
	for(var i=0;i<tmpels.length;i++)
	{
		if(tmpels[i].checked)
		{
			return tmpels[i].value;
		}
	}
	return false;
}

//载入页面时获取99usd可以买的金币数
function onload_getGoldNum(area_id,servername_id,faction_id){
	var buygold_usd = 150;

	var servername_elm = document.getElementById("servername");
	var faction_elm = document.getElementById("faction");

	tmpnum = servername_id*2+faction_id;

	if(servername_elm.selectedIndex!=0 && faction_elm.selectedIndex!=0)
	{
		var amount_differ_old=100; //设置一个大数
		var amount_differ;

		for(ii=0;ii<discounts_num_all.length;ii++)
		{
			tmp_goldnum = discounts_num_all[ii];
			tmp_discount = getdiscount(tmp_goldnum);
			//alert(tmp_goldnum+","+tmp_discount);
			//alert(goldprice[area_id][tmpnum]+",sp="+special_price);
			if(goldprice[area_id][tmpnum]<=special_price) tmp_discount=1;
			//alert(tmp_goldnum+","+tmp_discount);


			//如果用户是商户，特别处理

			if(customer_level==1){
				tmp_discount = tmp_discount*customer_reseller_discount;
			}

			if ((goldprice[area_id]) && (goldprice[area_id][tmpnum]))
			{

				tmp_txt_goldprice=Math.round(goldprice[area_id][tmpnum]*tmp_discount*100000)/100000;

			} else {

				tmp_txt_goldprice=Math.round(0.69*tmp_discount*100000)/100000;

			}

			alert(tmp_goldnum+","+tmp_txt_goldprice);

			if(tmp_txt_goldprice<0.005){

				tmp_txt_goldprice=0.005;

			}


			tmp_allgoldprice=Math.round(tmp_txt_goldprice*tmp_goldnum*100)/100;

			amount_differ = Math.abs(tmp_allgoldprice-buygold_usd);

			if (amount_differ<amount_differ_old){
				amount_differ_old = amount_differ;
				goldnum_default = tmp_goldnum;
			}
		}
		setOptionValue("goldnum", goldnum_default);
		return goldnum_default;
	}
}
var mes_hide_sign;
function show_mes(txt,left,top) {
	var mes=document.getElementById("mes");
	var box=document.getElementById("box");
	mes.style.display="";
	mes.style.left=left+"px";
	mes.style.top =top +"px";
	box.innerHTML=txt;
}
function show_mes2(txt,left,top) {
	var mes2=document.getElementById("mes2");
	var box2=document.getElementById("box2");
	mes2.style.display="";
	mes2.style.left=left+"px";
	mes2.style.top =top +"px";
	box2.innerHTML=txt;
}
/*
In-Game Character: No Trial Character 

Coupon Code: 

Email Address: The order status will be sent to your email.

Phone Number: We will call you for a one-time anti-fraud screening or in most cases for an ingame trading.*/
function show_mesbytype(type){
	try{
		txt_type = '';
	//	alert(typeof(mes_hide_sign));
		if (typeof(mes_hide_sign)=="number") clearTimeout(mes_hide_sign);
		var top_offset_num = 3;//头的偏移量
		var left_offset_num = 0;//左的偏移量
		
		var objchar =document.getElementsByName('charactername')[0];
		var objemail=document.getElementsByName('customers_email_address')[0];
		var objphone=document.getElementsByName('country')[0];
		var box=document.getElementById("box");
		
		if (objphone==null) objphone=document.getElementById("country");
		
		
		if (eu_div_offset_sign){
			top_offset_num = 20;
		}
	//	alert(document.getElementById("f2f_trade").value);
	//	alert(document.sellgold.f2f_trade.value);
		if (type=='goldnum'){
			var obj_goldnum = document.getElementById("goldnum");
			var goldnum_s = parseInt(obj_goldnum.options[obj_goldnum.selectedIndex].value);
			if (goldnum_s<3000){
				txt_type='<font class="red">Purchase more than 3000 G, to get bigger discounts, more secure and faster delivery.</font>';
				left_ie=435+left_offset_num;
				left_ff=430+left_offset_num;
				
				top_ie=obj_goldnum.offsetTop-5;
				top_ff=obj_goldnum.offsetTop-5;	
				
				box.style.width=250+"px";
			}else{
				mes_hide_sign=setTimeout('hide_mes()',200);
				return;
			}
		}
		if(type=='character'){
			if(document.getElementById("serverarea5").checked || document.getElementById("serverarea8").checked){//us
				if (document.getElementById("f2f_trade") && document.getElementById("f2f_trade").value==1){
					txt_type='We will trade gold with you in game.(<a href="" target="_blank"><font color=blue><u>How to do in-game trading with us?</u></font></a>)';
					box_width=232;
				}else{
					txt_type='No Trial Character';
					box_width=102;
				}
			}
			left_ie=332+left_offset_num;
			top_ie=180+top_offset_num;
			left_ff=332+left_offset_num;
			top_ff=174+top_offset_num;
			box.style.width=box_width+"px";
	
			top_ff=objchar.offsetTop;
			top_ie=objchar.offsetTop;
			
		}
		if(type=='coupon'){
			showCCodeMsg();
			return;
//		    if(document.getElementById("coupon_code").value.length>0){
//				var return_info = showdiscount();
//				if(return_info==803){
//					txt_type='Invalid code!';
//				}
//				else
//				{
//					txt_type=return_info;
//				}
//			}
//			if(document.sellgold.servername.selectedIndex>0 && document.sellgold.faction.selectedIndex>0){
//				top_ie=228+top_offset_num;
//				top_ff=215+top_offset_num;
//			}else{
//				top_ie=208+top_offset_num;
//				top_ff=195+top_offset_num;
//			}
//			left_ie=332+left_offset_num;
//			left_ff=332+left_offset_num;
//			
//			var box2=document.getElementById("box2");
//			box2.style.width=260+"px";
		}
		if(type=='email'){
			txt_type='The order status will be sent to your email.';
			left_ie=332+left_offset_num;
			top_ie=267+top_offset_num;
			left_ff=332+left_offset_num;
			top_ff=258+top_offset_num;
			
			top_ie=objemail.offsetTop;
			top_ff=objemail.offsetTop;	
			
			box.style.width=260+"px";
		}
		if(type=='phone'){
			txt_type='We may call you for ingame delivery issues, please make sure we can reach you by this phone number.';
			left_ie=535+left_offset_num;
			top_ie=298+top_offset_num;
			left_ff=535+left_offset_num;
			top_ff=290+top_offset_num;
			
			top_ff=objphone.offsetTop;
			top_ie=objphone.offsetTop;
			
		}
		if(navigator.userAgent.indexOf("MSIE")>0 && typeof(top_ie)!="undefined"){//IE
			left_type=left_ie;
			top_type=top_ie;
		}
	    if(navigator.userAgent.indexOf("Firefox")>0  && typeof(top_ff)!="undefined"){//FIREFOX
			left_type=left_ff;
			top_type=top_ff;
		};
//		if(type=='coupon'){
//			if(document.getElementById("coupon_code").value.length>0&&document.getElementById("coupon_code").value.length!=9){
//				show_mes2(txt_type,left_type,top_type);
//			}else document.getElementById('mes2').style.display='none';
//		}
//		else 
			show_mes(txt_type,left_type,top_type);
	}catch(e){}
}
//show coupon code message
function showCCodeMsg(){
	final_amount = 0;
	final_unitprice = 0;
	if(document.getElementById("coupon_code").value.length>0){
		document.getElementById("ccode_msg_dt").style.display = "";
		document.getElementById("ccode_msg_dd").style.display = "";
		var return_info = showdiscount();
		if(return_info[0]=='803'){
			document.getElementById("ccode_msg").innerHTML = '<strong class="red">'+return_info[1]+'</strong>';
		}
		else
		{
			if (return_info[1].indexOf('|')!=-1){ //
				var msg_arr = return_info[1].split('|');
				final_amount = msg_arr[1];
				final_unitprice = msg_arr[2];
				return_info[1] = msg_arr[0]+msg_arr[3];
			}
			document.getElementById("ccode_msg").innerHTML = return_info[1];			
		}
	}else{
		document.getElementById("ccode_msg_dt").style.display = "none";
		document.getElementById("ccode_msg_dd").style.display = "none";
	}
}

function hide_mes() {
		document.getElementById('mes').style.display='none';
	var box=document.getElementById("box");
		box.style.width=180+"px";
}

function XMLHttpLoadFile(url){
	var httpRequest,ino;
	ino = document.getElementById('email_status');

    if (typeof(XMLHttpRequest) != 'undefined') {
        httpRequest = new XMLHttpRequest();
    }
    else if (typeof(ActiveXObject) != 'undefined') {
        httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
    }
    if (httpRequest){
        httpRequest.open('GET', url, false);
        httpRequest.send(null);
		if(httpRequest.readyState ==4){
			if(httpRequest.status == 200)
			{
				var textInfo = httpRequest.responseText;
				return textInfo;
			}
		}
    }
    return '';
}



