wlDateArr = new Array(20051202,20051205,20051206,20051207,20051208,20051209,20051212,20051213,20051214,20051215,20051216,20051219,20051220,20051221,20051222,20051223,20051228,20051229,20051230,20060103,20060104,20060105,20060106,20060109,20060110,20060111,20060112,20060113,20060116,20060117,20060118,20060119,20060120,20060123,20060124,20060125,20060127,20060130,20060131,20060201,20060202,20060203,20060206,20060207,20060208,20060209,20060210,20060213,20060214,20060215,20060216,20060217,20060220,20060221,20060222,20060223,20060224,20060227,20060228,20060301,20060302,20060303,20060306,20060307,20060308,20060309,20060310,20060313,20060314,20060315,20060316,20060317,20060320,20060321,20060322,20060323,20060324,20060327,20060328,20060329,20060330,20060331,20060403,20060404,20060405,20060406,20060407,20060410,20060411,20060412,20060413,20060418,20060419,20060420,20060421,20060424,20060426,20060427,20060428,20060501,20060502,20060503,20060504,20060505,20060508,20060509,20060510,20060511,20060512,20060515,20060516,20060517,20060518,20060519,20060522,20060523,20060524,20060525,20060526,20060529,20060530,20060531,20060601,20060602,20060605,20060606,20060607,20060608,20060609,20060613,20060614,20060615,20060616,20060619,20060620,20060621,20060622,20060623,20060626,20060627,20060628,20060629,20060630,20060703,20060704,20060705,20060706,20060707,20060710,20060711,20060712,20060713,20060714,20060717,20060718,20060719,20060720,20060721,20060724,20060725,20060726,20060727,20060728,20060731,20060801,20060802,20060803,20060804,20060807,20060808,20060809,20060810,20060811,20060814,20060815,20060816,20060817,20060818,20060821,20060822,20060823,20060824,20060825,20060828,20060829,20060830,20060831,20060901,20060904,20060905,20060906,20060907,20060908,20060911,20060912,20060913,20060914,20060915,20060918,20060919,20060920,20060921,20060922,20060925,20060926,20060927,20060928,20060929,20061002,20061003,20061004,20061005,20061006,20061009,20061010,20061011,20061012,20061013,20061016,20061017,20061018,20061019,20061020,20061023,20061024,20061025,20061026,20061027,20061030,20061031,20061101,20061102,20061103,20061106,20061107,20061108,20061109,20061110,20061113,20061114,20061115,20061116,20061117,20061120,20061121,20061122,20061123,20061124,20061127,20061128,20061129,20061130,20061201,20061204,20061205,20061206,20061207,20061208,20061211,20061212,20061213,20061214,20061215,20061218,20061219,20061220,20061221,20061222,20061227,20061228,20061229,20070102,20070103,20070104,20070105,20070108,20070109,20070110,20070111,20070112,20070115,20070116,20070117,20070118,20070119,20070122,20070123,20070124,20070125,20070129,20070130,20070131,20070201,20070202,20070205,20070206,20070207,20070208,20070209,20070212,20070213,20070214,20070215,20070216,20070219,20070220,20070221,20070222,20070223,20070226,20070227,20070228,20070301,20070302,20070305,20070306,20070307,20070308,20070309,20070312,20070313,20070314,20070315,20070316,20070319,20070320,20070321,20070322,20070323,20070326,20070327,20070328,20070329,20070330,20070402,20070403,20070404,20070405,20070410,20070411,20070412,20070413,20070416,20070417,20070418,20070419,20070420,20070423,20070424,20070426,20070427,20070430,20070501,20070502,20070503,20070504,20070507,20070508,20070509,20070510,20070511,20070514,20070515,20070516,20070517,20070518,20070521,20070522,20070523,20070524,20070525,20070528,20070529,20070530,20070531,20070601,20070604,20070605,20070606,20070607,20070608,20070612,20070613,20070614,20070615,20070618,20070619,20070620,20070621,20070622,20070625,20070626,20070627,20070628,20070629,20070702,20070703,20070704,20070705,20070706,20070709,20070710,20070711,20070712,20070713,20070716,20070717,20070718,20070719,20070720,20070723,20070724,20070725,20070726,20070727,20070730,20070731,20070801,20070802,20070803,20070806,20070807,20070808,20070809,20070810,20070813,20070814,20070815,20070816,20070817,20070820,20070821,20070822,20070823,20070824,20070827,20070828,20070829,20070830,20070831,20070903,20070904,20070905,20070906,20070907,20070910,20070911,20070912,20070913,20070914,20070917,20070918,20070919,20070920,20070921,20070924,20070925,20070926,20070927,20070928,20071001,20071002,20071003,20071004,20071005,20071008,20071009,20071010,20071011,20071012,20071015,20071016,20071017,20071018,20071019,20071022,20071023,20071024,20071025,20071026,20071029,20071030,20071031,20071101,20071102,20071105,20071106,20071107,20071108,20071109,20071112,20071113,20071114,20071115,20071116,20071119,20071120,20071121,20071122,20071123,20071126,20071127,20071128,20071129,20071130,20071203,20071204,20071205,20071206,20071207,20071210,20071211,20071212,20071213,20071214,20071217,20071218,20071219,20071220,20071221,20071224,20071227,20071228,20071231,20080102,20080103,20080104,20080107,20080108,20080109,20080110,20080111,20080114,20080115,20080116,20080117,20080118,20080121,20080122,20080123,20080124,20080125,20080129,20080130,20080131,20080201,20080204,20080205,20080206,20080207,20080208,20080211,20080212,20080213,20080214,20080215,20080218,20080219,20080220,20080221,20080222,20080225,20080226,20080227,20080228,20080229,20080303,20080304,20080305,20080306,20080307,20080310,20080311,20080312,20080313,20080314,20080317,20080318,20080319,20080320,20080325,20080326,20080327,20080328,20080331,20080401,20080402,20080403,20080404,20080407,20080408,20080409,20080410,20080411,20080414,20080415,20080416,20080417,20080418,20080421,20080422,20080423,20080424,20080428,20080429,20080430,20080501,20080502,20080505,20080506,20080507,20080508,20080509,20080512,20080513,20080514,20080515,20080516,20080519,20080520,20080521,20080522,20080523,20080526,20080527,20080528,20080529,20080530,20080602,20080603,20080604,20080605,20080606,20080610,20080611,20080612,20080613,20080616,20080617,20080618,20080619,20080620,20080623,20080624,20080625,20080626,20080627,20080630,20080701,20080702,20080703,20080704,20080707,20080708,20080709,20080710,20080711,20080714,20080715,20080716,20080717,20080718,20080721,20080722,20080723,20080724,20080725,20080728,20080729,20080730,20080731,20080801,20080804,20080805,20080806,20080807,20080808,20080811,20080812,20080813,20080814,20080815,20080818,20080819,20080820,20080821,20080822,20080825,20080826,20080827,20080828,20080829,20080901,20080902,20080903,20080904,20080905,20080908,20080909,20080910,20080911,20080912,20080915,20080916,20080917,20080918,20080919,20080922,20080923,20080924,20080925,20080926,20080929,20080930,20081001,20081002,20081003,20081006,20081007,20081008,20081009,20081010,20081013,20081014,20081015,20081016,20081017,20081020,20081021,20081022,20081023,20081024,20081027,20081028,20081029,20081030,20081031,20081103,20081104,20081105,20081106,20081107,20081110,20081111,20081112,20081113,20081114,20081117,20081118,20081119,20081120,20081121,20081124,20081125,20081126,20081127,20081128,20081201); wlPriceArr = new Array(0,0,0,0,0,0,0,0,0,0,0,2.04,2.03,2.02,2.08,2.09,2.1,2.08,2.09,2.09,2.09,2.07,2.09,2.14,2.14,2.14,2.13,2.11,2.1,2.09,2.07,2.06,2.02,2.08,2.17,2.24,2.21,2.22,2.31,2.31,2.29,2.31,2.28,2.25,2.27,2.25,2.28,2.31,2.31,2.36,2.31,2.3,2.34,2.32,2.34,2.34,2.32,2.3,2.31,2.29,2.3,2.32,2.32,2.3,2.25,2.26,2.24,2.23,2.23,2.28,2.31,2.25,2.27,2.26,2.26,2.22,2.17,2.1,2.16,2.19,2.17,2.18,2.2,2.16,2.2,2.18,2.18,2.19,2.18,2.17,2.17,2.18,2.18,2.17,2.17,2.17,2.26,2.24,2.22,2.23,2.25,2.23,2.17,2.17,2.19,2.22,2.2,2.24,2.2,2.2,2.18,2.16,2.14,2.13,2.08,2.07,2.05,2.05,2.06,2.07,2.14,2.1,2.04,2.07,2.1,2.1,2.1,2.03,2.01,2.01,2.02,2,2.06,2.03,1.99,2,2.01,2.04,2.07,2.05,2.05,2.06,2.14,2.09,2.13,2.14,2.15,2.11,2.12,2.13,2.16,2.1,2.11,2.13,2.11,2.14,2.16,2.06,2,2.04,2.06,2.04,2.02,2.01,1.975,1.95,2.02,1.995,2.01,2.01,1.975,1.955,1.92,1.935,1.925,1.92,1.94,1.955,1.975,1.99,2,2.02,2.07,2.08,2.12,2.1,2.12,2.12,2.2,2.23,2.19,2.21,2.23,2.25,2.23,2.22,2.23,2.22,2.19,2.16,2.16,2.14,2.13,2.07,2.07,2.07,2.09,2.16,2.19,2.16,2.15,2.18,2.19,2.14,2.13,2.1,2.03,2.03,2,2,2,2.06,2.08,2.06,2.04,2.01,2.06,2.08,2.1,2.08,2.1,2.06,2.08,2.08,2.07,2.1,2.08,2.09,2.08,2.09,2.1,2.08,2.09,2.08,2.11,2.09,2.09,2.06,2.07,2.06,2.08,2.11,2.16,2.1,2.11,2.11,2.1,2.11,2.12,2.15,2.16,2.16,2.24,2.24,2.18,2.18,2.19,2.2,2.23,2.21,2.22,2.2,2.23,2.23,2.23,2.26,2.29,2.29,2.31,2.32,2.32,2.3,2.32,2.32,2.37,2.36,2.35,2.32,2.35,2.38,2.39,2.38,2.41,2.37,2.35,2.4,2.37,2.39,2.39,2.41,2.43,2.42,2.4,2.42,2.42,2.4,2.39,2.39,2.38,2.38,2.3,2.26,2.29,2.23,2.22,2.27,2.29,2.3,2.3,2.3,2.34,2.32,2.33,2.37,2.36,2.36,2.36,2.37,2.38,2.4,2.4,2.42,2.42,2.44,2.45,2.52,2.6,2.48,2.49,2.49,2.53,2.47,2.48,2.46,2.45,2.45,2.48,2.47,2.42,2.42,2.4,2.4,2.35,2.37,2.37,2.37,2.38,2.38,2.37,2.51,2.42,2.48,2.46,2.42,2.51,2.44,2.45,2.48,2.5,2.42,2.47,2.49,2.5,2.47,2.55,2.5,2.42,2.47,2.42,2.4,2.38,2.38,2.35,2.38,2.33,2.36,2.37,2.42,2.4,2.39,2.37,2.32,2.29,2.39,2.43,2.43,2.46,2.4,2.5,2.47,2.46,2.52,2.55,2.55,2.54,2.56,2.56,2.57,2.63,2.61,2.57,2.59,2.54,2.53,2.52,2.5,2.55,2.46,2.54,2.46,2.43,2.49,2.49,2.5,2.43,2.48,2.43,2.35,2.29,2.28,2.43,2.4,2.41,2.48,2.42,2.59,2.44,2.4,2.5,2.6,2.57,2.54,2.5,2.59,2.59,2.57,2.56,2.56,2.51,2.54,2.53,2.44,2.46,2.46,2.5,2.45,2.45,2.5,2.49,2.58,2.5,2.5,2.4,2.3,2.32,2.32,2.34,2.34,2.29,2.3,2.31,2.32,2.3,2.23,2.23,2.14,2.13,2.14,2.1,2.11,2.11,2.1,2.1,2.1,2.1,2.07,2.08,2.06,2.01,2,1.96,2.01,2.13,2.1,2.1,1.975,1.94,1.93,1.9,1.98,1.97,1.9,1.965,1.945,1.955,1.91,1.92,1.965,1.945,1.955,1.94,1.935,1.905,1.88,1.87,1.855,1.83,1.85,1.83,1.885,1.9,1.895,1.915,1.895,1.865,1.835,1.845,1.83,1.855,1.83,1.755,1.675,1.7,1.655,1.665,1.67,1.65,1.675,1.64,1.66,1.65,1.74,1.67,1.7,1.69,1.775,1.8,1.785,1.75,1.76,1.775,1.73,1.77,1.795,1.83,1.825,1.9,1.83,1.79,1.845,1.82,1.81,1.83,1.89,1.89,1.875,1.83,1.77,1.775,1.84,1.795,1.785,1.77,1.775,1.77,1.73,1.615,1.7,1.74,1.78,1.815,1.8,1.74,1.77,1.8,1.82,1.87,1.89,1.935,1.915,1.88,1.87,1.81,1.75,1.705,1.725,1.74,1.745,1.745,1.79,1.78,1.81,1.785,1.79,1.82,1.79,1.775,1.805,1.8,1.81,1.775,1.81,1.8,1.79,1.795,1.795,1.8,1.795,1.795,1.795,1.8,1.8,1.765,1.74,1.755,1.77,1.76,1.75,1.68,1.66,1.645,1.62,1.64,1.635,1.575,1.57,1.51,1.465,1.45,1.465,1.425,1.435,1.4,1.38,1.375,1.43,1.395,1.405,1.405,1.42,1.37,1.39,1.375,1.38,1.37,1.4,1.365,1.345,1.305,1.3,1.29,1.32,1.34,1.3,1.295,1.34,1.34,1.34,1.305,1.335,1.31,1.32,1.33,1.34,1.42,1.475,1.48,1.51,1.51,1.51,1.45,1.49,1.5,1.485,1.5,1.5,1.51,1.45,1.415,1.45,1.455,1.48,1.475,1.53,1.54,1.48,1.435,1.48,1.47,1.41,1.465,1.475,1.45,1.4,1.475,1.43,1.44,1.405,1.375,1.375,1.3,1.33,1.36,1.39,1.44,1.42,1.47,1.46,1.54,1.49,1.515,1.46,1.48,1.5,1.52,1.445,1.42,1.45,1.495,1.47,1.48,1.51,1.5,1.51,1.575,1.62,1.655,1.67,1.63,1.67,1.59,1.6,1.635,1.6,1.59,1.53,1.57,1.51,1.535,1.53,1.47,1.43,1.365,1.4,1.39,1.34,1.345,1.32); wlLastPrice = 1.32; // asAtDate must be a string of type yyyymmdd // function returns price, or -1 if out of range function getHistoricalPrice(asAtDate) { var count =wlDateArr.length; date = parseInt(asAtDate); if (date > wlDateArr[count-1] || date < wlDateArr[0]) return -1; var lower = 0; var upper = count-1; var index = parseInt(upper/2); // binary search for date while(upper - lower > 1) { curDate = wlDateArr[index]; if (curDate == date) return wlPriceArr[index]; if (curDate > date) upper = index; else lower = index; index = parseInt((upper+lower)/2); } return wlPriceArr[lower]; }