{"id":310,"date":"2015-04-09T18:04:15","date_gmt":"2015-04-09T16:04:15","guid":{"rendered":"http:\/\/www.nazor.org\/?page_id=310"},"modified":"2017-10-03T18:13:20","modified_gmt":"2017-10-03T16:13:20","slug":"falesna-vlajka","status":"publish","type":"page","link":"https:\/\/www.nazor.org\/?page_id=310","title":{"rendered":"15. Oklaman\u00e9 Polsko"},"content":{"rendered":"<p align=\"LEFT\"><span style=\"color: #ff0000;\"><strong>\u00a0P\u0159\u00edb\u011bh 15.<\/strong><\/span><\/p>\n<p align=\"LEFT\">Oklaman\u00e9 Polsko (I)<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/orientalreview.org\/2015\/03\/21\/episode-15-poland-betrayed-i\/\" target=\"_blank\" rel=\"noopener\">origin\u00e1l<\/a><\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.zvedavec.org\/komentare\/2015\/03\/6399-oklamane-polsko-i.htm\" target=\"_blank\" rel=\"noopener\">zdroj<\/a><\/p>\n<p align=\"LEFT\">Nikolaj Starikov (Rusko) <a href=\"http:\/\/sk.wikipedia.org\/wiki\/Nikolaj_Viktorovi%C4%8D_Starikov\" target=\"_blank\" rel=\"noopener\">SK<\/a> RU<\/p>\n<p align=\"LEFT\">Pravda o ko\u0159enech n\u011bmecko-polsk\u00e9ho konfliktu, kter\u00fd vedl ke druh\u00e9 sv\u011btov\u00e9 v\u00e1lce, byla v\u017edy pe\u010dliv\u011b tutl\u00e1na. Aby se zakryla nechutn\u00e1 politick\u00e1 agenda z\u00e1padn\u00edch mocnost\u00ed, nechal se nejd\u0159\u00edve kolovat m\u00fdtus, \u017ee Hitler byl \u0161\u00edlen\u00fd, posedl\u00fd m\u00e1ni\u00ed ovl\u00e1dnout sv\u011bt, \u017ee proto ho jeho agresivn\u00ed povaha nutila k \u00fatoku na v\u0161echny sv\u00e9 sousedy, jednoho po druh\u00e9m, dokud nebyl kone\u010dn\u011b ztrest\u00e1n silami pokrokov\u00e9ho lidstva. Dokonce i v posledn\u00edch letech byl vymy\u0161len nov\u00fd m\u00fdtus, \u017ee druh\u00e1 sv\u011btov\u00e1 v\u00e1lka byla ve skute\u010dnosti poty\u010dkou mezi dv\u011bma dikt\u00e1tory, b\u011bhem kter\u00e9 \u201enevinn\u00e9 ob\u011bti\u201c, jako Polsko a pobaltsk\u00e9 st\u00e1ty, byly semlety ml\u00fdnsk\u00fdmi kameny historie.<\/p>\n<p align=\"LEFT\">Ale v r. 1939 Hitler neuva\u017eoval o velk\u00e9 v\u00e1lce a zcela ur\u010dt\u011bnesnil o sv\u011btov\u00e9 nadvl\u00e1d\u011b. Cht\u011bl se st\u00e1t rovn\u00fd partnerem USA a Brit\u00e1nie, a v \u017e\u00e1dn\u00e9m p\u0159\u00edpad\u011b se nep\u0159ipravoval na boj s nimi. Ale nen\u00ed tak snadn\u00e9 b\u00fdt vpu\u0161t\u011bn do klubu vyvolen\u00fdch mocnost\u00ed. Pro Hitlerovo N\u011bmecko m\u011blo b\u00fdt \u201evstupenkou\u201c zni\u010den\u00ed Sov\u011btsk\u00e9ho svazu.<\/p>\n<p align=\"LEFT\">Jakmile Hitler odm\u00edtl se \u0159\u00eddit sc\u00e9n\u00e1\u0159em, kter\u00fd pro n\u011bj byl seps\u00e1n v Lond\u00fdn\u011b (<a href=\"http:\/\/orientalreview.org\/2013\/08\/19\/episode-14-how-adolf-hitler-turned-to-be-a-defiant-aggressor-i\/\" target=\"_blank\" rel=\"noopener\">anexe Podkarpask\u00e9 Rusi v b\u0159eznu 1939<\/a>, kter\u00e1 m\u011bla slou\u017eit jako p\u0159\u00edm\u00fd casus belli pro v\u00e1lku se Sov\u011btsk\u00fdm Svazem), Z\u00e1pad n\u00e1hle oto\u010dil a zaujal proti F\u00fchrerovi nesmi\u0159iteln\u00fd postoj. Bylo mo\u017en\u00e9 sly\u0161et projevy v\u016fdc\u016f Anglie a Francie, odsuzuj\u00edc\u00ed Hitlerovu agresivn\u00ed povahu. Spojenci Lond\u00fdna a Pa\u0159\u00ed\u017ee se stali stejn\u011b hrd\u00fdmi, obzvl\u00e1\u0161t\u011b Pol\u00e1ci.<\/p>\n<p align=\"LEFT\">V t\u00e9 dob\u011b to vypadalo velmi podivn\u011b. Nakonec vztahy Var\u0161avy s nacistick\u00fdm N\u011bmeckem byly celkem delik\u00e1tn\u00ed a p\u0159\u00e1telsk\u00e9, co\u017e nen\u00ed p\u0159ekvapiv\u00e9 \u2013 ob\u011b mocnosti vd\u011b\u010dily za sv\u016fj vzestup Brit\u00e1nii, Francii a Spojen\u00fdm st\u00e1t\u016fm. Jak\u00e9koliv pochybnosti o tom lze rozpt\u00fdlit, kdy\u017e se pod\u00edv\u00e1me na datum, kdy polsk\u00fd st\u00e1t vznikl: 11. listopadu 1918. Pr\u00e1v\u011b 11. listopadu 1918 n\u011bmeck\u00e1 delegace podepsala p\u0159\u00edm\u011b\u0159\u00ed se spojenci v les\u00edku Compiegne, kter\u00e9 tolik p\u0159ipom\u00ednalo bezpodm\u00edne\u010dnou kapitulaci! Pol\u0161t\u00ed vlastenci rozhodli, \u017ee okam\u017eit\u011b vyhl\u00e1s\u00ed nez\u00e1vislost sv\u00e9 zem\u011b, kdy\u017e vyu\u017eili naprost\u00e9 podpory v\u00edt\u011bz\u016f. Nen\u00ed divu, \u017ee Brit\u00e1nie, Francie a Spojen\u00e9 st\u00e1ty ofici\u00e1ln\u011b uznaly Polsko hned druh\u00fd den. A tak za\u010dal bou\u0159liv\u00fd p\u0159\u00edb\u011bh obnovy Polsk\u00e9ho st\u00e1tu.<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-i.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-315\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-i-300x228.bmp\" alt=\"6399-oklamane-polsko-i\" width=\"300\" height=\"228\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-i-300x228.bmp 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-i-260x198.bmp 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-i-160x122.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-i.bmp 302w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p align=\"LEFT\">O m\u00e9n\u011b ne\u017e \u0161est m\u011bs\u00edc\u016f pozd\u011bji, v b\u0159eznu 1919, za\u010dali <a href=\"http:\/\/en.wikipedia.org\/wiki\/Polish%E2%80%93Soviet_War\" target=\"_blank\" rel=\"noopener\">Pol\u00e1ci aktivn\u011b pracovat na my\u0161lence &#8222;Velkopolska&#8220;<\/a>\u00a0, v r\u00e1mci hranic ze 16. stolet\u00ed. A proto\u017ee to vy\u017eadovalo\u00a0okupaci \u010d\u00e1sti Ruska, nem\u011bli nouzi o pomocn\u00edky a sponzory. Ameri\u010dan\u00e9 se ujali \u00fakolu pln\u011b vybavit polskou arm\u00e1du. Perfektn\u011b obl\u00e9kli voj\u00e1ky a dob\u0159e je krmili. Nicm\u00e9n\u011b Velkopolsko \u201eod mo\u0159e k mo\u0159i\u201c nebylo mo\u017eno z\u0159\u00eddit.<\/p>\n<p align=\"LEFT\">Ale Pol\u00e1ci svoji v\u00e1kychtivost neztratili. Odra\u017eeni na V\u00fdhod\u011b, za\u010dali s loupe\u017en\u00fdmi n\u00e1jezdy na Z\u00e1pad\u011b. V \u0159\u00ednu 1920, za vynucen\u00e9ho poru\u0161en\u00ed <a href=\"http:\/\/en.wikipedia.org\/wiki\/Suwa%C5%82ki_Agreement\" target=\"_blank\" rel=\"noopener\">Suvalsk\u00e9 dohody<\/a>\u00a0, se polsk\u00e9 jednotky\u00a0zmocnily Wilna\u00a0(Vilnius) a cel\u00e9ho regionu nov\u011b nez\u00e1visl\u00e9 Litvy. O sedm m\u011bs\u00edc\u016f pozd\u011bji za\u010dalo Polsko s invaz\u00ed do N\u011bmecka, kter\u00e9 upadlo do anarchie a chaosu. C\u00edlem invaze bylo zmocn\u011bn\u00ed se Horn\u00edho Slezska, kter\u00e9 bylo bohat\u00e9 na pr\u016fmysl a uhl\u00ed. Historick\u00e9 pozad\u00ed t\u00e9to invaze je velmi zaj\u00edmav\u00e9. Na m\u00edrov\u00e9 konferenci ve Versailles bylo rozhodnuto vy\u0159e\u0161it n\u011bmecko-polsk\u00fd spor m\u00edrovou cestou \u2013 prost\u0159ednictv\u00edm referenda. Polsko zu\u0159iv\u011b agitovalo mezi polskou \u010d\u00e1st\u00ed populace a dokonce vyvol\u00e1valo p\u0159i \u0159ad\u011b p\u0159\u00edle\u017eitost\u00ed povst\u00e1n\u00ed, kdy\u017e cht\u011blo postavit N\u011bmecko a mezin\u00e1rodn\u00ed spole\u010denstv\u00ed p\u0159ed hotovou v\u011bc, a\u017e se Polsko tohoto regionu zmocn\u00ed. Nicm\u00e9n\u011b n\u011bme\u010dt\u00ed dobrovoln\u00edci a policie pokusy o pu\u010d potla\u010dili a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Upper_Silesia_plebiscite\" target=\"_blank\" rel=\"noopener\">hlasov\u00e1n\u00ed prob\u011bhlo 20.b\u0159ezna 1920<\/a>. Ti, kte\u0159\u00ed podporovali za\u010dlen\u011bn\u00ed do N\u011bmecka, vyhr\u00e1li ziskem t\u00e9m\u011b\u0159 dvojn\u00e1sobku hlas\u016f proti odp\u016frc\u016fm.<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-ii.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-316\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-ii-167x300.bmp\" alt=\"6399-oklamane-polsko-ii\" width=\"167\" height=\"300\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-ii-167x300.bmp 167w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-ii-160x288.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6399-oklamane-polsko-ii.bmp 196w\" sizes=\"auto, (max-width: 167px) 100vw, 167px\" \/><\/a><\/p>\n<p align=\"LEFT\">Po prohran\u00e9m plebiscitu vedlo Polsko povst\u00e1n\u00ed ve Slezsku, podpo\u0159en\u00e9 invaz\u00ed polsk\u00e9 arm\u00e1dy 3. kv\u011btna 1921. Brit\u00e1nie, Francie a USA t\u00e9to agresi napom\u00e1haly a daly p\u0159\u00edkaz v\u00fdmarsk\u00e9 vl\u00e1d\u011b, aby nedovolila n\u011bmeck\u00e9 arm\u00e1d\u011b postavit se Pol\u00e1k\u016fm. Pokud by se do toho Reichswehr zapojil, spojenci by intervenovali na stran\u011b Polska. Tak\u017ee n\u011bmeck\u00e1 arm\u00e1da neud\u011blala nic a proti Pol\u00e1k\u016fm bojovali jen jednotky n\u011bmeck\u00fdch dobrovoln\u00edk\u016f (\u201eFreikorps\u201c). V d\u016fledku toho byli N\u011bmci vytla\u010deni a \u010d\u00e1st provincie byla obsazena. V \u0159\u00ednu 1921 Konference velvyslanc\u016f hlavn\u00edch spojenc\u016f a p\u0159idru\u017een\u00fdch mocnost\u00ed za ignorov\u00e1n\u00ed v\u00fdledk\u016f hlasov\u00e1n\u00ed polskou anexi legitimizovala a rozhodla p\u0159ev\u00e9st 30% Horn\u00edho Slezska Polsku (na t\u011bhto 30% se nach\u00e1zelo 95% z\u00e1sob uhl\u00ed t\u00e9to oblasti).<\/p>\n<p align=\"LEFT\">Nov\u00e9 Polsko se zrodilo v atmosf\u00e9\u0159e agrese a poru\u0161ov\u00e1n\u00ed smluv. Takov\u00e1to pov\u011bst, jako\u017e i <a href=\"http:\/\/www.strategic-culture.org\/news\/2014\/10\/19\/russian-victims-of-polish-concentration-camps.html\" target=\"_blank\" rel=\"noopener\">existence koncentra\u010dn\u00edch t\u00e1bor\u016f<\/a>, se zd\u00e1 b\u00fdt neslu\u010ditelnou s idejemi demokratick\u00e9ho st\u00e1tu. Nicm\u00e9n\u011b Polsko, budouc\u00ed \u201eob\u011b\u0165\u201c nacistick\u00e9 agrese, takov\u00fdm nikdy nebylo. Jakmile byl za v\u016fdce Polska v r. 1926 dosazen <a href=\"https:\/\/en.wikipedia.org\/wiki\/J%C3%B3zef_Pi%C5%82sudski\" target=\"_blank\" rel=\"noopener\">J\u00f3zef Pilsudski<\/a>, stala se polsk\u00e1 vl\u00e1da vojenskou diktaturou neli\u0161\u00edc\u00ed se od t\u00e9 nacistick\u00e9. Nen\u00ed p\u0159ekvapiv\u00e9, \u017ee navzdory konfliktu kv\u016fli Slezsku, jakmile se v N\u011bmecku dostal k moci Adolf Hitler, rozvinuly N\u011bmecko a Polsko velmi v\u0159el\u00e9 vztahy. Polsko bylo prvn\u00ed zem\u00ed, se kterou nov\u00fd n\u011bmeck\u00fd kancl\u00e9\u0159 podepsal v\u00fdznamn\u00fd zahrani\u010dn\u011b-politick\u00fd dokument: <a href=\"http:\/\/en.wikipedia.org\/wiki\/German%E2%80%93Polish_Non-Aggression_Pact\" target=\"_blank\" rel=\"noopener\">26.ledna 1934 uzav\u0159eli N\u011bmecko a Polsko 10 let\u00fd pakt o ne\u00fato\u010den\u00ed<\/a>. Po n\u011bm n\u00e1sledovalo mnoho dal\u0161\u00edch dvoustrann\u00fdch jedn\u00e1n\u00ed, kter\u00e1 m\u011bla jednu spole\u010dnou vlastnost &#8211; jejich sou\u010d\u00e1st\u00ed byla diskuse o spole\u010dn\u00e9 akci proti Sov\u011btsk\u00e9mu Svazu.<\/p>\n<p align=\"LEFT\">T\u011bmito v\u0159el\u00fdmi vztahy spolupr\u00e1ce Polska a N\u011bmecka v p\u0159edve\u010der druh\u00e9 sv\u011btov\u00e9 v\u00e1lky se budeme zab\u00fdvat podrobn\u011b zab\u00fdvat v druh\u00e9 \u010d\u00e1sti tohoto seri\u00e1lu.<\/p>\n<hr \/>\n<p align=\"LEFT\">Oklaman\u00e9 Polsko (II)<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/orientalreview.org\/2015\/03\/28\/episode-15-poland-betrayed-ii\/\" target=\"_blank\" rel=\"noopener\">origin\u00e1l<\/a><\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.zvedavec.org\/komentare\/2015\/04\/6401-oklamane-polsko-ii.htm\" target=\"_blank\" rel=\"noopener\">zdroj<\/a><\/p>\n<p align=\"LEFT\">Nikolaj Starikov (Rusko) <a href=\"http:\/\/sk.wikipedia.org\/wiki\/Nikolaj_Viktorovi%C4%8D_Starikov\" target=\"_blank\" rel=\"noopener\">SK<\/a> RU<\/p>\n<p align=\"LEFT\">Rozhovory mezi nacistick\u00fdm N\u011bmeckem a druhou Polskou republikou o spole\u010dn\u00e9m pochodu na SSSR b\u011b\u017eely celkem dlouho, ale dokud se Hitler nep\u0159ibl\u00ed\u017eil k sov\u011btsk\u00fdm hranic\u00edm, byly sp\u00ed\u0161e teoretick\u00e9, ne\u017e praktick\u00e9. Bezskrupul\u00f3zn\u00ed rozd\u011blen\u00ed \u010ceskoslovenska v \u0159\u00edjnu 1938, po\u017eehnan\u00e9 z\u00e1padn\u00edmi mocnostmi (Polsko tehdy okupovalo <a href=\"http:\/\/en.wikipedia.org\/wiki\/%C4%8Cesk%C3%BD_T%C4%9B%C5%A1%C3%ADn\" target=\"_blank\" rel=\"noopener\">T\u011b\u0161\u00ednsko<\/a>),\u00a0znamenalo v\u00fdznamn\u00fd postup\u00a0n\u011bmeck\u00e9 arm\u00e1dy bl\u00ed\u017ee hranic\u00edm SSSR. Existovaly pl\u00e1ny na vy\u0159e\u0161en\u00ed st\u00e1vaj\u00edc\u00edch\u00a0\u00fazemn\u00edch spor\u016f mezi N\u011bmeckem a Polskem podobn\u011b p\u0159\u00e1telsk\u00fdm zp\u016fsobem. \u201eV r. 1938 spojenci souhlasili, \u017ee Polsko se stane n\u011bmeck\u00fdm satelitem\u201c, p\u00ed\u0161e, jakoby mimochodem britsk\u00fd historik A.J.P.Taylor.&#8220;Vrchol&#8220; polsko-n\u011bmeck\u00fdch vztah\u016f &#8211; obdob\u00ed jejich &#8222;l\u00edb\u00e1nek&#8220; &#8211; p\u0159i\u0161el v obdob\u00ed &#8222;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Munich_Agreement\" target=\"_blank\" rel=\"noopener\">po Mnichov\u011b<\/a>&#8222;: na konci r.1938 a po\u010d\u00e1tku r. 1939&#8230;<\/p>\n<p align=\"LEFT\">S n\u00e1tupem Hitlera k moci za\u010dalo m\u00edt Polsko v\u00fdst\u0159edn\u00ed p\u0159\u00edstup k N\u011bmc\u016fm. Pro-nacistick\u00e9 organizace etnick\u00fdch N\u011bmc\u016f jako <a href=\"http:\/\/en.wikipedia.org\/wiki\/Deutscher_Volksverband\" target=\"_blank\" rel=\"noopener\">Svaz\u00a0N\u011bmc\u016f v Polsku<\/a>\u00a0a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Jungdeutsche_Partei\" target=\"_blank\" rel=\"noopener\">Strana Mlad\u00fdch N\u011bmc\u016f v Polsku<\/a>, za\u010daly rychle r\u016fst. Ob\u011b organizace byly financov\u00e1ny a \u0159\u00edzeny z N\u011bmecka a dokonce vys\u00edlaly z\u00e1stupce do polsk\u00e9ho Sejmu. Nacistick\u00e9 ideje byly aktivn\u011b zve\u0159ej\u0148ov\u00e1ny a propagov\u00e1ny mezi m\u00edstn\u00edmi N\u011bmci. v r. 1937 bylo v Polsku vyd\u00e1v\u00e1no p\u0159ibli\u017en\u011b 150 n\u011bmeck\u00fdch novin a \u010dasopis\u016f a asi 20 z nich byly den\u00edky. P\u0159ev\u00e1\u017en\u00e1 v\u011bt\u0161ina t\u011bchto periodik byla sledov\u00e1na \u0159\u00ed\u0161sk\u00fdm ministerstvem propagandy, veden\u00fdm <a href=\"http:\/\/en.wikipedia.org\/wiki\/Joseph_Goebbels\" target=\"_blank\" rel=\"noopener\">Josephem Goebbelsem.<\/a><\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-ii.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-320\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-ii-300x251.bmp\" alt=\"6401-oklamane-polsko-ii\" width=\"512\" height=\"429\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-ii-300x251.bmp 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-ii-260x218.bmp 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-ii-160x134.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-ii.bmp 552w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p align=\"LEFT\">Vztahy mezi t\u011bmito dv\u011bma vl\u00e1dami byly z\u0159\u00edzeny na r\u016fzn\u00fdch \u00farovn\u00edch. Prominentn\u00ed Pol\u00e1ci konali p\u0159\u00e1telsk\u00e9 n\u00e1v\u0161t\u011bvy T\u0159et\u00ed \u0159\u00ed\u0161e a nacisti\u010dt\u00ed v\u016fdci \u010dinili tot\u00e9\u017e ve sv\u00e9m \u201ebratrsk\u00e9m\u201c Polsku. V lednu 1938 Oberst-Gruppenf\u00fcrer SS <a href=\"http:\/\/en.wikipedia.org\/wiki\/Kurt_Daluege\" target=\"_blank\" rel=\"noopener\">Kurt Daluge<\/a> p\u0159ijel do Var\u0161avy a o dva m\u011bs\u00edce pozd\u011bji se vydal do V\u00eddn\u011b organizovat \u201ereferendum\u201c. Daluege, velitel n\u011bmeck\u00e9 policie (Sipo),, se p\u0159rozen\u011b d\u011blil o \u201etajemstv\u00ed\u201c sv\u00e9 profese s gener\u00e1lem Kordianem Zamorskim, \u0161\u00e9fem polsk\u00e9 st\u00e1n\u00ed policie. Nicm\u00e9n\u011b \u201epan gener\u00e1l\u201c zcela jist\u011b p\u0159i\u0161el i se svou tro\u0161kou do ml\u00fdna. Polsk\u00e1 policie pou\u017e\u00edvala p\u0159 sv\u00e9 pr\u00e1ci dokonce je\u0161t\u011b krut\u011b\u0161\u00ed metody, ne\u017e N\u011bmci: bit\u00ed mu\u010den\u00ed a zat\u00fdk\u00e1n\u00ed bez zatyka\u010de. St\u0159\u00edleli zadr\u017en\u00e9 p\u0159i sebemen\u0161\u00ed zn\u00e1mce odporu nebo pokusu o \u00fat\u011bk. V\u016f\u010di komu se pol\u0161\u00ed policist\u00e9 chovali tak krut\u011b? V\u016f\u010di zlo\u010dinc\u016fm a zlod\u011bj\u016fm? Ne, v\u016f\u010di politick\u00fdm odp\u016fc\u016fm vl\u00e1nouc\u00ed klaky ve Var\u0161av\u011b, komunist\u016fm a ukrajinsk\u00fdm nacionalist\u016fm.<\/p>\n<p align=\"LEFT\">N\u011bmecko-polsk\u00e1 spolupr\u00e1ce byla tak \u00fazk\u00e1 \u017ee <a href=\"https:\/\/en.wikipedia.org\/wiki\/Kordian_J%C3%B3zef_Zamorski\" target=\"_blank\" rel=\"noopener\">Kordian Zamorski<\/a> dostal pozv\u00e1n\u00ed na v\u00fdro\u010dn\u00ed sjezd nacistick\u00e9 strany v Norimberku (!). Tam se tento polsk\u00fd \u201egenosse\u201c setkal osobn\u011b s Hitlerem. Nen\u00ed pochyb, \u017ee cizinci byli zv\u00e1ni na sjezd NSDAP velmi ojedin\u011ble, a je\u0161t\u011b m\u00e9n\u011b jich bylo poct\u011bno osobn\u00ed rozpravou s F\u00fcrerem. Ale Hitler a jeho stoupenci se, co se t\u00fdkalo Pol\u00e1k\u016f v\u017edy dr\u017eeli politiky otev\u0159en\u00fdch dve\u0159\u00ed. A nebylo to jen nacistick\u00e9 N\u011bmecko, kdo si odv\u00e1\u017en\u00e9 polsk\u00e9 policie v\u00e1\u017eilo a respektovalo ji. O m\u011bs\u00edc pozd\u011bji, 7. \u0159\u00edjna 1938, nav\u0161t\u00edvil gener\u00e1l Kordian Zamorski Kurta Daluege v Berl\u00edn\u011b na sv\u00e9 cest\u011b do \u0158\u00edma na stranick\u00fd sjezd italsk\u00e9 fa\u0161istick\u00e9 strany.<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iidruha.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-321\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iidruha-300x241.bmp\" alt=\"6401-oklamane-polsko-iidruha\" width=\"300\" height=\"241\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iidruha-300x241.bmp 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iidruha-260x209.bmp 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iidruha-160x129.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iidruha.bmp 302w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p align=\"LEFT\">Ale n\u011bmecko-polsk\u00e9 p\u0159\u00e1telstv\u00ed se neomezovalo jen na tyto osobn\u00ed vztahy mezi \u0161\u00e9fy bezpe\u010dnosti t\u011bchto dvou zem\u00ed: v prosinci 1938 nav\u0161t\u00edvil Var\u0161avu n\u011bmeck\u00fd ministr spravedlnosti Hermann Frank, a 18. \u00fanora 1939 p\u0159jel dokonce i Reichsf\u00fcrer-SS <a href=\"https:\/\/en.wikipedia.org\/wiki\/Heinrich_Himmler\" target=\"_blank\" rel=\"noopener\">Heinrich Himmler<\/a>. Pol\u0161t\u00ed p\u0159edstavitel\u00e9 se nijak ne\u0161t\u00edtili zu\u0159iv\u00e9ho antisemitismu nacist\u016f a nijak to nenaru\u0161ovalo jejich robustn\u00ed n\u011bmecko-polsk\u00e9 p\u0159\u00e1telstv\u00ed.<\/p>\n<p align=\"LEFT\">Hitler, kter\u00fd byl st\u00e1le ochoten (v t\u00e9 dob\u011b), dodr\u017eet sv\u00e9 z\u00e1vazky v\u016f\u010di Z\u00e1padu, se prim\u00e1rn\u011b soust\u0159edil na dv\u011b z\u00e1le\u017eitosti t\u00fdkaj\u00edc\u00ed se jeho vztah\u016f s Var\u0161avou: n\u00e1vrat \u0158\u00ed\u0161sk\u00fdch pozemk\u016f, o kter\u00e9 N\u011bmecko p\u0159i\u0161lo ve prosp\u011bch Polska po prvn\u00ed sv\u011btov\u00e9 v\u00e1lce, a vojenskou podporou polsk\u00e9 arm\u00e1d\u011b b\u011bhem jej\u00edho budouc\u00edho \u00fatoku na Sov\u011btsk\u00fd svaz. Proto\u017ee druh\u00fd bod byl pro Hitlera extr\u00e9mn\u011b v\u00fdznamn\u00fd, zmi\u0148oval prvn\u00ed z\u00e1le\u017eitost jen v tichosti a diplomaticky. Hitler se choval k Polsku jako gentleman \u2013dokud sami Pol\u00e1ci neu\u010dinili ukvapen\u00e9 \u010di nestoudn\u00e9 kroky k naru\u0161en\u00ed sv\u00fdch vztah\u016f s\u00a0\u0158\u00ed\u0161\u00ed, poslu\u0161n\u00ed p\u0159\u00edkaz\u016f z Lond\u00fdna. T\u00edm jak a pro\u010d se to stalo se budeme zab\u00fdvat ve t\u0159et\u00ed \u010d\u00e1sti seri\u00e1lu.<\/p>\n<p align=\"LEFT\">\u00a0<a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iitreti.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-323\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iitreti-300x266.bmp\" alt=\"6401-oklamane-polsko-iitreti\" width=\"300\" height=\"266\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iitreti-300x266.bmp 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iitreti-260x230.bmp 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iitreti-160x142.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6401-oklamane-polsko-iitreti.bmp 552w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<hr \/>\n<p align=\"LEFT\">Oklaman\u00e9 Polsko (III)<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/orientalreview.org\/2015\/04\/04\/episode-15-poland-betrayed-iii\/\" target=\"_blank\" rel=\"noopener\">origin\u00e1l<\/a><\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.zvedavec.org\/komentare\/2015\/04\/6411-oklamane-polsko-iii.htm\" target=\"_blank\" rel=\"noopener\">zdroj<\/a><\/p>\n<p align=\"LEFT\">Nikolaj Starikov (Rusko) <a href=\"http:\/\/sk.wikipedia.org\/wiki\/Nikolaj_Viktorovi%C4%8D_Starikov\" target=\"_blank\" rel=\"noopener\">SK<\/a> RU<\/p>\n<p align=\"LEFT\">V p\u0159ede\u0161l\u00fdch kapitol\u00e1ch jsme zkoumali srde\u010dn\u00e9 vztahy mezi nacistick\u00fdm N\u011bmeckem a druhou Polskou republikou ve 30. letech, kter\u00e9 byly naru\u0161eny pouze mal\u00fdm \u00fazemn\u00edm sporem, v porovn\u00e1n\u00ed s ambicemi obou zem\u00ed na V\u00fdchod\u011b nev\u00fdznamn\u00fdm\u2026<\/p>\n<p align=\"LEFT\">N\u011bmci nab\u00eddli m\u00edrov\u00e9 a civilizovan\u00e9 \u0159e\u0161en\u00ed \u00fazemn\u00edho probl\u00e9mu \u2013 ve sporn\u00fdch oblastech se m\u011blo konat referendum (gda\u0148sk\u00fd koridor), kter\u00e9 by vy\u0159e\u0161ilo v\u0161echny probl\u00e9my. Pokud by\u00a0obyvatel\u00e9 toho, co bylo zn\u00e1mo jako \u201e<a href=\"http:\/\/en.wikipedia.org\/wiki\/Polish_Corridor\" target=\"_blank\" rel=\"noopener\">Koridor<\/a>&#8222;, rozhodli, \u017ee jejich \u00fazem\u00ed se vr\u00e1t\u00ed N\u011bmecku, dostalo by Polsko \u017eelezni\u010dn\u00ed tra\u0165 s extrateritori\u00e1ln\u00edm statutem plus d\u00e1lnici Reichsautobahn, kter\u00e1 by zachovala jeho p\u0159\u00edstup k Baltsk\u00e9mu mo\u0159i. A pokud by \u201e<a href=\"http:\/\/en.wikipedia.org\/wiki\/Polish_Corridor\" target=\"_blank\" rel=\"noopener\">Koridor<\/a>\u201c z\u016fstal pod polskou kontrolou, bylo by N\u011bmecko kompenzov\u00e1no touto transportn\u00ed mo\u017enost\u00ed. Hitler ne\u017e\u00e1dal Pol\u00e1ky, aby vr\u00e1tili Gda\u0148sk zp\u011bt, zadarmo. Byl p\u0159ipraven zaru\u010dit nov\u00e9 hranice Polska, prodlou\u017eit <a href=\"http:\/\/en.wikipedia.org\/wiki\/German%E2%80%93Polish_Non-Aggression_Pact\" target=\"_blank\" rel=\"noopener\">N\u011bmecko-polsk\u00fd pakt o ne\u00fato\u010den\u00ed<\/a> a zaru\u010dit zvl\u00e1\u0161tn\u00ed pr\u00e1va Pol\u00e1k\u016fm v nov\u011b n\u011bmeck\u00e9m Gda\u0148sku. A kus sov\u011btsk\u00e9 Ukrajiny by v\u00edce ne\u017e kompenzoval Polsku ztr\u00e1tu jeho \u00fazem\u00ed. To byly celkem \u0161t\u011bdr\u00e9 nab\u00eddky, ale Polsko je odm\u00edtlo. Z\u00e1liba Pol\u00e1k\u016f v dobr\u00fdch vztaz\u00edch s N\u011bmeckem byla ur\u010dov\u00e1na velmi daleko od polsk\u00fdch hranic.<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiiprvni.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-325\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiiprvni-196x300.bmp\" alt=\"6411-oklamane-polsko-iiiprvni\" width=\"196\" height=\"300\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiiprvni-196x300.bmp 196w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiiprvni-160x245.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiiprvni.bmp 242w\" sizes=\"auto, (max-width: 196px) 100vw, 196px\" \/><\/a><\/p>\n<p align=\"LEFT\"><strong>21. b\u0159ezna 1939 <\/strong>Pol\u00e1ci dramaticky zm\u011bnili sv\u016fj p\u0159\u00edstup k n\u011bmeck\u00fdm n\u00e1vrh\u016fm. T\u00e9ho\u017e dne N\u011bmci \u00fadajn\u011b p\u0159edlo\u017eili Polsku ultim\u00e1tum: Polsko mus\u00ed okam\u017eit\u011b p\u0159edat Gda\u0148sk a \u201eKoridor\u201c N\u011bmecku. Ale to nebyla pravda. N\u011bmci Pol\u00e1k\u016fm toho dne nenab\u00eddli nic nov\u00e9ho. \u010cekali na odpov\u011b\u010f na sv\u00e9 star\u00e9 a velmi shov\u00edvav\u00e9 n\u00e1vrhy. Odpov\u011b\u010f m\u011bl p\u0159edat polsk\u00fd ministr zahrani\u010d\u00ed <a href=\"http:\/\/en.wikipedia.org\/wiki\/J%C3%B3zef_Beck\" target=\"_blank\" rel=\"noopener\">J\u00f3zef Beck<\/a> a byl toho dne o\u010dk\u00e1v\u00e1n v Berl\u00edn\u011b.\u00a0Nikdy se tam ale neuk\u00e1zal. M\u00edsto ministra dorazil polsk\u00fd velvyslanec <a href=\"https:\/\/en.wikipedia.org\/wiki\/J%C3%B3zef_Lipski\" target=\"_blank\" rel=\"noopener\">J\u00f3zef Lipski<\/a>. \u0160\u00e9f n\u011bmeck\u00e9ho ministerstva zahrani\u010d\u00ed Joachim von Ribbentrop, m\u011b na polsk\u00e9ho vyslance dv\u011b v\u011bci. Prvn\u00ed bylo, \u017ee N\u011bmecko o\u010dek\u00e1v\u00e1, \u017ee Var\u0161ava p\u0159ijme jeho n\u00e1vrhy, druhou byla ot\u00e1zka \u2013 Pro\u010d let\u011bl polsk\u00fd ministr zahrani\u010d\u00ed <a href=\"http:\/\/en.wikipedia.org\/wiki\/J%C3%B3zef_Beck\" target=\"_blank\" rel=\"noopener\">J\u00f3zef Beck<\/a> (kter\u00fd m\u011bl dorazit do n\u011bmeck\u00e9ho hlavn\u00edho m\u011bsta na kone\u010dn\u00e9 p\u0159ijet\u00ed n\u011bmeck\u00e9ho pl\u00e1nu) do Lond\u00fdna, m\u00edsto do Berl\u00edna?<\/p>\n<p align=\"LEFT\">To bylo snadno vysv\u011btliteln\u00e9 jakmile Hitler <a href=\"http:\/\/orientalreview.org\/2013\/08\/19\/episode-14-how-adolf-hitler-turned-to-be-a-defiant-aggressor-i\/\" target=\"_blank\" rel=\"noopener\">p\u0159edvedl drzost jednat se Slov\u00e1ky a Ukrajinci jinak<\/a>, ne\u017e jak mu bylo na\u0159\u00edzeno, sm\u011br britsk\u00e9 politiky se okam\u017eit\u011b zm\u011bnil.\u00a0Pot\u00e9 zm\u011bnila sv\u016fj t\u00f3n tak\u00e9 \u201enez\u00e1visl\u00e1\u201c polsk\u00e1 \u0161lechta. Onoho dne, 21. b\u0159ezna 1939, Brit\u00e1nie \u201en\u00e1hle\u201c navrhla, aby SSSR a Francie ozn\u00e1mily okam\u017eit\u00e9 konzultace o tom, jak zastavit \u201edal\u0161\u00ed agresi v Evrop\u011b\u201c. Stejn\u00e9ho dne v\u016fci z\u00e1padn\u00edch zem\u00ed p\u0159isp\u011bchali do Lond\u00fdna, aby rozhodli, co d\u011blat s Hitlerem vymknuv\u0161\u00edm se kontrole. Ministr zahrani\u010d\u00ed \u201enez\u00e1visl\u00e9ho\u201c Polska p\u0159ilet\u011bl tak\u00e9. M\u011bl k tomu dobr\u00fd d\u016fvod. Pol\u00e1ci byli rychle informov\u00e1ni o nov\u00e9 \u201ejednotn\u00e9 politice\u201c. P\u0159edt\u00edm d\u011blali co mohli, aby vyhov\u011bli N\u011bmc\u016fm, ale nyn\u00ed proti nim museli vystupovat co nejtvrd\u011bji. A aby se Polsko nezdr\u00e1halo nasadit takov\u00fd t\u00f3n s N\u011bmeckem \u2013 Anglie, n\u00e1hle a bez jak\u00e9koliv \u017e\u00e1dosti ze strany Pol\u00e1k\u016f vydala z\u00e1ruku vojensk\u00e9 ochrany.<\/p>\n<p align=\"LEFT\">Ub\u011bhlo p\u011bt dn\u00ed a <strong>26.b\u0159ezna 1939 polsk\u00fd velvyslanec Lipski p\u0159edal von Ribbentropovi memorandum polsk\u00e9 vl\u00e1dy, kter\u00e9 p\u0159\u00edk\u0159e odm\u00edtlo n\u011bmeck\u00e9 n\u00e1vrhy na n\u00e1vrat Gda\u0148sku. <\/strong>S\u00e1m Lipski to zpe\u010detil t\u00edm, \u017ee uvedl: &#8222;Jak\u00fdkoliv dal\u0161\u00ed pokus zab\u00fdvat se n\u011bmeck\u00fdmi pl\u00e1ny, obzvl\u00e1\u0161t\u011b co se t\u00fdk\u00e1\u00a0n\u00e1vratu Gda\u0148sku \u0158\u00ed\u0161i, bude znamenat v\u00e1lku s Polskem.<\/p>\n<p align=\"LEFT\"><span lang=\"JA\" style=\"font-family: DejaVuSans; font-size: xx-small;\"><span lang=\"JA\" style=\"font-family: DejaVuSans; font-size: xx-small;\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiidruhy.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-326\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiidruhy-300x292.bmp\" alt=\"6411-oklamane-polsko-iiidruhy\" width=\"300\" height=\"292\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiidruhy-300x292.bmp 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiidruhy-260x253.bmp 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiidruhy-160x156.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiidruhy.bmp 302w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/span><\/span><\/p>\n<p align=\"LEFT\">To byl obrat u polsk\u00e9ho diplomatick\u00e9ho postoje o 180 stup\u0148\u016f. Dali Hitlerovi jasn\u011b najevo, \u017ee Polsko s n\u00edm ji\u017e vyjedn\u00e1vat nebude a \u017ee je zcela p\u0159ipraveno br\u00e1nit sv\u016fj postoj silou. A aby se pro Berl\u00edn odstranily jak\u00e9koliv p\u0159etrv\u00e1vaj\u00edc\u00ed pochyby, p\u0159ikro\u010dili Pol\u00e1ci k \u0159ad\u011b rozhodn\u011b nep\u0159\u00e1telsk\u00fdch akc\u00ed: v\u011bt\u0161ina osazenstva polsk\u00e9ho velvyslanectv\u00ed v Berl\u00edn\u011b jako\u017e i \u010dlenov\u00e9 exilov\u00e9 komunity, poslali sv\u00e9 \u017eeny a d\u011bti zp\u011bt do Polska; pol\u0161t\u00ed studenti studuj\u00edc\u00ed v n\u011bmeck\u00e9m hlavn\u00edm m\u011bst\u011b se vr\u00e1tili dom\u016f a polsk\u00fdm konzul\u016fm bylo na\u0159\u00edzeno sp\u00e1lit v\u0161echny tajn\u00e9 dokumenty a archivy. 23.b\u0159ezna byla ozn\u00e1mena \u010d\u00e1ste\u010dn\u00e1 mobilizace polsk\u00e9 arm\u00e1dy. A druh\u00fd den bylo N\u011bmc\u016fm p\u0159edlo\u017eeno \u201ep\u0159\u00edkr\u00e9\u201c memorandum. 27. b\u0159ezna 1939 vydal polsk\u00fd prezident dekret schvaluj\u00edc\u00ed dal\u0161\u00edch 1,2 miliardy zlot\u00fdch na obranu.<\/p>\n<p align=\"LEFT\">To byly \u010diny zem\u011b kter\u00e1 m\u011bla s N\u011bmeckem pakt o ne\u00fato\u010den\u00ed <strong>Bylo to stejn\u00e9 Polsko, kter\u00e9 je\u0161t\u011b p\u0159ed t\u00fddnem bylo pova\u017eov\u00e1no za prim\u00e1rn\u00edho partnera v budouc\u00ed F\u00fchrerov\u011b v\u00fdchodn\u00ed kampani. <\/strong>Ale Hitler byl nucen tuto kampa\u0148 odlo\u017eit, jakmile Polsko reagovalo ozn\u00e1men\u00edm o \u010d\u00e1ste\u010dn\u00e9 mobilizaci. A toto gesto vedlo p\u0159\u00edmo k v\u00e1lce! Je d\u016fle\u017eit\u00e9 poznamenat, \u017ee ani tehdy postoj N\u011bmecka neznamenal jakoukoliv hrozbu pro Polsko. V \u0158\u00ed\u0161i \u017e\u00e1dn\u00e1 mobilizace neprob\u011bhla a nep\u0159i\u0161lo se s \u017e\u00e1dn\u00fdmi hrozbami v\u016f\u010di Var\u0161av\u011b. N\u011bmci nem\u011bli dokonce ani vojensk\u00fd pl\u00e1n pro \u00fatok na Polsko! I ten nejzu\u0159iv\u011bj\u0161\u00ed kritik Hitlerovy agrese by byl nucen p\u0159ipustit, \u017ee teprve a\u017e 1. dubna 1939 vydal Hitler p\u0159\u00edkaz p\u0159ipravit pl\u00e1n\u00a0k \u00fatoku na Polsko. A dokonce jen hrub\u00fd n\u00e1\u010drt pl\u00e1nu byl k dispozici teprve a\u017e v polovin\u011b dubna 1939.<\/p>\n<p align=\"LEFT\">Hitlerovi bylo naprosto jasn\u00e9, \u017ee N\u011bmecko nemohlo nechat sv\u00e9 z\u00e1zem\u00ed nekryt\u00e9 p\u0159ed Polskem, zem\u00ed \u0159\u00edzenou z Lond\u00fdna, kter\u00e1 poslu\u0161n\u011b plnila v\u0161echny p\u0159\u00edkazy, kter\u00e9 dostala od Brit\u016f. Stejn\u00fd polsk\u00fd \u201ez\u00e1taras\u201c, kter\u00fd od\u0159\u00edzl jeho cestu na v\u00fdhod, se nyn\u00ed p\u0159ito\u010dil a dr\u017eel n\u016f\u017e u krku N\u011bmecka. Hitler musel bojovat, ne proto, \u017ee by byl maniak\u00e1ln\u00edm agresorem, ale proto, \u017ee jeho ekonomika byla vysoce zmilitarizovan\u00e1 Pr\u00e1v\u011b te\u010f pot\u0159eboval ur\u010dit sm\u011br sv\u00e9ho dal\u0161\u00edho kroku. Ale a\u0165 se vyd\u00e1 kamkoliv \u2013 na v\u00fdhod nebo na z\u00e1pad \u2013 Polsko m\u016f\u017ee zah\u00e1jit \u00fatok na N\u011bmecko kdykoliv to bude vyhovovat Lond\u00fdnu. Hitler musel tento probl\u00e9m vy\u0159e\u0161it rychle.<\/p>\n<p align=\"LEFT\"><span lang=\"JA\" style=\"font-family: DejaVuSans; font-size: xx-small;\"><span lang=\"JA\" style=\"font-family: DejaVuSans; font-size: xx-small;\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiitreti.bmp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-327\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiitreti-300x201.bmp\" alt=\"6411-oklamane-polsko-iiitreti\" width=\"300\" height=\"201\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiitreti-300x201.bmp 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiitreti-260x174.bmp 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiitreti-160x107.bmp 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/6411-oklamane-polsko-iiitreti.bmp 550w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/span><\/span><\/p>\n<hr \/>\n<p align=\"LEFT\">Oklaman\u00e9 Polsko (IV)<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/orientalreview.org\/2015\/04\/11\/episode-15-poland-betrayed-iv\/\" target=\"_blank\" rel=\"noopener\">origin\u00e1l<\/a><\/p>\n<p align=\"LEFT\">zdroj &#8211; vlastn\u00ed p\u0159eklad 14.4.2015<\/p>\n<p align=\"LEFT\">Nikolaj Starikov (Rusko) <a href=\"http:\/\/sk.wikipedia.org\/wiki\/Nikolaj_Viktorovi%C4%8D_Starikov\" target=\"_blank\" rel=\"noopener\">SK<\/a> RU<\/p>\n<p align=\"LEFT\"><span title=\"So, by March 31, 1939, 16 days after Hitler entered Prague, the United Kingdom, which until then had \u201cnot noticed\u201d Germany's aggressive nature and had surrendered Austria and Czechoslovakia to Hitler and meekly handed over the Saarland and the Rhineland, was now\">Tak\u017ee, 31. b\u0159ezna 1939, 16 dn\u016f pot\u00e9, co Hitler vstoupil\u00a0 do Prahy, Spojen\u00e9 kr\u00e1lovstv\u00ed, kter\u00e9 si do\u00a0t\u00e9 chv\u00edle &#8222;nev\u0161imlo&#8220;\u00a0 agresivn\u00ed povahy N\u011bmecka a vydalo Rakousko a \u010ceskoslovensko Hitlerovi a pokorn\u011b p\u0159edalo S\u00e1rsko a Por\u00fdn\u00ed, bylo nyn\u00ed <\/span><span title=\"ready to fight him.\">p\u0159ipraveno s Hitlerem bojovat. <\/span><span title=\"On that day, the British prime minister, Neville Chamberlain, made an official statement, claiming that \u201cin the event of any action which clearly threatened Polish independence and which the Polish Government accordingly considered it vital to resist,\u201d Great Britain would provide support to\">V ten den britsk\u00fd premi\u00e9r Neville Chamberlain vydal <a href=\"http:\/\/avalon.law.yale.edu\/wwii\/blbk17.asp\" target=\"_blank\" rel=\"noopener\">ofici\u00e1ln\u00ed prohl\u00e1\u0161en\u00ed<\/a>, kter\u00fdm\u00a0potvrdil, \u017ee &#8222;v p\u0159\u00edpad\u011b jak\u00e9hokoliv jedn\u00e1n\u00ed, kter\u00e9 zjevn\u011b ohroz\u00ed polskou nez\u00e1vislost, a u kter\u00e9ho bude polsk\u00e1 vl\u00e1da\u00a0pova\u017eovat za z\u00e1sadn\u00ed, aby mu odolala,&#8220; Velk\u00e1 Brit\u00e1nie\u00a0poskytne podporu <\/span><span title=\"Warsaw.&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt;&lt;br \/&gt; \">Var\u0161av\u011b.<br \/>\n<\/span><strong><span title=\"It was not Germany, but Poland and Great Britain that violated their own treaties!\">Nebylo to N\u011bmecko, ale Polsko a Velk\u00e1 Brit\u00e1nie, kter\u00e9 poru\u0161ili sv\u00e9 vlastn\u00ed smlouvy\u00a0smlouvy! <\/span><\/strong><span title=\"Poland had violated the German-Polish treaty by announcing a mobilization, and then violated it again when she accepted British promises to guarantee her security.\">Polsko poru\u0161ilo <a href=\"http:\/\/en.wikipedia.org\/wiki\/German%E2%80%93Polish_Non-Aggression_Pact\" target=\"_blank\" rel=\"noopener\">N\u011bmecko-polskou smlouvu o ne\u00fato\u010den\u00ed<\/a> vyhl\u00e1\u0161en\u00edm mobilizace, a pak ji\u00a0poru\u0161ilo znovu, kdy\u017e p\u0159ijalo britsk\u00e9 sliby o zaji\u0161t\u011bn\u00ed bezpe\u010dnosti. <\/span><span title=\"The treaty between Poland and Germany preclude any conflict between the two countries, and after signing a treaty with the British, the Poles were then obligated to fight the Germans in the event of an Anglo-German war.\">Smlouva mezi Polskem a N\u011bmeckem vylu\u010dovala konflikt mezi ob\u011bma zem\u011bmi, ale po podeps\u00e1n\u00ed smlouvy s Brity byli\u00a0Pol\u00e1ci\u00a0povinni bojovat proti N\u011bmc\u016fm v p\u0159\u00edpad\u011b Anglo-n\u011bmeck\u00e9 v\u00e1lky. <\/span><span title=\"In addition, signing a treaty with Warsaw and issuing guarantees conflicted with the British-German treaty.\">Krom\u011b toho, podpis smlouvy s Var\u0161avou a vyd\u00e1n\u00ed z\u00e1ruk bylo v rozporu s Britsko-n\u011bmeckou dohodou o ne\u00fato\u010den\u00ed. <\/span><strong><span title=\"A supplementary agreement to the Munich treaty stated that neither Germany nor England could enter into any political commitments without prior consultations with one another.\">Dodatkov\u00e1 dohoda k <a href=\"http:\/\/en.wikipedia.org\/wiki\/Munich_Agreement\" target=\"_blank\" rel=\"noopener\">Mnichovsk\u00e9 dohod\u011b<\/a> uv\u00e1d\u011bla, \u017ee ani N\u011bmecko, ani Anglie\u00a0nemohou vstoupit do \u017e\u00e1dn\u00fdch politick\u00fdch z\u00e1vazk\u016f bez p\u0159edchoz\u00edch vz\u00e1jemn\u00fdch konzultac\u00ed. <\/span><\/strong><span title=\"But Britain was now obligated to declare war against the Germans if a conflict erupted between the latter and Poland!\">Ale Brit\u00e1nie byla te\u010f povinn\u00e1 vyhl\u00e1sit\u00a0N\u011bmc\u016fm v\u00e1lku, pokud\u00a0vypukne konflikt\u00a0mezi N\u011bmeckem\u00a0a\u00a0Polskem!<\/span><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/*\n    http:\/\/www.JSON.org\/json2.js\n    2008-11-19\n\n    Public Domain.\n\n    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n    See http:\/\/www.JSON.org\/js.html\n\n    This file creates a global JSON object containing two methods: stringify\n    and parse.\n\n        JSON.stringify(value, replacer, space)\n            value       any JavaScript value, usually an object or array.\n\n            replacer    an optional parameter that determines how object\n                        values are stringified for objects. It can be a\n                        function or an array of strings.\n\n            space       an optional parameter that specifies the indentation\n                        of nested structures. If it is omitted, the text will\n                        be packed without extra whitespace. If it is a number,\n                        it will specify the number of spaces to indent at each\n                        level. If it is a string (such as '\\t' or '&nbsp;'),\n                        it contains the characters used to indent at each level.\n\n            This method produces a JSON text from a JavaScript value.\n\n            When an object value is found, if the object contains a toJSON\n            method, its toJSON method will be called and the result will be\n            stringified. A toJSON method does not serialize: it returns the\n            value represented by the name\/value pair that should be serialized,\n            or undefined if nothing should be serialized. The toJSON method\n            will be passed the key associated with the value, and this will be\n            bound to the object holding the key.\n\n            For example, this would serialize Dates as ISO strings.\n\n                Date.prototype.toJSON = function (key) {\n                    function f(n) {\n                        \/\/ Format integers to have at least two digits.\n                        return n < 10 ? '0' + n : n;\n                    }\n\n                    return this.getUTCFullYear()   + '-' +\n                         f(this.getUTCMonth() + 1) + '-' +\n                         f(this.getUTCDate())      + 'T' +\n                         f(this.getUTCHours())     + ':' +\n                         f(this.getUTCMinutes())   + ':' +\n                         f(this.getUTCSeconds())   + 'Z';\n                };\n\n            You can provide an optional replacer method. It will be passed the\n            key and value of each member, with this bound to the containing\n            object. The value that is returned from your method will be\n            serialized. If your method returns undefined, then the member will\n            be excluded from the serialization.\n\n            If the replacer parameter is an array of strings, then it will be\n            used to select the members to be serialized. It filters the results\n            such that only members with keys listed in the replacer array are\n            stringified.\n\n            Values that do not have JSON representations, such as undefined or\n            functions, will not be serialized. Such values in objects will be\n            dropped; in arrays they will be replaced with null. You can use\n            a replacer function to replace those with JSON values.\n            JSON.stringify(undefined) returns undefined.\n\n            The optional space parameter produces a stringification of the\n            value that is filled with line breaks and indentation to make it\n            easier to read.\n\n            If the space parameter is a non-empty string, then that string will\n            be used for indentation. If the space parameter is a number, then\n            the indentation will be that many spaces.\n\n            Example:\n\n            text = JSON.stringify(['e', {pluribus: 'unum'}]);\n            \/\/ text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\\t');\n            \/\/ text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n            text = JSON.stringify([new Date()], function (key, value) {\n                return this[key] instanceof Date ?\n                    'Date(' + this[key] + ')' : value;\n            });\n            \/\/ text is '[\"Date(---current time---)\"]'\n\n        JSON.parse(text, reviver)\n            This method parses a JSON text to produce an object or array.\n            It can throw a SyntaxError exception.\n\n            The optional reviver parameter is a function that can filter and\n            transform the results. It receives each of the keys and values,\n            and its return value is used instead of the original value.\n            If it returns what it received, then the structure is not modified.\n            If it returns undefined then the member is deleted.\n\n            Example:\n\n            \/\/ Parse the text. Values that look like ISO date strings will\n            \/\/ be converted to Date objects.\n\n            myData = JSON.parse(text, function (key, value) {\n                var a;\n                if (typeof value === 'string') {\n                    a =\n\/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$\/.exec(value);\n                    if (a) {\n                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n                            +a[5], +a[6]));\n                    }\n                }\n                return value;\n            });\n\n            myData = JSON.parse('[\"Date(09\/09\/2001)\"]', function (key, value) {\n                var d;\n                if (typeof value === 'string' &#038;&#038;\n                        value.slice(0, 5) === 'Date(' &#038;&#038;\n                        value.slice(-1) === ')') {\n                    d = new Date(value.slice(5, -1));\n                    if (d) {\n                        return d;\n                    }\n                }\n                return value;\n            });\n\n    This is a reference implementation. You are free to copy, modify, or\n    redistribute.\n\n    This code should be minified before deployment.\n    See http:\/\/javascript.crockford.com\/jsmin.html\n\n    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n    NOT CONTROL.\n*\/\n\n\/*jslint evil: true *\/\n\n\/*global JSON *\/\n\n\/*members \"\", \"\\b\", \"\\t\", \"\\n\", \"\\f\", \"\\r\", \"\\\"\", JSON, \"\\\\\", apply,\n    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n    lastIndex, length, parse, prototype, push, replace, slice, stringify,\n    test, toJSON, toString, valueOf\n*\/\n\n\/\/ Create a JSON object only if one does not already exist. We create the\n\/\/ methods in a closure to avoid creating global variables.\n\nif (!this.JSON) {\n    JSON = {};\n}\n(function () {\n\n    function f(n) {\n        \/\/ Format integers to have at least two digits.\n        return n < 10 ? '0' + n : n;\n    }\n\n    if (typeof Date.prototype.toJSON !== 'function') {\n\n        Date.prototype.toJSON = function (key) {\n\n            return this.getUTCFullYear()   + '-' +\n                 f(this.getUTCMonth() + 1) + '-' +\n                 f(this.getUTCDate())      + 'T' +\n                 f(this.getUTCHours())     + ':' +\n                 f(this.getUTCMinutes())   + ':' +\n                 f(this.getUTCSeconds())   + 'Z';\n        };\n\n        String.prototype.toJSON =\n        Number.prototype.toJSON =\n        Boolean.prototype.toJSON = function (key) {\n            return this.valueOf();\n        };\n    }\n\n    var cx = \/[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]\/g,\n        escapable = \/[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]\/g,\n        gap,\n        indent,\n        meta = {    \/\/ table of character substitutions\n            '\\b': '\\\\b',\n            '\\t': '\\\\t',\n            '\\n': '\\\\n',\n            '\\f': '\\\\f',\n            '\\r': '\\\\r',\n            '\"' : '\\\\\"',\n            '\\\\': '\\\\\\\\'\n        },\n        rep;\n\n    function quote(string) {\n\n\/\/ If the string contains no control characters, no quote characters, and no\n\/\/ backslash characters, then we can safely slap some quotes around it.\n\/\/ Otherwise we must also replace the offending characters with safe escape\n\/\/ sequences.\n\n        escapable.lastIndex = 0;\n        return escapable.test(string) ?\n            '\"' + string.replace(escapable, function (a) {\n                var c = meta[a];\n                return typeof c === 'string' ? c :\n                    '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n            }) + '\"' :\n            '\"' + string + '\"';\n    }\n\n    function str(key, holder) {\n\n\/\/ Produce a string from holder[key].\n\n        var i,          \/\/ The loop counter.\n            k,          \/\/ The member key.\n            v,          \/\/ The member value.\n            length,\n            mind = gap,\n            partial,\n            value = holder[key];\n\n\/\/ If the value has a toJSON method, call it to obtain a replacement value.\n\n        if (value &#038;&#038; typeof value === 'object' &#038;&#038;\n                typeof value.toJSON === 'function') {\n            value = value.toJSON(key);\n        }\n\n\/\/ If we were called with a replacer function, then call the replacer to\n\/\/ obtain a replacement value.\n\n        if (typeof rep === 'function') {\n            value = rep.call(holder, key, value);\n        }\n\n\/\/ What happens next depends on the value's type.\n\n        switch (typeof value) {\n        case 'string':\n            return quote(value);\n\n        case 'number':\n\n\/\/ JSON numbers must be finite. Encode non-finite numbers as null.\n\n            return isFinite(value) ? String(value) : 'null';\n\n        case 'boolean':\n        case 'null':\n\n\/\/ If the value is a boolean or null, convert it to a string. Note:\n\/\/ typeof null does not produce 'null'. The case is included here in\n\/\/ the remote chance that this gets fixed someday.\n\n            return String(value);\n\n\/\/ If the type is 'object', we might be dealing with an object or an array or\n\/\/ null.\n\n        case 'object':\n\n\/\/ Due to a specification blunder in ECMAScript, typeof null is 'object',\n\/\/ so watch out for that case.\n\n            if (!value) {\n                return 'null';\n            }\n\n\/\/ Make an array to hold the partial results of stringifying this object value.\n\n            gap += indent;\n            partial = [];\n\n\/\/ Is the value an array?\n\n            if (Object.prototype.toString.apply(value) === '[object Array]') {\n\n\/\/ The value is an array. Stringify every element. Use null as a placeholder\n\/\/ for non-JSON values.\n\n                length = value.length;\n                for (i = 0; i < length; i += 1) {\n                    partial[i] = str(i, value) || 'null';\n                }\n\n\/\/ Join all of the elements together, separated with commas, and wrap them in\n\/\/ brackets.\n\n                v = partial.length === 0 ? '[]' :\n                    gap ? '[\\n' + gap +\n                            partial.join(',\\n' + gap) + '\\n' +\n                                mind + ']' :\n                          '[' + partial.join(',') + ']';\n                gap = mind;\n                return v;\n            }\n\n\/\/ If the replacer is an array, use it to select the members to be stringified.\n\n            if (rep &#038;&#038; typeof rep === 'object') {\n                length = rep.length;\n                for (i = 0; i < length; i += 1) {\n                    k = rep[i];\n                    if (typeof k === 'string') {\n                        v = str(k, value);\n                        if (v) {\n                            partial.push(quote(k) + (gap ? ': ' : ':') + v);\n                        }\n                    }\n                }\n            } else {\n\n\/\/ Otherwise, iterate through all of the keys in the object.\n\n                for (k in value) {\n                    if (Object.hasOwnProperty.call(value, k)) {\n                        v = str(k, value);\n                        if (v) {\n                            partial.push(quote(k) + (gap ? ': ' : ':') + v);\n                        }\n                    }\n                }\n            }\n\n\/\/ Join all of the member texts together, separated with commas,\n\/\/ and wrap them in braces.\n\n            v = partial.length === 0 ? '{}' :\n                gap ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' +\n                        mind + '}' : '{' + partial.join(',') + '}';\n            gap = mind;\n            return v;\n        }\n    }\n\n\/\/ If the JSON object does not yet have a stringify method, give it one.\n\n    if (typeof JSON.stringify !== 'function') {\n        JSON.stringify = function (value, replacer, space) {\n\n\/\/ The stringify method takes a value and an optional replacer, and an optional\n\/\/ space parameter, and returns a JSON text. The replacer can be a function\n\/\/ that can replace values, or an array of strings that will select the keys.\n\/\/ A default replacer method can be provided. Use of the space parameter can\n\/\/ produce text that is more easily readable.\n\n            var i;\n            gap = '';\n            indent = '';\n\n\/\/ If the space parameter is a number, make an indent string containing that\n\/\/ many spaces.\n\n            if (typeof space === 'number') {\n                for (i = 0; i < space; i += 1) { indent += ' '; } \/\/ If the space parameter is a string, it will be used as the indent string. } else if (typeof space === 'string') { indent = space; } \/\/ If there is a replacer, it must be a function or an array. \/\/ Otherwise, throw an error. rep = replacer; if (replacer &#038;&#038; typeof replacer !== 'function' &#038;&#038; (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } \/\/ Make a fake root object containing our value under the key of ''. \/\/ Return the result of stringifying the value. return str('', {'': value}); }; } \/\/ If the JSON object does not yet have a parse method, give it one. if (typeof JSON.parse !== 'function') { JSON.parse = function (text, reviver) { \/\/ The parse method takes a text and an optional reviver function, and returns \/\/ a JavaScript value if the text is a valid JSON text. var j; function walk(holder, key) { \/\/ The walk method is used to recursively walk the resulting structure so \/\/ that modifications can be made. var k, v, value = holder[key]; if (value &#038;&#038; typeof value === 'object') { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); } \/\/ Parsing happens in four stages. In the first stage, we replace certain \/\/ Unicode characters with escape sequences. JavaScript handles many characters \/\/ incorrectly, either silently deleting them, or treating them as line endings. cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } \/\/ In the second stage, we run the text against regular expressions that look \/\/ for non-JSON patterns. We are especially concerned with '()' and 'new' \/\/ because they can cause invocation, and '=' because it can cause mutation. \/\/ But just to be safe, we want to reject all unexpected forms. \/\/ We split the second stage into 4 regexp operations in order to work around \/\/ crippling inefficiencies in IE's and Safari's regexp engines. First we \/\/ replace the JSON backslash pairs with '@' (a non-JSON character). Second, we \/\/ replace all simple value tokens with ']' characters. Third, we delete all \/\/ open brackets that follow a colon or comma or that begin the text. Finally, \/\/ we look to see that the remaining characters are only whitespace or ']' or \/\/ ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. if (\/^[\\],:{}\\s]*$\/. test(text.replace(\/\\\\(?:[\"\\\\\\\/bfnrt]|u[0-9a-fA-F]{4})\/g, '@'). replace(\/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?\/g, ']'). replace(\/(?:^|:|,)(?:\\s*\\[)+\/g, ''))) { \/\/ In the third stage we use the eval function to compile the text into a \/\/ JavaScript structure. The '{' operator is subject to a syntactic ambiguity \/\/ in JavaScript: it can begin a block or an object literal. We wrap the text \/\/ in parens to eliminate the ambiguity. j = eval('(' + text + ')'); \/\/ In the optional fourth stage, we recursively walk the new structure, passing \/\/ each name\/value pair to a reviver function for possible transformation. return typeof reviver === 'function' ? walk({'': j}, '') : j; } \/\/ If the text is not JSON parseable, then a SyntaxError is thrown. throw new SyntaxError('JSON.parse'); }; } })(); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/\/ HTML5 placeholder plugin version 1.01\n\/\/ Copyright (c) 2010-The End of Time, Mike Taylor, http:\/\/miketaylr.com\n\/\/ MIT Licensed: http:\/\/www.opensource.org\/licenses\/mit-license.php\n\/\/\n\/\/ Enables cross-browser HTML5 placeholder for inputs, by first testing\n\/\/ for a native implementation before building one.\n\/\/\n\/\/\n\/\/ USAGE:\n\/\/$('input[placeholder]').placeholder();\n\n\/\/ <input type=\"text\" placeholder=\"username\">\n(function($){\n    \/\/feature detection\n    var hasPlaceholder = 'placeholder' in document.createElement('input');\n    var placeholderClass = 'evn-placeholder';\n\n    \/\/sniffy sniff sniff -- just to give extra left padding for the older\n    \/\/graphics for type=email and type=url\n    var isOldOpera = $.browser.opera &#038;&#038; $.browser.version < 10.5;\n\n    $.fn.placeholder = function(options) {\n        \/\/merge in passed in options, if any\n        var options = $.extend({}, $.fn.placeholder.defaults, options),\n        \/\/cache the original 'left' value, for use by Opera later\n            o_left = options.placeholderCSS.left;\n\n        \/\/first test for native placeholder support before continuing\n        \/\/feature detection inspired by ye olde jquery 1.4 hawtness, with paul irish\n        return (hasPlaceholder) ? this : this.each(function() {\n\n            \/\/local vars\n            var $this = $(this),\n                inputVal = $.trim($this.val()),\n                inputWidth = $this.width(),\n                inputHeight = $this.height(),\n\n            \/\/grab the inputs id for the <label @for>, or make a new one from the Date\n                inputId = (this.id) ? this.id : 'placeholder' + (+new Date()) + this.className.replace(' ',''),\n                placeholderText = options.placeholderText ? options.placeholderText : $this.attr('placeholder'),\n                placeholder = $('<label class=\"' + placeholderClass + '\" for=\\\"'+ inputId +'\\\">'+ placeholderText + '<\/label>');\n\n            \/\/stuff in some calculated values into the placeholderCSS object\n\/\/            options.placeholderCSS['width'] = inputWidth;\n            options.placeholderCSS['height'] = inputHeight;\n\n            \/\/ adjust position of placeholder\n            options.placeholderCSS.left = (isOldOpera &#038;&#038; (this.type == 'email' || this.type == 'url')) ?\n                '11%' : o_left;\n            placeholder.css(options.placeholderCSS);\n\n            \/\/place the placeholder if the input is empty\n\n            $this.wrap(options.inputWrapper);\n            $this.attr('id', inputId).after(placeholder);\n\n            if(inputVal) {\n                $this.next().hide();\n            }\n\n            \/\/hide placeholder on focus\n            $this.focus(function(){\n                $this.next().hide();\n            });\n\n            \/\/show placeholder if the input is empty\n            $this.blur(function(){\n                if (!$.trim($this.val())){\n                    $this.next().show();\n                };\n            });\n        });\n    };\n\n    \/\/expose defaults\n    $.fn.placeholder.defaults = {\n        \/\/you can pass in a custom wrapper\n        inputWrapper: '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div style=\"position:relative;\"><\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n',\n        placeholderText: null,\n\n        \/\/more or less just emulating what webkit does here\n        \/\/tweak to your hearts content\n        placeholderCSS: {\n            'font':'0.75em sans-serif',\n            'color':'#bababa',\n            'position': 'absolute',\n            'left':'5px',\n            'top':'3px',\n            'overflow': 'hidden'\n        }\n    };\n})(jQuery);\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/*! * ClearlyComponent__detect * Evernote Clearly's content-detection algorithm as an embeddable component. * Copyright 2013, Evernote Corporation * * Usage: * ====== * * \/\/ define * window.ClearlyComponent__detect = { * 'callbacks': { * 'finished': someFunction(), * }, * 'window': window, * 'document': document, * 'jQuery': window.jQuery * }; * * \/\/ init -- will return false, if something goes wrong * window.ClearlyComponent__detect = initClearlyComponent__detect(window.ClearlyComponent__detect); * * \/\/ call -- returns nothing; callbacks will be used * window.ClearlyComponent__detect.start(); * * \/\/ publcly available\/overridable * window.ClearlyComponent__detect.debug * window.ClearlyComponent__detect.parseOptions * *\/ \/* changes: ======== $R => $D\n        $R.win => $D.window\n        $R.parsingOptions => $D.parseOptions\n        $R.skipStuffFromDomains__links => $D.parseOptions._skip_link_from_domain\n        $R.skipStuffFromDomain__images => $D.parseOptions._skip_image_from_domain\n        $R.keepStuffFromDomain__video => $D.parseOptions._keep_video_from_domain\n        $R.getContent__processCandidates => $D.getContent__processCandidates__first\n        $R.getContent__computePointsForCandidate => $D.getContent__computePointsForCandidate__first\n        $R.getContent__computeDetailsForCandidate => $D.getContent__computeDetailsForCandidate__first\n        $R.getContent__processCandidatesSecond => $D.getContent__processCandidates__second\n        $R.getContent__computePointsForCandidateSecond => $D.getContent__computePointsForCandidate__second\n        $R.getContent__computeDetailsForCandidateSecond => $D.getContent__computeDetailsForCandidate__second\n        $R.getContent__computePointsForCandidateThird => $D.getContent__computePointsForCandidate__third\n        $R.getContent__computeDetailsForCandidateThird => $D.getContent__computeDetailsForCandidate__third\n\n    to do:\n    ======\n*\/\n\nfunction initClearlyComponent__detect(_paramInstance)\n{\n    \/\/  global instance reference {\n    \/\/  ===========================\n\n        \/\/  null; return\n        if (_paramInstance); else { return false; }\n\n        \/\/  shorthand\n        $D = _paramInstance;\n\n    \/\/  global instance reference }\n\n    \/\/  required vars {\n    \/\/  ===============\n\n        \/\/  the component instance object must already be created,\n        \/\/  when the init function is called. it must have these vars set:\n\n        switch (true)\n        {\n            case (!($D.callbacks)):\n            case (!($D.callbacks.finished)):\n\n            case (!($D.window)):\n            case (!($D.document)):\n            case (!($D.document.body)):\n\n            case (!($D.jQuery)):\n\n                if ($D.debug)\n                {\n                    console.log(!($D.callbacks));\n                    console.log(!($D.callbacks.finished));\n\n                    console.log(!($D.window));\n                    console.log(!($D.document));\n                    console.log(!($D.document.body));\n\n                    console.log(!($D.jQuery));\n                }\n\n                \/\/  something's wrong\n                return false;\n        }\n\n    \/\/  required vars }\n\n    \/\/  global vars {\n    \/\/  =============\n\n        $CJ = $D.jQuery;\n\n        $D.$window = $CJ($D.window);\n        $D.$document = $CJ($D.document);\n\n    \/\/  global vars }\n\n    \/\/  parse options {\n    \/\/  ===============   \n\n\t\t$D.parseOptions =\n\t\t{\n\t\t\t'_elements_ignore': \t\t\t        '|button|input|select|textarea|optgroup|command|datalist|--|frame|frameset|noframes|--|style|link|script|noscript|--|canvas|applet|map|--|marquee|area|base|',\n\t\t\t'_elements_ignore_id': \t\t\t\t\t'|evernote-content|evernote-attributes-content|evernote-share-content|evernoteErrorPopup|evernote-post-clip-content|',\n\t\t\t'_elements_ignore_tag': \t\t        '|form|fieldset|details|dir|--|center|font|span|',\n\n\t\t\t'_elements_container': \t\t\t        '|body|--|article|section|--|div|--|td|--|li|--|dd|dt|',\n            '_elements_self_closing': \t\t        '|br|hr|--|img|--|col|--|source|--|embed|param|--|iframe|',\n\n\t\t\t'_elements_visible': \t\t\t        '|article|section|--|ul|ol|li|dd|--|table|tr|td|--|div|--|p|--|h1|h2|h3|h4|h5|h6|--|span|',\n\t\t\t'_elements_too_much_content': \t        '|b|i|em|strong|--|h1|h2|h3|h4|h5|--|td|',\n\t\t\t'_elements_link_density':\t\t        '|div|--|table|ul|ol|--|section|aside|header|',\n\t\t\t'_elements_floating':\t\t\t        '|div|--|table|',\n\t\t\t'_elements_above_target_ignore':        '|br|--|ul|ol|dl|--|table|',\n\n            '_unskippable_attribute':               'clearly__unskippable_element',\n            '_unskippable_attribute_value':         'yes',\n\n            '_use_document_title_attribute':        'clearly__use_document_title_as_article_title',\n            '_use_document_title_attribute_value':  'yes',\n\n            '_elements_keep_attributes':\n\t\t\t{\n\t\t\t\t'a': \t\t['href', 'title', 'name'],\n\t\t\t\t'img': \t\t['src', 'width', 'height', 'alt', 'title'],\n\n\t\t\t\t'video': \t['src', 'width', 'height', 'poster', 'audio', 'preload', 'autoplay', 'loop', 'controls'],\n\t\t\t\t'audio': \t['src', 'preload', 'autoplay', 'loop', 'controls'],\t\t \n\t\t\t\t'source': \t['src', 'type'],\n\n\t\t\t\t'object': \t['data', 'type', 'width', 'height', 'classid', 'codebase', 'codetype'],\t\t\t\t\t\t\n\t\t\t\t'param': \t['name', 'value'],\n\t\t\t\t'embed': \t['src', 'type', 'width', 'height', 'flashvars', 'allowscriptaccess', 'allowfullscreen', 'bgcolor'],\n\n\t\t\t\t'iframe':\t['src', 'width', 'height', 'frameborder', 'scrolling'],\n\n\t\t\t\t'td':\t\t['colspan', 'rowspan'],\t\t\t\n\t\t\t\t'th':\t\t['colspan', 'rowspan']\n\t\t\t},\n\n\t\t\t'_skip_link_from_domain': [\n                \/* international *\/     'doubleclick.net', 'fastclick.net', 'adbrite.com', 'adbureau.net', 'admob.com', 'bannersxchange.com', 'buysellads.com', 'impact-ad.jp', 'atdmt.com', 'advertising.com', 'serving-sys.com',\n                \/* japan *\/             'itmedia.jp', 'microad.jp', 'adplan-ds.com'\n\t\t\t],\n\n\t\t\t'_skip_image_from_domain': [\n                \/* international *\/     'googlesyndication.com', 'fastclick.net', '.2mdn.net', 'de17a.com', 'content.aimatch.com', 'bannersxchange.com', 'buysellads.com', 'atdmt.com', 'advertising.com', 'serving-sys.com',\n                \/* japan *\/             'impact-ad.jp', 'itmedia.jp', 'microad.jp', 'adplan-ds.com'\n\t\t\t],\n\n\t\t\t'_keep_video_from_domain': [\n                \/* video *\/     'youtube.com', 'youtube-nocookie.com', 'vimeo.com', 'hulu.com', 'flickr.com',\n                \/* other *\/     'yahoo.com', 'newsnetz.ch'\n\t\t\t]\n\t\t};\n\n    \/\/  parse options }\n\n    \/\/  debug {\n    \/\/  =======\n\n        $D.debug = ($D.debug || false);\n\t\t$D.debugRemembered = {};\n        $D.debugTimers = [];\n\n\t\tif ($D.debug)\n\t\t{\n\t\t    \/\/  writeLog\n\t\t    \/\/  ========\n\t\t\t\tswitch (true)\n\t\t\t\t{\n\t\t\t\t\tcase (!(!($D.window.console &#038;&#038; $D.window.console.log))):    $D.writeLog = function (msg) { $D.window.console.log(msg); };       break;\n\t\t\t\t\tcase (!(!($D.window.opera &#038;&#038; $D.window.opera.postError))):  $D.writeLog = function (msg) { $D.window.opera.postError(msg); };   break;\n\t\t\t\t\tdefault:                                                    $D.writeLog = function (msg) {};                                    break;\n\t\t\t\t}\n\n            \/\/  log\n            \/\/  ===\n                $D.log = function ()\n                {\n                    if ($D.debug); else { return; }\n                    for (var i=0, il=arguments.length; i<il ; i++) { $D.writeLog(arguments[i]); } $D.writeLog('-----------------------------------------'); }; \/\/ remember \/\/ ======== $D.debugRemember = function (_k, _v) { $D.debugRemembered[_k] = _v; }; \/\/ outline \/\/ ======= $D.debugOutline = function (_element, _category, _reason) { var _outline = '#ff5500', _background = 'rgba(255, 85, 0, 0.5)'; switch (true) { case (!$D.debug): case (!(_element.nodeType === 1)): case (!(_element.tagName > '')):\n                        case (_element.tagName.toLowerCase() == 'onject'):\n                        case (_element.tagName.toLowerCase() == 'embed'):\n                            return;\n                    }\n\n                    switch (true)\n                    {\n                        case (_category == 'target' &#038;&#038; _reason == 'first'):                 _outline = '#00cc00'; _background = 'rgba(0, 255, 0, 0.5)';         break;\n                        case (_category == 'target' &#038;&#038; _reason == 'second'):                _outline = '#0000cc'; _background = 'rgba(0, 0, 255, 0.5)';         break;\n\n                        case (_category == 'target' &#038;&#038; _reason == 'next-page'):             _outline = '#FF80C0'; _background = 'rgba(255, 128, 192, 0.5)';     break;\n                        case (_category == 'target' &#038;&#038; _reason == 'add-above'):             _outline = '#804000'; _background = 'rgba(128, 64, 0, 0.5)';        break;\n\n                        case (_category == 'clean-before' &#038;&#038; _reason == 'floating'):        _outline = '#808080'; _background = 'rgba(128, 128, 128, 0.5)';     break;\n                        case (_category == 'clean-after' &#038;&#038; _reason == 'missing-density'):  _outline = '#C0C0C0'; _background = 'rgba(192, 192, 192, 0.5)';     break;\n                        case (_category == 'clean-after' || _category == 'clean-before'):   _outline = '#000000'; _background = 'rgba(0, 0, 0, 0.5)';           break;\n                    }\n\n                    \/\/  do\n                    $CJ(_element).attr('readable__outline', (_category + ': ' + _reason));\n                    $CJ(_element).css({ 'outline': '5px solid ' + _outline, 'background-color': '' + _background });\n                };\n\n\t\t\/\/\ttimers\n\t\t\/\/\t======\n\n\t\t\t$D.debugTimerStart = function (timerName)\n\t\t\t{\n\t\t\t\t$D.debugTimers.push({\n\t\t\t\t\t'name': timerName,\n\t\t\t\t\t'start': (new Date()).getTime()\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t$D.debugTimerEnd = function ()\n\t\t\t{\n\t\t\t\tvar _t = $D.debugTimers.pop(), _time = ((new Date()).getTime() - _t.start);\n\t\t\t\t$D.log('TIMER \/ '+_t.name+': ' + _time);\n\t\t\t\treturn _time;\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\n            $D.writeLog \t\t= function () { return false; };\n            $D.log \t\t\t\t= function () { return false; };\n            $D.debugRemember \t= function () { return false; };\n            $D.debugOutline \t= function () { return false; };\n            $D.debugTimerStart \t= function () { return false; };\n            $D.debugTimerEnd \t= function () { return false; };\n        }\n\n    \/\/  debug }\n\n    \/\/  language {\n    \/\/  ==========\n\n        \/\/  default\n        $D.language = 'general';\n\n        \/\/  text to test\n        \/\/  ============\n\n            \/\/  title\n            $D.textForlanguageDetection = $D.document.title;\n\n            \/\/  snippets\n            \/\/  ...\n\n        \/\/  check\n        \/\/  =====\n            switch (true)\n            {\n                case ($D.textForlanguageDetection.match(\/([\\u3000])\/gi) != null):\n                case ($D.textForlanguageDetection.match(\/([\\u3001])\/gi) != null):\n                case ($D.textForlanguageDetection.match(\/([\\u3002])\/gi) != null):\n                case ($D.textForlanguageDetection.match(\/([\\u301C])\/gi) != null):\n                    $D.language = 'cjk';\n                    break;\n            }\n\n    \/\/  language }\n\n    \/\/  rtl {\n    \/\/  =====\n\n        \/\/  flags\n        $D.rtl = false;\n        $D.maybeRTL = false;\n\n        \/\/  on\/off\n        $D.makeRTL = function () { $D.rtl = true; };\n        $D.makeNotRTL = function () { $D.rtl = false; };\n\n        \/\/\tdetect\n\t\t(function ()\n\t\t{\n\t\t\t\/\/\tdefinitely\n\t\t\t$D.$document.find('html, body').each(function (_i, _e)\n\t\t\t{\n\t\t\t\tswitch (true)\n\t\t\t\t{\n\t\t\t\t\tcase ($CJ(_e).attr('dir') == 'rtl'):\n\t\t\t\t\tcase ($CJ(_e).css('direction') == 'rtl'):\n\t\t\t\t\tcase ($CJ(_e).attr('lang') == 'he'):\n\t\t\t\t\tcase ($CJ(_e).attr('lang') == 'he-il'):\n\t\t\t\t\tcase ($CJ(_e).attr('lang') == 'ar'):\n\t\t\t\t\tcase ($CJ(_e).attr('lang') == 'ur'):\n\t\t\t\t\t\t$D.makeRTL();\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t\/\/\tmaybe?\n            if (true\n                &#038;&#038; (!$D.rtl) \n                &#038;&#038; ($D.$document.find(\"div[dir='rtl'], table[dir='rtl'], td[dir='rtl']\").length > 0)\n            ) { $D.maybeRTL = true; }\n\t\t}\n\t\t)();\n\n    \/\/  rtl }\n\n    \/\/  measure text {\n    \/\/  ==============\n\n        \/\/\tasian languages\n        \/\/\t===============\n        \/\/\t    http:\/\/msdn.microsoft.com\/en-us\/goglobal\/bb688158\n        \/\/\t    http:\/\/en.wikipedia.org\/wiki\/Japanese_punctuation\n        \/\/\t    http:\/\/en.wikipedia.org\/wiki\/Japanese_typographic_symbols\n        \/\/\t    http:\/\/unicode.org\/charts\/PDF\/U3000.pdf\n        \/\/\t    CJK: Chnese, Japanese, Korean -- HAN character set\n\n        \/\/\tlength\n        \/\/\t======\n            $D.measureText__getTextLength = function (_the_text)\n            {\n                var _text = _the_text;\n\n                    _text = _text.replace(\/[\\s\\n\\r]+\/gi, '');\n                    \/\/_text = _text.replace(\/\\d+\/, '');\n\n                return _text.length;\n            };\n\n        \/\/\tword count\n        \/\/\t==========\n            $D.measureText__getWordCount = function (_the_text)\n            {\n                var _text = _the_text;\n\n                \/\/\tdo stuff\n                \/\/\t========\n                    _text = _text.replace(\/[\\s\\n\\r]+\/gi, ' ');\n\n                    _text = _text.replace(\/([.,?!:;()\\[\\]'\"\"-])\/gi, ' $1 ');\n\n                    _text = _text.replace(\/([\\u3000])\/gi, \t\t\t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u3001])\/gi, \t\t\t\t'[=words(2)]');\n                    _text = _text.replace(\/([\\u3002])\/gi, \t\t\t\t'[=words(4)]');\n                    _text = _text.replace(\/([\\u301C])\/gi, \t\t\t\t'[=words(2)]');\n                    _text = _text.replace(\/([\\u2026|\\u2025])\/gi, \t\t'[=words(2)]');\n                    _text = _text.replace(\/([\\u30FB\\uFF65])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u300C\\u300D])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u300E\\u300F])\/gi,\t\t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u3014\\u3015])\/gi,\t\t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u3008\\u3009])\/gi,\t\t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u300A\\u300B])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u3010\\u3011])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u3016\\u3017])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u3018\\u3019])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u301A\\u301B])\/gi, \t\t'[=words(1)]');\n                    _text = _text.replace(\/([\\u301D\\u301E\\u301F])\/gi, \t'[=words(1)]');\n                    _text = _text.replace(\/([\\u30A0])\/gi, \t\t\t\t'[=words(1)]');\n\n                \/\/\tcount\n                \/\/\t=====\n                    var \n                        _count = 0,\n                        _words_match = _text.match(\/([^\\s\\d]{3,})\/gi)\n                    ;\t\n\n                    \/\/\tadd match\n                    _count += (_words_match != null ? _words_match.length : 0);\n\n                    \/\/\tadd manual count\n                    _text.replace(\/\\[=words\\((\\d)\\)\\]\/, function (_match, _plus) { _count += (5 * parseInt(_plus)); });\n\n                \/\/\treturn\n                \/\/\t======\n                    return _count;\n            };\n\n        \/\/\tlevenshtein\n        \/\/\t===========\t\n            $D.levenshteinDistance = function (str1, str2)\n            {\n                var l1 = str1.length, l2 = str2.length, i = 0, j = 0, d = [];\n\n                if (Math.min(l1, l2) === 0)\n                    { return Math.max(l1, l2); }\n\n                for (i = 0 ; i <= l1 ; i++)\n                    { d[i] = []; d[i][0] = i; }\n\n                for (j = 0 ; j <= l2 ; j++)\n                    { d[0][j] = j; }\n\n                for (i = 1 ; i <= l1 ; i++)\n                    { for (j = 1 ; j <= l2 ; j++) { d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + (str1.charAt(i - 1) === str2.charAt(j - 1) ? 0 : 1)); } }\n\n                return d[l1][l2];\n            };\n\n        \/\/\tget first fragment\n        \/\/\t==================\n            $D.nextPage__getFirstFragment = function (_html)\n            {\n                \/\/  remove all tags\n                _html = _html.replace(\/<[^>]+?>\/gi, '');\n\n                \/\/  normalize spaces\n                _html = _html.replace(\/\\s+\/gi, ' ');\n\n                \/\/  return first 1000 characters\n                return _html.substr(0, 2000);\n            };\n\n    \/\/  measure text }\n\n    \/\/  hidden node {\n    \/\/  =============\n\n        $D.isNodeHidden = function (_node, _tag_name)\n        {\n            switch (true)\n            {\n                case (_node.offsetWidth > 0):\n                case (_node.offsetHeight > 0):\n                    break;\n\n                default:\n                    switch (true)\n                    {\n                        case (_node.offsetLeft > 0):\n                        case (_node.offsetTop > 0):\n                            break;\n\n                        default:\n                            \/\/  exclude inline DIVs -- which, stupidly, don't have a width\/height\n                            if (true\n                                &#038;&#038; (_tag_name == 'div') \n                                &#038;&#038; ((_node.style.display || $CJ.css( _node, \"display\" )) == 'inline')\n                            ) { break; }\n\n                            \/\/  it's hidden\n                            return true;\n                    }\n                    break;\n            }\n\n            \/\/  it's not hidden\n            return false;\n        };\n\n    \/\/  hidden node }\n\n    \/\/  compute points for candidate {\n    \/\/  ==============================\n\n        $D.getContent__computePointsForCandidate__do = function (_ratio_remaining, _power, _ratio, _points_history)\n        {\n            var \n                _points_remaining = (_points_history[0] * _ratio_remaining),\n                _points_to_compute = (_points_history[0] - _points_remaining)\n            ;\n\n            if (_ratio < 0) { \/\/_points_return = (0.75 * _points_remaining); _points_return = _points_remaining; } else { _points_return = 0 + _points_remaining + (_points_to_compute * Math.pow(_ratio, _power)) ; } \/\/ add _points_history.unshift(_points_return); }; \/\/ compute points for candidate } \/\/ process candidates (first) { \/\/ ============================ $D.getContent__computeDetailsForCandidate__first = function (_e, _main) { var _r = {}; \/\/ bad candidate \/\/ ============= if (_e._is__bad) { return _r; } \/\/ paragraphs \/\/ ========== _r['_count__lines_of_65_characters'] = (_e._length__plain_text \/ 65); _r['_count__paragraphs_of_3_lines'] = (_r._count__lines_of_65_characters \/ 3); _r['_count__paragraphs_of_5_lines'] = (_r._count__lines_of_65_characters \/ 5); _r['_count__paragraphs_of_50_words'] = (_e._count__plain_words \/ 50); _r['_count__paragraphs_of_80_words'] = (_e._count__plain_words \/ 80); \/\/ total text \/\/ ========== _r['_ratio__length__plain_text_to_total_plain_text'] = (_e._length__plain_text \/ _main._length__plain_text); _r['_ratio__count__plain_words_to_total_plain_words'] = (_e._count__plain_words \/ _main._count__plain_words); \/\/ links \/\/ ===== _r['_ratio__length__links_text_to_plain_text'] = (_e._length__links_text \/ _e._length__plain_text); _r['_ratio__count__links_words_to_plain_words'] = (_e._count__links_words \/ _e._count__plain_words); _r['_ratio__length__links_text_to_all_text'] = (_e._length__links_text \/ _e._length__all_text); _r['_ratio__count__links_words_to_all_words'] = (_e._count__links_words \/ _e._count__all_words); _r['_ratio__length__links_text_to_total_links_text'] = (_e._length__links_text \/ (_main._length__links_text + 1)); _r['_ratio__count__links_words_to_total_links_words'] = (_e._count__links_words \/ (_main._count__links_words + 1)); _r['_ratio__count__links_to_total_links'] = (_e._count__links \/ (_main._count__links + 1)); _r['_ratio__count__links_to_plain_words'] = ((_e._count__links * 2) \/ _e._count__plain_words); \/\/ text above \/\/ ========== var _divide__candidates = Math.max(2, Math.ceil(_e._count__above_candidates * 0.5)), _above_text = ((0 + (_e._length__above_plain_text * 1) + (_e._length__above_plain_text \/ _divide__candidates) ) \/ 2), _above_words = ((0 + (_e._count__above_plain_words * 1) + (_e._count__above_plain_words \/ _divide__candidates) ) \/ 2) ; _r['_ratio__length__above_plain_text_to_total_plain_text'] = (_above_text \/ _main._length__plain_text); _r['_ratio__count__above_plain_words_to_total_plain_words'] = (_above_words \/ _main._count__plain_words); \/\/ candidates \/\/ ========== _r['_ratio__count__candidates_to_total_candidates'] = (_e._count__candidates \/ (_main._count__candidates + 1)); _r['_ratio__count__containers_to_total_containers'] = (_e._count__containers \/ (_main._count__containers + 1)); \/\/ return \/\/ ====== return _r; }; $D.getContent__computePointsForCandidate__first = function (_e, _main) { var _details = _e.__candidate_details, _points_history = [], _really_big = ((_main._length__plain_text \/ 65) > 250)\n            ;\n\n            \/\/\tbad candidate\n            if (_e._is__bad) { return [0]; }\n\n            \/\/\tthe basics\n            \/\/\t==========\n                _points_history.unshift(((0\n                    + (_details._count__paragraphs_of_3_lines)\n                    + (_details._count__paragraphs_of_5_lines * 1.5)\n                    + (_details._count__paragraphs_of_50_words)\n                    + (_details._count__paragraphs_of_80_words * 1.5)\n                    + (_e._count__images_large * 3)\n                    - ((_e._count__images_skip + _e._count__images_small) * 0.5)\n                ) * 1000));\n\n                \/\/  negative\n                if (_points_history[0] < 0) { return [0]; }\n\n            \/\/  candidates, containers, pieces\n            \/\/  ==============================\n                var \n                    _divide__pieces =     Math.max(5,  Math.ceil(_e._count__pieces *     0.25)),\n                    _divide__candidates = Math.max(5,  Math.ceil(_e._count__candidates * 0.25)),\n                    _divide__containers = Math.max(10, Math.ceil(_e._count__containers * 0.25))\n                ;\n\n                _points_history.unshift(((0\n                    + (_points_history[0] * 3)\n                    + (_points_history[0] \/ _divide__pieces)\n                    + (_points_history[0] \/ _divide__candidates)\n                    + (_points_history[0] \/ _divide__containers)\n                ) \/ 6));\n\n            \/\/\ttotal text\n            \/\/\t==========\n                $D.getContent__computePointsForCandidate__do(0.10, 2, (1 - (1 - _details._ratio__length__plain_text_to_total_plain_text)), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.10, 2, (1 - (1 - _details._ratio__count__plain_words_to_total_plain_words)), _points_history);\n\n                if (_really_big) {\n                $D.getContent__computePointsForCandidate__do(0.10, 4, (1 - (1 - _details._ratio__length__plain_text_to_total_plain_text)), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.10, 4, (1 - (1 - _details._ratio__count__plain_words_to_total_plain_words)), _points_history);\n                }\n\n            \/\/\ttext above\n            \/\/\t==========\n                $D.getContent__computePointsForCandidate__do(0.10, 5, (1 - _details._ratio__length__above_plain_text_to_total_plain_text), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.10, 5, (1 - _details._ratio__count__above_plain_words_to_total_plain_words), _points_history);\n\n                if (_really_big) {\n                $D.getContent__computePointsForCandidate__do(0.10, 10, (1 - _details._ratio__length__above_plain_text_to_total_plain_text), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.10, 10, (1 - _details._ratio__count__above_plain_words_to_total_plain_words), _points_history);\n                }\n\n            \/\/\tlinks outer\n            \/\/\t===========\n                $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details._ratio__length__links_text_to_total_links_text), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details._ratio__count__links_words_to_total_links_words), _points_history);\n\n                $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details._ratio__count__links_to_total_links), _points_history);\n\n            \/\/  links inner\n            \/\/  ===========\n                var __lr = ($D.language == 'cjk' ? 0.75 : 0.50);\n\n                $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__length__links_text_to_plain_text), _points_history);\n                $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__count__links_words_to_plain_words), _points_history);\n\n                $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__length__links_text_to_all_text), _points_history);\n                $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__count__links_words_to_all_words), _points_history);\n\n                $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__count__links_to_plain_words), _points_history);\n\n            \/\/\tcandidates, containers, pieces\n            \/\/\t==============================\n                $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details._ratio__count__candidates_to_total_candidates), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details._ratio__count__containers_to_total_containers), _points_history);\n                $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details._ratio__count__pieces_to_total_pieces), _points_history);\n\n            \/\/\treturn -- will get [0] as the actual final points\n            \/\/\t======\n                return _points_history;\n        };    \n\n        $D.getContent__processCandidates__first = function (_candidatesToProcess)\n        {\n            \/\/\tprocess this var\n            \/\/\t================\n                var _candidates = _candidatesToProcess;\n\n            \/\/\tsort _candidates -- the lower in the dom, the closer to position 0\n            \/\/\t================\n                _candidates.sort(function (a, b)\n                {\n                    switch (true)\n                    {\n                        case (a.__index < b.__index): return -1; case (a.__index > b.__index): return 1;\n                        default: return 0;\n                    }\n                });\n\n            \/\/\tget first\n            \/\/\t=========\n                var\t_main = _candidates[0]\n                if ($D.debug) { $D.log('should be body', _main, _main.__node); }\n\n            \/\/\tpieces of text -- and points computation\n            \/\/\t==============\n                for (var i=0, _i=_candidates.length; i<_i; i++)\n                {\n                    \/\/\tpieces\n                    \/\/\t======\n                        var \n                            _count__pieces = 0,\n                            _array__pieces = []\n                        ;\n\n                        for (var k=i, _k=_candidates.length; k<_k; k++) { if (_candidates[k]._count__candidates > 0) { continue; }\n                            if ($CJ.contains(_candidates[i].__node, _candidates[k].__node)); else { continue; }\n\n                            \/\/\tstore piece, if in debug mode\n                            if ($D.debug) { _array__pieces.push(_candidates[k]); }\n\n                            \/\/\tincement pieces count\n                            _count__pieces++;\n                        }\n\n                    \/\/\tcandidate details\n                    \/\/\t=================\n                        _candidates[i]['__candidate_details'] = $D.getContent__computeDetailsForCandidate__first(_candidates[i], _main);\n\n                    \/\/\tpieces -- do this here because _main doesn't yet have a pieces count\n                    \/\/\t======\n\n                        \/\/\tset pieces\n                        _candidates[i]['_count__pieces'] = _count__pieces;\n                        _candidates[i]['_array__pieces'] = _array__pieces;\n\n                        \/\/\tpieces ratio\n                        _candidates[i]['__candidate_details']['_ratio__count__pieces_to_total_pieces'] = (_count__pieces \/ (_candidates[0]._count__pieces + 1));\n\n                    \/\/  check some more\n                    \/\/  ===============\n                    \/*    switch (true)\n                        {\n                            case (($D.language != 'cjk') &#038;&#038; (_candidates[i]['__candidate_details']['_ratio__length__links_text_to_plain_text'] > 1)):\n                            case (($D.language != 'cjk') &#038;&#038; (_candidates[i]['__candidate_details']['_ratio__count__links_words_to_plain_words'] > 1)):\n                                _candidates[i]._is__bad = true;\n                                break;\n                        }\n                    *\/\n\n                    \/\/\tpoints\n                    \/\/\t======\n                        _candidates[i].__points_history = $D.getContent__computePointsForCandidate__first(_candidates[i], _main);\n                        _candidates[i].__points = _candidates[i].__points_history[0];\n                }\n\n            \/\/\tsort _candidates -- the more points, the closer to position 0\n            \/\/\t================\n                _candidates.sort(function (a, b)\n                {\n                    switch (true)\n                    {\n                        case (a.__points > b.__points): return -1;\n                        case (a.__points < b.__points): return 1; default: return 0; } }); \/\/ return \/\/ ====== return _candidates; }; \/\/ process candidates (first) } \/\/ process candidates (second) { \/\/ ============================= $D.getContent__computePointsForCandidate__second = function (_e, _main) { var _details = _e.__candidate_details, _details_second = _e.__candidate_details_second, _points_history = [] ; \/\/ bad candidate if (_e._is__bad) { return [0]; } \/\/ get initial points \/\/ ================== _points_history.unshift(_e.__points_history[(_e.__points_history.length-1)]); \/\/ candidates, containers, pieces \/\/ ============================== var _divide__pieces = Math.max(5, Math.ceil(_e._count__pieces * 0.25)), _divide__candidates = Math.max(5, Math.ceil(_e._count__candidates * 0.25)), _divide__containers = Math.max(10, Math.ceil(_e._count__containers * 0.25)) ; _points_history.unshift(((0 + (_points_history[0] * 3) + ((_points_history[0] \/ _divide__pieces) * 2) + ((_points_history[0] \/ _divide__candidates) * 2) + ((_points_history[0] \/ _divide__containers) * 2) ) \/ 9)); \/\/ total text \/\/ ========== $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - (1 - _details_second._ratio__length__plain_text_to_total_plain_text)), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - (1 - _details_second._ratio__count__plain_words_to_total_plain_words)), _points_history); \/\/ text above \/\/ ========== var __ar = ($D.language == 'cjk' ? 0.50 : 0.10); $D.getContent__computePointsForCandidate__do(__ar, 1, (1 - _details_second._ratio__length__above_plain_text_to_total_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(__ar, 1, (1 - _details_second._ratio__count__above_plain_words_to_total_plain_words), _points_history); $D.getContent__computePointsForCandidate__do(__ar, 1, (1 - _details_second._ratio__length__above_plain_text_to_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(__ar, 1, (1 - _details_second._ratio__count__above_plain_words_to_plain_words), _points_history); \/\/ links outer \/\/ =========== $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details_second._ratio__count__links_to_total_links), _points_history); $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details_second._ratio__length__links_text_to_total_links_text), _points_history); $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - _details_second._ratio__count__links_words_to_total_links_words), _points_history); \/\/ links inner \/\/ =========== var __lr = ($D.language == 'cjk' ? 0.75 : 0.50); $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__length__links_text_to_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details._ratio__count__links_words_to_plain_words), _points_history); $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details_second._ratio__length__links_text_to_all_text), _points_history); $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details_second._ratio__count__links_words_to_all_words), _points_history); $D.getContent__computePointsForCandidate__do(__lr, 1, (1 - _details_second._ratio__count__links_to_plain_words), _points_history); \/\/ candidates, containers, pieces \/\/ ============================== $D.getContent__computePointsForCandidate__do(0.10, 2, (1 - _details_second._ratio__count__candidates_to_total_candidates), _points_history); $D.getContent__computePointsForCandidate__do(0.10, 2, (1 - _details_second._ratio__count__containers_to_total_containers), _points_history); $D.getContent__computePointsForCandidate__do(0.10, 2, (1 - _details_second._ratio__count__pieces_to_total_pieces), _points_history); \/\/ return -- will get [0] as the actual final points \/\/ ====== return _points_history; }; $D.getContent__computeDetailsForCandidate__second = function (_e, _main) { var _r = {}; \/\/ bad candidate \/\/ ============= if (_e._is__bad) { return _r; } \/\/ total text \/\/ ========== _r['_ratio__length__plain_text_to_total_plain_text'] = (_e._length__plain_text \/ _main._length__plain_text); _r['_ratio__count__plain_words_to_total_plain_words'] = (_e._count__plain_words \/ _main._count__plain_words); \/\/ links \/\/ ===== _r['_ratio__length__links_text_to_all_text'] = (_e._length__links_text \/ _e._length__all_text); _r['_ratio__count__links_words_to_all_words'] = (_e._count__links_words \/ _e._count__all_words); _r['_ratio__length__links_text_to_total_links_text'] = (_e._length__links_text \/ (_main._length__links_text + 1)); _r['_ratio__count__links_words_to_total_links_words'] = (_e._count__links_words \/ (_main._count__links_words + 1)); _r['_ratio__count__links_to_total_links'] = (_e._count__links \/ (_main._count__links + 1)); _r['_ratio__count__links_to_plain_words'] = ((_e._count__links * 2) \/ _e._count__plain_words); \/\/ text above \/\/ ========== var _divide__candidates = Math.max(2, Math.ceil((_e._count__above_candidates - _main._count__above_candidates) * 0.5)), _above_text = ((0 + (_e.__second_length__above_plain_text * 1) + (_e.__second_length__above_plain_text \/ _divide__candidates) ) \/ 2), _above_words = ((0 + (_e.__second_count__above_plain_words * 1) + (_e.__second_count__above_plain_words \/ _divide__candidates) ) \/ 2) ; _r['_ratio__length__above_plain_text_to_total_plain_text'] = (_above_text \/ _main._length__plain_text); _r['_ratio__count__above_plain_words_to_total_plain_words'] = (_above_words \/ _main._count__plain_words); _r['_ratio__length__above_plain_text_to_plain_text'] = (_above_text \/ _e._length__plain_text); _r['_ratio__count__above_plain_words_to_plain_words'] = (_above_words \/ _e._count__plain_words); \/\/ candidates \/\/ ========== _r['_ratio__count__candidates_to_total_candidates'] = (Math.max(0, (_e._count__candidates - (_main._count__candidates * 0.25))) \/ (_main._count__candidates + 1)); _r['_ratio__count__containers_to_total_containers'] = (Math.max(0, (_e._count__containers - (_main._count__containers * 0.25))) \/ (_main._count__containers + 1)); _r['_ratio__count__pieces_to_total_pieces'] = (Math.max(0, (_e._count__pieces - (_main._count__pieces * 0.25))) \/ (_main._count__pieces + 1)); \/\/ return \/\/ ====== return _r; }; $D.getContent__processCandidates__second = function (_processedCandidates) { var _candidates = _processedCandidates, _main = _candidates[0] ; \/\/ only get children of target \/\/ =========================== _candidates = $CJ.map(_candidates, function (_element, _index) { switch (true) { case (!(_index > 0)):\n                        case (!($CJ.contains(_main.__node, _element.__node))):\n                            return null;\n\n                        default:\n                            return _element;\n                    }\n                });\n\n                \/\/  add main - to amke sure the result is never blank\n                _candidates.unshift(_main);\n\n            \/\/\tsort _candidates -- the lower in the dom, the closer to position 0\n            \/\/\t================\n                _candidates.sort(function (a, b)\n                {\n                    switch (true)\n                    {\n                        case (a.__index < b.__index): return -1; case (a.__index > b.__index): return 1;\n                        default: return 0;\n                    }\n                });\n\n            \/\/\tsecond candidate computation\n            \/\/\t============================\n                for (var i=0, _i=_candidates.length; i<_i; i++) { \/\/ additional numbers \/\/ ================== _candidates[i].__second_length__above_plain_text = (_candidates[i]._length__above_plain_text - _main._length__above_plain_text); _candidates[i].__second_count__above_plain_words = (_candidates[i]._count__above_plain_words - _main._count__above_plain_words); \/\/ candidate details \/\/ ================= _candidates[i]['__candidate_details_second'] = $D.getContent__computeDetailsForCandidate__second(_candidates[i], _main); \/\/ check some more \/\/ =============== \/* switch (true) { case (!(_candidates[i]['__candidate_details_second']['_ratio__count__plain_words_to_total_plain_words'] > 0.05)):\n                            case (!(_candidates[i]['__candidate_details_second']['_ratio__length__plain_text_to_total_plain_text'] > 0.05)):\n\n                            \/\/case (!(_candidates[i]['__candidate_details_second']['_ratio__count__above_plain_words_to_total_plain_words'] < 0.1)):\n                            \/\/case (!(_candidates[i]['__candidate_details_second']['_ratio__length__above_plain_text_to_total_plain_text'] < 0.1)): \/\/case (_candidates[i]['__candidate_details_second']['_ratio__length__above_plain_text_to_plain_text'] > 1):\n                            \/\/case (_candidates[i]['__candidate_details_second']['_ratio__count__above_plain_words_to_plain_words'] > 1):\n\n                                _candidates[i]._is__bad = true;\n                                \/\/\twil set points to 0, in points computation function\n                                break;\n                        }\n                    *\/\n\n                    \/\/\tpoints\n                    \/\/\t======\n                        _candidates[i].__points_history_second = $D.getContent__computePointsForCandidate__second(_candidates[i], _main);\n                        _candidates[i].__points_second = _candidates[i].__points_history_second[0];\n                }\n\n            \/\/\tsort _candidates -- the more points, the closer to position 0\n            \/\/\t================\n                _candidates.sort(function (a, b)\n                {\n                    switch (true)\n                    {\n                        case (a.__points_second > b.__points_second): return -1;\n                        case (a.__points_second < b.__points_second): return 1; default: return 0; } }); \/\/ return \/\/ ====== return _candidates; }; \/\/ process candidates (second) } \/\/ process candidates (third) { \/\/ ============================ $D.getContent__computePointsForCandidate__third = function (_e, _main) { var _details = _e.__candidate_details, _details_second = _e.__candidate_details_second, _points_history = [] ; \/\/ bad candidate if (_e._is__bad) { return [0]; } \/\/ get initial points \/\/ ================== _points_history.unshift(_e.__points_history[(_e.__points_history.length-1)]); \/\/ candidates, containers, pieces \/\/ ============================== var _divide__pieces = Math.max(2, Math.ceil(_e._count__pieces * 0.25)), _divide__candidates = Math.max(2, Math.ceil(_e._count__candidates * 0.25)), _divide__containers = Math.max(4, Math.ceil(_e._count__containers * 0.25)) ; _points_history.unshift(((0 + (_points_history[0] * 3) + ((_points_history[0] \/ _divide__pieces) * 2) + ((_points_history[0] \/ _divide__candidates) * 2) + ((_points_history[0] \/ _divide__containers) * 2) ) \/ 9)); \/\/ total text \/\/ ========== $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - (1 - _details_second._ratio__length__plain_text_to_total_plain_text)), _points_history); $D.getContent__computePointsForCandidate__do(0.75, 1, (1 - (1 - _details_second._ratio__count__plain_words_to_total_plain_words)), _points_history); \/\/ text above \/\/ ========== $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__length__above_plain_text_to_total_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__above_plain_words_to_total_plain_words), _points_history); $D.getContent__computePointsForCandidate__do(0.10, 1, (1 - _details_second._ratio__length__above_plain_text_to_total_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(0.10, 1, (1 - _details_second._ratio__count__above_plain_words_to_total_plain_words), _points_history); $D.getContent__computePointsForCandidate__do(0.10, 1, (1 - _details_second._ratio__length__above_plain_text_to_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(0.10, 1, (1 - _details_second._ratio__count__above_plain_words_to_plain_words), _points_history); \/\/ links inner \/\/ =========== $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__length__links_text_to_all_text), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__links_words_to_all_words), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__length__links_text_to_plain_text), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__links_words_to_plain_words), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__links_to_plain_words), _points_history); \/\/ candidates, containers, pieces \/\/ ============================== $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__candidates_to_total_candidates), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__containers_to_total_containers), _points_history); $D.getContent__computePointsForCandidate__do(0.50, 1, (1 - _details._ratio__count__pieces_to_total_pieces), _points_history); \/\/ return -- will get [0] as the actual final points \/\/ ====== return _points_history; }; \/\/ process candidates (third) } \/\/ explore node and get stuff { \/\/ ============================ $D.getContent__exploreNodeAndGetStuff = function (_nodeToExplore, _justExploring) { var _global__element_index = 0, _global__inside_link = false, _global__inside_link__element_index = 0, _global__length__above_plain_text = 0, _global__count__above_plain_words = 0, _global__length__above_links_text = 0, _global__count__above_links_words = 0, _global__count__above_candidates = 0, _global__count__above_containers = 0, _global__above__plain_text = '', _global__above__links_text = '', _return__containers = [], _return__candidates = [], _return__links = [] ; \/\/ recursive function \/\/ ================== var _recursive = function (_node) { \/\/ increment index \/\/ starts with 1 _global__element_index++; var _tag_name = (_node.nodeType === 3 ? '#text' : ((_node.nodeType === 1 &#038;&#038; _node.tagName &#038;&#038; _node.tagName > '') ? _node.tagName.toLowerCase() : '#invalid')),\n\t\t\t\t\t\t_node_id = (_node.id),\n                        _result =\n                        {\n                            '__index': _global__element_index, \n                            '__node': _node, \n\n                            '_is__container': \t\t($D.parseOptions._elements_container.indexOf('|'+_tag_name+'|') > -1),\n                            '_is__candidate': \t\tfalse,\n                            '_is__text': \t\t\tfalse,\n                            '_is__link': \t\t\tfalse,\n                            '_is__link_skip': \t\tfalse,\n                            '_is__image_small': \tfalse,\n                            '_is__image_medium': \tfalse,\n                            '_is__image_large': \tfalse,\n                            '_is__image_skip': \t\tfalse,\n                            '_is__unskippable':     false,\n\n                            '_debug__above__plain_text': _global__above__plain_text,\n                            '_debug__above__links_text': _global__above__links_text,\n\n                            '_length__above_plain_text': _global__length__above_plain_text,\n                            '_count__above_plain_words': _global__count__above_plain_words,\n\n                            '_length__above_links_text': _global__length__above_links_text,\n                            '_count__above_links_words': _global__count__above_links_words,\n\n                            '_length__above_all_text': \t(_global__length__above_plain_text + _global__length__above_links_text),\n                            '_count__above_all_words': \t(_global__count__above_plain_words + _global__count__above_links_words),\n\n                            '_count__above_candidates': _global__count__above_candidates,\n                            '_count__above_containers': _global__count__above_containers,\n\n                            '_length__plain_text': 0,\n                            '_count__plain_words': 0,\n\n                            '_length__links_text': 0,\n                            '_count__links_words': 0,\n\n                            '_length__all_text': 0,\n                            '_count__all_words': 0,\n\n                            '_count__containers': 0,\n                            '_count__candidates': 0,\n\n                            '_count__links': 0,\n                            '_count__links_skip': 0,\n\n                            '_count__images_small': 0,\n                            '_count__images_medium': 0,\n                            '_count__images_large': 0,\n                            '_count__images_skip': 0\n                        };\n\n                    \/\/  unskippable\n                    \/\/  ===========\n                        if (false\n                            || (_result._is__container)\n                            || ($D.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1)\n                        ) {\n                            var _unskip = _node.getAttribute($D.parseOptions._unskippable_attribute);\n                            if (_unskip == $D.parseOptions._unskippable_attribute_value) { _result._is__unskippable = true; }\n                        }\n\n                    \/\/\tfast return\n                    \/\/\t===========\n                        switch (true)\n                        {\n                            case ((_tag_name == '#invalid')):\n                            case (($D.parseOptions._elements_ignore.indexOf('|'+_tag_name+'|') > -1)):\n                                return false;\n\t\t\t\t\t\t\tcase (($D.parseOptions._elements_ignore_id.indexOf('|'+_node_id+'|') > -1)):\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn false;\t\t\t\t\t\t\t\t\n                            case (($D.parseOptions._elements_visible.indexOf('|'+_tag_name+'|') > -1)):\n                                if ($D.isNodeHidden(_node, _tag_name)) { return false; }\n                                break;\n\n                            \/\/\tself-closing -- with some exceptions\n                            case ($D.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1):\n                                switch (true)\n                                {\n                                    case ((_tag_name == 'img')): break;\n                                    default: return false;\n                                }\n                                break;\n                        }\n\n                    \/\/\tdo stuff\n                    \/\/\t========\n                        switch (true)\n                        {\n                            \/\/\ttext node\n                            case ((_tag_name == '#text')):\n                                \/\/\tmark\n                                _result._is__text = true;\n\n                                \/\/\tget\n                                var _nodeText = _node.nodeValue;\n\n                                \/\/\tresult\n                                _result._length__plain_text = $D.measureText__getTextLength(_nodeText);\n                                _result._count__plain_words = $D.measureText__getWordCount(_nodeText);\n\n                                if (_global__inside_link)\n                                {\n                                    _global__length__above_links_text += _result._length__plain_text;\n                                    _global__count__above_links_words += _result._count__plain_words;\t\t\t\t\t\n                                    if (false &#038;&#038; $D.debug) { _global__above__links_text += ' ' + _nodeText; }\n                                }\n                                else\n                                {\n                                    _global__length__above_plain_text += _result._length__plain_text;\n                                    _global__count__above_plain_words += _result._count__plain_words;\t\t\t\t\t\n                                    if (false &#038;&#038; $D.debug) { _global__above__plain_text += ' ' + _nodeText; }\n                                }\n\n                                \/\/\treturn text\n                                return _result;\n\n                            \/\/\tlink\n                            case (_tag_name == 'a'):\n                                var _href = '';\n\n                                try {\n                                    _href = _node.href\n                                } catch (e) {\n                                    _href = $CJ.attr('href');\n                                }\n\n                                \/\/\tsanity\n                                if (_href > ''); else { break; }\n                                if (_href.indexOf); else { break; }\n\n                                _result._is__link = true;\n\n                                \/\/\tskip\n                                for (var i=0, _i=$D.parseOptions._skip_link_from_domain.length; i<_i; i++) { if (_href.indexOf($D.parseOptions._skip_link_from_domain[i]) > -1)\n                                        { _result._is__link_skip = true; break; }\n                                }\n\n                                \/\/\tinside link\n                                if (_global__inside_link); else\n                                {\n                                    _global__inside_link = true;\n                                    _global__inside_link__element_index = _result.__index;\n                                }\n\n                                \/\/\tdone\n                                _return__links.push(_result);\n                                break;\n\n                            \/\/\timage\n                            case (_tag_name == 'img'):\n\n                                \/\/\tskip\n                                if (_node.src &#038;&#038; _node.src.indexOf)\n                                {\n                                    for (var i=0, _i=$D.parseOptions._skip_image_from_domain.length; i<_i; i++) { if (_node.src.indexOf($D.parseOptions._skip_image_from_domain[i]) > -1)\n                                            { _result._is__image_skip = true; break; }\n                                    }\n                                }\n\n                                \/\/\tsize\n                                var\t_width = $CJ(_node).width(), _height = $CJ(_node).height();\n                                switch (true)\n                                {\n                                    case ((_width * _height) >= 50000):\n                                    case ((_width >= 350) &#038;&#038; (_height >= 75)):\n                                        _result._is__image_large = true;\n                                        break;\n\n                                    case ((_width * _height) >= 20000):\n                                    case ((_width >= 150) &#038;&#038; (_height >= 150)):\n                                        _result._is__image_medium = true;\n                                        break;\n\n                                    case ((_width <= 5) &#038;&#038; (_height <= 5)):\n                                        _result._is__image_skip = true;\n                                        break;\n\n                                    default:\n                                        _result._is__image_small = true;\n                                        break;\n                                }\n\n                                break;\n                        }\n\n                    \/\/\tchild nodes\n                    \/\/\t===========\n                        for (var i=0, _i=_node.childNodes.length; i<_i; i++) { var _child = _node.childNodes[i], _child_result = _recursive(_child) ; \/\/ if false, continue if (_child_result); else { continue; } \/\/ add to result _result._count__links += _child_result._count__links + (_child_result._is__link ? 1 : 0); _result._count__links_skip += _child_result._count__links_skip + (_child_result._is__link_skip ? 1 : 0); _result._count__images_small += _child_result._count__images_small + (_child_result._is__image_small ? 1 : 0); _result._count__images_medium += _child_result._count__images_medium + (_child_result._is__image_medium ? 1 : 0); _result._count__images_large += _child_result._count__images_large + (_child_result._is__image_large ? 1 : 0); _result._count__images_skip += _child_result._count__images_skip + (_child_result._is__image_skip ? 1 : 0); _result._count__containers += _child_result._count__containers + (_child_result._is__container ? 1 : 0); _result._count__candidates += _child_result._count__candidates + (_child_result._is__candidate ? 1 : 0); _result._length__all_text += _child_result._length__plain_text + _child_result._length__links_text; _result._count__all_words += _child_result._count__plain_words + _child_result._count__links_words; \/\/ plain text \/ link text switch (true) { case (_child_result._is__link): \/\/ no text to add _result._length__links_text += (_child_result._length__plain_text + _child_result._length__links_text); _result._count__links_words += (_child_result._count__plain_words + _child_result._count__links_words); break; default: _result._length__plain_text += _child_result._length__plain_text; _result._count__plain_words += _child_result._count__plain_words; _result._length__links_text += _child_result._length__links_text; _result._count__links_words += _child_result._count__links_words; break; } } \/\/ after child nodes \/\/ ================= \/\/ mark as not in link anymore if (true &#038;&#038; (_result._is__link) &#038;&#038; (_global__inside_link__element_index == _result.__index) ) { _global__inside_link = false; _global__inside_link__element_index = 0; } \/\/ add to containers \/\/ ================= if (_result._is__container || ((_result.__index == 1) &#038;&#038; (_justExploring == true))) { \/\/ add to containers _return__containers.push(_result); \/\/ increase above containers if (_result._is__container) { _global__count__above_containers++; } \/\/ add to candidates if (_justExploring); else { switch (true) { case (($D.language != 'cjk') &#038;&#038; ((_result._count__links * 2) >= _result._count__plain_words)):  \/* link ratio *\/\n\n                                    case (($D.language != 'cjk') &#038;&#038; (_result._length__plain_text < (65 \/ 3))):  \/* text length *\/\n                                    case (($D.language != 'cjk') &#038;&#038; (_result._count__plain_words < 5)):\t\t\t\/* words *\/\n\n                                    case (($D.language == 'cjk') &#038;&#038; (_result._length__plain_text < 10)):\t    \/* text length *\/\n                                    case (($D.language == 'cjk') &#038;&#038; (_result._count__plain_words < 2)):\t\t\t\/* words *\/\n\n                                    \/\/case (_result._length__plain_text == 0):    \/* no text *\/\n                                    \/\/case (_result._count__plain_words == 0):    \/* no words *\/\n\n                                    \/\/case (($D.language == 'cjk') &#038;&#038; ((_result._length__plain_text \/ 65 \/ 3) < 0.1)):\t\t\t\t\/* paragrahs of 3 lines *\/\n                                    \/\/case (($D.language != 'cjk') &#038;&#038; ((_result._count__plain_words \/ 50) < 0.5)): \/* paragraphs of 50 words *\/ \/\/ not a valid candidate \/\/if (_tag_name == 'div') { $D.log('bad candidate', _result.__node); } break; default: \/\/ good candidate _result._is__candidate = true; _return__candidates.push(_result); \/\/ increase above candidates _global__count__above_candidates++; break; } \/\/ special case for body -- if it was just skipped \/\/ ===================== if ((_result.__index == 1) &#038;&#038; !(_result._is__candidate)) { _result._is__candidate = true; _result._is__bad = true; _return__candidates.push(_result); } } } \/\/ return \/\/ ====== return _result; }; \/\/ actually do it \/\/ ============== _recursive(_nodeToExplore); \/\/ just exploring -- return first thing \/\/ ============== if (_justExploring) { return _return__containers.pop(); } \/\/ return containers list \/\/ ====================== return { '_containers': _return__containers, '_candidates': _return__candidates, '_links': _return__links }; }; \/\/ explore node and get stuff } \/\/ build html for node { \/\/ ===================== $D.getContent__buildHTMLForNode = function (_nodeToBuildHTMLFor, _custom_mode) { var _global__element_index = 0, _global__the_html = '', _global__exploreNodeToBuildHTMLFor = $D.getContent__exploreNodeAndGetStuff(_nodeToBuildHTMLFor, true) ; \/\/ custom switch (_custom_mode) { case 'above-the-target': _global__exploreNodeToBuildHTMLFor = false; break; } \/\/ recursive function \/\/ ================== var _recursive = function (_node) { \/\/ increment index -- starts with 1 \/\/ =============== _global__element_index++; \/\/ vars \/\/ ==== var _explored = false, _tag_name = (_node.nodeType === 3 ? '#text' : ((_node.nodeType === 1 &#038;&#038; _node.tagName &#038;&#038; _node.tagName > '') ? _node.tagName.toLowerCase() : '#invalid')),\n\t\t\t\t\t\t\t_node_id = _node.id,\n                            _pos__start__before = 0,\n                            _pos__start__after = 0,\n                            _pos__end__before = 0,\n                            _pos__end__after = 0\n                        ;\n\n                    \/\/\tfast return\n                    \/\/\t===========\n                        switch (true)\n                        {\n                            case ((_tag_name == '#invalid')):\n                            case (($D.parseOptions._elements_ignore.indexOf('|'+_tag_name+'|') > -1)):\n                                return;\n\t\t\t\t\t\t\tcase (($D.parseOptions._elements_ignore_id.indexOf('|'+_node_id+'|') > -1)):\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn;\t\t\t\t\t\t\t\t\t\n\n                            case (_tag_name == '#text'):\n                                _global__the_html += _node.nodeValue\n                                    .replace(\/<\/gi, '&lt;') .replace(\/>\/gi, '&gt;')\n                                ;\n                                return;\n                        }\n\n                    \/\/\thidden\n                    \/\/\t======\n                        if (true\n                            &#038;&#038; ($D.parseOptions._elements_visible.indexOf('|'+_tag_name+'|') > -1)\n                            &#038;&#038; $D.isNodeHidden(_node, _tag_name)\n                        ) { return; }\n\n                    \/\/\tclean -- before\n                    \/\/\t=====\n\n                        \/\/\tobjects, embeds, iframes\n                        \/\/\t========================\n                            switch (_tag_name)\n                            {\n                                case ('object'):\n                                case ('embed'):\n                                case ('iframe'):\n                                    var \n                                        _src = (_tag_name == 'object' ? $CJ(_node).find(\"param[name='movie']\").attr('value') : $CJ(_node).attr('src')),\n                                        _skip = ((_src > '') ? false : true)\n                                    ;\n\n                                    if (_skip); else\n                                    {\n                                        \/\/\tdefault skip\n                                        _skip = true;\n\n                                        \/\/\tloop\n                                        for (var i=0, _i=$D.parseOptions._keep_video_from_domain.length; i<_i; i++) { if (_src.indexOf($D.parseOptions._keep_video_from_domain[i]) > -1) { _skip = false; break; } }\n                                    }\n\n                                    \/\/\tskip?\n                                    if (_skip)\n                                    {\n                                        _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                        if (_explored &#038;&#038; _explored._is__unskippable); else\n                                        {\n                                            $D.debugOutline(_node, 'clean-before', 'object-embed-iframe');\n                                            return;\n                                        }\n                                    }\n\n                                    break;\n                            }\n\n                        \/\/\tskipped link\n                        \/\/\t============\n                            if (_tag_name == 'a' || _tag_name == 'li')\n                            {\n                                _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                if (_explored &#038;&#038; _explored._is__unskippable); else\n                                {\n                                    switch (true)\n                                    {\n                                        case (_explored._is__link_skip):\n                                        case (((_explored._count__images_small + _explored._count__images_skip) > 0) &#038;&#038; (_explored._length__plain_text < 65)): $D.debugOutline(_node, 'clean-before', 'skip-link'); return; } } } \/\/ link density \/\/ ============ if ($D.parseOptions._elements_link_density.indexOf('|'+_tag_name+'|') > -1)\n                            {\n                                _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                if (_explored &#038;&#038; _explored._is__unskippable); else\n                                {\n                                    switch (true)\n                                    {\n                                        case (_explored._length__plain_text > (65 * 3 * 2)):\n                                        case ($D.language == 'cjk' &#038;&#038; (_explored._length__plain_text > (65 * 3 * 1))):\n                                        case (!(_explored._count__links > 1)):\n                                        case (_global__exploreNodeToBuildHTMLFor &#038;&#038; (_explored._length__plain_text \/ _global__exploreNodeToBuildHTMLFor._length__plain_text) > 0.5):\n                                        case (_global__exploreNodeToBuildHTMLFor &#038;&#038; (_explored._count__plain_words \/ _global__exploreNodeToBuildHTMLFor._count__plain_words) > 0.5):\n                                        case ((_explored._length__plain_text == 0) &#038;&#038; (_explored._count__links == 1) &#038;&#038; (_explored._length__links_text < 65)):\n                                        case ((_explored._length__plain_text < 25) &#038;&#038; ((_explored._count__images_large + _explored._count__images_medium) > 0)):\n                                            break;\n\n                                        case ((_explored._length__links_text \/ _explored._length__all_text) < 0.5): if (_explored._count__links > 0); else { break; }\n                                            if (_explored._count__links_skip > 0); else { break; }\n                                            if (((_explored._count__links_skip \/ _explored._count__links) > 0.25) &#038;&#038; (_explored._length__links_text \/ _explored._length__all_text) < 0.05) { break; } default: $D.debugOutline(_node, 'clean-before', 'link-density'); return; } } } \/\/ floating \/\/ ======== if ($D.parseOptions._elements_floating.indexOf('|'+_tag_name+'|') > -1)\n                            {\n                                _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                if (_explored &#038;&#038; _explored._is__unskippable); else\n                                {\n                                    switch (true)\n                                    {\n                                        case (_explored._length__plain_text > (65 * 3 * 2)):\n                                        case ($D.language == 'cjk' &#038;&#038; (_explored._length__plain_text > (65 * 3 * 1))):\n                                        case (_global__exploreNodeToBuildHTMLFor &#038;&#038; (_explored._length__plain_text \/ _global__exploreNodeToBuildHTMLFor._length__plain_text) > 0.25):\n                                        case (_global__exploreNodeToBuildHTMLFor &#038;&#038; (_explored._count__plain_words \/ _global__exploreNodeToBuildHTMLFor._count__plain_words) > 0.25):\n                                        case ((_explored._length__plain_text < 25) &#038;&#038; (_explored._length__links_text < 25) &#038;&#038; ((_explored._count__images_large + _explored._count__images_medium) > 0)):\n                                        case (_node.getElementsByTagName &#038;&#038; (_explored._length__plain_text < (65 * 3 * 1)) &#038;&#038; ((_node.getElementsByTagName('h1').length + _node.getElementsByTagName('h2').length + _node.getElementsByTagName('h3').length + _node.getElementsByTagName('h4').length) > 0)):\n                                            break;\n\n                                        default:\n                                            var _float = $CJ(_node).css('float');\n                                            if (_float == 'left' || _float == 'right'); else { break; }\n                                            if ((_explored._length__links_text == 0) &#038;&#038; ((_explored._count__images_large + _explored._count__images_medium) > 0)) { break; }\n\n                                            $D.debugOutline(_node, 'clean-before', 'floating');\n                                            return;\n                                    }\n                                }\n                            }\n\n                        \/\/\tabove target\n                        \/\/\t============\n                            if (_custom_mode == 'above-the-target')\n                            {\n                                \/\/  is ignored?\n                                if ($D.parseOptions._elements_above_target_ignore.indexOf('|'+_tag_name+'|') > -1)\n                                {\n                                    _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                    if (_explored &#038;&#038; _explored._is__unskippable); else\n                                    {\n                                        $D.debugOutline(_node, 'clean-before', 'above-target');\n                                        return;\n                                    }\n                                }\n\n                                \/\/  is image?\n                                if (_tag_name == 'img')\n                                {\n                                    _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                    if (_explored &#038;&#038; _explored._is__unskippable); else\n                                    {\n                                        if (_explored._is__image_large); else\n                                        {\n                                            $D.debugOutline(_node, 'clean-before', 'above-target');\n                                            return;\n                                        }\n                                    }\n                                }\n\n                                \/\/  has too many links?\n                                \/\/if (_node.getElementsByTagName &#038;&#038; _node.getElementsByTagName('a').length > 5)\n                                \/\/    { $D.debugOutline(_node, 'clean-before', 'above-target'); return; }\n                            }\n\n                        \/\/  headers that are images\n                        \/\/  =======================\n                            if (_tag_name.match(\/^h(1|2|3|4|5|6)$\/gi))\n                            {\n                                _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                if (_explored &#038;&#038; _explored._is__unskippable); else\n                                {\n                                    switch (true)\n                                    {\n                                        case ((_explored._length__plain_text < 10) &#038;&#038; ((_explored._count__images_small + _explored._count__images_medium + _explored._count__images_large + _explored._count__images_skip) > 0)):\n                                            $D.debugOutline(_node, 'clean-before', 'skip-heading');\n                                            return;\n                                    }\n                                }\n                            }\n\n                    \/\/\tstart tag\n                    \/\/\t=========\n                        if ($D.parseOptions._elements_ignore_tag.indexOf('|'+_tag_name+'|') > -1); else\n                        {\n                            \/* mark *\/\t_pos__start__before = _global__the_html.length;\n                            \/* add *\/\t_global__the_html += '<'+_tag_name;\n\n                            \/\/\tattributes\n                            \/\/\t==========\n\n                                \/\/\tallowed attributes\n                                if (_tag_name in $D.parseOptions._elements_keep_attributes)\n                                {\n                                    for (var i=0, _i=$D.parseOptions._elements_keep_attributes[_tag_name].length; i<_i; i++) { var _attribute_name = $D.parseOptions._elements_keep_attributes[_tag_name][i], _attribute_value = _node.getAttribute(_attribute_name) ; \/\/ if present if (_attribute_value > '')\n                                            { _global__the_html += ' '+_attribute_name+'=\"'+(_attribute_value)+'\"'; }\n                                    }\n                                }\n\n                                \/\/\tkeep ID for all elements\n                                var _id_attribute = _node.getAttribute('id');\n                                if (_id_attribute > '')\n                                    { _global__the_html += ' id=\"'+_id_attribute+'\"'; }\n\n                                \/\/\tlinks target NEW\n                                if (_tag_name == 'a')\n                                    { _global__the_html += ' target=\"_blank\"'; }\n\n                            \/\/\tclose start\n                            \/\/\t===========\n                                if ($D.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1) { _global__the_html += ' \/>'; }\n                                else { _global__the_html += '>';}\n\n                            \/* mark *\/ _pos__start__after = _global__the_html.length;\n                        }\n\n                    \/\/\tchild nodes\n                    \/\/\t===========\n                        if ($D.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1); else\n                        {\n                            for (var i=0, _i=_node.childNodes.length; i<_i; i++) { _recursive(_node.childNodes[i]); } } \/\/ end tag \/\/ ======= switch (true) { case (($D.parseOptions._elements_ignore_tag.indexOf('|'+_tag_name+'|') > -1)):\n                                return;\n\n                            case (($D.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1)):\n                                \/* mark *\/ \t_pos__end__before = _global__the_html.length;\n                                \/* mark *\/ \t_pos__end__after = _global__the_html.length;\n                                break;\n\n                            default:\n                                \/* mark *\/ \t_pos__end__before = _global__the_html.length;\n                                \/* end *\/ \t_global__the_html += '<\/'+_tag_name+'>';\n                                \/* mark *\/ \t_pos__end__after = _global__the_html.length;\n                                break;\n                        }\n\n                    \/\/\tclean -- after\n                    \/\/\t=====\n\n                        \/\/\tlargeObject classes\n                        if (_tag_name == 'iframe' || _tag_name == 'embed' || _tag_name == 'object')\n                        {\n                            _global__the_html = ''\n                                + _global__the_html.substr(0, _pos__start__before)\n                                + '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"readableLargeObjectContainer\">'\n                                + \t_global__the_html.substr(_pos__start__before, (_pos__end__after - _pos__start__before))\n                                + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                            ;\n                            return;\n                        }\n\n                        \/\/\tadd image classes\n                        if (_tag_name == 'img')\n                        {\n                            _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                            if (_explored &#038;&#038; _explored._is__unskippable); else\n                            {\n                                switch (true)\n                                {\n                                    case (_explored._is__image_skip):\n                                        $D.debugOutline(_node, 'clean-after', 'skip-img');\n                                        _global__the_html = _global__the_html.substr(0, _pos__start__before);\n                                        return;\n\n                                    case (_explored._is__image_large):\n\n                                        \/\/  add float class -- for images too narrow\/tall\n                                        \/\/  remove width\/height -- only for large images\n\n                                        \/\/  http:\/\/www.wired.com\/threatlevel\/2011\/05\/gps-gallery\/?pid=89&#038;viewall=true\n                                        \/\/  http:\/\/david-smith.org\/blog\/2012\/03\/10\/ios-5-dot-1-upgrade-stats\/index.html\n                                        \/\/  http:\/\/www.turntablekitchen.com\/2012\/04\/dutch-baby-with-caramelized-vanilla-bean-pears-moving-through-the-decades\/\n\n                                        _global__the_html = ''\n                                            + _global__the_html.substr(0, _pos__start__before)\n                                            + '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"readableLargeImageContainer'\n                                            + \t(($CJ(_node).width() <= 250) &#038;&#038; ($CJ(_node).height() >= 250) ? ' float' : '')\n                                            + '\">'\n                                            + \t_global__the_html.substr(_pos__start__before, (_pos__end__after - _pos__start__before)).replace(\/width=\"([^=]+?)\"\/gi, '').replace(\/height=\"([^=]+?)\"\/gi, '')\n                                            + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                                        ;\n                                        return;\n                                }\n                            }\n                        }\n\n                        \/\/\tlarge images in links\n                        if (_tag_name == 'a')\n                        {\n                            _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                            switch (true)\n                            {\n                                case (_explored._count__images_large == 1):\n                                    _global__the_html = ''\n                                        + _global__the_html.substr(0, _pos__start__after-1)\n                                        + ' class=\"readableLinkWithLargeImage\">'\n                                        + \t_global__the_html.substr(_pos__start__after, (_pos__end__before - _pos__start__after))\n                                        + '<\/a>'\n                                    ;\n                                    return;\n\n                                case (_explored._count__images_medium == 1):\n                                    _global__the_html = ''\n                                        + _global__the_html.substr(0, _pos__start__after-1)\n                                        + ' class=\"readableLinkWithMediumImage\">'\n                                        + \t_global__the_html.substr(_pos__start__after, (_pos__end__before - _pos__start__after))\n                                        + '<\/a>'\n                                    ;\n                                    return;\n                            }\t\t\n                        }\n\n                        \/\/\ttoo much content\n                        if ($D.parseOptions._elements_too_much_content.indexOf('|'+_tag_name+'|') > -1)\n                        {\n                            _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                            if (_explored &#038;&#038; _explored._is__unskippable); else\n                            {\n                                switch (true)\n                                {\n                                    case (_tag_name == 'h1' &#038;&#038; (_explored._length__all_text > (65 * 2))):\n                                    case (_tag_name == 'h2' &#038;&#038; (_explored._length__all_text > (65 * 2 * 3))):\n                                    case ((_tag_name.match(\/^h(3|4|5|6)$\/) != null) &#038;&#038; (_explored._length__all_text > (65 * 2 * 5))):\n                                    case ((_tag_name.match(\/^(b|i|em|strong)$\/) != null) &#038;&#038; (_explored._length__all_text > (65 * 5 * 5))):\n                                        $D.debugOutline(_node, 'clean-after', 'too-much-content');\n                                        _global__the_html = ''\n                                            + _global__the_html.substr(0, _pos__start__before)\n                                            + _global__the_html.substr(_pos__start__after, (_pos__end__before - _pos__start__after))\n                                        ;\n                                        return;\n                                }\n                            }\n                        }\t\t\n\n                        \/\/\tempty elements\n                        switch (true)\n                        {\n                            case (($D.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1)):\n                            case (($D.parseOptions._elements_ignore_tag.indexOf('|'+_tag_name+'|') > -1)):\n                            case (_tag_name == 'td'):\n                                break;\n\n                            default:\n                                var _contents = _global__the_html.substr(_pos__start__after, (_pos__end__before - _pos__start__after));\n                                    _contents = _contents.replace(\/(<br \\\/>)\/gi, '');\n                                    _contents = _contents.replace(\/(\n\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<hr \\\/>\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n\n)\/gi, '');\n\n                                \/\/  for rows, clear empty cells\n                                if (_tag_name == 'tr')\n                                {\n                                    _contents = _contents.replace(\/\n<td[^>\n\n<p>&nbsp;<\/p>\n\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>]*?>\/gi, '');\n                                    _contents = _contents.replace(\/<\\\/td>\/gi, '');\n                                }\n\n                                \/\/  for tables, clear empty rows\n                                if (_tag_name == 'table')\n                                {\n                                    _contents = _contents.replace(\/\n<tr[^>]*?>\/gi, '');\n                                    _contents = _contents.replace(\/<\\\/tr>\/gi, '');\n                                }\n\n                                var _contentsLength = $D.measureText__getTextLength(_contents);\n\n                                _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                                if (_explored &#038;&#038; _explored._is__unskippable); else\n                                {\n                                    switch (true)\n                                    {\n                                        case (_contentsLength == 0 &#038;&#038; _tag_name == 'p'):\n                                            _global__the_html = _global__the_html.substr(0, _pos__start__before) + '\n\n';\n                                            return;\n\n                                        case (_contentsLength == 0):\n                                        case ((_contentsLength < 5) &#038;&#038; ($D.parseOptions._elements_visible.indexOf('|'+_tag_name+'|') > -1)):\n                                            $D.debugOutline(_node, 'clean-after', 'blank');\n                                            _global__the_html = _global__the_html.substr(0, _pos__start__before);\n                                            return;\n                                    }\n                                }\n\n                                break;\n                        }\n\n                        \/\/\ttoo much missing\n                        if ($D.parseOptions._elements_link_density.indexOf('|'+_tag_name+'|') > -1)\n                        {\n                            _explored = (_explored || $D.getContent__exploreNodeAndGetStuff(_node, true));\n                            if (_explored &#038;&#038; _explored._is__unskippable); else\n                            {\n                                var\n                                    _contents = _global__the_html\n                                                .substr(_pos__start__after, (_pos__end__before - _pos__start__after))\n                                                    .replace(\/(<([^>]+)>)\/gi, ''),\n                                    _contentsLength = $D.measureText__getTextLength(_contents),\n                                    _initialLength = 0\n                                        + _explored._length__all_text \n                                        + (_explored._count__images_small \t\t\t\t\t* 10)\n                                        + (_explored._count__images_skip \t\t\t\t\t* 10)\n                                        + (_node.getElementsByTagName('iframe').length \t\t* 10)\n                                        + (_node.getElementsByTagName('object').length \t\t* 10)\n                                        + (_node.getElementsByTagName('embed').length \t\t* 10)\n                                        + (_node.getElementsByTagName('button').length \t\t* 10)\n                                        + (_node.getElementsByTagName('input').length \t\t* 10)\n                                        + (_node.getElementsByTagName('select').length \t\t* 10)\n                                        + (_node.getElementsByTagName('textarea').length \t* 10)\n                                ;\n\n                                \/\/\ttoo much missing\n                                switch (true)\n                                {\n                                    case (!(_contentsLength > 0)):\n                                    case (!(_initialLength > 0)):\n                                    case (!((_contentsLength \/ _initialLength) < 0.5)):\n                                    case (!(($D.language == 'cjk') &#038;&#038; (_contentsLength \/ _initialLength) < 0.1)): case ((_global__exploreNodeToBuildHTMLFor &#038;&#038; ((_explored._length__plain_text \/ _global__exploreNodeToBuildHTMLFor._length__plain_text) > 0.25))):\n                                    case (($D.language == 'cjk') &#038;&#038; (_global__exploreNodeToBuildHTMLFor &#038;&#038; ((_explored._length__plain_text \/ _global__exploreNodeToBuildHTMLFor._length__plain_text) > 0.1))):\n                                        break;\n\n                                    default:\n                                        $D.debugOutline(_node, 'clean-after', 'missing-density');\n                                        _global__the_html = _global__the_html.substr(0, _pos__start__before);\n                                        return;\n                                }\n                            }\n                        }                \n\n                    \/\/\treturn\n                        return;\n                };\n\n            \/\/\tactually do it\n            _recursive(_nodeToBuildHTMLFor);\n\n            \/\/\treturn html\n            return _global__the_html;\n        };\n\n    \/\/  build html for node }\n\n    \/\/  isolate title in html {\n    \/\/  =======================\n\n        $D.articleTitleMarker__start = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"articleHeader\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<h1>';\n        $D.articleTitleMarker__end = '<\/h1>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n\n        $D.getContent__find__hasIsolatedTitleInHTML = function (_html)\n        {\n            return (_html.substr(0, $D.articleTitleMarker__start.length) == $D.articleTitleMarker__start);\n        };\n\n        $D.getContent__find__getIsolatedTitleInHTML = function (_html)\n        {\n            \/\/  is it there?\n            if ($D.getContent__find__hasIsolatedTitleInHTML(_html)); else { return ''; }\n\n            \/\/  regex\n            var \n                _getTitleRegex = new RegExp($D.articleTitleMarker__start + '(.*?)' + $D.articleTitleMarker__end, 'i'),\n                _getTitleMatch = _html.match(_getTitleRegex)\n            ;\n\n            \/\/  match?\n            if (_getTitleMatch); else { return ''; }\n\n            \/\/  return\n            return _getTitleMatch[1];\n        };\n\n        $D.getContent__find__isolateTitleInHTML = function (_html, _document_title)\n        {\n            \/\/  use document title\n            if ($D.$document.find('body').attr($D.parseOptions._use_document_title_attribute) == $D.parseOptions._use_document_title_attribute_value)\n                { return _html; }\n\n            \/\/  can't just use (h1|h2|h3|etc)\n            \/\/      we want to try them in a certain order\n\n            var\n                _heading_pregs = [\n                    \/<(h1)[^>]*?>([\\s\\S]+?)<\\\/\\1>\/gi,\n                    \/<(h2)[^>]*?>([\\s\\S]+?)<\\\/\\1>\/gi,\n                    \/<(h3|h4|h5|h6)[^>]*?>([\\s\\S]+?)<\\\/\\1>\/gi\n                ],\n                _secondary_headings = '|h2|h3|h4|h5|h6|',\n                _search_document_title = ' ' + _document_title.replace(\/<[^>]+?>\/gi, '').replace(\/\\s+\/gi, ' ') + ' '\n            ;\n\n            \/\/  loop pregs\n            for (var i=0, _i=_heading_pregs.length; i<_i; i++) { \/\/ exec var _match = _heading_pregs[i].exec(_html); \/\/ return? switch (true) { case (!(_match)): case (!(_heading_pregs[i].lastIndex > -1)):\n                        \/\/  will continue loop\n                        break;\n\n                    default:\n\n                        \/\/  measurements\n                        var\n                            _heading_end_pos = _heading_pregs[i].lastIndex,\n                            _heading_start_pos = (_heading_end_pos - _match[0].length),\n\n                            _heading_type = _match[1],\n                            _heading_text = _match[2].replace(\/<\\s*br[^>]*>\/gi, '').replace(\/[\\n\\r]+\/gi, ''),\n                            _heading_text_plain = _heading_text.replace(\/<[^>]+?>\/gi, '').replace(\/\\s+\/gi, ' ');\n                            _heading_length = $D.measureText__getTextLength(_heading_text_plain),\n                            _heading_words = [],\n\n                            _to_heading_text = _html.substr(0, _heading_start_pos),\n                            _to_heading_length = $D.measureText__getTextLength(_to_heading_text.replace(\/<[^>]+?>\/gi, '').replace(\/\\s+\/gi, ' '))\n                        ;\n\n                        \/\/  return?\n                        switch (true)\n                        {\n                            case (!(_heading_length > 5)):\n                            case (!(_heading_length < (65 * 3))):\n                            case (!(_to_heading_length < (65 * 3 * 2))): \/\/ will continue for loop break; case ((_secondary_headings.indexOf('|' + _heading_type + '|') > -1)):\n                                \/\/  words in this heading\n                                _heading_words = _heading_text_plain.split(' ');\n\n                                \/\/  count words present in title\n                                for (var j=0, _j=_heading_words.length, _matched_words=''; j<_j; j++) { if (_search_document_title.indexOf(' ' + _heading_words[j] + ' ') > -1) {\n                                        _matched_words += _heading_words[j] + ' ';\n                                    }\n                                }\n\n                                \/\/  break continues for loop\n                                \/\/      nothing goes to switch's default\n\n                                \/\/  no break?\n                                \/\/  =========\n                                    var _no_break = false;\n                                    switch (true)\n                                    {\n                                        \/\/  if it's big enough, and it's a substring of the title, it's good\n                                        case ((_heading_length > 20) &#038;&#038; (_search_document_title.indexOf(_heading_text_plain) > -1)):\n\n                                        \/\/  if it's slightly smaler, but is exactly at the begging or the end\n                                        case ((_heading_length > 10) &#038;&#038; ((_search_document_title.indexOf(_heading_text_plain) == 1) || (_search_document_title.indexOf(_heading_text_plain) == (_search_document_title.length - 1 - _heading_text_plain.length)))):\n\n                                            _no_break = true;\n                                            break;\n                                    }\n\n                                    \/\/  break?\n                                    \/\/  ======\n                                        var _break = false;\n                                        switch (true)\n                                        {\n                                            \/\/  no break?\n                                            case (_no_break):\n                                                break;\n\n                                            \/\/ heading too long? -- if not h2\n                                            case ((_heading_length > ((_search_document_title.length - 2) * 2)) &#038;&#038; (_heading_type != 'h2')):\n\n                                            \/\/  heading long enough?\n                                            case ((_heading_length < Math.ceil((_search_document_title.length - 2) * 0.50))):\n\n                                            \/\/  enough words matched?\n                                            case ((_heading_length < 25) &#038;&#038; (_matched_words.length < Math.ceil(_heading_length * 0.75))):\n                                            case ((_heading_length < 50) &#038;&#038; (_matched_words.length < Math.ceil(_heading_length * 0.65))):\n                                            case ((_matched_words.length < Math.ceil(_heading_length * 0.55))): _break = true; break; } \/\/ break? \/\/ ====== if (_break) { break; } default: \/\/ this is the title -- do isolation; return return '' + $D.articleTitleMarker__start + _heading_text + $D.articleTitleMarker__end + $D.getContent__find__isolateTitleInHTML__balanceDivsAtStart(_html.substr(_heading_end_pos)) ; } break; } } \/\/ return unmodified return _html; }; $D.getContent__find__isolateTitleInHTML__balanceDivsAtStart__substrCount = function (_haystack, _needle, _offset, _length) { \/\/ http:\/\/kevin.vanzonneveld.net \/\/ + original by: Kevin van Zonneveld (http:\/\/kevin.vanzonneveld.net) \/\/ + bugfixed by: Onno Marsman \/\/ + improved by: Brett Zamir (http:\/\/brett-zamir.me) \/\/ + improved by: Thomas \/\/ * example 1: substr_count('Kevin van Zonneveld', 'e'); \/\/ * returns 1: 3 \/\/ * example 2: substr_count('Kevin van Zonneveld', 'K', 1); \/\/ * returns 2: 0 \/\/ * example 3: substr_count('Kevin van Zonneveld', 'Z', 0, 10); \/\/ * returns 3: false var cnt = 0; _haystack += ''; _needle += ''; if (isNaN(_offset)) { _offset = 0; } if (isNaN(_length)) { _length = 0; } if (_needle.length == 0) { return false; } _offset--; while ((_offset = _haystack.indexOf(_needle, _offset + 1)) != -1) { if (_length > 0 &#038;&#038; (_offset + _needle.length) > _length) {\n                    return false;\n                }\n                cnt++;\n            }\n\n            return cnt;\n        };\n\n        $D.getContent__find__isolateTitleInHTML__balanceDivsAtStart = function (_html)\n        {\n            \/\/  easy; remove all <\/X> at begining\n            var \n                _h = _html.replace(\/^(\\s*<\\s*\\\/\\s*[^>]+>)+\/gi, ''),\n                _r = \/<\\s*\\\/\\s*([^\\s>]+?)[^>]*>\/gi,\n                _the_end_tag = '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n',\n                _the_start_tag = '\n\n<div',\n\n\n<p>&nbsp;<\/p>\n\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>                _end_tag_pos = -1,\n                _last_pos = 0\n            ;\n\n            \/\/  remove all unbalanced _end_tags\n            for (var _i=0; _i<100; _i++) { _end_tag_pos = _h.indexOf(_the_end_tag, _last_pos); if (_end_tag_pos > -1); else { break; }\n\n                var \n                    _sub = _h.substr(0, _end_tag_pos),\n                    _start_tags = $D.getContent__find__isolateTitleInHTML__balanceDivsAtStart__substrCount(_sub, _the_start_tag, _last_pos),\n                    _end_tags = ((_start_tags > 0) ? (1 + $D.getContent__find__isolateTitleInHTML__balanceDivsAtStart__substrCount(_sub, _the_end_tag, _last_pos)) : false)\n                ;\n\n                if ((!(_start_tags > 0)) || (_start_tags < _end_tags)) { _h = '' + _h.substr(0, _end_tag_pos) + _h.substr(_end_tag_pos + _the_end_tag.length) ; _last_pos = _end_tag_pos; } else { _last_pos = _end_tag_pos + 1; } } $D.log(_h); return _h; }; \/\/ isolate title in html } \/\/ find in page { \/\/ ============== $D.getContent__findInPage = function (_pageWindow) { \/\/ calculations \/\/ ============ var _firstCandidate = false, _secondCandidate = false, _targetCandidate = false ; $D.debugTimerStart('ExploreAndGetStuff'); var _stuff = $D.getContent__exploreNodeAndGetStuff(_pageWindow.document.body); $D.debugRemember('ExploreAndGetStuff', $D.debugTimerEnd()+'ms'); $D.debugTimerStart('ProcessFirst'); var _processedCandidates = $D.getContent__processCandidates__first(_stuff._candidates); _firstCandidate = _processedCandidates[0]; _targetCandidate = _firstCandidate; $D.debugRemember('ProcessFirst', $D.debugTimerEnd()+'ms'); \/\/ debug if ($D.debug) { \/\/ debug first candidates $D.log('First 5 Main Candidates:'); for (var x in _processedCandidates) { if (x == 5) { break; } $D.log(_processedCandidates[x], _processedCandidates[x].__node); } \/\/ highlight first $D.debugOutline(_firstCandidate.__node, 'target', 'first'); } \/\/ in case we stop $D.debugRemember('Target', 'first'); \/\/ do second? switch (true) { case (!(_firstCandidate._count__containers > 0)):\n                    case (!(_firstCandidate._count__candidates > 0)):\n                    case (!(_firstCandidate._count__pieces > 0)):\n                    case (!(_firstCandidate._count__containers > 25)):\n                        break;\n\n                    default:\n\n                        $D.debugTimerStart('ProcessSecond');\n                            var _processedCandidatesSecond = $D.getContent__processCandidates__second(_processedCandidates);\n                            _secondCandidate = _processedCandidatesSecond[0];\n                        $D.debugRemember('ProcessSecond', $D.debugTimerEnd()+'ms');\n\n                        \/\/  they're the same\n                        if (_firstCandidate.__node == _secondCandidate.__node) { break; }\n\n                        \/\/  debug\n                        if ($D.debug)\n                        {\n                            \/\/  log second candidates\n                            $D.log('First 5 Second Candidates:');\n                            for (var x in _processedCandidatesSecond)\n                            {\n                                if (x == 5) { break; }\n                                $D.log(_processedCandidatesSecond[x], _processedCandidatesSecond[x].__node);\n                            }\n\n                            \/\/  highlight second\n                            $D.debugOutline(_secondCandidate.__node, 'target', 'second');\n                        }\n\n                        \/\/  compute again\n                        \/\/  =============\n                            _firstCandidate['__points_history_final'] = $D.getContent__computePointsForCandidate__third(_firstCandidate, _firstCandidate);\n                            _firstCandidate['__points_final'] = _firstCandidate.__points_history_final[0];\n\n                            _secondCandidate['__points_history_final'] = $D.getContent__computePointsForCandidate__third(_secondCandidate, _firstCandidate);\n                            _secondCandidate['__points_final'] = _secondCandidate.__points_history_final[0];\n\n                        \/\/  log results\n                        \/\/  ===========\n                            if ($D.debug)\n                            {\n                                $D.log('The 2 Candidates:');\n                                $D.log(_firstCandidate);\n                                $D.log(_secondCandidate);\n                            }\n\n                        \/\/  are we selecting _second?\n                        \/\/  =========================\n                            switch (true)\n                            {\n                                case ((_secondCandidate.__candidate_details._count__lines_of_65_characters < 20) &#038;&#038; (_secondCandidate.__points_final \/ _firstCandidate.__points_final) > 1):\n                                case ((_secondCandidate.__candidate_details._count__lines_of_65_characters > 20) &#038;&#038; (_secondCandidate.__points_final \/ _firstCandidate.__points_final) > 0.9):\n                                case ((_secondCandidate.__candidate_details._count__lines_of_65_characters > 50) &#038;&#038; (_secondCandidate.__points_final \/ _firstCandidate.__points_final) > 0.75):\n                                    _targetCandidate = _secondCandidate;\n                                    $D.debugRemember('Target', 'second');\n                                    break;\n                            }\n\n                        \/\/  print points\n                        \/\/  ============\n                            if ($D.debug)\n                            {\n                                $D.debugRemember('PointsFirst', _firstCandidate['__points_history_final'][0].toFixed(2));\n                                $D.debugRemember('PointsSecond', _secondCandidate['__points_history_final'][0].toFixed(2));\n                            }\n\n                        break;\n                }\n\n                \/\/  highlight target\n                \/\/  ================\n                    if ($D.debug)\n                    {\n                        $CJ(_targetCandidate.__node).css({\n                            'box-shadow': \n                                'inset 0px 0px 50px rgba(255, 255, 0, 0.95), 0px 0px 50px rgba(255, 255, 0, 0.95)'\n                        });\n                    }\n\n            \/\/\tget html\n            \/\/\t========\n                $D.debugTimerStart('BuildHTML');\n                    var _html = $D.getContent__buildHTMLForNode(_targetCandidate.__node, 'the-target');\n                        _html = _html.substr((_html.indexOf('>')+1))\n                        _html = _html.substr(0, _html.lastIndexOf('<'));\n                $D.debugRemember('BuildHTML', $D.debugTimerEnd()+'ms');\n\n                $D.debugTimerStart('BuildHTMLPregs');\n                    _html = _html.replace(\/<(blockquote|div|p|td|li)([^>]*)>(\\s*<br \\\/>)+\/gi, '<$1$2>');\n                    _html = _html.replace(\/(<br \\\/>\\s*)+<\\\/(blockquote|div|p|td|li)>\/gi, '<\/$2>');\n                    _html = _html.replace(\/(<br \\\/>\\s*)+<(blockquote|div|h\\d|ol|p|table|ul|li)([^>]*)>\/gi, '<$2$3>');\n                    _html = _html.replace(\/<\\\/(blockquote|div|h\\d|ol|p|table|ul|li)>(\\s*<br \\\/>)+\/gi, '<\/$1>');\n                    _html = _html.replace(\/(\n\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<hr \\\/>\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n\n\\s*\n\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<hr \\\/>\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n\n\\s*)+\/gi, '\n\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<hr \/>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n\n');\n                    _html = _html.replace(\/(<br \\\/>\\s*<br \\\/>\\s*)+\/gi, '\n\n');\n                $D.debugRemember('BuildHTMLPregs', $D.debugTimerEnd()+'ms');\n\n            \/\/\treturn\n            \/\/\t======\n                return {\n                    '_html': _html,\n                    '_links': _stuff._links,\n                    '_targetCandidate': _targetCandidate,\n                    '_firstCandidate': _firstCandidate\n                };\n        };\n\n    \/\/  find in page }\n\n    \/\/  start {\n    \/\/  =======\n\n        $D.start = function ()\n        {\n            \/\/\tget content\n            \/\/\t===========\n                var \n                    _found = $D.getContent__findInPage($D.window),\n                    _found_links = _found._links,\n                    _targetNode = _found._targetCandidate.__node,\n                    _$targetNode = $CJ(_targetNode),\n                    _aboveNodes = []\n                ;\n\n            \/\/\tRTL\n            \/\/\t===\n                switch (true)\n                {\n                    case (_$targetNode.attr('dir') == 'rtl'):\n                    case (_$targetNode.css('direction') == 'rtl'):\n                        $D.makeRTL();\n                        break;\n                }\n\n            \/\/  get html\n            \/\/  ========\n                var \n                    _foundHTML = _found._html,\n                    _firstFragmentBeforeProcessing = $D.nextPage__getFirstFragment(_foundHTML),\n                    _documentTitle = ($D.document.title > '' ? $D.document.title : '')\n                ;\n\n            \/\/  get title\n            \/\/  =========\n\n                \/\/  has title already?\n                _foundHTML = $D.getContent__find__isolateTitleInHTML(_foundHTML, _documentTitle);\n                $D.articleTitle = $D.getContent__find__getIsolatedTitleInHTML(_foundHTML);\n                $D.debugRemember('TitleSource', 'target');\n\n                \/\/  get html above?\n                if ($D.articleTitle > ''); else\n                {\n                    \/\/  get html above target?\n                    \/\/  ======================\n\n                        \/\/  global vars:\n                        \/\/      _found\n                        \/\/      _foundHTML\n                        \/\/      _documentTitle\n                        \/\/      _aboveNodes\n\n                        var \n                            _prevNode = _found._targetCandidate.__node,\n                            _prevHTML = '',\n                            _aboveHTML = '',\n                            _differentTargets = (_found._firstCandidate.__node != _found._targetCandidate.__node)\n                        ;\n\n                        (function () \n                        {\n\n                            while (true)\n                            {\n                                \/\/  the end?\n                                switch (true)\n                                {\n                                    case (_prevNode.tagName &#038;&#038; (_prevNode.tagName.toLowerCase() == 'body')):\n                                    case (_differentTargets &#038;&#038; (_prevNode == _found._firstCandidate.__node)):\n                                        \/\/  enough is enough\n                                        return;\n                                }\n\n                                \/\/  up or sideways?\n                                if (_prevNode.previousSibling); else\n                                {\n                                    _prevNode = _prevNode.parentNode;\n                                    continue;\n                                }\n\n                                \/\/\tprevious\n                                _prevNode = _prevNode.previousSibling;\n\n                                \/\/\toutline -- element might be re-outlined, when buildHTML is invoked\n                                if ($D.debug) { $D.debugOutline(_prevNode, 'target', 'add-above'); }\n\n                                \/\/\tget html; add\n                                _prevHTML = $D.getContent__buildHTMLForNode(_prevNode, 'above-the-target');\n                                _aboveHTML = _prevHTML + _aboveHTML;\n                                _aboveNodes.unshift(_prevNode);\n\n                                \/\/  isolate title\n                                _aboveHTML = $D.getContent__find__isolateTitleInHTML(_aboveHTML, _documentTitle);\n\n                                \/\/\tfinished?\n                                switch (true)\n                                {\n                                    case ($D.measureText__getTextLength(_aboveHTML.replace(\/<[^>]+?>\/gi, '').replace(\/\\s+\/gi, ' ')) > (65 * 3 * 3)):\n                                    case ($D.getContent__find__hasIsolatedTitleInHTML(_aboveHTML)):\n                                        return;\n                                }\n                            }\n\n                        })();\n\n                    \/\/  is what we found any good?\n                    \/\/  ==========================\n                        switch (true)\n                        {\n                            case ($D.getContent__find__hasIsolatedTitleInHTML(_aboveHTML)):\n                            case (_differentTargets &#038;&#038; (_aboveHTML.split('<a ').length < 3) &#038;&#038; ($D.measureText__getTextLength(_aboveHTML.replace(\/<[^>]+?>\/gi, '').replace(\/\\s+\/gi, ' ')) < (65 * 3))): _foundHTML = _aboveHTML + _foundHTML; break; default: _aboveHTML = ''; _aboveNodes = []; break; } \/\/ set title \/\/ ========= $D.articleTitle = $D.getContent__find__getIsolatedTitleInHTML(_foundHTML); $D.debugRemember('TitleSource', 'above_HTML'); \/\/ get document title? if ($D.articleTitle > ''); else\n                        {\n                            \/\/  if all else failed, get document title\n                            \/\/  ======================================\n\n                                \/\/  global vars:\n                                \/\/      _foundHTML\n                                \/\/      _documentTitle\n\n                                (function ()\n                                {\n                                    \/\/  return?\n                                    \/\/  =======\n                                        if (_documentTitle > ''); else { return; }\n\n                                    \/\/  vars\n                                        var\n                                            _doc_title_parts = [],\n                                            _doc_title_pregs =\n                                            [\n                                                \/( [-][-] |( [-] )|( [>][>] )|( [<][<] )|( [|] )|( [\\\/] ))\/i,\n                                                \/(([:] ))\/i\n                                            ]\n                                        ;\n\n                                    \/\/\tloop through pregs\n                                    \/\/  ==================\n                                        for (var i=0, _i=_doc_title_pregs.length; i<_i; i++) { \/\/ split _doc_title_parts = _documentTitle.split(_doc_title_pregs[i]); \/\/ break if we managed a split if (_doc_title_parts.length > 1) { break; }\n                                        }\n\n                                    \/\/\tsort title parts -- longer goes higher up -- i.e. towards 0\n                                    \/\/\t================\n                                        _doc_title_parts.sort(function (a, b)\n                                        {\n                                            switch (true)\n                                            {\n                                                case (a.length > b.length): return -1;\n                                                case (a.length < b.length): return 1; default: return 0; } }); \/\/ set title -- first part, if more than one word; otherwise, whole \/\/ ========= _foundHTML = '' + $D.articleTitleMarker__start + (_doc_title_parts[0].split(\/\\s+\/i).length > 1 ? _doc_title_parts[0] : _documentTitle) \n                                            + $D.articleTitleMarker__end \n                                            + _foundHTML\n                                        ;\n\n                                })();\n\n                            \/\/  set title\n                            \/\/  =========\n\n                                $D.articleTitle = $D.getContent__find__getIsolatedTitleInHTML(_foundHTML);\n                                $D.debugRemember('TitleSource', 'document_title');\n                        }\n                }\n\n            \/\/\tremember\n            \/\/\t========\n                $D.debugRemember('theTarget', _found._targetCandidate.__node);\n                $D.debugRemember('firstCandidate', _found._firstCandidate.__node);\n\n            \/\/\tresult\n            \/\/  ======\n\n                $D.nextPage__firstFragment__firstPage = _firstFragmentBeforeProcessing;\n                $D.nextPage__firstFragment__lastPage = $D.nextPage__getFirstFragment(_foundHTML);\n                $D.nextPage__firstLinks = _found_links;\n\n                var\n                    _result = {\n                        '_html': _foundHTML,\n                        '_title': $D.articleTitle,\n                        '_rtl': $D.rtl\n                    }\n                ;\n\n                \/\/  add elements\n                _result['_elements'] = _aboveNodes;\n                _result['_elements'].push(_found._targetCandidate.__node);\n\n            \/\/  return\n            \/\/  ======\n                $D.callbacks.finished(_result);\n        };\n\n    \/\/  start }    \n\n    \/\/  return self\n    \/\/  ===========\n        return $D;\n}\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/*! * ClearlyComponent__highlight * Evernote Clearly's highlighting algorithm\/functionality as an embeddable component. * Copyright 2013, Evernote Corporation * * Usage: * ====== * * \/\/ define * window.ClearlyComponent__highlight = { * 'callbacks': { * 'highlightAdded': someFunction(), * 'highlightDeleted': someFunction(), * 'arbitraryRangeExclusion': someFunction() * }, * 'settings': { * 'imgPath': 'string', * 'onInsertCSSUseThisId': 'string', * 'highlightingEnabledCSSClass': 'string', * 'highlightElementCSSClass': 'string', * 'highlightElementIdAttribute': 'string', * 'highlightElementFirstCSSClass': 'string', * 'highlightElementLastCSSClass': 'string', * 'highlightElementDeleteCSSClass': 'string', * 'highlightElementDeleteIdPrefix': 'string', * 'highlightCleanHTMLElementStart': 'string', * 'highlightCleanHTMLElementEnd': 'string', * 'elementWhichMustContainAllHighlights': _dom_element, * 'elementsToAttachMouseHandlersTo': [ * _dom_element * ] * }, * 'window': window, * 'document': document, * 'jQuery': window.jQuery * }; * * \/\/ init -- will return false, if something goes wrong * window.ClearlyComponent__highlight = initClearlyComponent__highlight(window.ClearlyComponent__highlight); * * \/\/ setup * window.ClearlyComponent__highlight.insertCSS(); * window.ClearlyComponent__highlight.addMouseHandlers(); * * \/\/ enable * window.ClearlyComponent__highlight.enable(); * * \/\/ publcly available\/overridable * window.ClearlyComponent__highlight.debug * *\/ \/* changes: ======== $R => $H\n        $R.highlight => $H.enabled\n\n    to do:\n    ======\n*\/\n\nfunction initClearlyComponent__highlight(_paramInstance)\n{\n    \/\/  global instance reference {\n    \/\/  ===========================\n\n        \/\/  null; return\n        if (_paramInstance); else { return false; }\n\n        \/\/  shorthand\n        $H = _paramInstance;\n\n    \/\/  global instance reference }\n\n    \/\/  required vars {\n    \/\/  ===============\n\n        \/\/  the component instance object must already be created,\n        \/\/  when the init function is called. it must have these vars set:\n\n        switch (true)\n        {\n            case (!($H.settings)):\n            case (!($H.settings.imgPath)):\n\n            case (!($H.window)):\n            case (!($H.document)):\n            case (!($H.document.body)):\n\n            case (!($H.jQuery)):\n\n                if ($H.debug)\n                {\n                    console.log(!($H.settings));\n                    console.log(!($H.settings.imgPath));\n\n                    console.log(!($H.window));\n                    console.log(!($H.document));\n                    console.log(!($H.document.body));\n\n                    console.log(!($H.jQuery));\n                }\n\n                \/\/  something's wrong\n                return false;\n        }\n\n    \/\/  required vars }\n\n    \/\/  missing settings {\n    \/\/  ==================\n\n        \/\/  restrictions\n        if ($H.settings.elementWhichMustContainAllHighlights); else { $H.settings.elementWhichMustContainAllHighlights = $H.document.body; }\n        if ($H.settings.elementsToAttachMouseHandlersTo); else { $H.settings.elementsToAttachMouseHandlersTo = [$H.document.body]; }\n\n        \/\/  names for stuff\n        \/* css id *\/            if ($H.settings.onInsertCSSUseThisId); else             { $H.settings.onInsertCSSUseThisId =            'clearly_highlighting_css'; }\n        \/* enabled *\/           if ($H.settings.highlightingEnabledCSSClass); else      { $H.settings.highlightingEnabledCSSClass =     'clearly_highlighting_enabled'; }\n        \/* element id *\/        if ($H.settings.highlightElementIdAttribute); else      { $H.settings.highlightElementIdAttribute =     'clearly_highlight_id'; }\n        \/* element class *\/     if ($H.settings.highlightElementCSSClass); else         { $H.settings.highlightElementCSSClass =        'clearly_highlight_element'; }\n        \/* element (first) *\/   if ($H.settings.highlightElementFirstCSSClass); else    { $H.settings.highlightElementFirstCSSClass =   'clearly_highlight_first'; }\n        \/* element (first) *\/   if ($H.settings.highlightElementLastCSSClass); else     { $H.settings.highlightElementLastCSSClass =    'clearly_highlight_last'; }\n        \/* delete class *\/      if ($H.settings.highlightElementDeleteCSSClass); else   { $H.settings.highlightElementDeleteCSSClass =  'clearly_highlight_delete_element'; }\n        \/* delete id prefix *\/  if ($H.settings.highlightElementDeleteIdPrefix); else   { $H.settings.highlightElementDeleteIdPrefix =  'clearly_highlight_delete__'; }\n        \/* clean html start *\/  if ($H.settings.highlightCleanHTMLElementStart); else   { $H.settings.highlightCleanHTMLElementStart =  '<span style=\"-evernote-highlighted:true; background-color:#f6ee96\">'; }\n        \/* clean html end *\/    if ($H.settings.highlightCleanHTMLElementEnd); else     { $H.settings.highlightCleanHTMLElementEnd =    '<\/span>'; }\n\n    \/\/  missing settings }\n\n    \/\/  global vars {\n    \/\/  =============\n\n        $CJ = $H.jQuery;\n\n        $H.$window = $CJ($H.window);\n        $H.$document = $CJ($H.document);\n        $H.$html = $H.$document.find('html');\n        $H.$elementWhichMustContainAllHighlights = $CJ($H.settings.elementWhichMustContainAllHighlights);\n\n        $H.enabled = false;\n\n    \/\/  global vars }\n\n    \/\/  parse options {\n    \/\/  ===============   \n\n\t\t$H.parseOptions =\n\t\t{\n\t\t\t'_elements_ignore': \t\t\t        '|button|input|select|textarea|optgroup|command|datalist|--|frame|frameset|noframes|--|style|link|script|noscript|--|canvas|applet|map|--|marquee|area|base|',\n\t\t\t'_elements_ignore_tag': \t\t        '|form|fieldset|details|dir|--|center|font|span|',\n\n\t\t\t'_elements_container': \t\t\t        '|body|--|article|section|--|div|--|td|--|li|--|dd|dt|',\n            '_elements_self_closing': \t\t        '|br|hr|--|img|--|col|--|source|--|embed|param|--|iframe|',\n\n            '_elements_highlight_protect':          '|video|audio|source|--|object|param|embed|',\n\n            '_elements_keep_attributes':\n\t\t\t{\n\t\t\t\t'a': \t\t['href', 'title', 'name'],\n\t\t\t\t'img': \t\t['src', 'width', 'height', 'alt', 'title'],\n\n\t\t\t\t'video': \t['src', 'width', 'height', 'poster', 'audio', 'preload', 'autoplay', 'loop', 'controls'],\n\t\t\t\t'audio': \t['src', 'preload', 'autoplay', 'loop', 'controls'],\t\t \n\t\t\t\t'source': \t['src', 'type'],\n\n\t\t\t\t'object': \t['data', 'type', 'width', 'height', 'classid', 'codebase', 'codetype'],\t\t\t\t\t\t\n\t\t\t\t'param': \t['name', 'value'],\n\t\t\t\t'embed': \t['src', 'type', 'width', 'height', 'flashvars', 'allowscriptaccess', 'allowfullscreen', 'bgcolor'],\n\n\t\t\t\t'iframe':\t['src', 'width', 'height', 'frameborder', 'scrolling'],\n\n\t\t\t\t'td':\t\t['colspan', 'rowspan'],\t\t\t\n\t\t\t\t'th':\t\t['colspan', 'rowspan']\n\t\t\t}\n\n\t\t};\n\n    \/\/  parse options }\n\n    \/\/  debug {\n    \/\/  =======\n\n        $H.debug = ($H.debug || false);\n\n\t\tif ($H.debug)\n\t\t{\n\t\t    \/\/  writeLog\n\t\t    \/\/  ========\n\t\t\t\tswitch (true)\n\t\t\t\t{\n\t\t\t\t\tcase (!(!($H.window.console &#038;&#038; $H.window.console.log))):    $H.writeLog = function (msg) { $H.window.console.log(msg); };       break;\n\t\t\t\t\tcase (!(!($H.window.opera &#038;&#038; $H.window.opera.postError))):  $H.writeLog = function (msg) { $H.window.opera.postError(msg); };   break;\n\t\t\t\t\tdefault:                                                    $H.writeLog = function (msg) {};                                    break;\n\t\t\t\t}\n\n            \/\/  log\n            \/\/  ===\n                $H.log = function ()\n                {\n                    if ($H.debug); else { return; }\n                    for (var i=0, il=arguments.length; i<il ; i++) { $H.writeLog(arguments[i]); } $H.writeLog('-----------------------------------------'); }; } else { $H.writeLog = function () { return false; }; $H.log = function () { return false; }; } \/\/ debug } \/\/ insert css { \/\/ ============ $H.insertCSS = function () { var _cssText = '' + '\/* selection *\/ ' + 'html.'+$H.settings.highlightingEnabledCSSClass+' ::-moz-selection { background: rgba(246, 238, 150, 0.99); } ' + 'html.'+$H.settings.highlightingEnabledCSSClass+' ::selection { background: rgba(246, 238, 150, 0.99); } ' + '\/* cursor *\/ ' + 'html.'+$H.settings.highlightingEnabledCSSClass+' { ' + ' \/* cursor and hot-spot position -- requires a default cursor, after the URL one *\/ ' + '} ' + '\/* highlight tag *\/ ' + 'em.'+$H.settings.highlightElementCSSClass+' { ' + ' font-style: inherit !important; font-weight: inherit !important; ' + ' background-repeat: repeat-x; background-position: top left; background-size: 100% 100%; ' + '} ' + '\/* the delete-buttons are positioned relative to this *\/ ' + 'em.'+$H.settings.highlightElementCSSClass+'.'+$H.settings.highlightElementFirstCSSClass+' { position: relative; } ' + '\/* delete buttons *\/ ' + 'em.'+$H.settings.highlightElementCSSClass+' a.'+$H.settings.highlightElementDeleteCSSClass+' { ' + ' display: none; cursor: pointer; ' + ' padding: 0; margin: 0; line-height: 0; ' + ' position: absolute; width: 34px; height: 34px; left: -17px; top: -17px; ' + '} ' + 'em.'+$H.settings.highlightElementCSSClass+' a.'+$H.settings.highlightElementDeleteCSSClass+':hover { background-position: -34px 0px; } ' ; \/\/ create var _cssElement = $H.document.createElement('style'); _cssElement.setAttribute('id', $H.settings.onInsertCSSUseThisId); _cssElement.setAttribute('type', 'text\/css'); if (_cssElement.styleSheet) { _cssElement.styleSheet.cssText = _cssText; } else { _cssElement.appendChild($H.document.createTextNode(_cssText)); } \/\/ append $H.$document.find('head').append(_cssElement); }; \/\/ insert css } \/\/ selection { \/\/ =========== $H.sel = {}; $H.sel.getWindowFromDocument = function (theDocument) { if (theDocument); else { return null; } if ('defaultView' in theDocument) { arguments.calee = function (theDocument) { if (theDocument); else { return null; } return theDocument.defaultView; }; } else if ('parentWindow' in theDocument) { arguments.calee = function (theDocument) { if (theDocument); else { return null; } return theDocument.parentWindow; }; } else { arguments.calee = function (theDocument) { return null; }; } return arguments.calee(theDocument); }; $H.sel.getSelection = function (theWindow) { if (theWindow); else { return null; } if ('getSelection' in theWindow) { arguments.calee = function (theWindow) { if (theWindow); else { return null; } return theWindow.getSelection(); }; } else if ('selection' in theWindow.document) { arguments.calee = function (theWindow) { if (theWindow); else { return null; } return theWindow.document.selection; }; } else { arguments.calee = function (theWindow) { return null; }; } return arguments.calee(theWindow); }; $H.sel.getRange = function (selection) { if (selection); else { return null; } if ('getRangeAt' in selection) { arguments.calee = function (selection) { if (selection); else { return null; } if (selection.rangeCount > 0) { return selection.getRangeAt(0); }\n                    else { return null; }\n                    \/\/\tdoesn't work in old versions of safari \n                    \/\/\t... I don't care\n                };\n            }\n            else if ('createRange' in selection) {\n                arguments.calee = function (selection) {\n                    if (selection); else { return null; }\n                    return selection.createRange();\n                };\n            }\n            else {\n                arguments.calee = function (selection) {\n                    return null;\n                };\n            }\n\n            return arguments.calee(selection);\n        };\n\n        $H.sel.getRangeHTML = function (range)\n        {\n            if (range); else { return null; }\n\n            if ('htmlText' in range) {\n                arguments.calee = function (range) {\n                    if (range); else { return null; }\n                    return range.htmlText;\n                };\n            }\n            else if ('surroundContents' in range) {\n                arguments.calee = function (range) {\n\n                    if (range); else { return null; }\n                    if (range.commonAncestorContainer &#038;&#038; range.commonAncestorContainer.ownerDocument); else { return null; }\n\n                    var dummy = range.commonAncestorContainer.ownerDocument.createElement(\"div\");\n                    dummy.appendChild(range.cloneContents());\n                    return dummy.innerHTML;\n                };\n            }\n            else {\n                arguments.calee = function (range) {\n                    return null;\n                };\n            }\n\n            return arguments.calee(range);\n        };\n\n        $H.sel.getRangeText = function (range)\n        {\n            if (range); else { return null; }\n\n            if ('text' in range) {\n                arguments.calee = function (range) {\n                    if (range); else { return null; }\n                    return range.text;\n                };\n            }\n            else if ('surroundContents' in range) {\n                arguments.calee = function (range) {\n\n                    if (range); else { return null; }\n                    if (range.commonAncestorContainer &#038;&#038; range.commonAncestorContainer.ownerDocument); else { return null; }\n\n                    var dummy = range.commonAncestorContainer.ownerDocument.createElement(\"div\");\n                    dummy.appendChild(range.cloneContents());\n                    return dummy.textContent;\n                };\n            }\n            else {\n                arguments.calee = function (range) {\n                    return null;\n                };\n            }\n\n            return arguments.calee(range);\n        };\n\n    \/\/  selection }\n\n    \/\/  helpers {\n    \/\/  =========\n\n        $H.rand = function (_min, _max)\n        {\n            return (Math.floor(Math.random() * (_max - _min + 1)) + _min);\n        };\n\n        $H.highlight__deleteSpansFromParents = function (_parents)\n        {\n            var _done = [], _this_done = false, _inner = '';\n\n            \/\/  main loop\n            for (var i=0, _i=_parents.length; i<_i; i++)\n            {\n                \/\/  init\n                _this_done = false;\n\n                \/\/  check\n                for (var ii=0, _ii=_done.length; ii<_ii; ii++)\n                {\n                    if (_done[ii] == _parents[i])\n                    {\n                        _this_done = true;\n                        break;\n                    }\n                }    \n\n                \/\/  skip\n                if (_this_done) { continue; }\n\n                \/\/  actually do\n                \/\/  ===========\n\n                    \/\/  add\n                    _done.push(_parents[i]);\n\n                    \/\/  get\n                    _inner = _parents[i].innerHTML;\n\n                    \/\/  check\n                    if (_inner.indexOf('<span') > -1); else { continue; }\n\n                    \/\/  replace\n                    _inner = _inner.replace(\/<span([^>]*?)>\/gi, '');\n                    _inner = _inner.replace(\/<\\\/span>\/gi, '');\n                    _parents[i].innerHTML = _inner;\n            }\n        };\n\n        $H.highlight__getDeepestTextNode = function (_node)\n        {\n            var _n = _node;\n\n            while (true)\n            {\n                switch (true)\n                {\n                    \/\/  text\n                    case (_n.nodeType &#038;&#038; _n.nodeType == 3): return _n;\n\n                    \/\/  single child\n                    case (_n.nodeType &#038;&#038; _n.nodeType == 1 &#038;&#038; _n.childNodes.length > 0): _n = _n.childNodes[0]; break;\n\n                    \/\/  no children but has sibling\n                    case (_n.nodeType &#038;&#038; _n.nodeType == 1 &#038;&#038; _n.childNodes.length == 0 &#038;&#038; _n.nextSibling): _n = _n.nextSibling; break;\n\n                    \/\/  default\n                    default: return _node;\n                }\n            }\n        };\n\n        $H.highlight__getCommonAncestorContainerForNodes = function (_node1, _node2, _fallback)\n        {\n            var _parent1 = _node1, _parent2 = _node2;\n\n            while (true)\n            {\n                \/\/  next\n                _parent1 = _parent1.parentNode;\n                _parent2 = _parent2.parentNode;\n\n                \/\/  break\n                switch (true)\n                {\n                    case (!(_parent1)):\n                    case (!(_parent2)):\n                    case (_parent1 == _fallback):\n                    case (_parent2 == _fallback):\n                        return _fallback;\n                }\n\n                \/\/  maybe\n                switch (true)\n                {\n                    case (_parent1 == _parent2): return _parent1;\n\n                    case ($CJ.contains(_parent1, _node2)): return _parent1;\n                    case ($CJ.contains(_parent2, _node1)): return _parent2;\n\n                    case ($CJ.contains(_parent1, _parent2)): return _parent1;\n                    case ($CJ.contains(_parent2, _parent1)): return _parent2;\n                }\n            }\n        };\n\n        $H.highlight__getParentElementOfNode = function (_thisNode)\n        {\n            var _element = _thisNode;\n            while (true) {\n                \/\/  correct\n                if (_element.nodeType == 1) { break; }\n\n                \/\/  continue\n                _element = _element.parentNode;\n            }\n            return _element;\n        };\n\n        $H.highlight__getParentElementOfNodeWithThisParent = function (_thisNode, _thisParent)\n        {\n            \/\/  impossible\n            switch (true)\n            {\n                case (_thisNode == _thisParent):\n                    return _thisNode;\n\n                case (!($CJ.contains(_thisParent, _thisNode))):  \/\/ always false in IE\n                    \/\/return _thisNode;\n            }\n\n            \/\/  do\n            var _element = _thisNode;\n            while (true) {\n                \/\/  correct\n                if (_element.parentNode == _thisParent) { break; }\n\n                \/\/  continue\n                _element = _element.parentNode;\n            }\n            return _element;\n        };\n\n    \/\/  helpers }\n\n    \/\/  build html for element with selected range {\n    \/\/  ============================================\n\n        $H.highlight__buildHTMLForElementWithSelectedRange = function (_elementToBuildHTMLFor, _modeToBuildHTMLIn, _rangeToBuildHTMLWith)\n        {\n            var \n                _global__element_index = 0,\n                _global__the_html = '',\n                _global__highlight_on = ((_modeToBuildHTMLIn == 'boundry-end') ? true : false)\n            ;\n\n            \/\/\trecursive function\n            \/\/\t==================\n                var _recursive = function (_node)\n                {\n                    \/\/\tincrement index -- starts with 1\n                    \/\/\t===============\n                        _global__element_index++;\n\n                    \/\/\tvars\n                    \/\/\t====\n                        var \n                            _explored = false,\n                            _tag_name = (_node.nodeType === 3 ? '#text' : ((_node.nodeType === 1 &#038;&#038; _node.tagName &#038;&#038; _node.tagName > '') ? _node.tagName.toLowerCase() : '#invalid')),\n                            _tag_is_ignored = ($H.parseOptions._elements_ignore_tag.indexOf('|'+_tag_name+'|') > -1),\n                            _tag_is_ignored = (_tag_is_ignored ? ((_tag_name == 'span') ? false : true) : false),\n                            _pos__start__before = 0,\n                            _pos__start__after = 0,\n                            _pos__end__before = 0,\n                            _pos__end__after = 0,\n                            _to_write = '',\n                            _selection_starts_here = false,\n                            _selection_ends_here = false\n                        ;\n\n                    \/\/\tfast return\n                    \/\/\t===========\n                        switch (true)\n                        {\n                            case ((_tag_name == '#invalid')):\n                            case (($H.parseOptions._elements_ignore.indexOf('|'+_tag_name+'|') > -1)):\n                                return;\n\n                            case (_tag_name == '#text'):\n                                \/\/  get value\n                                \/\/  =========\n                                    _to_write = _node.nodeValue.replace(\/<\/gi, '&lt;').replace(\/>\/gi, '&gt;');\n\n                                \/\/  mode?\n                                \/\/  =====\n                                    switch (true)\n                                    {\n                                        case (_modeToBuildHTMLIn == 'nothing'):\n                                            break;\n\n                                        case (_modeToBuildHTMLIn == 'everything'):\n                                            _to_write = ''\n                                                + '<highlight>' \n                                                +   _to_write \n                                                + '<\/highlight>'\n                                            ;\n                                            break;\n\n                                        case (_modeToBuildHTMLIn == 'boundry-start'):\n                                        case (_modeToBuildHTMLIn == 'boundry-end'):\n                                        case (_modeToBuildHTMLIn == 'boundry-both'):\n\n                                            \/\/  end of range?\n                                            \/\/  =============\n                                                if (_node == _rangeToBuildHTMLWith.endContainer)\n                                                {\n                                                    _to_write = ''\n                                                        + '<highlight>'\n                                                        +   _to_write.substr(0, _rangeToBuildHTMLWith.endOffset)\n                                                        + '<\/highlight>'\n                                                        + _to_write.substr(_rangeToBuildHTMLWith.endOffset)\n                                                    ;\n\n                                                    _global__highlight_on = false;\n                                                    _selection_ends_here = true;\n                                                }\n\n                                            \/\/  start of range?\n                                            \/\/  ===============\n                                                if (_node == _rangeToBuildHTMLWith.startContainer)\n                                                {\n                                                    _to_write = ''\n                                                        + _to_write.substr(0, _rangeToBuildHTMLWith.startOffset)\n                                                        + '<highlight>'\n                                                        +   _to_write.substr(_rangeToBuildHTMLWith.startOffset)\n                                                        + '<\/highlight>'  \n                                                    ;\n\n                                                    _global__highlight_on = true;\n                                                    _selection_starts_here = true;\n                                                }\n\n                                            \/\/  correction\n                                            \/\/  ==========\n                                                if (_selection_starts_here &#038;&#038; _selection_ends_here)\n                                                {\n                                                    _to_write = _node.nodeValue.replace(\/<\/gi, '&lt;').replace(\/>\/gi, '&gt;');\n                                                    _to_write = ''\n                                                        + _to_write.substr(0, _rangeToBuildHTMLWith.startOffset)\n                                                        + '<highlight>'\n                                                        +   _to_write.substr(_rangeToBuildHTMLWith.startOffset, (_rangeToBuildHTMLWith.endOffset - _rangeToBuildHTMLWith.startOffset))\n                                                        + '<\/highlight>'\n                                                        + _to_write.substr(_rangeToBuildHTMLWith.endOffset)\n                                                    ;\n\n                                                    _global__highlight_on = false;\n                                                }\n\n                                            \/\/  snap-to\n                                            \/\/  =======\n                                                if (_selection_starts_here &#038;&#038; (_rangeToBuildHTMLWith.startOffset > 0))\n                                                {\n                                                    \/\/  before\n                                                    _to_write = _to_write.replace(\/([ .,;?!])([a-z0-9]{1,2})<highlight>\/gi, '$1<highlight>$2');\n\n                                                    \/\/  space at begining\n                                                    _to_write = _to_write.replace(\/<highlight>([\\s])([^\\s])\/gi, '$1<highlight>$2');\n\n                                                    \/\/  too much\n                                                    _to_write = _to_write.replace(\/<highlight>([a-z0-9])([ ])([a-z0-9])\/gi, '$1$2<highlight>$3');\n                                                }\n\n                                                if (_selection_ends_here &#038;&#038; (_rangeToBuildHTMLWith.endOffset > 0))\n                                                {\n                                                    var _do_end = true;\n\n                                                    if (_rangeToBuildHTMLWith.endContainer &#038;&#038; _rangeToBuildHTMLWith.endContainer.nodeValue &#038;&#038; _rangeToBuildHTMLWith.endContainer.nodeValue.length)\n                                                        { _do_end = (_rangeToBuildHTMLWith.endOffset < _rangeToBuildHTMLWith.endContainer.nodeValue.length); }\n\n                                                    if (_do_end)\n                                                    {\n                                                        \/\/  after\n                                                        _to_write = _to_write.replace(\/<\\\/highlight>([a-z0-9]{0,2})([ .,;?!])\/gi, '$1$2<\/highlight>');\n\n                                                        \/\/  space at end\n                                                        _to_write = _to_write.replace(\/([^\\s])([\\s])<\\\/highlight>\/gi, '$1<\/highlight>$2');\n\n                                                        \/\/  too much\n                                                        _to_write = _to_write.replace(\/([ ])([a-z0-9])<\\\/highlight>([a-z0-9])\/gi, '<\/highlight>$1$2$3');\n                                                    }\n                                                }\n\n                                            \/\/  other\n                                            \/\/  =====\n                                                if (!(_selection_starts_here) &#038;&#038; !(_selection_ends_here))\n                                                {\n                                                    _to_write = _node.nodeValue.replace(\/<\/gi, '&lt;').replace(\/>\/gi, '&gt;');\n                                                    if (_global__highlight_on)\n                                                    {\n                                                        _to_write = ''\n                                                            + '<highlight>' \n                                                            +   _to_write \n                                                            + '<\/highlight>'\n                                                        ;\n                                                    }\n                                                }\n\n                                            break;\n                                    }\n\n                                \/\/  write value\n                                \/\/  ===========\n                                    _global__the_html += _to_write;\n\n                                return;\n                        }\n\n                    \/\/  range anchors are elements instead of text-nodes\n                    \/\/  ================================================\n\n                        \/\/  end of range?\n                        if ((_rangeToBuildHTMLWith.endContainer.nodeType == 1) &#038;&#038; (_node == _rangeToBuildHTMLWith.endContainer)) {\n                            _global__highlight_on = false;\n                            _selection_ends_here = true;\n                        }\n\n                        \/\/  start of range?\n                        if ((_rangeToBuildHTMLWith.startContainer.nodeType == 1) &#038;&#038; (_node == _rangeToBuildHTMLWith.startContainer)) {\n                            _global__highlight_on = true;\n                            _selection_starts_here = true;\n                        }\n\n                        \/\/  correction\n                        if (_selection_starts_here &#038;&#038; _selection_ends_here) {\n                            _global__highlight_on = false;\n                        }\n\n                    \/\/\tstart tag\n                    \/\/\t=========\n                        if (_tag_is_ignored); else\n                        {\n                            \/* mark *\/\t_pos__start__before = _global__the_html.length;\n                            \/* add *\/\t_global__the_html += '<'+_tag_name;\n\n                            \/\/\tattributes\n                            \/\/\t==========\n\n                                \/\/\tallowed attributes\n                                if (_tag_name in $H.parseOptions._elements_keep_attributes)\n                                {\n                                    for (var i=0, _i=$H.parseOptions._elements_keep_attributes[_tag_name].length; i<_i; i++) { var _attribute_name = $H.parseOptions._elements_keep_attributes[_tag_name][i], _attribute_value = _node.getAttribute(_attribute_name) ; \/\/ if present if (_attribute_value > '')\n                                            { _global__the_html += ' '+_attribute_name+'=\"'+(_attribute_value)+'\"'; }\n                                    }\n                                }\n\n                                \/\/\tkeep ID for all elements\n                                var _id_attribute = _node.getAttribute('id');\n                                if (_id_attribute > '')\n                                    { _global__the_html += ' id=\"'+_id_attribute+'\"'; }\n\n                                \/\/\tlinks target NEW\n                                if (_tag_name == 'a')\n                                    { _global__the_html += ' target=\"_blank\"'; }\n\n                            \/\/  add class name\n                            \/\/  ==============\n                                var _class_attribute = _node.getAttribute('class');\n                                if (_class_attribute > '')\n                                    { _global__the_html += ' class=\"'+_class_attribute+'\"'; }\n\n                            \/\/  add highlight id -- for EMs that are outside the global highlight\n                            \/\/  ================\n                                if (_tag_name == 'em' &#038;&#038; _modeToBuildHTMLIn != 'everything')\n                                {\n                                    \/\/  with a fix for when an em is the first thing inside a parent element\n\n                                    switch (true)\n                                    {\n                                        case (_global__highlight_on):\n                                        case ((_rangeToBuildHTMLWith.startOffset == 0) &#038;&#038; (_node.firstChild) &#038;&#038; (_node.firstChild == _rangeToBuildHTMLWith.startContainer)):\n                                            break;\n\n                                        default:\n                                            var _highlight_id_attribute = _node.getAttribute($H.settings.highlightElementIdAttribute);\n                                            if (_highlight_id_attribute > '')\n                                                { _global__the_html += ' '+$H.settings.highlightElementIdAttribute+'=\"'+_highlight_id_attribute+'\"'; }\n                                            break;\n                                    }\n                                }\n\n                            \/\/\tclose start\n                            \/\/\t===========\n                                if ($H.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1) { _global__the_html += ' \/>'; }\n                                else { _global__the_html += '>';}\n\n                            \/* mark *\/ _pos__start__after = _global__the_html.length;\n                        }\n\n                    \/\/\tchild nodes\n                    \/\/\t===========\n                        if ($H.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1); else\n                        {\n                            for (var i=0, _i=_node.childNodes.length; i<_i; i++) { _recursive(_node.childNodes[i]); } } \/\/ end tag \/\/ ======= switch (true) { case (_tag_is_ignored): return; case (($H.parseOptions._elements_self_closing.indexOf('|'+_tag_name+'|') > -1)):\n                                \/* mark *\/ \t_pos__end__before = _global__the_html.length;\n                                \/* mark *\/ \t_pos__end__after = _global__the_html.length;\n                                break;\n\n                            default:\n                                \/* mark *\/ \t_pos__end__before = _global__the_html.length;\n                                \/* end *\/ \t_global__the_html += '<\/'+_tag_name+'>';\n                                \/* mark *\/ \t_pos__end__after = _global__the_html.length;\n                                break;\n                        }\n\n                    \/\/  protected elements\n                    \/\/  ==================\n                        switch (true)\n                        {\n                            \/\/  some elemnts are protected from highlighting\n                            case (($H.parseOptions._elements_highlight_protect.indexOf('|'+_tag_name+'|') > -1)):\n                            case ((_tag_name == 'em') &#038;&#038; $CJ(_node).hasClass($H.settings.highlightElementCSSClass)):\n\n                                \/\/  so, if highlights are inside an already highlighted element --or an unhighlightable one-- remove\n\n                                _global__the_html = ''\n                                    + _global__the_html.substr(0, _pos__start__after)\n                                    +   _global__the_html.substr(_pos__start__after, (_pos__end__before - _pos__start__after))\n                                            .replace(\/<highlight>\/gi, '')\n                                            .replace(\/<\\\/highlight>\/gi, '')\n                                    + _global__the_html.substr(_pos__end__before)\n                                ;\n\n                                break;\n\n                            \/\/  some elements are invalid completely\n                            case ((_tag_name == 'a') &#038;&#038; (_node.className == 'deleteHighlight')):\n\n                                _global__the_html = ''\n                                    + _global__the_html.substr(0, _pos__start__before)\n                                    + _global__the_html.substr(_pos__end__after)\n                                ;\n\n                                break;\n\n                            \/\/  some elements need to have their tags ignored\n                            \/*case (_tag_name == 'span'):\n\n                                _global__the_html = ''\n                                    + _global__the_html.substr(0, _pos__start__before)\n                                    + _global__the_html.substr(_pos__start__after, (_pos__end__before - _pos__start__after))\n                                    + _global__the_html.substr(_pos__end__after)\n                                ;\n\n                                break;*\/\n                        }\n\n                    \/\/\treturn\n                        return;\n                };\n\n            \/\/\tactually do it\n            _recursive(_elementToBuildHTMLFor);\n\n            \/\/  use em, instead of highlight\n            _global__the_html = _global__the_html\n                .replace(\/<highlight>\/gi, '<em class=\"'+$H.settings.highlightElementCSSClass+'\">')\n                .replace(\/<\\\/highlight>\/gi, '<\/em>')\n            ;\n\n            \/\/\treturn\n            return _global__the_html;\n        };    \n\n    \/\/  build html for element with selected range }\n\n    \/\/  do range {\n    \/\/  ==========\n\n        $H.highlight__doRange = function (_range_to_highlight)\n        {\n            \/\/  get referrence elements\n            var\n                _commonAncestorElement = $H.highlight__getParentElementOfNode(_range_to_highlight.commonAncestorContainer),\n                _startElement = $H.highlight__getParentElementOfNodeWithThisParent(_range_to_highlight.startContainer, _commonAncestorElement),\n                _endElement = $H.highlight__getParentElementOfNodeWithThisParent(_range_to_highlight.endContainer, _commonAncestorElement)\n            ;\n\n            \/\/  range not in container element\n            if (true\n                &#038;&#038; (_commonAncestorElement.tagName) \n                &#038;&#038; !($CJ.contains($H.settings.elementWhichMustContainAllHighlights, _commonAncestorElement))\n            ) {\n                return false;\n            }\n\n            \/\/  arbitrary range exclusion\n            if ($H.callbacks.arbitraryRangeExclusion) {\n                if ($H.callbacks.arbitraryRangeExclusion(_range_to_highlight, _commonAncestorElement, _startElement, _endElement) === false) {\n                    return false;\n                }\n            }\n\n            \/* $H.log(\n                _range.startContainer, _range.endContainer, _range.startOffset, _range.endOffset, \n                _range_to_highlight, \n                _commonAncestorElement, _startElement, _endElement\n            ); *\/\n\n            \/\/  selection id\n            var _selection_id = $H.rand(1, 1000);\n            while (true)\n            {\n                \/\/  nothing found\n                if ($H.$elementWhichMustContainAllHighlights.find('em.'+$H.settings.highlightElementCSSClass+'['+$H.settings.highlightElementIdAttribute+'=\"'+_selection_id+'\"]').length > 0); else { break; }\n\n                \/\/  new id\n                _selection_id = $H.rand(1, 1000);\n            }\n\n            \/\/  chainging elements\n            \/\/  ==================\n\n                var _chaingingElements = [], _currElement = _startElement, _currChainging = false;\n\n                while (true)\n                {\n                    \/\/  object\n                    _currChainging = {\n                        '_element': _currElement,\n                        '_tagName': (_currElement.nodeType === 3 ? '#text' : ((_currElement.nodeType === 1 &#038;&#038; _currElement.tagName &#038;&#038; _currElement.tagName > '') ? _currElement.tagName.toLowerCase() : '#invalid'))\n                    };\n\n                    \/\/  add\n                    _chaingingElements.push(_currChainging);\n\n                    \/\/  break\n                    if (_currElement == _endElement) { break; }\n\n                    \/\/  next\n                    _currElement = _currElement.nextSibling;\n\n                    \/\/  error?\n                    if (_currElement); else { break; }\n                }\n\n            \/\/  rewrite elements\n            \/\/  ================\n                var _parents_to_clean = [];\n                for (var i=0, _i=_chaingingElements.length, _currElement=false; i<_i; i++) { var _currElement = _chaingingElements[i], _currNode = _currElement._element, _currTag = _currElement._tagName, _boundry_mode = '', _currBuiltHTML = false, _resNode = false ; \/\/ get html \/ mode \/\/ =============== switch (true) { case ((_i == 1) &#038;&#038; (i == 0)): _boundry_mode = 'boundry-both'; break; case ((_i > 1) &#038;&#038; (i == 0)):        _boundry_mode = 'boundry-start';    break;\n                            case ((_i > 1) &#038;&#038; (i == (_i-1))):   _boundry_mode = 'boundry-end';      break;\n                            default:                            _boundry_mode = 'everything';       break;\n                        }\n\n                    \/\/  get html\n                    \/\/  ========\n                        _currBuiltHTML = $H.highlight__buildHTMLForElementWithSelectedRange(_currNode, _boundry_mode, _range_to_highlight);\n\n                    \/\/  write\n                    \/\/  =====\n                        switch (true)\n                        {\n                            case ((_currTag == '#text')):\n\n                                \/\/  resulting html might be something like \"<em>something<\/em> something else\"\n                                \/\/  so we create a dummy span tag to eomcompass it, and then repalce the old text node with that\n\n                                \/\/  create\n                                var _newElement = $H.document.createElement('span');\n                                    _newElement.innerHTML = _currBuiltHTML;\n\n                                \/\/  result\n                                _resNode = _newElement;\n\n                               \/* with (Evernote.evernotePopup) {\n                                    console.log(' ~~~ highlight.js gadit before |'  + docSelection + \"|\");\n                                    console.log(' ~~~ from ' +docSelection.startOffset + ' to  ' + docSelection.endOffset);\n                                }*\/\n\n                                Evernote.Utils.sendMessageToPopup('highlightDomChangesStart');\n                                \/\/  replace\n                                _currNode.parentNode.replaceChild(_resNode, _currNode);\n\n                                Evernote.Utils.sendMessageToPopup('highlightDomChangesEnd');\n\/*\n                                with (Evernote.evernotePopup) {\n                                    console.log(' ~~~ highlight.js nagadil |'  + docSelection + \"|\");\n                                    console.log(' ~~~ from ' +docSelection.startOffset + ' to  ' + docSelection.endOffset);\n                                }*\/\n\n                                break;\n\n                            case (($H.parseOptions._elements_self_closing.indexOf('|'+_currTag+'|') > -1)):\n\n                                \/\/  result\n                                _resNode = _currNode;\n\n                                \/* nothing *\/ \/*\n                                    var _newElement = $H.document.createElement('em');\n                                        _newElement.className = $H.settings.highlightElementCSSClass;\n                                        _newElement.innerHTML = _currBuiltHTML;\n                                    _currNode.parentNode.replaceChild(_newElement, _currNode);\n                                *\/\n\n                                break;\n\n                            default:\n\n                                \/\/  result\n                                _resNode = _currNode;\n\n                                \/\/  innerHTML\n                                _currBuiltHTML = _currBuiltHTML.substr((_currBuiltHTML.indexOf('>')+1));\n                                _currBuiltHTML = _currBuiltHTML.substr(0, _currBuiltHTML.lastIndexOf('<'));\n\n                                \/\/  highlighted anything?\n                                if (_currBuiltHTML.indexOf('<em class=\"'+$H.settings.highlightElementCSSClass+'\">') > - 1); else { break; }\n\n                                \/\/  do it\n                                _currNode.innerHTML = _currBuiltHTML;\n                                break;\n                        }\n\n                    \/\/  set highlight class \n                    \/\/  ===================\n\n                        \/\/  inside node\n                        $CJ(_resNode).find('em.'+$H.settings.highlightElementCSSClass+':not(['+$H.settings.highlightElementIdAttribute+'])').attr($H.settings.highlightElementIdAttribute, _selection_id);\n\n                        \/\/  on node\n                        if ((_currTag == 'em') &#038;&#038; $CJ(_resNode).hasClass($H.settings.highlightElementCSSClass))\n                            { $CJ(_resNode).attr($H.settings.highlightElementIdAttribute, _selection_id); }\n\n                        \/\/  clean::add\n                        _parents_to_clean.push(_resNode.parentNode);\n                }\n\n                \/\/  clean::do\n                $H.highlight__deleteSpansFromParents(_parents_to_clean);\n        };\n\n    \/\/  do range }\n\n    \/\/  do current selection {\n    \/\/  ======================\n\n        $H.highlight__doCurentSelection = function ()\n        {\n            \/\/  vars\n            \/\/  ====\n                var \n                    _selection = $H.sel.getSelection($H.window),\n                    _range = $H.sel.getRange(_selection),\n                    _text = $H.sel.getRangeText(_range),\n\n                    _good_range = (_range ? {\n                        'commonAncestorContainer':  _range.commonAncestorContainer,\n                        'startContainer':           _range.startContainer,\n                        'endContainer':             _range.endContainer,\n                        'startOffset':              _range.startOffset,\n                        'endOffset':                _range.endOffset\n                    } : false)\n                ;\n\n            \/\/  some exception rules\n            \/\/  ====================\n                switch (true)\n                {\n                    case (!(_text)):\n                    case (!(_text.length > 0)):\n                    case (!(_good_range)):\n                        return false;\n                }\n\n            \/\/  some corrections\n            \/\/  ================\n\n                \/\/  Firefox fucks up -- https:\/\/developer.mozilla.org\/en\/DOM\/range.startOffset\n                \/\/  Offsets mean two differet things\n\n                \/\/  start container\n                if (_good_range.startContainer.nodeType == 1)\n                {\n                    if (_good_range.startContainer.childNodes[_good_range.startOffset])\n                    {\n                        _good_range.startContainer = _good_range.startContainer.childNodes[_good_range.startOffset];\n                        _good_range.startOffset = 0;\n                    }\n                }\n\n                \/\/  end container\n                if (_good_range.endContainer.nodeType == 1)\n                {\n                    if (_good_range.endContainer.childNodes[_good_range.endOffset])\n                    {\n                        _good_range.endContainer = _good_range.endContainer.childNodes[_good_range.endOffset];\n                        _good_range.endOffset = 0;\n                    }\n                }\n\n            \/\/  highlight range\n            \/\/  ===============\n                var _highlighted_range = $H.highlight__doRange(_good_range);\n                if (_highlighted_range === false) { return false; }\n\n            \/\/  clear selection\n            \/\/  ===============\n                try { _selection.removeAllRanges(); } catch (e) {}\n\n            \/\/  correct double highlights\n            \/\/  =========================\n                var _parents_double_to_clean = [];\n                $H.$elementWhichMustContainAllHighlights.find('em.'+$H.settings.highlightElementCSSClass+' em.'+$H.settings.highlightElementCSSClass).each(function (_i, _e)\n                {\n                    \/\/  remove inner button\n                        $CJ(_e).find('a.'+$H.settings.highlightElementDeleteCSSClass).remove();\n\n                    \/\/  create\n                    var _newElement = $H.document.createElement('span');\n                        _newElement.innerHTML = _e.innerHTML;\n\n                    \/\/  repalce\n                    _e.parentNode.replaceChild(_newElement, _e);\n\n                    \/\/  add\n                    _parents_double_to_clean.push(_newElement.parentNode);\n                });\n\n                \/\/  clean\n                $H.highlight__deleteSpansFromParents(_parents_double_to_clean);\n\n            \/\/  remove buttons and classes\n            \/\/  ==========================\n                \/\/  delete buttons\n                $H.$elementWhichMustContainAllHighlights.find('em.'+$H.settings.highlightElementCSSClass+' a.'+$H.settings.highlightElementDeleteCSSClass).remove();\n\n                \/\/  first, last\n                $H.$elementWhichMustContainAllHighlights.find('em.'+$H.settings.highlightElementCSSClass+'.'+$H.settings.highlightElementFirstCSSClass).removeClass($H.settings.highlightElementFirstCSSClass);\n                $H.$elementWhichMustContainAllHighlights.find('em.'+$H.settings.highlightElementCSSClass+'.'+$H.settings.highlightElementLastCSSClass).removeClass($H.settings.highlightElementLastCSSClass);\n\n            \/\/  add buttons and classes\n            \/\/  =======================\n                var \n                    _highlights_collection = $H.$elementWhichMustContainAllHighlights.find('em.'+$H.settings.highlightElementCSSClass),\n                    _highlights_collection_ids = [],\n                    _curr_delete_button = false\n                ;\n\n                \/\/  get all ids\n                _highlights_collection.each(function (_i, _e) {\n                    _highlights_collection_ids.push($CJ(_e).attr($H.settings.highlightElementIdAttribute));\n                });\n\n                \/\/  add button, classes\n                _highlights_collection.each(function (_i, _e)\n                {\n                    var\n                        _isFirst = (_highlights_collection_ids[(_i-1)] ? (_highlights_collection_ids[_i] != _highlights_collection_ids[(_i-1)]) : true),\n                        _isLast = (_highlights_collection_ids[(_i+1)] ? (_highlights_collection_ids[_i] != _highlights_collection_ids[(_i+1)]) : true)\n                    ;\n\n                    if (_isFirst)\n                    {\n                        \/\/  class\n                        $CJ(_e).addClass($H.settings.highlightElementFirstCSSClass);\n\n                        \/\/  create button\n                        _curr_delete_button = $H.document.createElement('a');\n                        _curr_delete_button.className = $H.settings.highlightElementDeleteCSSClass;\n                        _curr_delete_button.id = $H.settings.highlightElementDeleteIdPrefix + _highlights_collection_ids[_i];\n\n                        \/\/  add button\n                        _e.insertBefore(_curr_delete_button, _e.firstChild);\n                    }\n\n                    if (_isLast)\n                    {\n                        \/\/  class\n                        $CJ(_e).addClass($H.settings.highlightElementLastCSSClass);\n                    }\n                });\n        };\n\n    \/\/  do current selection }\n\n    \/\/  delete highlight {\n    \/\/  ==================\n\n        $H.highlight__deleteAllHighlights = function ()\n        {\n            $H.highlight__deleteHighlight('all');\n        };\n\n        $H.highlight__deleteHighlight = function (_highlight_id)\n        {\n            var \n                _expression = 'em.' + $H.settings.highlightElementCSSClass + (_highlight_id == 'all' ? '' : '['+$H.settings.highlightElementIdAttribute+'=\"'+_highlight_id+'\"]'),\n                _parents_to_clean = []\n            ;\n\n            \/\/  collection\n            $H.$elementWhichMustContainAllHighlights.find(_expression).each(function (_index, _e)\n            {\n                \/\/  create\n                var _s = $H.document.createElement('span');\n                    _s.innerHTML = _e.innerHTML;\n\n                \/\/  do\n                _e.parentNode.replaceChild(_s, _e);\n\n                \/\/  parents\n                _parents_to_clean.push(_s.parentNode);\n            });\n\n            \/\/  delete spans\n            $H.highlight__deleteSpansFromParents(_parents_to_clean);\n        };\n\n    \/\/  delete highlight }\n\n    \/\/  enable \/ disable {\n    \/\/  ==================\n\n        $H.enable = function ()\n        {\n            if ($H.enabled) { return; }\n            $H.enabled = true;\n            $H.$html.addClass($H.settings.highlightingEnabledCSSClass);\n        };\n\n        $H.disable = function ()\n        {\n            if ($H.enabled); else { return; }\n            $H.enabled = false;\n            $H.$html.removeClass($H.settings.highlightingEnabledCSSClass);\n        };\n\n    \/\/  enable \/ disable }\n\n    \/\/  add mouse handlers {\n    \/\/  ====================\n\n        \/\/  globals\n        $H.highlight__mouseUp_timeout = false;\n        $H.highlight__deleteButton__byId__mouseEnter_timeout = {};\n        $H.highlight__deleteButton__byId__mouseLeave_timeout = {};\n\n        \/\/  containers mouse up\n        $H.highlight__mouseUp = function ()\n        {\n            \/\/  not in highlight mode\n            if ($H.enabled); else { return; }\n\n            \/\/  timeout\n            $H.highlight__mouseUp_timeout = $H.window.setTimeout\n            (\n                function ()\n                {\n                    \/\/  try\n                    $H.highlight__mouseUp_timeout = false;\n                    var _didSelection = $H.highlight__doCurentSelection();\n\n                    \/\/  callback\n                    if (_didSelection === false); else {\n                        if ($H.callbacks.highlightAdded) {\n                            $H.callbacks.highlightAdded();\n                        }\n                    }\n                }, \n                250\n            );\n        };\n\n        \/\/  containers mouse down\n        $H.highlight__mouseDown = function ()\n        {\n            \/\/  not in highlight mode\n            if ($H.enabled); else { return; }\n\n            \/\/  timeout\n            $H.window.clearTimeout($H.highlight__mouseUp_timeout);\n        };\n\n        \/\/  delete buttons show\/hide\n        $H.highlight__deleteButton__show = function (_highlight_id) { $H.$elementWhichMustContainAllHighlights.find('#' + $H.settings.highlightElementDeleteIdPrefix + _highlight_id).fadeIn(250); };\n        $H.highlight__deleteButton__hide = function (_highlight_id) { $H.$elementWhichMustContainAllHighlights.find('#' + $H.settings.highlightElementDeleteIdPrefix + _highlight_id).fadeOut(250); };\n\n        \/\/  add mouse handlers\n        $H.addMouseHandlers = function ()\n        {\n            \/\/  mouse up\/down\n            for (var i=0, _i=$H.settings.elementsToAttachMouseHandlersTo.length; i<_i; i++)\n            {\n                $CJ($H.settings.elementsToAttachMouseHandlersTo[i])\n                    .mouseup($H.highlight__mouseUp)\n                    .mousedown($H.highlight__mouseDown)\n                ;\n            }\n\n            \/\/  highlight mouse enter\n            $H.$elementWhichMustContainAllHighlights.on('mouseenter', 'em.'+$H.settings.highlightElementCSSClass, function ()\n            {\n                var _highlight_id = $CJ(this).attr($H.settings.highlightElementIdAttribute);\n\n                $H.window.clearTimeout($H.highlight__deleteButton__byId__mouseLeave_timeout[_highlight_id]);\n\n                $H.highlight__deleteButton__byId__mouseEnter_timeout[_highlight_id] = $H.window.setTimeout(\n                    function ()\n                    {\n                        $H.highlight__deleteButton__byId__mouseEnter_timeout[_highlight_id] = false;\n                        $H.highlight__deleteButton__show(_highlight_id);\n                    },\n                    250\n                );\n            });\n\n            \/\/  highlight mouse leave\n            $H.$elementWhichMustContainAllHighlights.on('mouseleave', 'em.'+$H.settings.highlightElementCSSClass, function ()\n            {\n                var _highlight_id = $CJ(this).attr($H.settings.highlightElementIdAttribute);\n\n                $H.window.clearTimeout($H.highlight__deleteButton__byId__mouseEnter_timeout[_highlight_id]);\n\n                $H.highlight__deleteButton__byId__mouseLeave_timeout[_highlight_id] = $H.window.setTimeout(\n                    function ()\n                    {\n                        $H.highlight__deleteButton__byId__mouseLeave_timeout[_highlight_id] = false;\n                        $H.highlight__deleteButton__hide(_highlight_id);\n                    },\n                    250\n                );\n            });\n\n            \/\/  highlight delete click        \n            $H.$elementWhichMustContainAllHighlights.on('click', 'em.'+$H.settings.highlightElementCSSClass+' a.'+$H.settings.highlightElementDeleteCSSClass, function ()\n            {\n                \/\/  get id\n                var _id = $CJ(this.parentNode).attr($H.settings.highlightElementIdAttribute);\n\n                \/\/  remove self\n                $CJ(this).remove();\n\n                \/\/  delete\n                $H.highlight__deleteHighlight(_id);\n\n                \/\/  callback\n                if ($H.callbacks.highlightDeleted) {\n                    $H.callbacks.highlightDeleted();\n                }\n            });\n        };\n\n    \/\/  add mouse handlers }\n\n    \/\/  get clean html {\n    \/\/  ================\n\n        $H.getCleanHTML = function (_rawHTML)\n        {\n            \/\/  html\n            var _html = _rawHTML;\n\n            \/\/  remove all spans -- spans hold deleted highlights, or useless helper elements\n            _html = _html.replace(\/<span([^>]*?)>\/gi, '');\n            _html = _html.replace(\/<\\\/span>\/gi, '');\n\n            \/\/  remove highlight-delete buttons\n            var _highlight_delete_reg = new RegExp('<a ([^>]*?)'+$H.settings.highlightElementDeleteCSSClass+'([^>]*?)><\/a>', 'gi');\n            _html = _html.replace(_highlight_delete_reg, '');\n\n            \/\/  highlight element\n            var _highlight_element_reg = new RegExp('<em ([^>]*?)'+$H.settings.highlightElementCSSClass+'([^>]*?)>([^>]+?)<\/em>', 'gi');\n            _html = _html.replace(_highlight_element_reg, '<highlight>$3<\/highlight>');\n\n            \/\/  double EMs\n            var _two_highlights_reg = new RegExp('<highlight>([\\\\s\\\\S]*?)<\/highlight>([ \\\\n\\\\r\\\\t]*?)<highlight>([\\\\s\\\\S]*?)<\/highlight>', 'gi');\n            while (true &#038;&#038; _html.match(_two_highlights_reg)) {\n                _html = _html.replace(_two_highlights_reg, '<highlight>$1$3<\/highlight>');\n            }\n\n            \/\/  replace EMs\n            var _highlight_reg = new RegExp('<highlight>([\\\\s\\\\S]*?)<\/highlight>', 'gi');\n            _html = _html.replace(_highlight_reg, $H.settings.highlightCleanHTMLElementStart+'$1'+$H.settings.highlightCleanHTMLElementEnd);\n\n            return _html;\n        };\n\n    \/\/  get clean html }\t\t\n\n    \/\/  return self\n    \/\/  ===========\n        return $H;\n}\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/*! * ClearlyComponent__next * Evernote Clearly's next-page algorithm as an embeddable component. * Copyright 2013, Evernote Corporation * * Usage: * ====== * * The Next-pages Clearly-component works hand-in-hand with the clearly Detect Component. * So its init\/usage pattern needs to come after the normal init\/usage pattern for the Detect Component. * Like this: * * First \"Detect\": * ============= * * \/\/ define * window.ClearlyComponent__detect = { * 'callbacks': { * 'finished': someFunction(), * }, * 'window': window, * 'document': document, * 'jQuery': window.jQuery * }; * * \/\/ init -- will return false, if something goes wrong * window.ClearlyComponent__detect = initClearlyComponent__detect(window.ClearlyComponent__detect); * * Then \"Next\": * ============ * * \/\/ define * window.ClearlyComponent__next = { * 'callbacks': { * 'newPageFound': someFunction() * }, * * 'settings': { * 'onCreateNextPagesContainerUseThisId': 'string', * 'onCreateNextPagesContainerDoNotInsertCSS': true * }, * * 'detectComponentInstance': window.ClearlyComponent__detect * }; * * \/\/ init -- will return false, if something goes wrong * window.ClearlyComponent__next = initClearlyComponent__next(window.ClearlyComponent__next); * * \/\/ call -- returns nothing; callbacks will be used * window.ClearlyComponent__next.createNextPagesContainer() * window.ClearlyComponent__next.start(); * *\/ \/* changes: ======== $R => $N, $D\n*\/\n\nfunction initClearlyComponent__next(_paramInstance)\n{\n    \/\/  global instance reference {\n    \/\/  ===========================\n\n        \/\/  null; return\n        if (_paramInstance); else { return false; }\n\n        \/\/  shorthand\n        $N = _paramInstance;\n\n    \/\/  global instance reference }\n\n    \/\/  required vars {\n    \/\/  ===============\n\n        \/\/  the component instance object must already be created,\n        \/\/  when the init function is called. it must have these vars set:\n\n        switch (true)\n        {\n            case (!($N.detectComponentInstance)):\n\n            case (!($N.callbacks)):\n            case (!($N.callbacks.newPageFound)):\n\n                \/\/  something's wrong\n                return false;\n        }\n\n    \/\/  required vars }\n\n    \/\/  missing settings {\n    \/\/  ==================\n\n        if ($N.settings); else { $N.settings = {}; }\n\n        \/\/  names for stuff\n        \/* frames id *\/               if ($N.settings.onCreateNextPageFramesUseThisIdPrefix); else           { $N.settings.onCreateNextPageFramesUseThisIdPrefix =          'clearly_next_page_frame__'; }\n        \/* container id *\/            if ($N.settings.onCreateNextPagesContainerUseThisId); else             { $N.settings.onCreateNextPagesContainerUseThisId =            'clearly_next_pages_container'; }\n        \/* insert container css *\/    if ($N.settings.onCreateNextPagesContainerDoNotInsertCSS); else        { $N.settings.onCreateNextPagesContainerDoNotInsertCSS =       false; }\n        \/* frames attribute *\/        if ($N.settings.onLoadingNextPageFramesUseThisAttribute); else         { $N.settings.onLoadingNextPageFramesUseThisAttribute =        'clearly_next_page_loaded'; }\n        \/* frames attribute value *\/  if ($N.settings.onLoadingNextPageFramesUseThisAttributeValue); else    { $N.settings.onLoadingNextPageFramesUseThisAttributeValue =   'yes'; }\n\n    \/\/  missing settings }\n\n    \/\/  global vars {\n    \/\/  =============\n\n        $D = $N.detectComponentInstance;\n        $CJ = $D.jQuery;\n\n        $N.pages = [];\n\n    \/\/  global vars }\n\n    \/\/  parse options {\n    \/\/  =============   \n\n\t\t$N.parseOptions =\n\t\t{\n\t\t\t'_next_page_keywords': [\n                \/* english *\/   'next page', 'next',\n                \/* german *\/    'vorw&#228;rts', 'weiter',\n                \/* japanese *\/  '&#27425;&#12408;'\n\t\t\t],\n\n\t\t\t'_next_page_keywords_not': [\n\t\t\t    \/* english *\/   'article', 'story', 'post', 'comment', 'section', 'chapter'\n\t\t\t]\n\t\t};\n\n    \/\/  parse options }\n\n    \/\/  create next pages container {\n    \/\/  =============================\n\n        $N.createNextPagesContainer = function ()\n        {\n            \/\/  default id\n            \/\/  ==========\n                _container_id = $N.settings.onCreateNextPagesContainerUseThisId;\n\n            \/\/\tcontainer\n            \/\/\t=========\n                var _containerElement = $D.document.createElement('div');\n                    _containerElement.setAttribute('id', _container_id);\n\n            \/\/\tcss\n            \/\/\t===\n                if ($N.settings.onCreateNextPagesContainerDoNotInsertCSS); else\n                {\n                    var \n                        _cssElement = $D.document.createElement('style'),\n                        _cssText = ''\n                        +\t'#'+_container_id+' { '\n                        +\t\t'margin: 0; padding: 0; border: none; '\n                        +\t\t'position: absolute; '\n                        +\t\t'width: 10px; height: 10px; '\n                        +\t\t'top: -100px; left: -100px; '\n                        +\t'} '\n                        +\t'#'+_container_id+' iframe { '\n                        +\t\t'margin: 0; padding: 0; border: none; '\n                        +\t\t'position: absolute; '\n                        +\t\t'width: 10px; height: 10px; '\n                        +\t\t'top: -100px; left: -100px; '\n                        +\t'} '\n                    ;\n                    _cssElement.setAttribute('id', _container_id + '__css');\n                    _cssElement.setAttribute('type', 'text\/css');\n                    if (_cssElement.styleSheet) { _cssElement.styleSheet.cssText = _cssText; }\n                        else { _cssElement.appendChild($D.document.createTextNode(_cssText)); }\n                }\n\n            \/\/\twrite\n            \/\/\t=====\n                var _body = $D.document.getElementsByTagName('body')[0];\n                    \/* css *\/       if (_cssElement) { _body.appendChild(_cssElement); }\n                    \/* container *\/ _body.appendChild(_containerElement);\n\n            \/\/  set\n            \/\/  ===\n                $N.nextPages = _containerElement;\n                $N.$nextPages = $CJ($N.nextPages);\n        };\n\n    \/\/  create next pages container }\n\n\t\/\/  helpers {\n\t\/\/  =========\n\n        \/\/  substr starting with the first slash after \/\/\n\t\t$N.getURLPath = function (_url) { return _url.substr(_url.indexOf('\/', (_url.indexOf('\/\/') + 2))); };\n\n        \/\/  substr until the first slash after \/\/\n\t\t$N.getURLDomain = function (_url) { return _url.substr(0, _url.indexOf('\/', (_url.indexOf('\/\/') + 2))); };\n\n\t\/\/  helpers }\n\n\t\/\/  load page {\n\t\/\/  ===========\n\n        $N.nextPage__loadToFrame = function (_pageNr, _nextPageURL)\n        {\n            \/\/\tdo ajax\n            \/\/\t=======\n                $CJ.ajax\n                ({\n                    'url' : _nextPageURL,\n\n                    'type' : 'GET',\n                    'dataType' : 'html',\n                    'async' : true,\n                    'timeout': (10 * 1000),\n\n                    \/\/'headers': { 'Referrer': _nextPageURL },\n\n                    'success' : function (_response, _textStatus, _xhr)\t{ $N.nextPage__ajaxComplete(_pageNr, _response, _textStatus, _xhr); },\n                    'error' : \tfunction (_xhr, _textStatus, _error)\t{ $N.nextPage__ajaxError(_pageNr, _xhr, _textStatus, _error); }\n                });\n        };\n\n        $N.nextPage__ajaxError = function (_pageNr, _xhr, _textStatus, _error) { };\n\n        $N.nextPage__ajaxComplete = function (_pageNr, _response, _textStatus, _xhr)\n        {\n            \/\/\tvalid?\n            \/\/\t======\n                if (_response > ''); else { return; }\n\n            \/\/\tget html\n            \/\/\t========\n                var _html = _response;\n\n                \/\/\tnormalize\n                \/\/\t=========\n                    _html = _html.replace(\/<\\s+\/gi, '<'); _html = _html.replace(\/\\s+>\/gi, '>');\n                    _html = _html.replace(\/\\s+\\\/>\/gi, '\/>');\n\n                \/\/\tremove\n                \/\/\t======\n                    _html = _html.replace(\/<script[^>]*?>([\\s\\S]*?)<\\\/script>\/gi, '');\n                    _html = _html.replace(\/<script[^>]*?\\\/>\/gi, '');\n                    _html = _html.replace(\/<noscript[^>]*?>([\\s\\S]*?)<\\\/noscript>\/gi, '');\n\n            \/\/\tappend frame\n            \/\/\t============\n                $N.$nextPages.append(''\n                    + '<iframe' + ' id=\"'+$N.settings.onCreateNextPageFramesUseThisIdPrefix+_pageNr+'\"' + ' scrolling=\"no\" frameborder=\"0\"' + '><\/iframe>'\n                );\t\t\n\n            \/\/\twrite to frame\n            \/\/\t==============\n                var _doc = $N.$nextPages.find('#'+$N.settings.onCreateNextPageFramesUseThisIdPrefix+_pageNr).contents().get(0);\n                    _doc.open();\n                    _doc.write(_html);\n                    _doc.close();\n\n            \/\/\tadd load handler\n            \/\/\t================\n                $N.$nextPages.find('#'+$N.settings.onCreateNextPageFramesUseThisIdPrefix+_pageNr).bind('load', function ()\n                {\n                    \/\/  done?\n                    if ($N.$nextPages.find('#'+$N.settings.onCreateNextPageFramesUseThisIdPrefix+_pageNr).attr($N.settings.onLoadingNextPageFramesUseThisAttribute) == $N.settings.onLoadingNextPageFramesUseThisAttributeValue) { return; }\n\n                    \/\/  can do?\n                    var _doc = $N.$nextPages.find('#'+$N.settings.onCreateNextPageFramesUseThisIdPrefix+_pageNr).contents().get(0);\n                    if (_doc); else { return; }\n                    if (_doc.readyState == 'interactive' || _doc.readyState == 'complete'); else { return; }\n\n                    \/\/  mark\n                    $N.$nextPages.find('#'+$N.settings.onCreateNextPageFramesUseThisIdPrefix+_pageNr).attr($N.settings.onLoadingNextPageFramesUseThisAttribute, $N.settings.onLoadingNextPageFramesUseThisAttributeValue);\n\n                    \/\/ do\n                    $N.nextPage__loadedInFrame(_pageNr, _doc.defaultView);                  \n                });\n        };\n\n        $N.nextPage__loadedInFrame = function (_pageNr, _pageWindow)\n        {\n            \/\/\tfind\n            \/\/\t====\n                var \n                    _found = $D.getContent__findInPage(_pageWindow),\n                    _foundHTML = _found._html,\n                    _removeTitleRegex = new RegExp($D.articleTitleMarker__start + '(.*?)' + $D.articleTitleMarker__end, 'i')\n                ;\n\n            \/\/  get first fragment\n            \/\/  ==================\n                var _firstFragment = $D.nextPage__getFirstFragment(_foundHTML);\n\n                \/\/  gets first 2000 characters\n                \/\/  diff set at 100 -- 0.05\n                switch (true)\n                {\n                    case ($D.levenshteinDistance(_firstFragment, $N.nextPage__firstFragment__firstPage) < 100):\n                    case ($D.levenshteinDistance(_firstFragment, $N.nextPage__firstFragment__lastPage) < 100): \/\/ break return false; default: \/\/ add to first fragemnts $N.nextPage__firstFragment__lastPage = _firstFragment; break; } \/\/ remove title -- do it twice \/\/ ============ \/\/ once with document title _foundHTML = $D.getContent__find__isolateTitleInHTML(_foundHTML, ($D.document.title > '' ? $D.document.title : ''));\n                _foundHTML = _foundHTML.replace(_removeTitleRegex, '');\n\n                \/\/  once with article title\n                _foundHTML = $D.getContent__find__isolateTitleInHTML(_foundHTML, $D.articleTitle);\n                _foundHTML = _foundHTML.replace(_removeTitleRegex, '');\n\n            \/\/\treturn\n            \/\/\t======\n                var _page = {\n                    '_url':         _pageWindow.location.href,\n                    '_html':        _foundHTML,\n                    '_elements':    [_found._targetCandidate.__node]\n                };\n\n                $N.pages.push(_page);\n                if ($N.callbacks.newPageFound) { $N.callbacks.newPageFound(_page); }\n\n            \/\/\tnext\n            \/\/\t====\n                $N.nextPage__find(_pageWindow, _found._links);\n        };\n\n\t\/\/  load }\n\n    \/\/  find {\n    \/\/  ======\n\n\t\t$N.nextPage__find = function (_currentPageWindow, _linksInCurrentPage)\n\t\t{\n\t\t\t\/\/\tpage id\n\t\t\t\tvar _pageNr = ($N.pages.length + 1);\n\n\t\t\t\/\/\tget\n\t\t\t\/\/\t===\n\t\t\t\tvar _possible = [];\n\t\t\t\tif (_possible.length > 0); else { _possible = $N.nextPage__find__possible(_currentPageWindow, _linksInCurrentPage, 0.5); }\n\t\t\t\t\/\/if (_possible.length > 0); else { _possible = $N.nextPage__find__possible(_currentPageWindow, _linksInCurrentPage, 0.50); }\n\n\t\t\t\t\/\/\tnone\n\t\t\t\tif (_possible.length > 0); else\n\t\t\t\t\t{ if ($D.debug) { $D.log('no next link found'); } return; }\n\n\t\t\t\t\/\/  log\n\t\t\t\tif ($D.debug) { $D.log('possible next', _possible); }\n\n\t\t\t\/\/\tthe one\n\t\t\t\/\/\t=======\n\t\t\t\tvar _nextLink = false;\n\n\t\t\t\/\/\tnext keyword?\n\t\t\t\/\/\t=============\n\t\t\t\t(function ()\n\t\t\t\t{\n\t\t\t\t\tif (_nextLink) { return; }\n\n\t\t\t\t\tfor (var i=0, _i=_possible.length; i<_i; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var j=0, _j=$N.parseOptions._next_page_keywords.length; j<_j; j++) { if (_possible[i]._caption.indexOf($N.parseOptions._next_page_keywords[j]) > -1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\/\/\tlength\n\t\t\t\t\t\t\t\t\/\/\t======\n\t\t\t\t\t\t\t\t\tif (_possible[i]._caption.length > $N.parseOptions._next_page_keywords[j].length * 2)\n\t\t\t\t\t\t\t\t\t\t{ continue; }\n\n\t\t\t\t\t\t\t\t\/\/\tnot keywords\n\t\t\t\t\t\t\t\t\/\/\t============\n\t\t\t\t\t\t\t\t\tfor (var z=0, _z=$N.parseOptions._next_page_keywords_not.length; z<_z; z++) { if (_possible[i]._caption.indexOf($N.parseOptions._next_page_keywords_not[z]) > -1)\n\t\t\t\t\t\t\t\t\t\t\t{ _nextLink = false; return; }\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\/\/\tgot it\n\t\t\t\t\t\t\t\t\/\/\t======\n\t\t\t\t\t\t\t\t\t_nextLink = _possible[i];\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})();\t\n\n\t\t\t\/\/\tcaption matched page number\n\t\t\t\/\/\t===========================\n\t\t\t\t(function ()\n\t\t\t\t{\n\t\t\t\t\tif (_nextLink) { return; }\n\n\t\t\t\t\tfor (var i=0, _i=_possible.length; i<_i; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_possible[i]._caption == (''+_pageNr))\n\t\t\t\t\t\t\t{ _nextLink = _possible[i]; return; }\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\/\/\tnext keyword in title\n\t\t\t\/\/\t=====================\n\t\t\t\t(function ()\n\t\t\t\t{\n\t\t\t\t\tif (_nextLink) { return; }\n\n\t\t\t\t\tfor (var i=0, _i=_possible.length; i<_i; i++) { \/\/ sanity if (_possible[i]._title > ''); else { continue; }\n\t\t\t\t\t\tif ($D.measureText__getTextLength(_possible[i]._caption) <= 2); else { continue; }\n\n\t\t\t\t\t\tfor (var j=0, _j=$N.parseOptions._next_page_keywords.length; j<_j; j++) { if (_possible[i]._title.indexOf($N.parseOptions._next_page_keywords[j]) > -1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\/\/\tlength\n\t\t\t\t\t\t\t\t\/\/\t======\n\t\t\t\t\t\t\t\t\tif (_possible[i]._title.length > $N.parseOptions._next_page_keywords[j].length * 2)\n\t\t\t\t\t\t\t\t\t\t{ continue; }\n\n\t\t\t\t\t\t\t\t\/\/\tnot keywords\n\t\t\t\t\t\t\t\t\/\/\t============\n\t\t\t\t\t\t\t\t\tfor (var z=0, _z=$N.parseOptions._next_page_keywords_not.length; z<_z; z++) { if (_possible[i]._title.indexOf($N.parseOptions._next_page_keywords_not[z]) > -1)\n\t\t\t\t\t\t\t\t\t\t\t{ _nextLink = false; return; }\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\/\/\tgot it\n\t\t\t\t\t\t\t\t\/\/\t======\n\t\t\t\t\t\t\t\t\t_nextLink = _possible[i];\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\/\/\treturn?\n\t\t\t\/\/\t=======\n\t\t\t\tif (_nextLink); else { return; }\n\n\t\t\t\/\/\tmark\n\t\t\t\/\/\t====\n\t\t\t\tif ($D.debug)\n\t\t\t\t{\n\t\t\t\t\t$D.debugOutline(_nextLink._node, 'target', 'next-page');\n\t\t\t\t\t$D.log('NextPage Link', _nextLink, _nextLink._node);\n\t\t\t\t}\n\n\t\t\t\/\/\tprocess page\n\t\t\t\/\/\t============\n\t\t\t\t$N.nextPage__loadToFrame(_pageNr, _nextLink._href);\n\t\t};\n\n\t\t$N.nextPage__find__possible = function (_currentPageWindow, _linksInCurrentPage, _distanceFactor)\n\t\t{\n\t\t\tvar \n\t\t\t\t_mainPageHref = $D.window.location.href,\n\t\t\t\t_mainPageDomain = $N.getURLDomain(_mainPageHref),\n\t\t\t\t_mainPagePath = $N.getURLPath(_mainPageHref)\n\t\t\t;\n\n\t\t\tvar _links = $CJ.map\n\t\t\t(\n\t\t\t\t_linksInCurrentPage,\n\t\t\t\tfunction (_element, _index)\n\t\t\t\t{\n\t\t\t\t\tvar \n\t\t\t\t\t\t_href = _element.__node.href,\n\t\t\t\t\t\t_path = $N.getURLPath(_href),\n\t\t\t\t\t\t_title = (_element.__node.title > '' ? _element.__node.title.toLowerCase() : ''),\n\t\t\t\t\t\t_caption = _element.__node.innerHTML.replace(\/<[^>]+?>\/gi, '').replace(\/\\&#038;[^\\&\\s;]{1,10};\/gi, '').replace(\/\\s+\/gi, ' ').replace(\/^ \/, '').replace(\/ $\/, '').toLowerCase(),\n\t\t\t\t\t\t_distance = $D.levenshteinDistance(_mainPagePath, _path)\n\t\t\t\t\t;\n\n\t\t\t\t\tvar _caption2 = '';\n\t\t\t\t\tfor (var i=0, _i=_caption.length, _code=0; i<_i; i++) { _code = _caption.charCodeAt(i); _caption2 += (_code > 127 ? ('&#'+_code+';') : _caption.charAt(i));\n\t\t\t\t\t}\n\t\t\t\t\t_caption = _caption2;\n\n\t\t\t\t\tswitch (true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase (!(_href > '')):\n\t\t\t\t\t\tcase (_mainPageHref.length > _href.length):\n\t\t\t\t\t\tcase (_mainPageDomain != $N.getURLDomain(_href)):\n\t\t\t\t\t\tcase (_href.substr(_mainPageHref.length).substr(0, 1) == '#'):\n\t\t\t\t\t\tcase (_distance > Math.ceil(_distanceFactor * _path.length)):\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\/\/\tskip if already loaded as next page\n\t\t\t\t\t\t\tfor (var i=0, _i=$N.pages.length; i<_i; i++)\n\t\t\t\t\t\t\t\t{ if ($N.pages[i]._url == _href) { return null; } }\n\n\t\t\t\t\t\t\t\/\/\treturn\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t'_node': _element.__node,\n\t\t\t\t\t\t\t\t'_href': _href,\n\t\t\t\t\t\t\t\t'_title': _title,\n\t\t\t\t\t\t\t\t'_caption': _caption,\n\t\t\t\t\t\t\t\t'_distance': _distance\n\t\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t\/\/\tsort -- the less points, the closer to position 0\n\t\t\t\/\/\t====\n\t\t\t\t_links.sort(function (a, b)\n\t\t\t\t{\n\t\t\t\t\tswitch (true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase (a._distance < b._distance): return -1; case (a._distance > b._distance): return 1;\n\t\t\t\t\t\tdefault: return 0;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\/\/\treturn\n\t\t\t\treturn _links;\n\t\t};\n\n    \/\/  find }\n\n    \/\/  start {\n    \/\/  =======\n\n        $N.start = function ()\n        {\n            \/\/  first fragments\n                $N.nextPage__firstFragment__firstPage = $D.nextPage__firstFragment__firstPage;\n                $N.nextPage__firstFragment__lastPage = $D.nextPage__firstFragment__lastPage;\n\n            \/\/  first page\n                $N.pages = [{ '_url': $D.window.location.href }];\n\n            \/\/  start\n                $N.nextPage__find($D.window, $D.nextPage__firstLinks);\n        };\n\n    \/\/  start }\n\n    \/\/  return self\n    \/\/  ===========\n        return $N;\n}\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/*! * ClearlyComponent__reformat * Evernote Clearly's display as an embeddable component. * Copyright 2013, Evernote Corporation * * Usage: * ====== * * \/\/ define * window.ClearlyComponent__reformat = { * 'callbacks': { * 'frameCreated': someFunction(), * 'pageAdded': someFunction(), * }, * * 'settings': { * 'cssPath': 'string', * 'pageLabel': 'string'. * 'onCreateFrameUseThisId': 'string', * 'onCreateFrameDoNotInsertCSS': true * }, * * 'window': window, * 'document': document, * 'jQuery': window.jQuery * }; * * \/\/ init -- will return false, if something goes wrong * window.ClearlyComponent__reformat = initClearlyComponent__reformat(window.ClearlyComponent__reformat); * * \/\/ create frame * window.ClearlyComponent__detect.createFrame(); * * \/\/ apply options * window.ClearlyComponent__detect.applyOptions(_options_object); * * \/\/ add page * window.ClearlyComponent__detect.addNewPage(_html, _source_url); * *\/ \/* changes: ======== $R => $R\n        $R.win => $R.window\n\n    to do:\n    ======\n*\/\n\nfunction initClearlyComponent__reformat(_paramInstance)\n{\n    \/\/  global instance reference {\n    \/\/  ===========================\n\n        \/\/  null; return\n        if (_paramInstance); else { return false; }\n\n        \/\/  shorthand\n        $R = _paramInstance;\n\n    \/\/  global instance reference }\n\n    \/\/  required vars {\n    \/\/  ===============\n\n        \/\/  the component instance object must already be created,\n        \/\/  when the init function is called. it must have these vars set:\n\n        switch (true)\n        {\n            case (!($R.settings)):\n            case (!($R.settings.cssPath)):\n\n            case (!($R.window)):\n            case (!($R.document)):\n            case (!($R.document.body)):\n\n            case (!($R.jQuery)):\n\n                if ($R.debug)\n                {\n                    console.log(!($R.settings));\n                    console.log(!($R.settings.cssPath));\n\n                    console.log(!($R.window));\n                    console.log(!($R.document));\n                    console.log(!($R.document.body));\n\n                    console.log(!($R.jQuery));\n                }\n\n                \/\/  something's wrong\n                return false;\n        }\n\n    \/\/  required vars }\n\n    \/\/  missing settings {\n    \/\/  ==================\n\n        \/\/  names for stuff\n        \/* frame id *\/            if ($R.settings.onCreateFrameUseThisId); else             { $R.settings.onCreateFrameUseThisId =            'clearly_frame'; }\n        \/* insert frame css *\/    if ($R.settings.onCreateFrameDoNotInsertCSS); else        { $R.settings.onCreateFrameDoNotInsertCSS =       false; }\n        \/* page label *\/          if ($R.settings.pageLabel); else                          { $R.settings.pageLabel =                         'Page '; }\n\n    \/\/  missing settings }\n\n    \/\/  global vars {\n    \/\/  =============\n\n        $CJ = $R.jQuery;\n\n        $R.$window = $CJ($R.window);\n        $R.$document = $CJ($R.document);\n\n        $R.pagesCount = 0;\n        $R.footnotedLinksCount;\n\n        \/*\n            .iframe, .$iframe\n            .iframeWindow, .$iframeWindow\n            .iframeDocument, .$iframeDocument\n            .$iframeBackground, .$iframeBox, .$iframePages\n        *\/\n\n    \/\/  global vars }\n\n    \/\/  debug {\n    \/\/  =======\n\n        $R.debug = ($R.debug || false);\n\t\t$R.debugRemembered = {};\n        $R.debugTimers = [];\n\n\t\tif ($R.debug)\n\t\t{\n\t\t    \/\/  writeLog\n\t\t    \/\/  ========\n\t\t\t\tswitch (true)\n\t\t\t\t{\n\t\t\t\t\tcase (!(!($R.window.console &#038;&#038; $R.window.console.log))):    $R.writeLog = function (msg) { $R.window.console.log(msg); };       break;\n\t\t\t\t\tcase (!(!($R.window.opera &#038;&#038; $R.window.opera.postError))):  $R.writeLog = function (msg) { $R.window.opera.postError(msg); };   break;\n\t\t\t\t\tdefault:                                                    $R.writeLog = function (msg) {};                                    break;\n\t\t\t\t}\n\n            \/\/  log\n            \/\/  ===\n                $R.log = function ()\n                {\n                    if ($R.debug); else { return; }\n                    for (var i=0, il=arguments.length; i<il ; i++) { $R.writeLog(arguments[i]); }\n                    $R.writeLog('-----------------------------------------');\n                };\n\n            \/\/  remember\n            \/\/  ========\n                $R.debugRemember = function (_k, _v)\n                {\n                    $R.debugRemembered[_k] = _v;\n                };\n\t\t}\n\t\telse\n\t\t{\n            $R.writeLog \t\t= function () { return false; };\n            $R.log \t\t\t\t= function () { return false; };\n            $R.debugRemember \t= function () { return false; };\n        }\n\n    \/\/  debug }\n\n    \/\/  encode \/ decode {\n    \/\/  =================\n\n\t\t$R.encode = function (_string)\n\t\t{\n\t\t\t\/\/\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\n\t\t\t\/\/\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(\/!\/g, '%21')\n\t\t\t\t.replace(\/'\/g, '%27')\n\t\t\t\t.replace(\/\\(\/g, '%28')\n\t\t\t\t.replace(\/\\)\/g, '%29')\n\t\t\t\t.replace(\/\\*\/g, '%2A')\n\t\t\t;\n\t\t};\n\n\t\t$R.decode = function (_string)\n\t\t{\n\t\t\t\/\/\tnone\n\t\t\tif (_string == 'none') { return ''; }\n\n\t\t\t\/\/\tdecode\n\t\t\treturn decodeURIComponent(_string);\n\t\t};\n\n    \/\/  encode \/ decode }\n\n    \/\/  themes {\n    \/\/  ========\n\n        (function ()\n        {\n            \/\/  themes already set\n            if ($R.availableThemes) { return; } \n\n            \/\/  set themes\n            $R.availableThemes = {\n                'newsprint': {\n                    'text_font': \t\t\t$R.encode('\"PT Serif\"'),\n                    'text_font_header': \t$R.encode('\"PT Serif\"'),\n                    'text_font_monospace': \t$R.encode('Inconsolata'),\n                    'text_size': \t\t\t$R.encode('16px'),\n                    'text_line_height': \t$R.encode('1.5em'),\n                    'box_width': \t\t\t$R.encode('36em'),\n                    'color_background': \t$R.encode('#f3f2ee'),\n                    'color_text': \t\t\t$R.encode('#1f0909'),\n                    'color_links': \t\t\t$R.encode('#065588'),\n                    'text_align': \t\t\t$R.encode('normal'),\n                    'base': \t\t\t\t$R.encode('base__newsprint'),\n                    'footnote_links': \t\t$R.encode('on_print'),\n                    'large_graphics': \t\t$R.encode('do_nothing'),\n                    'custom_css': \t\t\t$R.encode(''\n                                            + '#text #articleHeader { border-color: #c5c5c5; }'\n                                            + '#text #relatedNotes { border-color: rgba(197, 197, 197, 0.5); }'\n                                            + '#text blockquote { border-color: #bababa; color: #656565; }'\n                                            + '#text thead { background-color: #dadada; }'\n                                            + '#text tr:nth-child(even) { background: #e8e7e7; }'\n                                            + '#text hr { border-color: #c5c5c5; }')\n                },\n                'notable': {\n                    'text_font': \t\t\t$R.encode('Helvetica, Arial'),\n                    'text_font_header': \t$R.encode('Helvetica, Arial'),\n                    'text_font_monospace': \t$R.encode('\"Droid Sans Mono\"'),\n                    'text_size': \t\t\t$R.encode('14px'),\n                    'text_line_height': \t$R.encode('1.5em'),\n                    'box_width': \t\t\t$R.encode('42em'),\n                    'color_background': \t$R.encode('#fff'),\n                    'color_text': \t\t\t$R.encode('#333'),\n                    'color_links': \t\t\t$R.encode('#090'),\n                    'text_align': \t\t\t$R.encode('normal'),\n                    'base': \t\t\t\t$R.encode('base__notable'),\n                    'footnote_links': \t\t$R.encode('on_print'),\n                    'large_graphics': \t\t$R.encode('do_nothing'),\n                    'custom_css': \t\t\t$R.encode(''\n                                            + '#text #articleHeader { border-color: #000; }'\n                                            + '#text #relatedNotes { border-color: rgba(0, 0, 0, 0.25); }'\n                                            + '#text h1 { color: #000; }'\n                                            + '#text h2, #text h3, #text h4, #text h5, #text h6 { color: #444; }'\n                                            + '#text blockquote { border-color: #d1d1d1; }'\n                                            + '#text thead { background-color: #444; color: #fff; }'\n                                            + '#text tr:nth-child(even) { background: #d1d1d1; }'\n                                            + '#text hr { border-color: #000; }')\n                },\n                'night_owl': {\n                    'text_font': \t\t\t$R.encode('\"PT Serif\"'),\n                    'text_font_header': \t$R.encode('\"PT Serif\"'),\n                    'text_font_monospace': \t$R.encode('Inconsolata'),\n                    'text_size': \t\t\t$R.encode('16px'),\n                    'text_line_height': \t$R.encode('1.5em'),\n                    'box_width': \t\t\t$R.encode('36em'),\n                    'color_background': \t$R.encode('#2d2d2d'),\n                    'color_text': \t\t\t$R.encode('#e3e3e3'),\n                    'color_links': \t\t\t$R.encode('#e3e3e3'),\n                    'text_align': \t\t\t$R.encode('normal'),\n                    'base': \t\t\t\t$R.encode('base__night_owl'),\n                    'footnote_links': \t\t$R.encode('on_print'),\n                    'large_graphics': \t\t$R.encode('do_nothing'),\n                    'custom_css': \t\t\t$R.encode(''\n                                            + '#text #articleHeader { border-color: #c5c5c5; }'\n                                            + '#text #relatedNotes { border-color: rgba(197, 197, 197, 0.5); }'\n                                            + '#text a:link { -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; }'\n                                            + '#text #relatedNotes a { -webkit-transition-duration: 0s; -moz-transition-duration: 0s; -o-transition-duration: 0s; }'\n                                            + '#text a:hover, #text a:active {\tcolor: #44bde8; }'\n                                            + '#text blockquote { color: #c1bfbf; border-color: #c1bfbf; }'\n                                            + '#text thead { background-color: #4f4f4f; }'\n                                            + '#text tr:nth-child(even) { background: #404040; }'\n                                            + '#text hr { border-color: #c5c5c5; }')\n                }\n            };\n        })();\n\n    \/\/  themes }\n\n    \/\/  font sizes {\n    \/\/  ============\n\n        (function ()\n        {\n            \/\/  font sizes already set\n            if ($R.availableFontSizes) { return; } \n\n            \/\/  set font sizes\n            $R.availableFontSizes = {\n                'small':    { 'newsprint': '12px', 'notable': '12px', 'night_owl': '12px' },\n                'medium':   { 'newsprint': '16px', 'notable': '16px', 'night_owl': '16px' },\n                'large':    { 'newsprint': '20px', 'notable': '20px', 'night_owl': '20px' }\n            };\n        })();\n\n    \/\/  font sizes }\n\n    \/\/  google fonts {\n    \/\/  ==============\n\n        (function ()\n        {\n            \/\/  google fonts already set\n            if ($R.availableGoogleFonts) { return; }\n\n            \/\/  set google fonts to these\n            var __google_fonts_array = [\n                \/* serif *\/ 'Arvo', 'Bentham', 'Cardo', 'Copse', 'Corben', 'Crimson Text', 'Droid Serif', 'Goudy Bookletter 1911', 'Gruppo', 'IM Fell', 'Josefin Slab', 'Kreon', 'Meddon', 'Merriweather', 'Neuton', 'OFL Sorts Mill Goudy TT', 'Old Standard TT', 'Philosopher', 'PT Serif', 'Radley', 'Tinos', 'Vollkorn',\n                \/* sans  *\/ 'Allerta', 'Anton', 'Arimo', 'Bevan', 'Buda', 'Cabin', 'Cantarell', 'Coda', 'Cuprum', 'Droid Sans', 'Geo', 'Josefin Sans', 'Lato', 'Lekton', 'Molengo', 'Nobile', 'Orbitron', 'PT Sans', 'Puritan', 'Raleway', 'Syncopate', 'Ubuntu', 'Yanone Kaffeesatz',\n                \/* fixed *\/ 'Anonymous Pro', 'Cousine', 'Droid Sans Mono', 'Inconsolata'\n            ];\n\n            \/\/  set\n            $R.availableGoogleFonts = {};\n            for (var i=0, ii=__google_fonts_array.length; i<ii; i++){ $R.availableGoogleFonts[__google_fonts_array[i]] = 1; } })(); \/\/ google fonts } \/\/ default options { \/\/ ================= $R.defaultOptions = { 'text_font': $R.encode('\"PT Serif\"'), 'text_font_header': $R.encode('\"PT Serif\"'), 'text_font_monospace': $R.encode('Inconsolata'), 'text_size': $R.encode('16px'), 'text_line_height': $R.encode('1.5em'), 'box_width': $R.encode('36em'), 'color_background': $R.encode('#f3f2ee'), 'color_text': $R.encode('#1f0909'), 'color_links': $R.encode('#065588'), 'text_align': $R.encode('normal'), \/* normal, justified *\/ 'base': $R.encode('base__newsprint'), \/* base__ newsprint, notable, night_owl *\/ 'footnote_links': $R.encode('on_print'), \/* on_print, always, never *\/ 'large_graphics': $R.encode('do_nothing'), \/* do_nothing, hide_on_print, hide_always *\/ 'custom_css': ('') }; \/\/ default options } \/\/ get css from options { \/\/ ====================== $R.getCSSFromOptions = function (_options) { var _cssText = ('' + '#body { ' + 'font-family: [=text_font]; ' + 'font-size: [=text_size]; ' + 'line-height: [=text_line_height]; ' + 'color: [=color_text]; ' + 'text-align: '+(_options['text_align'] == 'justified' ? 'justify' : 'left')+'; ' + '} ' + '#background { background-color: [=color_background]; } ' + '.setTextColorAsBackgroundColor { background-color: [=color_text]; } ' + '.setBackgroundColorAsTextColor { color: [=color_background]; } ' + '#box, .setBoxWidth { width: [=box_width]; } ' + 'a { color: [=color_links]; } ' + 'a:visited { color: [=color_text]; } ' + '@media print { body.footnote_links__on_print a, body.footnote_links__on_print a:hover { color: [=color_text] !important; text-decoration: none !important; } } ' + 'body.footnote_links__always a, body.footnote_links__always a:hover { color: [=color_text] !important; text-decoration: none !important; } ' + 'img { border-color: [=color_text]; } ' + 'a img { border-color: [=color_links]; } ' + 'a:visited img { border-color: [=color_text]; } ' + 'h1 a, h2 a, a h1, a h2 { color: [=color_text]; } ' + 'h1, h2, h3, h4, h5, h6 { font-family: [=text_font_header]; } ' + 'pre { background-color: [=color_background]; } ' + 'pre, code { font-family: [=text_font_monospace]; } ' + 'hr { border-color: [=color_text]; } ' + 'html.rtl #body #text { text-align: ' + (_options['text_align'] == 'justified' ? 'justify' : 'right')+' !important; } ' + 'h1, h2, h3, h4, h5, h6 { text-align: left; } ' + 'html.rtl h1, html.rtl h2, html.rtl h3, html.rtl h4, html.rtl h5, html.rtl h6 { text-align: right !important; } ' + '[=custom_css] ' ).replace( \/\\[=([a-z_]+?)\\]\/gi, function (_match, _key) { return _options[_key]; } ); return _cssText; } \/\/ get css from options } \/\/ apply options { \/\/ =============== \/\/ var \/\/ === \/\/ _encodedOptions and _decodeOptions hold the options to be applied \/\/ $R.appliedOptions holds the options currently applied (encoded) \/\/ $R.loadedGoogleFonts holds the currently loaded Google fonts URLs $R.appliedOptions = {}; $R.loadedGoogleFonts = {}; \/\/ apply options \/\/ ============= $R.applyOptions = function (_encodedOptions) { \/\/ possible options \/\/ ================= var _possible_options = $R.defaultOptions; \/\/ our themes \/\/ ========== var _ourOwnThemes = '|theme-1|theme-2|theme-3|'; \/\/ null \/\/ ==== if (_encodedOptions); else { _encodedOptions = {}; } \/\/ blank, invalid \/\/ ============== for (var _option in _possible_options) { switch (true) { case (!(_option in _encodedOptions)): case (!(_encodedOptions[_option] > '')):\n                                \/\/  either current, or default\n                                _encodedOptions[_option] = ($R.appliedOptions[_option] ? $R.appliedOptions[_option] : _possible_options[_option]);\n                                break;\n                        }\n                    }\n\n                \/\/\twhat to do\n                \/\/\t==========\n\n                    var \n                        _resetBase = false,\n                        _resetOptions = false, \n                        _decodedOptions = {}\n                    ;\n\n                \/\/  set stuff\n                \/\/  =========\n\n                    \/\/\t_resetBase\n                    switch (true)\n                    {\n                        case (!('base' in  $R.appliedOptions)):\n                        case (!(_encodedOptions['base'] == $R.appliedOptions['base'])):\n                            _resetBase = true;\n                            break;\n                    }\n\n                    \/\/\t_resetOptions\n                    for (var _option in _possible_options)\n                    {\n                        switch (true)\n                        {\n                            case (!(_option in $R.appliedOptions)):\n                            case (!(_encodedOptions[_option] == $R.appliedOptions[_option])):\n                                _resetOptions = true;\n                                break;\n                        }\n\n                        \/\/\tstop\n                        if (_resetOptions) { break; }\n                    }\t\n\n                    \/\/\tappliedOptions and optionsToApply\n                    for (var _option in _possible_options)\n                    {\n                        $R.appliedOptions[_option] = _encodedOptions[_option];\n                        _decodedOptions[_option] = $R.decode(_encodedOptions[_option]);\n                    }\n\n                \/\/\tapply stuff\n                \/\/\t===========\n\n                    \/\/  base\n                    if (_resetBase)\n                    {\n                        \/\/\tremove old\n                        $R.$iframeDocument.find('#baseCSS').remove();\n\n                        \/\/\tadd new\n                        if (_decodedOptions['base'] > '')\n                        {\n                            $R.$iframeDocument.find('head').append(''\n                                + '\t\n\t<link id=\"baseCSS\" href=\"' + $R.settings.cssPath + _decodedOptions['base']+'.css' + '\" rel=\"stylesheet\" type=\"text\/css\" \/>'\n                            );\n                        }\n                    }\n\n                    \/\/\toptions\n                    if (_resetOptions)\n                    {\n                        var _cssText = $R.getCSSFromOptions(_decodedOptions);\n\n                        \/\/\tremove old\n                        \/\/\t==========\n                            $R.$iframeDocument.find('#optionsCSS').remove();\n\n                        \/\/\tnew\n                        \/\/\t===\n                            var _cssElement = document.createElement('style');\n                                _cssElement.setAttribute('type', 'text\/css');\n                                _cssElement.setAttribute('id', 'optionsCSS');\n\n                            if (_cssElement.styleSheet) { _cssElement.styleSheet.cssText = _cssText; }\n                                else { _cssElement.appendChild(document.createTextNode(_cssText)); }\n\n                            $R.$iframeDocument.find('head').append(_cssElement);\n\n                        \/\/\tbody classes\n                        \/\/\t============\n                            $R.$iframeDocument.find('body')\n                                .removeClass('footnote_links__on_print footnote_links__always footnote_links__never')\n                                .removeClass('large_graphics__do_nothing large_graphics__hide_on_print large_graphics__hide_always')\n                                .addClass('footnote_links__'+_decodedOptions['footnote_links'])\n                                .addClass('large_graphics__'+_decodedOptions['large_graphics'])\n                            ;\n                    }\t\n            };\n\n    \/\/  apply options }\n\n    \/\/  apply google fonts  {\n    \/\/  =====================\n\n        $R.getGoogleFontsFromOptions = function (_options)\n        {\n            var \n                _fonts = {},\n                _fonts_urls = [],\n                _check_font = function (_match, _font) {\n                    if (_font in $R.availableGoogleFonts) { _fonts[_font] = 1; }\n                }\n            ;\n\n            \/\/\tbody\n            \/\/\t====\n                _options['text_font'].replace(\/\"([^\",]+)\"\/gi, _check_font);\n                _options['text_font'].replace(\/([^\",\\s]+)\/gi, _check_font);\t\t\t\t\n\n            \/\/\theaders\n            \/\/\t=======\n                _options['text_font_header'].replace(\/\"([^\",]+)\"\/gi, _check_font);\n                _options['text_font_header'].replace(\/([^\",\\s]+)\/gi, _check_font);\t\t\t\t\n\n            \/\/\tmonospace\n            \/\/\t=========\n                _options['text_font_monospace'].replace(\/\"([^\",]+)\"\/gi, _check_font);\n                _options['text_font_monospace'].replace(\/([^\",\\s]+)\/gi, _check_font);\t\t\t\t\n\n            \/\/\tcustom css\n            \/\/\t==========\n                _options['custom_css'].replace(\/font-family: \"([^\",]+)\"\/gi, _check_font);\n                _options['custom_css'].replace(\/font-family: ([^\",\\s]+)\/gi, _check_font);\n\n            \/\/\treturn\n            \/\/\t======\n\n                \/\/\ttransform to array\n                for (var _font in _fonts)\n                {\n                    _fonts_urls.push(''\n                        + 'http:\/\/fonts.googleapis.com\/css?family='\n                        + _font.replace(\/\\s+\/g, '+')\n                        + ':regular,bold,italic'\n                    );\n                }\n\n                \/\/\treturn\n                return _fonts_urls;\n        };\n\n        $R.loadGoogleFontsRequiredByAppliedOptions = function ()\n        {\n            \/\/  decode options\n            var _decodedOptions = {};\n            for (var _option in $R.appliedOptions)\n                { _decodedOptions[_option] = $R.decode($R.appliedOptions[_option]); }\n\n            \/\/\tget\n            var _fonts_urls = $R.getGoogleFontsFromOptions(_decodedOptions);\n\n            \/\/\tapply\n            for (var i=0,_i=_fonts_urls.length; i<_i; i++) {\n                \/* loaded *\/    if ($R.loadedGoogleFonts[_fonts_urls[i]]) { continue; }\n                \/* load *\/      $R.$iframeDocument.find('head').append('\t\n\t<link href=\"'+_fonts_urls[i]+'\" rel=\"stylesheet\" type=\"text\/css\" \/>');\n                \/* mark *\/      $R.loadedGoogleFonts[_fonts_urls[i]] = 1;\n            }\n        };\n\n    \/\/  apply google fonts }\n\n    \/\/  create frame {\n    \/\/  ==============\n\n        $R.createFrame = function ()\n        {\n            \/\/  default id\n            \/\/  ==========\n                _frame_id = $R.settings.onCreateFrameUseThisId;\n\n            \/\/\tiframe\n            \/\/\t======\n                var\n                    _iframeElement = $R.document.createElement('div'),\n                    _iframeHTML = ''\n                    +\t'\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"html\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                    +\t    '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"body\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                    +\t    \t'\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"bodyContent\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n\n                    +\t            '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"box\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                    +\t    \t        '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"box_inner\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                    +\t    \t\t        '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"text\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                    +\t    \t\t\t        '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"pages\"><\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t    \t\t\t        '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<ol id=\"footnotedLinks\"><\/ol>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t    \t\t        '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t    \t        '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t            '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t            '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"background\"><\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +           '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t    '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    +\t'\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                ;\n                _iframeElement.setAttribute('id', _frame_id);\n\n            \/\/\tcss\n            \/\/\t===\n\n                if ($R.settings.onCreateFrameDoNotInsertCSS); else\n                {\n                    var \n                        _cssElement = $R.document.createElement('style'),\n                        _cssText = ''\n                        +\t'#'+_frame_id+' { '\n                        +\t\t'margin: 0; padding: 0; border: none; '\n                        +\t\t'position: absolute; '\n                        +\t\t'width: 10px; height: 10px; '\n                        +\t\t'top: -100px; left: -100px; '\n                        +\t'} '\n                    ;\n                    _cssElement.setAttribute('id', _frame_id + '__css');\n                    _cssElement.setAttribute('type', 'text\/css');\n                    if (_cssElement.styleSheet) { _cssElement.styleSheet.cssText = _cssText; }\n                        else { _cssElement.appendChild($R.document.createTextNode(_cssText)); }\n                }\n\n            \/\/\twrite\n            \/\/\t=====\n\n                var _body = $R.document.getElementsByTagName('body')[0];\n                    \/* css *\/   if (_cssElement) { _body.appendChild(_cssElement); }\n                    \/* frame *\/ _body.appendChild(_iframeElement);\n\n                var _iframe = $R.document.getElementById(_frame_id);\n                var _doc;\n                _iframe.innerHTML = _iframeHTML;\n\n            \/\/  callback &#038; variables\n            \/\/  ====================\n                var _check_interval = false;\n                var _check = function ()\n                {\n                    \/\/  iframe\n                        var _iframe = $R.document.getElementById(_frame_id);\n                        if (_iframe); else { return; }\n\n                    \/\/  body\n                        var _body = $CJ(_iframe).find('#bodyContent')[0];\n\n                        if (_body); else { return; }\n\n                    \/\/  clear interval\n                        $R.window.clearInterval(_check_interval);\n\n                    \/\/  global vars\n                        $R.iframe = _iframe;\n                        $R.$iframe = $CJ($R.iframe);\n\n                        $R.iframeDocument = _iframe;\n                        $R.$iframeDocument = $CJ($R.iframeDocument);\n\n                        $R.iframeWindow = _iframe;\n                        $R.$iframeWindow = $CJ($R.iframeWindow);\n\n                        $R.$iframeBox = $R.$iframeDocument.find('#box');\n                        $R.$iframePages = $R.$iframeDocument.find('#pages');\n                        $R.$iframeBackground = $R.$iframeDocument.find('#background');\n                        $R.$iframeFootnotedLinks = $R.$iframeDocument.find('#footnotedLinks');\n\n                    \/\/  callback\n                        if ($R.callbacks.frameCreated) { $R.callbacks.frameCreated(); }\n                };\n\n                \/\/  set interval\n                _check_interval = $R.window.setInterval(_check, 250);\n        };\n\n    \/\/  create frame }\n\n    \/\/  add page {\n    \/\/  ==========\n\n        $R.addNewPage = function (_pageHTML, _pageURL)\n        {\n            \/\/  update page count\n            \/\/  =================\n                var _pageNr = $R.pagesCount + 1;\n                $R.pagesCount++;\n\n            \/\/\tseparator\n            \/\/\t=========\n                if (_pageNr > 1)\n                {\n                    $R.$iframePages.append(''\n                        + '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"pageSeparator\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                        +\t'\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"pageSeparatorLine setTextColorAsBackgroundColor\"><\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                        + \t'\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"pageSeparatorLabel\"><em>'+$R.settings.pageLabel+_pageNr+'<\/em><\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                        + '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    );\n                }\n\n            \/\/\tappend page\n            \/\/\t===========\n                $R.$iframePages.append(''\n                    + '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"page\" id=\"page'+_pageNr+'\">\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n                    +     '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div class=\"page_content\">'\n                    + \t      _pageHTML\n                    +     '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                    + '\n<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n'\n                );\n\n            \/\/  this new page\n            \/\/  =============\n\n                \/\/  cache\n                var _$page = $R.$iframeDocument.find('#page'+_pageNr);\n\n                \/\/\tlinks as footnotes\n                _$page.find('a').each(function (_index, _element)\n                {\n                    \/\/\tcheck\n                    var _href = _element.href;\n                    if (_href > ''); else { return; }\n                    if (_href.indexOf); else { return; }\n                    if (_href.indexOf('#') > -1) { return; }\n\n                    \/\/\tcount\n                    var _nr = ++$R.footnotedLinksCount;\n\n                    \/\/\tadd\n                    $CJ(_element).append(' <sup class=\"readableLinkFootnote\">['+_nr+']<\/sup>');\n                    $R.$iframeFootnotedLinks.append('\n\n\t<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<li>'+_href+'<\/li>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n');\n                });\n        };\n\n    \/\/  add page }\n\n    \/\/  clear all pages {\n    \/\/  =================\n\n        $R.clearAllPages = function ()\n        {\n            \/\/  reset pages count\n            $R.pagesCount = 0;\n\n            \/\/  delete all pages\n            $R.$iframePages.get(0).innerHTML = '';\n\n            \/\/  reset footnote count\n            $R.footnotedLinksCount = 0;\n\n            \/\/  delete all footnotes\n            $R.$iframeFootnotedLinks.get(0).innerHTML = '';\n        };\n\n    \/\/  clear all pages }\n\n    \/\/  return self\n    \/\/  ===========\n        return $R;\n}\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClearlyController = { _created : false, _visible : false, _logEnabled : false, _detectResult : null, logger : function(text) { if (!this._logEnabled) return; console.log('[Clearly] : ' + text); }, getSimplifiedArticle : function() { this.logger('getSimplifiedArticle()'); return Evernote.JQuery('#evernoteClearlyArticle #box #text').get(0); }, changeFrameClassTo : function(className) { this.clearlyFrame[0].className = ''; this.clearlyFrame.addClass(className); }, hide : function() { this.logger('hide()'); var self = this; if (this._created &#038;&#038; this._visible) { this.clearlyBackground.stop(); this.changeFrameClassTo('processing'); this.clearlyBackground.animate({right:'100%'}, 500, null, function() { self.changeFrameClassTo('temphidden'); window.focus(); } ); this._visible = false; } }, show : function() { this.logger('show()'); var self = this; if (this._created &#038;&#038; !this._visible) { this.clearlyBackground.stop(); this.changeFrameClassTo('processing'); this.clearlyBackground.animate({ right: \"0px\" }, 500, null, function() { self.changeFrameClassTo('visible'); window.focus(); } ); this._visible = true; } }, detectComponent : function(callback) { this.logger('detectComponent()'); window.ClearlyComponent__detect = { callbacks: { finished: function(data) { if (callback) callback(data); } }, window: window, document: document, jQuery: Evernote.JQuery }; window.ClearlyComponent__detect = initClearlyComponent__detect(window.ClearlyComponent__detect); window.ClearlyComponent__detect.start(); }, reformatComponent : function(callback){ this.logger('reformatComponent()'); window.ClearlyComponent__reformat = { callbacks: { frameCreated: function(data) { if (callback) callback(data); } }, settings: { cssPath: 'css\/clearly', pageLabel: \"page \", onCreateFrameUseThisId: \"evernoteClearlyArticle\", onCreateFrameDoNotInsertCSS: true }, window: window, document: document, jQuery: Evernote.JQuery }; window.ClearlyComponent__reformat = initClearlyComponent__reformat(window.ClearlyComponent__reformat); window.ClearlyComponent__reformat.createFrame(); }, getContentElementAndHTML : function (callback) { this.logger('getContentElementAndHTML()'); this.detectComponent(callback); }, getClearlyArticleText : function(callback) { this.logger('getClearlyArticleText()'); this.detectComponent(callback); }, assignClearlyArticleContent : function() { this.logger('showClearlyArticleContent()'); window.ClearlyComponent__reformat.$iframeBox.find('#text #pages')[0].innerHTML = this._detectResult; }, setContainersSize : function() { var maxHeight = Math.max(document.body.scrollHeight, this.clearlyFrame.scrollHeight); try { \/\/old ie throws error this.clearlyFrame[0].style.height = maxHeight + \"px\"; } catch (e) { } }, startClearly : function() { this.logger('startClearly()'); var self = this; if (this._created) { self.show(); return; } function onDetectEnd(data) { self._detectResult = data._html.replace(\/(id|class)=\"(.*?)\"\/ig,'cid=\"$2\"'); self.assignClearlyArticleContent(); self.show(); } function onFrameCreated() { self.clearlyFrame = window.ClearlyComponent__reformat.$iframe; self.clearlyBackground = window.ClearlyComponent__reformat.$iframeBackground; self._created = true; self.setContainersSize(); self.detectComponent(onDetectEnd); } window.scrollTo(0,0); this.reformatComponent(onFrameCreated); }, isReady : function() { return this._created; }, isVisible : function() { return this._visible; }, highlight : function () { this.logger('highlight()'); var numTextHighlights; window.ClearlyComponent__highlight = { callbacks: { highlightAdded: function() { numTextHighlights++; }, highlightDeleted: function() { numTextHighlights--; } }, settings: { imgPath: \"images\/\" }, window: window, document: document, jQuery: Evernote.JQuery }; window.ClearlyComponent__highlight = initClearlyComponent__highlight(window.ClearlyComponent__highlight); window.ClearlyComponent__highlight.insertCSS(); window.ClearlyComponent__highlight.addMouseHandlers(); window.ClearlyComponent__highlight.enable(); }, disableHighlight : function() { this.logger('disableHighlight()'); if (window.ClearlyComponent__highlight) { window.ClearlyComponent__highlight.disable(); } }, removeHighlighted : function() { this.logger('removeHighlighed()'); \/\/ Evernote.JQuery('.clearly_highlight_delete_element').click(); } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/** * SelectionFinder provides mechanism for finding selection on the page via * find(). It is able to traverse frames in order to find a selection. It will * report whether there's a selection via hasSelection(). After doing find(), * the selection is stored in the selection property, and the document property * will contain the document in which the selection was found. Find method will * only recurse documents if it was invoked as find(true), specifying to do * recursive search. You can use reset() to undo find(). *\/ Evernote.SelectionFinder = function SelectionFinder( doc ) { this._document = doc; }; Evernote.SelectionFinder.prototype._document = null; Evernote.SelectionFinder.prototype._selection = null; Evernote.SelectionFinder.prototype.hasSelection = function() { Evernote.Logger.debug( \"SelectionFinder.hasSelection()\" ); var range = Evernote.Utils.fixIERangeObject(this.getRange()); return range &#038;&#038; (range.startContainer != range.endContainer || (range.startContainer == range.endContainer &#038;&#038; range.startOffset != range.endOffset)); }; Evernote.SelectionFinder.prototype.find = function( deep ) { Evernote.Logger.debug( \"SelectionFinder.find()\" ); var result = this.findSelectionInDocument( this._document, deep ); this._document = result.document; this._selection = result.selection; }; Evernote.SelectionFinder.prototype.getRange = function() { Evernote.Logger.debug( \"SelectionFinder.getRange()\" ); if ( !this._selection || this._selection.rangeCount == 0 ) { return null; } if ( typeof this._selection.getRangeAt == 'function' ) { return this._selection.getRangeAt( 0 ); } if ( (window.Range &#038;&#038; this._selection instanceof window.Range) || !this._selection.anchorNode ) { return this._selection; } var range = this._document.createRange(); range.setStart( this._selection.anchorNode, this._selection.anchorOffset ); range.setEnd( this._selection.focusNode, this._selection.focusOffset ); return range; }; Evernote.SelectionFinder.prototype.findSelectionInDocument = function( doc, deep ) { try { Evernote.Logger.debug( \"SelectionFinder.findSelectionInDocument()\" ); var sel = null; var hasSelection = false; var win = null; try { win = (doc.defaultView) ? doc.defaultView : window; } catch ( e ) { win = window; } if ( typeof win.getSelection == 'function' ) { sel = win.getSelection(); if ( sel &#038;&#038; typeof sel.rangeCount != 'undefined' &#038;&#038; sel.rangeCount > 0 ) {\n                Evernote.Logger.debug(\"Found selection by win.getSelection()\");\n                hasSelection = true;\n            }\n        }\n        else if ( win.selection &#038;&#038; typeof win.selection.createRange == 'function' ) {\n            sel = win.selection.createRange();\n            if ( win.selection.type == 'Text' &#038;&#038; typeof sel.htmlText == 'string' &#038;&#038; sel.htmlText.length > 0 ) {\n                Evernote.Logger.debug(\"Found selection by win.selection\");\n                hasSelection = true;\n            }\n        }\n        else if ( doc.selection &#038;&#038; (typeof doc.selection.createRange == 'function' || typeof doc.selection.createRange == 'object') ) {\n            sel = doc.selection.createRange();\n            if(doc.selection.type == \"None\")\n                sel = undefined;\n            if ( (doc.selection.type == 'Text') &#038;&#038; (typeof sel.htmlText == 'string') &#038;&#038; (sel.htmlText.length > 0) ) {\n                Evernote.Logger.debug(\"Found selection by doc.selection\");\n                hasSelection = true;\n            }\n        }\n\n        if ( sel &#038;&#038; !hasSelection &#038;&#038; deep ) {\n            var nestedDocs = Evernote.Utils.getNestedDocuments( doc );\n            for ( var i = 0; i < nestedDocs.length; ++i ) { if ( nestedDocs[ i ] ) { var framedSel = this.findSelectionInDocument( nestedDocs[ i ], deep ); if ( framedSel &#038;&#038; framedSel.selection &#038;&#038; framedSel.selection.rangeCount > 0 ) {\n                        return framedSel;\n                    }\n                }\n            }\n        }\n\n        \/\/if do not find any selection in document, try to find selection in HTMLTextArea|Input.\n        \/\/Get Selection object for TextArea, and set selection as a Range object\n        if(doc.activeElement)\n            Evernote.Logger.debug( \"Check selection in INPUT TEXT area (input, textarea), for active element :\" + doc.activeElement.nodeName );\n\n        var activeEl = doc.activeElement &#038;& false; \/\/ disabled, because no need to search selections in this elements.\n        if ( activeEl &#038;&#038; ( (window.HTMLInputElement &#038;&#038; (activeEl instanceof window.HTMLInputElement &#038;&#038; activeEl.type == \"text\")) || ( window.HTMLTextAreaElement &#038;&#038; (activeEl instanceof window.HTMLTextAreaElement)) ) ) {\n            if ( activeEl.selectionStart != activeEl.selectionEnd ) {\n                var range = doc.createRange();\n                var textNode = doc.createTextNode( activeEl.value );\n\n                range.setStart( textNode, activeEl.selectionStart );\n                range.setEnd( textNode, activeEl.selectionEnd );\n                sel = range;\n            }\n        }\n\n        return {\n            document : doc,\n            selection : sel\n        };\n    } catch(e) {\n        Evernote.Logger.error(\"Failed to find selection on the page due to error \" + e);\n        \/\/Do not throw exception here, it is better to not show error to user and allow to clip article or something else.\n    }\n    return {\n        document: doc,\n        selection: null\n    }\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.JSSerializer = {\n\n    _selectionFinder : new Evernote.SelectionFinder(window.document),\n\n    serializeAsync : function( element, fullPage, callback ) {\n        try {\n            var start = new Date().getTime();\n            var root = element || document.body.parentNode || document.body;\n            var serializer = new Evernote.NodeSerializer( window, new Evernote.ClipFullStylingStrategy() );\n            var parser = new Evernote.DomParser( window, null );\n\n            var resultFunc = function() {\n                var images = [];\n                var imageUrls = serializer.getImagesUrls();\n\n                for(var i = 0; i < imageUrls.length; i++) {\n                    images.push(Evernote.Utils.makeAbsolutePath(serializer.getDocumentBase(), imageUrls[i]).replace(\/\\s\/g, \"%20\"));\n                }\n                callback( {\n                    content : serializer.getSerializedDom(),\n                    imageUrls : images,\n                    docBase : serializer.getDocumentBase()\n                    });\n            };\n            parser.parseAsync( root, fullPage ? true: false, serializer, resultFunc);\n            var end = new Date().getTime();\n            Evernote.Logger.debug( \"Clip.clipFullPage(): clipped body in \" + (end - start) + \" milliseconds\" );\n        }\n        catch ( e ) {\n            Evernote.Logger.error( \"JSSerializer.serialize() failed: error = \" + e );\n            throw e;\n        }\n    },\n\n    serialize : function( element, fullPage ) {\n        try {\n            var start = new Date().getTime();\n            var root = element || document.body.parentNode || document.body;\n            var serializer = new Evernote.NodeSerializer( window, new Evernote.ClipFullStylingStrategy() );\n            var parser = new Evernote.DomParser( window, null );\n            parser.parse( root, fullPage ? true: false, serializer);\n            var end = new Date().getTime();\n            Evernote.Logger.debug( \"Clip.clipFullPage(): clipped body in \" + (end - start) + \" milliseconds\" );\n            var images = [];\n            var imageUrls = serializer.getImagesUrls();\n\n            for(var i = 0; i < imageUrls.length; i++) {\n                images.push(Evernote.Utils.makeAbsolutePath(serializer.getDocumentBase(), imageUrls[i]).replace(\/\\s\/g, \"%20\"));\n            }\n            return {\n                content : serializer.getSerializedDom(),\n                imageUrls : images,\n                docBase : serializer.getDocumentBase()\n            }\n        }\n        catch ( e ) {\n            Evernote.Logger.error( \"JSSerializer.serialize() failed: error = \" + e );\n            throw e;\n        }\n    },\n\n    serializeSelectionAsync : function( range, callback ) {\n\n        try {\n            if( !range ) {\n                if ( !this.hasSelection() ) {\n                    Evernote.Logger.warn( \"JSSerializer.serializeSelection(): no selection to clip\" );\n                    callback();\n                    return;\n                }\n\n                range = Evernote.Utils.fixIERangeObject(this._selectionFinder.getRange());\n\n                if ( !range ) {\n                    Evernote.Logger.warn( \"JSSerializer.serializeSelection(): no range in selection\" );\n                    callback();\n                    return;\n                }\n            }\n\n            var start = new Date().getTime();\n            var ancestor = (this._styleStrategy &#038;&#038; Evernote.Utils.Selection.getCommonAncestorContainer(range).nodeType == Evernote.Node.TEXT_NODE\n                &#038;&#038; Evernote.Utils.Selection.getCommonAncestorContainer(range).parentNode) ? Evernote.Utils.Selection.getCommonAncestorContainer(range).parentNode : Evernote.Utils.Selection.getCommonAncestorContainer(range);\n\n            while ( typeof Evernote.ClipRules.NON_ANCESTOR_NODES[ ancestor.nodeName.toUpperCase() ] != 'undefined' &#038;&#038; ancestor.parentNode ) {\n                if ( ancestor.nodeName.toUpperCase() == \"BODY\" ) {\n                    break;\n                }\n                ancestor = ancestor.parentNode;\n            }\n\n            var serializer = new Evernote.NodeSerializer( window, new Evernote.ClipFullStylingStrategy(), null, true );\n            var parser = new Evernote.DomParser(window, Evernote.Utils.fixIERangeObject(range));\n\n            var resultFunc = function() {\n                var images = [];\n                var imageUrls = serializer.getImagesUrls();\n\n                for(var i = 0; i < imageUrls.length; i++) {\n                    images.push(Evernote.Utils.makeAbsolutePath(serializer.getDocumentBase(), imageUrls[i]).replace(\/\\s\/g, \"%20\"));\n                }\n\n                callback( {\n                    content : serializer.getSerializedDom(),\n                    imageUrls : images,\n                    docBase : serializer.getDocumentBase()\n                } );\n            };\n            parser.parseAsync( ancestor, false, serializer, resultFunc );\n            var end = new Date().getTime();\n            Evernote.Logger.debug( \"JSSerializer.serializeSelection(): clipped selection in \" + (end - start) + \" milliseconds\" );\n        }\n        catch ( e ) {\n            Evernote.Logger.error( \"JSSerializer.serializeSelection() failed: error = \" + e );\n            throw e;\n        }\n    },\n\n    serializeSelection : function( range ) {\n        try {\n            if( !range ) {\n                if ( !this.hasSelection() ) {\n                    Evernote.Logger.warn( \"JSSerializer.serializeSelection(): no selection to clip\" );\n                    return;\n                }\n\n                range = Evernote.Utils.fixIERangeObject(this._selectionFinder.getRange());\n\n                if ( !range ) {\n                    Evernote.Logger.warn( \"JSSerializer.serializeSelection(): no range in selection\" );\n                    return;\n                }\n            }\n\n            var start = new Date().getTime();\n            var ancestor = (this._styleStrategy &#038;&#038; Evernote.Utils.Selection.getCommonAncestorContainer(range).nodeType == Evernote.Node.TEXT_NODE\n                &#038;&#038; Evernote.Utils.Selection.getCommonAncestorContainer(range).parentNode) ? Evernote.Utils.Selection.getCommonAncestorContainer(range).parentNode : Evernote.Utils.Selection.getCommonAncestorContainer(range);\n\n            while ( typeof Evernote.ClipRules.NON_ANCESTOR_NODES[ ancestor.nodeName.toUpperCase() ] != 'undefined' &#038;&#038; ancestor.parentNode ) {\n                if ( ancestor.nodeName.toUpperCase() == \"BODY\" ) {\n                    break;\n                }\n                ancestor = ancestor.parentNode;\n            }\n\n            var serializer = new Evernote.NodeSerializer( window, new Evernote.ClipFullStylingStrategy() );\n            var parser = new Evernote.DomParser(window, Evernote.Utils.fixIERangeObject(range));\n            parser.parse( ancestor, false, serializer );\n\n            var end = new Date().getTime();\n            Evernote.Logger.debug( \"JSSerializer.serializeSelection(): clipped selection in \" + (end - start) + \" milliseconds\" );\n            var images = [];\n            var imageUrls = serializer.getImagesUrls();\n\n            for(var i = 0; i < imageUrls.length; i++) { images.push(Evernote.Utils.makeAbsolutePath(serializer.getDocumentBase(), imageUrls[i]).replace(\/\\s\/g, \"%20\")); } return { content : serializer.getSerializedDom(), imageUrls : images, docBase : serializer.getDocumentBase() } } catch ( e ) { Evernote.Logger.error( \"JSSerializer.serializeSelection() failed: error = \" + e ); throw e; } }, hasSelection : function() { Evernote.Logger.debug( \"Clip.hasSelection()\" ); if ( this._selectionFinder.hasSelection() ) { return true; } else { this._selectionFinder.find( true ); return this._selectionFinder.hasSelection(); } } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/** * Represents JQuery loader that allow to have two versions of JQuery loaded on the same page * @type {Object} *\/ Evernote.JQueryLoader = { \/** * Initializes jquery instance on global Evernote context *\/ initJQuery : function() { if (!Evernote.JQuery) { Evernote.JQuery = $.noConflict(true); } } }; (function () { if (!Evernote.JQuery) { Evernote.JQuery = $.noConflict(true); } }()); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClipNotificator = function ClipNotificator() { }; \/\/ TODO: clip notificator is obsolete now. Remove it. Evernote.ClipNotificator.WAIT_CONTAINER_ID = \"evernoteContentClipperWait\"; Evernote.ClipNotificator.SHOW_WAIT_MIN_TIME = 2000; Evernote.ClipNotificator.prototype.showCopyNotification = function( doc, options, useAutoHide ) { Evernote.evernotePostClipPopup.fillOutPopup(options.title, options.notebookName); Evernote.evernotePostClipPopup.show(); try { var wait = this.getWaitContainer( doc, Evernote.Addin.getLocalizedMessage(Evernote.Messages.CLIPPING) ); wait.style.display = \"none\"; this.centerBox(wait); if ( doc.body ) { doc.body.appendChild( wait ); } if (useAutoHide) { var self = this; var timeout = this.constructor.SHOW_WAIT_MIN_TIME; setTimeout( function() { self.clearWait( doc ); }, timeout ); } } catch ( e ) { Evernote.Logger.error( \"ClipNotificator.showCopyNotification() failed: error = \" + e ); } }; Evernote.ClipNotificator.prototype.centerBox = function( container ) { \/\/ TODO: for what? It can be done with css. var topPosition = ((document.documentElement.scrollTop || document.body.scrollTop) + ((((document.documentElement.clientHeight || document.body.clientHeight) + (!container.offsetHeight &#038;&#038; 0)) \/ 2) >> 0));\n    var leftPosition = (((document.documentElement.clientWidth || document.body.clientWidth) \/ 2) - (container.offsetWidth \/ 2));\n    container.style.position = \"absolute\";\n    container.style.top = (topPosition-20) + \"px\";\n    container.style.left = (leftPosition - 90) + \"px\";\n};\n\nEvernote.ClipNotificator.prototype.getWaitContainer = function( doc, msg ) {\n    Evernote.Logger.debug( \"ClipNotificator.getWaitContainer()\" );\n\n    var container = doc.getElementById( this.constructor.WAIT_CONTAINER_ID );\n    if ( !container ) {\n        container = doc.createElement( \"evernotediv\" );\n        if(Evernote.Utils.isQuirkMode()) {\n            container.className = \"quirk-mode-container\";\n        }\n        container.id = this.constructor.WAIT_CONTAINER_ID;\n\n        var wait = doc.createElement( \"div\" );\n        wait.id = this.constructor.WAIT_CONTAINER_ID + \"Content\";\n        if(Evernote.BrowserDetection.isLessThanIE9()) {\n            wait.className = \"content-less-than-nine-container\";\n        }\n        container.appendChild( wait );\n\n        var center = doc.createElement( \"center\" );\n        wait.appendChild( center );\n\n        var spinner = doc.createElement( \"div\" );\n        spinner.id = \"evernote-spinner-container\";\n        center.appendChild( spinner );\n\n        var text = doc.createElement( \"span\" );\n        text.id = this.constructor.WAIT_CONTAINER_ID + \"Text\";\n        center.appendChild( text );\n\n        container._waitMsgBlock = text;\n        container._waitMsgBlock.appendChild( doc.createTextNode( msg ) );\n    }\n\n    return container;\n};\n\nEvernote.ClipNotificator.prototype.clearWait = function( doc, immediately ) {\n    Evernote.Logger.debug( \"ClipNotificator.clearWait()\" );\n\n    var wait = doc.getElementById( Evernote.ClipNotificator.WAIT_CONTAINER_ID );\n    if ( wait ) {\n        wait.style.opacity = \"0\";\n        if (immediately) {\n            wait.parentNode.removeChild( wait );\n        } else {\n            setTimeout( function() {\n                if ( wait.parentNode ) {\n                    wait.parentNode.removeChild( wait );\n                }\n            }, 300 );\n        }\n    }\n\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/**\n * Represents clipper object that is capable of clipping elements from pages or clip elements based on preferences.\n *\/\nEvernote.Clipper = {\n\n    _serializer : Evernote.JSSerializer,\n\n    _clipNotifier : new Evernote.ClipNotificator(),\n\n    _defaultOptions : {\n        title: PageContext.title,\n        tags: [],\n        comments: \"\",\n        notebookUid: -1,\n        notebookName : \"\"\n    },\n\n    \/**\n     * Clips article element (one that user selected or default if no selection was made).\n     *\/\n    clipArticle : function(options, clearly) {\n        var currentOptions = this.initOptions(options);\n        this._clipNotifier.showCopyNotification(document, currentOptions);\n        var self = this;\n        setTimeout(function() {\n            var article\n            if ( clearly ) {\n                article = Evernote.ClearlyController.getSimplifiedArticle();\n            } else {\n                article = Evernote.contentPreviewer.getArticleElement();\n            }\n            if(!article) {\n                article = Evernote.pageInfo.getDefaultArticle(function(article) {});\n            }\n            var resultFunc = function(serializedDom) {\n                self._clipNotifier.clearWait(document);\n                Evernote.Addin.clipNote(currentOptions.comments + serializedDom.content, currentOptions, PageContext.url, serializedDom.imageUrls, true, document);\n                Evernote.ClearlyController.hide();\n            };\n            self._serializer.serializeAsync(article, false, resultFunc);\n        }, 100);\n    },\n\n    initOptions: function(options) {\n        if(!options)\n            options = this._defaultOptions;\n        options = Evernote.JQuery.extend({}, this._defaultOptions, options);\n        if(!options.title || Evernote.JQuery.trim(options.title).length == 0)\n            options.title = Evernote.Addin.getLocalizedMessage(Evernote.Messages.UNTITLED_NOTE);\n        options.title = Evernote.JQuery.trim(Evernote.Utils.cutToLength(options.title, 255, \" \"));\n\n        \/* get notebook name *\/\n        var notebookUid = options.notebookUid || 0;\n        var notebook = Evernote.NotebooksLoader.getNotebookByUid(notebookUid);\n\n        if(!notebook) {\n            options.notebookName = Evernote.Addin.getLocalizedMessage(Evernote.Messages.DEFAULT_NOTEBOOK);\n        } else {\n            options.notebookName = notebook.name;\n        }\n\n        return options;\n    },\n\n    \/**\n     * Clips full page.\n     *\/\n    clipFullPage : function(options) {\n        Evernote.Logger.debug(\"Clipper: clipFullPage\");\n        var currentOptions = this.initOptions(options);\n        this._clipNotifier.showCopyNotification(document , currentOptions);\n        var self = this;\n        setTimeout(function() {\n            Evernote.Logger.debug(\"Start clipping of full page\");\n            var resultFunc = function(serializedDom) {\n                self._clipNotifier.clearWait(document);\n                Evernote.Logger.debug(\"Image urls \" + JSON.stringify(serializedDom.imageUrls));\n                Evernote.Logger.debug(\"Send clip to EN\");\n                Evernote.Addin.clipNote(currentOptions.comments + serializedDom.content, currentOptions, PageContext.url, serializedDom.imageUrls, true, document);\n            };\n            self._serializer.serializeAsync(null, true, resultFunc);\n        }, 100);\n    },\n\n    \/**\n     * Clips url with favicon (if favicon is recognized)\n     *\/\n    clipUrl : function(options) {\n        var currentOptions = this.initOptions(options);\n        this._clipNotifier.showCopyNotification(document, currentOptions, true);\n        var self = this;\n        setTimeout(function() {\n            var snippet = Evernote.contentPreviewer.getSnippetText();\n            if (snippet) {\n                snippet = snippet.replace(\/(<([^>]+)>)\/ig,\"\");\n                var content = Evernote.GlobalUtils.createUrlClipContent(PageContext.title, PageContext.url, PageContext.getFavIconUrl(), snippet);\n                Evernote.Addin.clipNote(currentOptions.comments + content, currentOptions, PageContext.url, PageContext.getFavIconUrl(), true, document);\n            }else {\n                self._clipNotifier.clearWait(document, true);\n                Evernote.ClearlyController.getClearlyArticleText( function (data) {\n                    snippet = data._html.replace(\/(<([^>]+)>)\/ig,\"\");\n                    var content = Evernote.GlobalUtils.createUrlClipContent(PageContext.title, PageContext.url, PageContext.getFavIconUrl(), snippet);\n                    Evernote.Addin.clipNote(currentOptions.comments + content, currentOptions, PageContext.url, PageContext.getFavIconUrl(), true, document);\n                });\n            }\n        }, 100);\n    },\n\n    \/**\n     * Clips selection from the page.\n     *\/\n    clipSelection : function( range, options ) {\n        var currentOptions = this.initOptions(options);\n        this._clipNotifier.showCopyNotification(document , currentOptions);\n        var self = this;\n        setTimeout(function() {\n            var resultFunc = function(serializedDom) {\n                self._clipNotifier.clearWait(document);\n                if(serializedDom) {\n                    Evernote.Addin.clipNote(currentOptions.comments + serializedDom.content, currentOptions, PageContext.url, serializedDom.imageUrls, true, document);\n                }\n            };\n            self._serializer.serializeSelectionAsync( range, resultFunc );\n        }, 100);\n    },\n\n    \/**\n     * Clips image from the page.\n     *\/\n    clipImage : function(options ) {\n        if (!options.imageElement) {\n            Evernote.Logger.debug(\"clipImage Empty element\");\n            return;\n        }\n        var currentOptions = this.initOptions(options);\n        this._clipNotifier.showCopyNotification(document , currentOptions);\n        var self = this;\n\n        var clojureBug = Evernote.BrowserDetection.isIE7();\n        var CUSTOM_ID = 'evn-image-for-clip';\n\n        if (clojureBug) {\n            \/\/ add attr to find this element later\t\t\t\n            Evernote.JQuery(document).find(options.imageElement).attr( CUSTOM_ID ,'true');\n        }\n\n        setTimeout(function() {\n            var elementToSerialize = options.imageElement;\n            if (clojureBug) {\n                var elem = Evernote.JQuery('*['+ CUSTOM_ID +']');\n                elementToSerialize = Evernote.JQuery('*['+ CUSTOM_ID +']')[0];\n                elem.removeAttr(CUSTOM_ID);\n            }\n            Evernote.Logger.debug(\"Start clipping of image\");\n            var resultFunc = function(serializedDom) {\n                self._clipNotifier.clearWait(document);\n                Evernote.Logger.debug(\"Image urls \" + JSON.stringify(serializedDom.imageUrls));\n                Evernote.Logger.debug(\"Send clip to EN\");\n                Evernote.Addin.clipNote(currentOptions.comments + serializedDom.content, currentOptions, PageContext.url, serializedDom.imageUrls, true, document);\n            };\n            self._serializer.serializeAsync(elementToSerialize, false, resultFunc);\n        }, 100);\n    },\n\n    \/**\n     * Clips part of the page, defined in option (url, article or full page) or selection if presented.\n     *\/\n    clipWithOptions : function(clipOptions) {\n\n        function getNotebook() {\n            return {uid : -1};\n        }\n\n        var notebookToClipTo = getNotebook();\n\n        var alwaysTags = [];\n        if (notebookToClipTo.type != Evernote.NotebookTypes.LINKED &#038;&#038; Evernote.Options.tags.alwaysEnable == true) {\n            alwaysTags = Evernote.Options.tags.alwaysData.split(',');\n        }\n\n        var options = {\n            notebookUid: notebookToClipTo.uid,\n            imageElement: EvernoteExternal.imageElement,\n            tags: alwaysTags\n        };\n\n        if(clipOptions.getClipAction() == Evernote.ClipperActions.CLIP_SELECTION &#038;&#038; Evernote.Utils.hasSelection(window)) {\n            Evernote.Clipper.clipSelection(null, options);\n        }\n\t\t else if(clipOptions.getClipAction() == Evernote.ClipperActions.CLIP_URL) {\n            Evernote.Clipper.clipUrl(options);\n        } else if(clipOptions.getClipAction() == Evernote.ClipperActions.CLIP_FULL_PAGE) {\n            Evernote.Clipper.clipFullPage(options);\n        } else if(clipOptions.getClipAction() == Evernote.ClipperActions.CLIP_IMAGE) {\n            Evernote.Clipper.clipImage(options);\n        } else {\n            Evernote.Logger.warn(\"Unknown option is specified : \" + clipOptions.getClipAction());\n        }\n    },\n\n    clipBase64Image : function(options, base64Image) {\n        var self = this;\n        var currentOptions = this.initOptions(options);\n        this._clipNotifier.showCopyNotification(document , currentOptions);\n        Evernote.Addin.clipImageAsync(options, function(result) {\n            EvernoteGlobalReceiver(result);\n        }, PageContext.url, base64Image);\n    }\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClipOptions = function ClipOptions(data) { this.clipAction = data.clipAction; }; Evernote.ClipOptions.prototype.getClipAction = function() { return this.clipAction; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nfunction ContentVeil() {\n\n    var veil = document.createElement(\"div\");\n    veil.id = \"evernoteContentVeil\";\n    var inner = document.createElement(\"div\");\n    inner.id = \"evernoteInnerBox\";\n\n    function fireClickUnderVeil(evt) {\n        veil.style.display = 'none';\n        var bottomElement = document.elementFromPoint(evt.clientX, evt.clientY);\n        veil.style.display = 'block';\n        bottomElement.click();\n    }\n\n    \/\/ make veil imperceptible for mouse clicks.\n    veil.attachEvent('onclick', fireClickUnderVeil);\n\n    var topExpandContract;\n    var bottomExpandContract;\n    for (var i = 0; i < 2; i++) {\n        var expand = document.createElement(\"span\");\n        var contract = document.createElement(\"span\");\n        expand.className = \"evernoteArticleExpand\";\n        contract.className = \"evernoteArticleContract\";\n\n\/\/        expand.setAttribute('tooltip', Evernote.Addin.getLocalizedMessage(Evernote.Messages.EXPAND));\n\/\/        expand.setAttribute('unselectable', 'on');\n\/\/        contract.setAttribute('tooltip',Evernote.Addin.getLocalizedMessage(Evernote.Messages.CONTRACT));\n\/\/        contract.setAttribute('unselectable','on');\n\n        expand.attachEvent(\"onclick\", function() {\n            Evernote.contentPreviewer.previewNudge('up');\n        });\n        contract.attachEvent(\"onclick\", function() {\n            Evernote.contentPreviewer.previewNudge('down');\n        });\n        if (i == 0) {\n            topExpandContract = document.createElement(\"div\");\n            topExpandContract.className = \"evernoteExpandContract evernoteUsingExpandContract\";\n            topExpandContract.appendChild(expand);\n            topExpandContract.appendChild(contract);\n        } else {\n            bottomExpandContract = document.createElement(\"div\");\n            bottomExpandContract.id = \"bottomExpandContract\";\n            bottomExpandContract.className = \"evernoteExpandContract\";\n            bottomExpandContract.appendChild(expand);\n            bottomExpandContract.appendChild(contract);\n        }\n    }\n\n    veil.appendChild(topExpandContract);\n    veil.appendChild(inner);\n    veil.appendChild(bottomExpandContract);\n\n    \/\/ We keep a record of what we're currently showing (at least in some cases) so that we can update it in case the\n    \/\/ state of the page changes (like if the user scrolls).\n    var currentlyShownRect = null;\n    var currentlyShownElt = null;\n    var currentRectOffsetTop = 0;\n    var currentRectOffsetLeft = 0;\n    var currentlyStatic = false;\n    var currentlyShadowBox = false;\n\n    function reset(doNotResetPageCount) {\n        currentlyShownRect = null;\n        currentlyShownElt = null;\n        currentRectOffsetTop = 0;\n        currentRectOffsetLeft = 0;\n        currentlyShadowBox = false;\n\n        inner.className = inner.className.replace(\/\\s*evernoteShadowBox\/g, \"\");\n        veil.className = inner.className.replace(\/\\s*evernoteShadowBox\/g, \"\");\n\n        if (!doNotResetPageCount) {\n\/\/            setPageCount();\n        }\n\n        topExpandContract.className = topExpandContract.className.replace(\/\\s*evernoteUsingExpandContract\/g, \"\");\n        bottomExpandContract.className = bottomExpandContract.className.replace(\/s*evernoteUsingExpandContract\/g, \"\");\n\n        showElements(\"embed\");\n        showElements(\"object\");\n        showElements(\"iframe\");\n\n        if(Evernote.Utils.isQuirkMode()) {\n            veil.className = \"evernote-top-fixed-position-quirks\";\n        }\n\n        blank();\n    }\n\n    function blank() {\n        veil.style.height = document.body.scrollHeight  + \"px\";\n        veil.style.width = document.body.scrollWidth  + \"px\";\n        veil.style.borderWidth = \"0\";\n    }\n\n    function gray() {\n        show();\n        inner.style.display = \"none\";\n        try {\n            veil.style.backgroundColor = \"rgba(255, 255, 255, 0.75)\";\n        } catch (e) {\n            veil.style.backgroundColor = \"rgb(255, 255, 255)\";\n        }\n    }\n\n    function show() {\n        Evernote.Logger.debug(\"Content veil show\");\n        inner.style.display = \"\";\n        veil.style.backgroundColor = \"\";\n        if (!Evernote.ElementExtension.hasParentNode(veil)) {\n            document.body.appendChild(veil);\n        }\n    }\n\n    function hide() {\n        if (Evernote.ElementExtension.hasParentNode(veil)) {\n            veil.parentNode.removeChild(veil);\n        }\n    }\n\n    function isHidden() {\n        if (Evernote.ElementExtension.hasParentNode(veil)) {\n            return false;\n        }\n        return true;\n    }\n\n    \/\/ Makes a rectangle bigger in all directions by the number of pixels specified (or smaller, if 'amount' is\n    \/\/ negative). Returns the new rectangle.\n    function expandRect(rect, amount) {\n        return {\n            top: (rect.top - amount),\n            left: (rect.left - amount),\n            bottom: (rect.bottom + amount),\n            right: (rect.right + amount),\n            width: (rect.width + (2 * amount)),\n            height: (rect.height + (2 * amount))\n        };\n    }\n\n    function revealRect(rect, elt, staticView, shadowBox) {\n\n        \/\/ Save this info.\n        currentlyShownRect = rect;\n        currentlyShownElt = elt;\n        currentRectOffsetTop = Evernote.Utils.scrollTop();\n        currentRectOffsetLeft = Evernote.Utils.scrollLeft();\n        currentlyStatic = staticView;\n        currentlyShadowBox = shadowBox;\n\n        \/\/ We expand the rectangle for two reasons.\n        \/\/ 1) we want to expand it by the width of the stroke, so that when we draw out outline, it doesn't overlap our\n        \/\/ content.\n        \/\/ 2) We want to leave a little extra room around the content for aesthetic reasons.\n        rect = expandRect(rect, 8);\n        var x = rect.left;\n        var y = rect.top;\n        var width = rect.width;\n        var height = rect.height;\n\n        \/*var veilWidth = Evernote.Utils.innerWidth(); \/\/veil.style.width.replace(\"px\", \"\");\n        var veilHeight = Evernote.Utils.innerHeight(); \/\/veil.style.height.replace(\"px\", \"\");*\/\n\n        var veilWidth = veil.style.width.replace(\"px\", \"\");\n        var veilHeight = veil.style.height.replace(\"px\", \"\");\n\n        inner.className = inner.className.replace(\/\\s*evernoteShadowBox\/g, \"\");\n        veil.className = inner.className.replace(\/\\s*evernoteShadowBox\/g, \"\");\n\n        if (shadowBox) {\n            inner.className += \" evernoteShadowBox\";\n            veil.className += \" evernoteShadowBox\";\n        }\n\n        inner.style.display = \"block\";\n        veil.style.borderLeftWidth = Math.max(x, 0) + \"px\";\n        veil.style.borderTopWidth = Math.max(y, 0) + \"px\";\n        veil.style.borderRightWidth = Math.max((veilWidth - x - width), 0) + \"px\";\n        veil.style.borderBottomWidth = Math.max((veilHeight - y - height), 0) + \"px\";\n\n        if (Evernote.BrowserDetection.isIE7() || document.documentMode == '7') {\n            \/\/ ie7 doesn't support 'border-box' value.\n\n            function val(prop) {\n                return prop.replace(\/px\/, '');\n            }\n            var vs = veil.style;\n            vs.width = (val(vs.width) - val(vs.borderLeftWidth) - val(vs.borderRightWidth)) + \"px\";\n            vs.height = (val(vs.height) - val(vs.borderTopWidth) - val(vs.borderBottomWidth)) + \"px\";\n        }\n\n        Evernote.Logger.debug(\"revealRect finished\");\n    }\n\n    function revealStaticRect(rect, elt, shadowBox) {\n        revealRect(rect, elt, true, shadowBox);\n    }\n\n    function outlineElement(element, scrollTo, shadowBox, articleAdjustment) {\n        \/\/ See notes in Preview.js for why we use this method instead of just calling element.getBoundingClientRect().\n\n        var rect = Evernote.contentPreviewer.computeDescendantBoundingBox(element);\n        if (rect) {\n\n            var mutableRect = {\n                top: rect.top,\n                bottom: rect.bottom,\n                left: rect.left,\n                right: rect.right,\n                width: rect.width,\n                height: rect.height\n            };\n\n            \/\/ We don't want to adjust ourselves into odd positions if the page is scrolled.\n            var sLeft = Evernote.Utils.scrollLeft();\n            var sTop = Evernote.Utils.scrollTop();\n\n            var BORDER_MIN = 9;\n            if (mutableRect.left < (BORDER_MIN - sLeft)) {\n                mutableRect.width -= (BORDER_MIN - sLeft) - mutableRect.left;\n                mutableRect.left = (BORDER_MIN - sLeft);\n            }\n            if (mutableRect.top < (BORDER_MIN - sTop)) { mutableRect.height -= (BORDER_MIN - sTop) - mutableRect.top; mutableRect.top = (BORDER_MIN - sTop); } \/\/ Get the wider of our two possible widths. var width = Math.max(document.body.scrollWidth, Evernote.Utils.innerWidth()); if (mutableRect.right > (width - BORDER_MIN - sLeft)) {\n                mutableRect.right = (width - BORDER_MIN - sLeft);\n                mutableRect.width = mutableRect.right - mutableRect.left;\n            }\n\n            reset(articleAdjustment);\n            revealStaticRect(mutableRect, true, shadowBox);\n\n            hideElements(\"embed\", element);\n            hideElements(\"object\", element);\n            hideElements(\"iframe\", element);\n\n            topExpandContract.className += \" evernoteUsingExpandContract\";\n\n            if (rect.height > Evernote.JQuery(window).height()) {\n                bottomExpandContract.className += \" evernoteUsingExpandContract\";\n            } else {\n                bottomExpandContract.className = bottomExpandContract.className.replace(\/\\s*evernoteUsingExpandContract\/g, \"\");\n            }\n\n            show();\n        }\n        else {\n            Evernote.Logger.warn(\"Couldn't create rectangle from element: \" + element.toString());\n        }\n    }\n\n    function hideAllActiveObjects() {\n        hideElements(\"embed\");\n        hideElements(\"object\");\n        hideElements(\"iframe\");\n    }\n\n    function hideElements (tagName, exceptInElement) {\n        var els = document.getElementsByTagName(tagName);\n        for (var i = 0; i < els.length; i++) {\n            els[i].enSavedVisibility = els[i].style.visibility;\n            els[i].style.visibility = \"hidden\";\n        }\n        showElements(tagName, exceptInElement);\n    }\n\n    function showElements (tagName, inElement) {\n        if (!inElement) {\n            inElement = document;\n        }\n        var els = inElement.getElementsByTagName(tagName);\n        for (var i = 0; i < els.length; i++) { if (typeof els[i].enSavedVisibility !== \"undefined\") { els[i].style.visibility = els[i].enSavedVisibility; try { delete els[i].enSavedVisibility; } catch(e) { els[i].enSavedVisibility = undefined; } } } } function getElement() { return veil; } var onScrollHandle = function(e) { if (currentlyShownRect &#038;&#038; !currentlyStatic) { var rect = { top: currentlyShownRect.top, bottom: currentlyShownRect.bottom, left: currentlyShownRect.left, right: currentlyShownRect.right, width: currentlyShownRect.width, height: currentlyShownRect.height }; var vert = Evernote.Utils.scrollTop() - currentRectOffsetTop; var horiz = Evernote.Utils.scrollLeft() - currentRectOffsetLeft; if (!vert &#038;&#038; !horiz) { return; } rect.top -= vert; rect.bottom -= vert; rect.left -= horiz; rect.right -= horiz; blank(); revealRect(rect, currentlyShownElt); } }; Evernote.JQuery(window).resize( function(e) { if (currentlyShownElt) { var rect = Evernote.contentPreviewer.computeDescendantBoundingBox(currentlyShownElt); if (rect) { blank(); if (currentlyShadowBox) { revealRect(rect, currentlyShownElt, true, true); } else { revealRect(rect, currentlyShownElt, true, false); } } } if (inner.style.display == 'none') { gray(); } }); if (window.attachEvent) window.attachEvent(\"onscroll\", onScrollHandle); else if (window.addEventListener) window.addEventListener(\"scroll\", onScrollHandle, false); else Evernote.Logger.error( \"ContentVeil can't attachEvent\" ); \/\/ Public API: this.reset = reset; this.show = show; this.gray = gray; this.hide = hide; this.revealRect = revealRect; this.revealStaticRect = revealStaticRect; this.outlineElement = outlineElement; this.expandRect = expandRect; this.hideAllActiveObjects = hideAllActiveObjects; } \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ function PageInfo() { \/\/ This is a map of hostnames (for hostnames that begin with 'www.', the 'www.' will be stripped off first, so don't \/\/ include it in your lookup string) to CSS selectors. When we try and locate an article in a page, we'll see if we \/\/ can find the doamin for the page in this list, and if so, we'll try and find an element that matches the given \/\/ selector. If no element is returned, we'll fall back to the heuristic approach. var specialCases = { \"penny-arcade.com\": \"div.contentArea > div.comic > img\",\n        \"aspicyperspective.com\": \"div.entry-content\",\n        \"thewirecutter.com\": \"div#content\",\n        \"katespade.com\": \"div#pdpMain\",\n        \"threadless.com\": \"section.product_section\",\n        \"yelp.com\": \"div#bizBox\",\n        \"flickr.com\": \"div#photo\",\n        \"instagr.am\": \"div.stage > div.stage-inner\",\n        \"stackoverflow.com\": \"div#mainbar\",\n        \"makeprojects.com\": \"div#guideMain\",\n        \"cookpad.com\": \"div#main\",\n        \"imgur.com\": \"div.image\",\n        \"smittenkitchen.com\": \"div.entry\",\n        \"allrecipes.com\": \"div#content-wrapper\",\n        \"qwantz.com\": \"img.comic\",\n        \"questionablecontent.net\": \"img#strip\",\n        \"cad-comic.com\": \"div#content\"\n    }\n\n    var useFoundImage = [\n        \"xkcd.com\"\n    ]\n\n    \/\/ These are the items we're trying to collect. This first block is trivial.\n    var containsImages = Boolean(document.getElementsByTagName(\"img\").length > 0);\n    var documentWidth = document.width;\n    var documentHeight = document.height;\n    var url = document.location.href;\n    var documentLength = document.body.textContent ? document.body.textContent.length : 0;\n\n    \/\/ These take slightly more work and are initialized only when requested.\n    var article = null;\n    var articleBoundingClientRect = null;\n    var selection = false; \/\/ This is easy to get, but is always \"false\" at load time until the user selects something.\n    var selectionIsInFrame = false;\n    var documentIsFrameset = false;\n    var selectionFrameElement = null;\n    var recommendationText = null;\n\n    \/\/ Internal state variables to keep us duplicating work.\n    var hasCheckedArticle = false;\n\n    \/\/ Experimental recognition of 'image' pages (like photo sites and comics).\n    function findImage() {\n        var imgs = document.getElementsByTagName(\"img\");\n        var biggest = null;\n        var biggestArea = 0;\n\n        try {\n            for (var i = 0; i < imgs.length; i++) { var style = Evernote.ElementExtension.getComputedStyle(imgs[i]); var width = style.width.replace(\/[^0-9.-]\/g, \"\"); var height = style.height.replace(\/[^0-9.-]\/g, \"\"); var area = width * height; if (!biggest || area > biggestArea) {\n                    biggest = imgs[i];\n                    biggestArea = area;\n                }\n            }\n        } catch (e) {\n            \/\/ error on mail.com\n        }\n        return biggest;\n    }\n\n    function getAncestors(node) {\n        var an = [];\n        while (node) {\n            an.unshift(node);\n            node = node.parentNode;\n        }\n        return an;\n    }\n\n    function getDeepestCommonNode(nodeList1, nodeList2) {\n        var current = null;\n        for (var i = 0; i < nodeList1.length; i++) {\n            if (nodeList1[i] === nodeList2[i]) {\n                current = nodeList1[i];\n            }\n            else {\n                break;\n            }\n        }\n        return current;\n    }\n\n    function getCommonAncestor(nodeList) {\n        if (!nodeList.length) return null;\n\n        if (nodeList.length == 1) return nodeList[0];\n        var lastList = getAncestors(nodeList[0]);\n\n        var node = null;\n        for (var i = 1; i < nodeList.length; i++) {\n            var list = getAncestors(nodeList[i]);\n            node = getDeepestCommonNode(lastList, list);\n            lastList = getAncestors(node);\n        }\n        return node;\n    }\n\n    function getBiggestImage(callback) {\n        getDefaultArticle(function(art) {\n            var imgs;\n            if (art) {\n                imgs = Evernote.JQuery(art).find('img');\n            } else {\n                imgs = Evernote.JQuery(\"img\");\n            }\n\n            var maxHeight = 0;\n            var maxWidth = 0;\n            var maxImage;\n            for (var i = 0; i < imgs.length; i++) { var w = imgs[i].width; var h = imgs[i].height; if (w * h > maxWidth * maxHeight) {\n                    maxHeight = h;\n                    maxWidth = w;\n                    maxImage = imgs[i].src;\n                }\n            }\n            callback({ src: maxImage, width: maxWidth, height: maxHeight });\n        });\n    }\n\n    function clearlyCallback(data, callback) {\n        Evernote.Logger.debug(\"Clearly callback invoked\");\n        findImage();\n\n        \/\/ See if we should special-case this.\n        var host = getHostname();\n        if (specialCases[host])\n        {\n            var candidate = Evernote.ElementExtension.querySelector(specialCases[host]);\n            if (candidate) {\n                Evernote.Logger.debug(\"Found article in specialCases\");\n                article = candidate;\n                articleBoundingClientRect = Evernote.ElementExtension.getBoundingClientRect(article);\n            }\n        }\n\n        \/\/ Or see if it's a special case image page.\n        else if (Evernote.ArrayExtension.indexOf(useFoundImage, host) != -1) {\n            article = findImage();\n            if (article) {\n                Evernote.Logger.debug(\"Found article in image\");\n                articleBoundingClientRect = Evernote.ElementExtension.getBoundingClientRect(article);\n            }\n        }\n\n        \/\/ If it's not a special case, see if it's a single image.\n        if (!article) {\n            var imageTypes = ['jpeg', 'jpg', 'gif', 'png'];\n            var urlExtension = document.location.href.replace(\/^.*\\.(\\w+)$\/, \"$1\");\n            if (urlExtension &#038;&#038; (Evernote.ArrayExtension.indexOf(imageTypes, urlExtension) != -1)) {\n                var candidate = Evernote.JQuery(\"body > img\");\n                if (candidate.length > 0) {\n                    Evernote.Logger.debug(\"Found article in a single image\");\n                    article = candidate.get(0);\n                    articleBoundingClientRect = Evernote.ElementExtension.getBoundingClientRect(article);\n                }\n            }\n        }\n\n        \/\/ If we still didn't find an article, let's see if maybe it's in a frame. Cleary fails on frames so we try this\n        \/\/ check before we use our clearly info.\n        if (!article) {\n            if (document.body.nodeName.toLowerCase() == \"frameset\") {\n                documentIsFrameset = true;\n                var frame = findBiggestFrame();\n                if (frame &#038;&#038; frame.contentDocument &#038;&#038; frame.contentDocument.documentElement) {\n                    selectionFrameElement = frame;\n                    article = frame.contentDocument.documentElement;\n                    articleBoundingClientRect = Evernote.ElementExtension.getBoundingClientRect(article);\n                }\n            }\n        }\n\n        \/\/ If we didn't use any of our special case handling, we'll use whatever clearly found.\n        if (!article) {\n            Evernote.Logger.debug(\"Use clearly find article\");\n            if (data &#038;&#038; data._elements &#038;&#038; data._elements.length) {\n                article = data._elements[0];\n                if (data._elements.length > 1) {\n\n                    \/\/ This will include *all* clearly elements (and whatever else in in between them).\n                    article = getCommonAncestor(data._elements);\n\n                    \/\/ This includes *just the last (and therefore most important)* element from the clearly detection.\n                    \/\/ article = data._elements[data._elements.length - 1];\n                }\n\n                if (article.nodeType === ( window.Node ? window.Node.TEXT_NODE : 1)) {\n                    article = article.parentNode;\n                }\n            }\n        }\n\n        if(article) {\n            if(Evernote.JQuery(article).closest(\"#evernote-content\").length != 0)\n                article = undefined;\n        }\n\n        \/\/ If clearly found nothing (because it failed), then use the body of the document.\n        if (!article) {\n            article = document.body;\n        }\n\n        hasCheckedArticle = true;\n        callback();\n    }\n\n    \/\/ This will try and determine the 'default' page article. It will only run once per page, but it's specifically\n    \/\/ called only on demand as it can be expensive.\n    function findArticle(callback) {\n\n        function afterInject() {\n            \/\/ If we'd previously computed an article element, but it's lost its parent or become invisible, then we'll try\n            \/\/ and re-compute the article. This can happen if, for example the page dynamically udaptes itself (like showing\n            \/\/ the latest news article in a box that updates periodically). This doesn't guarantee that we clip something\n            \/\/ sane if this happens, (if the page re-writes itself while a clip is taking place, the results are\n            \/\/ indeterminate), but it will make such things less likely.\n            if (article &#038;&#038;\n                (!article.parentNode || !article.getBoundingClientRect || Evernote.ElementExtension.getBoundingClientRect(article).width == 0)) {\n                article = null;\n                hasCheckedArticle = false;\n            }\n            Evernote.Logger.debug(\"afterInject\");\n            if (!hasCheckedArticle) {\n                Evernote.Logger.debug(\"no article\");\n                if (!window || !window.ClearlyComponent)\n                {\n                    Evernote.Logger.warn(\"Couldn't find clearly!\");\n                    clearlyCallback(null, callback);\n                }\n                else {\n                    Evernote.Logger.debug(\"Call clearly to select article\");\n                    try {\n                        Evernote.ClearlyController.getContentElementAndHTML(function(data){clearlyCallback(data, callback)});\n                    } catch(e) {\n                        Evernote.Logger.error(\"Failed to find article by clearly due to error \" + e);\n                        clearlyCallback(null, callback);\n                    }\n                }\n            }\n            \/\/ If the page is big enough, clearly is excruciatingly slow. We'll jsut get the whole page.\n            \/\/ @TODO: Maybe clearly can get faster.\n            else if (document.body.innerHTML.length > (1024 * 1024)) {\n                Evernote.Logger.warn(\"Page over 1mb, skipping article detection.\");\n                clearlyCallback(null, callback);\n            }\n            else {\n                Evernote.Logger.debug(\"callback\");\n                callback();\n            }\n        }\n\n        afterInject();\n\n    }\n\n    function findBiggestFrame() {\n        var frames = document.getElementsByTagName(\"frame\");\n        var candidate = null;\n        var candidateSize = 0;\n        for (var i = 0; i < frames.length; i++) { if (frames[i].width &#038;&#038; frames[i].height) { var area = frames[i].width * frames[i].height; if (area > candidateSize) {\n                    candidate = frames[i];\n                    candidateSize = area;\n                }\n            }\n        }\n        return candidate;\n    }\n\n    function getHostname() {\n        var match = document.location.href.match(\/^.*?:\\\/\\\/(www\\.)?(.*?)(\\\/|$)\/);\n        if (match) {\n            return match[2];\n        }\n        return null;\n    }\n\n    function getDefaultArticle(callback) {\n        Evernote.Logger.debug(\"getDefaultArticle\");\n        findArticle(function(){callback(article)});\n        \/\/ Article already exists, so we'll return it.\n        if (article) return article;\n    }\n\n    \/\/ Looks for selections in the current document and descendent (i)frames.\n    \/\/ Returns the *first* non-empty selection.\n    function getSelection() {\n\n        \/\/ First we check our main window and return a selection if that has one.\n        var selection = window.getSelection();\n        if (selection &#038;&#038; selection.rangeCount &#038;&#038; !selection.isCollapsed) {\n            return selection;\n        }\n\n        \/\/ Then we'll try our frames and iframes.\n        var docs = [];\n        var iframes = document.getElementsByTagName(\"iframe\");\n        for (var i = 0; i < iframes.length; i++) {\n            docs.push(iframes[i]);\n        }\n        var frames = document.getElementsByTagName(\"frame\");\n        for (var i = 0; i < frames.length; i++) {\n            docs.push(frames[i]);\n        }\n\n        var urlBase = document.location.href.replace(\/^(https?:\\\/\\\/.*?)\\\/.*\/i, \"$1\").toLowerCase();\n        for (var i = 0; i < docs.length; i++) {\n\n            \/\/ If frames\/iframes fail a same origin policy check, then they'll through annoying errors, and we wont be able\n            \/\/ to access them anyway, so we attempt to skip anything that wont match.\n            if (docs[i].src &#038;&#038; docs[i].src.toLowerCase().substr(0, urlBase.length) !== urlBase) {\n                continue;\n            }\n\n            var doc = docs[i].contentDocument;\n\n            if (doc) {\n                var frameSelection = doc.getSelection();\n                if (frameSelection &#038;&#038; frameSelection.rangeCount &#038;&#038; !frameSelection.isCollapsed) {\n                    selectionIsInFrame = true;\n                    selectionFrameElement = docs[i];\n                    return frameSelection;\n                }\n            }\n            else {\n                Evernote.Logger.warn(\"iframe contained no Document object.\");\n            }\n        }\n\n        \/\/ Didn't find anything.\n        return null;\n    }\n\n    function getUrl() {\n        return url;\n    }\n\n    function getText(node, soFar, maxLen) {\n        if (node.nodeType == Evernote.Node.TEXT_NODE) {\n            var trimmed = node.textContent.trim().replace(\/\\s+\/g, \" \");\n            if (trimmed === \" \" || trimmed === \"\") return soFar;\n            return soFar + \" \" + trimmed;\n        }\n\n        var banned = [\n            \"style\",\n            \"script\",\n            \"noscript\"\n        ];\n\n        if (node.nodeType == Evernote.Node.ELEMENT_NODE) {\n            if (Evernote.ArrayExtension.indexOf(banned, node.nodeName.toLowerCase()) == -1) {\n                for (var i = 0; i < node.childNodes.length; i++) { soFar = getText(node.childNodes[i], soFar, maxLen); if (soFar.length > maxLen) {\n                        return soFar;\n                    }\n                }\n            }\n        }\n        return soFar;\n    }\n\n    function getRecommendationText() {\n        var text = \"\";\n        var MAX_LEN = 5000;\n        var selection = getSelection();\n        if (selection) {\n            var df = selection.getRangeAt(0).cloneContents();\n            var div = document.createElement(\"div\");\n            div.appendChild(df);\n            text = getText(div, \"\", MAX_LEN);\n        }\n\n        else if (article) {\n            text = getText(article, \"\", MAX_LEN);\n        }\n        else {\n            text = getText(document.body, \"\", MAX_LEN);\n        }\n        text = document.title + \" \" + text;\n        return text;\n    }\n\n    \/\/ Note: you must call getSelection() first to populate this field!\n    function getSelectionFrame() {\n        return selectionFrameElement;\n    }\n\n    function checkClearly() {\n        var clearlyDoc = Evernote.ElementExtension.querySelector(\"iframe#readable_iframe\");\n        if (clearlyDoc) clearlyDoc = clearlyDoc.contentDocument;\n        if (clearlyDoc) clearlyDoc = Evernote.ElementExtension.querySelector(\"body#body div#box\", clearlyDoc);\n        if (clearlyDoc) {\n            article = clearlyDoc;\n            articleBoundingClientRect = Evernote.ElementExtension.getBoundingClientRect(article);\n        }\n    }\n\n    \/\/ @TODO: This is fairly incomplete.\n    function getFavIconUrl() {\n        var links = document.getElementsByTagName(\"link\");\n        var i;\n        for (i = 0; i < links.length; i++) { if (links[i].rel) { var rels = links[i].rel.toLowerCase().split(\/\\s+\/); if (Evernote.ArrayExtension.indexOf(rels, \"icon\") !== -1) { \/\/ Found it! return links[i].href; } } } return null; } function _getInfoRequestHandler(data, request, sender, sendResponse) { var isSelected = getSelection(); checkClearly(); var response = { containsImages: containsImages, documentWidth: documentWidth, documentHeight: documentHeight, url: url, selection: (isSelected !== null), selectionIsInFrame: selectionIsInFrame, documentLength: document.body.textContent.length, articleBoundingClientRect: articleBoundingClientRect, article: (article != null), recommendationText: getRecommendationText(), favIconUrl: getFavIconUrl(), documentIsFrameset: documentIsFrameset }; sendResponse(response); } function getInfoRequestHandler(request, sender, sendResponse) { findArticle(function(data){_getInfoRequestHandler(data, request, sender, respondWithInfo)}); } \/\/ Public API: this.getDefaultArticle = getDefaultArticle; this.getSelection = getSelection; this.getSelectionFrame = getSelectionFrame; this.getFavIconUrl = getFavIconUrl; this.getBiggestImage = getBiggestImage; this.getUrl = getUrl; } \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.Scroller = function Scroller( tab ) {\n    this.initialize( tab );\n};\n\nEvernote.Scroller.prototype._tab = null;\n\nEvernote.Scroller.prototype.initialize = function ( tab ) {\n    this._tab = tab;\n    var scrollX = (this._tab.pageXOffset !== undefined) ? this._tab.pageXOffset : (this._tab.document.documentElement || this._tab.document.body.parentNode ||this._tab.document.body).scrollLeft;\n    var scrollY = (this._tab.pageYOffset !== undefined) ? this._tab.pageYOffset : (this._tab.document.documentElement || this._tab.document.body.parentNode || this._tab.document.body).scrollTop;\n    this.initialPoint = {\n        x: scrollX,\n        y: scrollY\n    };\n};\n\nEvernote.Scroller.prototype.scrollTo = function ( endPoint, time, resolution ) {\n    this.abort();\n\n    this.endPoint = endPoint;\n    this.step = 0;\n    this.calculatePath( time, resolution );\n    var self = this;\n    this.proc = setInterval( function () {\n            if ( !self.doScroll() ) {\n                self.abort();\n            }\n        },\n        resolution );\n};\n\nEvernote.Scroller.prototype.calculatePath = function ( time, resolution ) {\n    this.path = [];\n    var sx = this.initialPoint.x;\n    var sy = this.initialPoint.y;\n    var ex = this.endPoint.x;\n    var ey = this.endPoint.y;\n    var k = (Math.PI * resolution) \/ time;\n    for ( var i = -(Math.PI \/ 2); i < (Math.PI \/ 2); i += k ) { var c = ((1 + Math.sin( i )) \/ 2); this.path.push( { x:(sx + c * (ex - sx)), y:(sy + c * (ey - sy)) } ); } }; Evernote.Scroller.prototype.doScroll = function () { var s = this.path[++this.step]; if ( !s ) { return false; } var view = this._tab.document.defaultView || this._tab; view.scrollTo( s.x, s.y ); return true; }; Evernote.Scroller.prototype.abort = function () { if ( this.proc ) { clearInterval( this.proc ); this.proc = null; } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nfunction ContentPreview() {\n    Evernote.Logger.debug(\"Start creating preview box\");\n\n    var contentVeil = new ContentVeil();\n    Evernote.Logger.debug(\"End creating preview box\");\n    \/\/ Stores a reference to the last element that we used as a preview.\n    var previewElement = null;\n    var article = null;\n    var snippet = null;\n\n    function buildUrlElement() {\n        var urlEl = document.createElement(\"div\");\n        urlEl.id = \"evernotePreviewContainer\";\n        var className = \"yui3-cssreset\";\n        if(Evernote.Utils.isQuirkMode()) {\n            className += \" evernote-middle-fixed-position-quirks\"\n        }\n        urlEl.className = className;\n        return urlEl;\n    }\n\n    Evernote.Logger.debug(\"Build url element\");\n    var urlElement = buildUrlElement();\n\n    function showUrlElement() {\n        Evernote.Logger.debug(\"ContentPreview: showUrlElement start\");\n        if (!Evernote.ElementExtension.hasParentNode(urlElement)) {\n            document.body.appendChild(urlElement);\n        }\n\n        \/\/ Make sure we're centered in the window.\n        var elStyle = Evernote.ElementExtension.getComputedStyle(urlElement, '');\n        var w = parseInt(Evernote.StyleElementExtension.getPropertyValue(elStyle, \"width\"));\n        var h = parseInt(Evernote.StyleElementExtension.getPropertyValue(elStyle, \"height\"));\n\n        if (isNaN(w) || isNaN(h)) {\n            \/\/ IE8\n            w =  Evernote.JQuery(urlElement).width();\n            h = Evernote.JQuery(urlElement).height();\n        }\n\n        if (w &#038;&#038; h) {\n            urlElement.style.marginLeft = (0 - w \/ 2) + \"px\";\n            urlElement.style.marginTop = (0 - h \/ 2) + \"px\";\n        }\n\n        Evernote.Logger.debug(\"ContentPreview: showUrlElement end\");\n    }\n\n    function hideUrlElement() {\n        if (Evernote.ElementExtension.hasParentNode(urlElement)) {\n            urlElement.parentNode.removeChild(urlElement);\n        }\n    }\n\n    function showOverlay()  {\n        previewElement = null;\n        clear();\n        contentVeil.reset();\n        contentVeil.hideAllActiveObjects();\n        contentVeil.gray();\n    }\n\n    function previewUrl() {\n        clear();\n\n        function buildContent ( data ) {\n            var title = PageContext.title;\n            var url = PageContext.url;\n            var favIconUrl = PageContext.getFavIconUrl();\n            snippet = data.replace(\/(<([^>]+)>)\/ig,\"\"); \/\/ remove html tags from text\n\n            urlElement.innerHTML = Evernote.GlobalUtils.createUrlClipContent(title, url, favIconUrl, snippet);\n\n            var element = Evernote.JQuery(urlElement);\n\n            if(Evernote.Utils.isQuirkMode() &#038;&#038; !element.hasClass(\"evernote-fixed-position-fix\")) {\n                element.addClass(\"evernote-fixed-position-fix\");\n            }\n\n            showUrlElement();\n            contentVeil.reset();\n            contentVeil.hideAllActiveObjects();\n            contentVeil.gray();\n\n        }\n\n        Evernote.ClearlyController.getClearlyArticleText( function (data) {\n            buildContent(data._html);\n        });\n    }\n\n    \/\/ This doesn't remove internal state of previewElement, because another script may not have finished clipping until\n    \/\/ after the page looks 'clear'.\n    function clear() {\n        contentVeil.reset();\n        contentVeil.hide();\n        hideUrlElement();\n    }\n\n    function _previewArticle () {\n        Evernote.Logger.debug(\"Start previewing article element\");\n        if (previewElement)\n        {\n            var selectionFrame;\n            if (typeof Evernote.pageInfo !== undefined) {\n                selectionFrame = Evernote.pageInfo.getSelectionFrame();\n            }\n            Evernote.Logger.debug(\"Selection frame selected \" + selectionFrame);\n            if (selectionFrame) {\n\n                var rect = {\n                    width: selectionFrame.width,\n                    height: selectionFrame.height,\n                    top: selectionFrame.offsetTop,\n                    bottom: (selectionFrame.height + selectionFrame.offsetTop),\n                    left: selectionFrame.offsetLeft,\n                    right: (selectionFrame.width + selectionFrame.offsetLeft)\n                };\n                Evernote.Logger.debug(\"contentVeil.revealStaticRect \" + rect);\n                contentVeil.revealStaticRect(contentVeil.expandRect(rect, -9), selectionFrame, true);\n                Evernote.Logger.debug(\"contentVeil.show \");\n                contentVeil.show();\n            }\n            else {\n                Evernote.Logger.debug(\"contentVeil.outlineElement\");\n                contentVeil.outlineElement(previewElement, false, true);\n                window.scrollTo(0, previewElement.offsetTop - 30);\n            }\n        }\n        else {\n            Evernote.Logger.warn(\"Couldn't find a preview element. We should switch to 'full page' mode.\");\n        }\n    }\n\n    \/**\n     * Finds and preview article element.\n     * If reloadArticle is specified and equals to true, then discard previously found article and re-start search of article again.\n     * Otherwise use article found on previous call (if this is the first call then article will be searched anyway).\n     * @param reloadArticle\n     *\/\n    function previewArticle (reloadArticle) {\n\n        clear();\n        previewElement = null;\n        if(reloadArticle) {\n            article = null;\n        }\n        Evernote.Logger.debug(\"Evernote.pageinfo \" + Evernote.pageInfo);\n        if (typeof Evernote.pageInfo !== undefined) {\n            if(!article) {\n                previewElement = Evernote.pageInfo.getDefaultArticle(function(el){\n                    Evernote.Logger.debug(\"Article element \" + el.nodeName);\n                    previewElement = el;\n                    article = el;\n                    Evernote.Logger.debug(\"Preview article \");\n                    _previewArticle();\n                });\n                article = previewElement;\n            } else {\n                previewElement = article;\n                _previewArticle();\n            }\n        }\n        else {\n            Evernote.Logger.warn(\"Couldn't find a 'pageInfo' object.\");\n        }\n    }\n\n    \/\/ When nudging the preview around the page, we want to skip nodes that aren't interesting. This includes empty\n    \/\/ nodes, containers that have identical contents to the already selected node, invisible nodes, etc.\n    \/\/ @TODO: There's a lot more we could probably add here.\n    function looksInteresting(candidate, given) {\n\n        if (!candidate) {\n            Evernote.Logger.warn(\"Can't determine if 'null' is interesting (it's probably not).\");\n            return false;\n        }\n        \/\/ This is the parent of our 'HTML' tag, but has no tag itself. There's no reason it's ever more interesting than\n        \/\/ the HTML element.\n        if (candidate === window.document) {\n            return false;\n        }\n\n        \/\/Disable clip of evernote main popup\n        if(Evernote.JQuery(candidate).closest(\"#evernote-content\").length != 0) {\n            return false;\n        }\n\n        \/\/ Elements with neither text nor images are not interesting.\n        if (!candidate.textContent &#038;&#038; (candidate.getElementsByTagName(\"img\").length === 0)) {\n            return false;\n        }\n\n        \/\/ Elements with 0 area are not interesting.\n        var rect = Evernote.ElementExtension.getBoundingClientRect(candidate);\n        if (!rect.width || !rect.height) {\n            return false;\n        }\n\n        \/\/ Invisible elements are not interesting.\n        var style = Evernote.ElementExtension.getComputedStyle(candidate);\n        if ((style.visibility === \"hidden\") || (style.display === \"none\")) {\n            return false;\n        }\n\n        \/\/ If the nodes have a parent\/child relationship, then they're only interesting if their visible contents differ.\n        if (candidate.parentNode &#038;&#038; given.parentNode) {\n            if ((candidate.parentNode == given) || (given.parentNode == candidate)) {\n                if ((candidate.textContent === given.textContent) &#038;&#038;\n                    (candidate.getElementsByTagName(\"img\").length === given.getElementsByTagName(\"img\").length)) {\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n\n    \/\/ Returns the current article element, which may not be the same as the auto-detected one if the user has 'nudged'\n    \/\/ the selection around the page.\n    function getArticleElement() {\n        return previewElement;\n    }\n\n    function nudgePreview(direction) {\n        Evernote.Logger.debug(\"nudgePreview start\");\n        if (!previewElement) {\n            return;\n        }\n\n        var oldPreview = previewElement;\n        Evernote.Logger.debug(\"nudgePreview: direction is \" + direction);\n        Evernote.Logger.debug(\"nudgePreview: previewElement is \" + previewElement.nodeName);\n        switch (direction) {\n            case \"up\":\n                var temp = previewElement.parentNode;\n                while (temp) {\n                    if (looksInteresting(temp, previewElement)) {\n                        \/\/ If we move up and then down, we want to move back to where we started, not the first child.\n                        temp.enNudgeDescendToNode = previewElement;\n                        previewElement = temp;\n                        break;\n                    }\n                    temp = temp.parentNode;\n                }\n                break;\n            case \"down\":\n                Evernote.Logger.debug(\"nudgePreview: previewElement.enNudgeDescendToNode is \" + previewElement.enNudgeDescendToNode);\n                if (previewElement.enNudgeDescendToNode)\n                {\n                    var temp = previewElement.enNudgeDescendToNode;\n                    \/\/ @TODO: make sure we clean these up somewhere else if we never reverse our nudging.\n                    try {\n                        delete previewElement.enNudgeDescendToNode;\n                    } catch(e) {\n                        previewElement.enNudgeDescendToNode = undefined;\n                    }\n                    previewElement = temp;\n                    break;\n                }\n                Evernote.Logger.debug(\"nudgePreview: previewElement.children.length = \" + previewElement.children.length);\n                for (var i = 0; i < previewElement.children.length; i++) { Evernote.Logger.debug(\"nudgePreview: checking child is \" + previewElement.children[i].nodeName); if (looksInteresting(previewElement.children[i], previewElement)) { Evernote.Logger.debug(\"nudgePreview: found interesting child\" + previewElement.children[i]); previewElement = previewElement.children[i]; break; } } break; case \"left\": var temp = previewElement.previousElementSibling; while (temp) { if (looksInteresting(temp, previewElement)) { previewElement = temp; break; } temp = temp.previousElementSibling; } break; case \"right\": var temp = previewElement.nextElementSibling; while (temp) { if (looksInteresting(temp, previewElement)) { previewElement = temp; break; } temp = temp.nextElementSibling; } break; default: Evernote.Logger.warn(\"Unhandled nudge direction: \" + direction); } \/\/ Drawing is expensive so don't bother if nothing changed. if (oldPreview !== previewElement) { Evernote.Logger.debug(\"nudgePreview: draw new element.\"); function enoughSize(elem) { var el = Evernote.JQuery(elem); var w = el.width(); var h = el.height(); return (w > 30 &#038;&#038; h > 15)\n            }\n\n\/\/            if (enoughSize(previewElement) === false) return;\n\n            contentVeil.outlineElement(previewElement, false, true, true);\n            article = previewElement;\n\n            window.scrollTo(0, previewElement.offsetTop - 30);\n        }\n    }\n\n    function previewFullPage() {\n        var borderWidth = 4;\n        var w = Evernote.Utils.innerWidth();\n        var h = Evernote.Utils.innerHeight();\n\n        var rect = {\n            bottom: (h - borderWidth),\n            top: (borderWidth),\n            left: (borderWidth),\n            right: (w - borderWidth),\n            width: (w - (2 * borderWidth)),\n            height: (h - (2 * borderWidth))\n        };\n\n        clear();\n        contentVeil.reset();\n        contentVeil.revealStaticRect(rect, document.body);\n        contentVeil.show();\n        contentVeil.hideAllActiveObjects();\n    }\n\n    \/\/ Creates the union of two rectangles, which is defined to be the smallest rectangle that contains both given\n    \/\/ rectangles.\n    function unionRectangles(rect1, rect2) {\n        var rect = {\n            top: (Math.min(rect1.top, rect2.top)),\n            bottom: (Math.max(rect1.bottom, rect2.bottom)),\n            left: (Math.min(rect1.left, rect2.left)),\n            right: (Math.max(rect1.right, rect2.right))\n        }\n        rect.width = rect.right - rect.left;\n        rect.height = rect.bottom - rect.top;\n\n        return rect;\n    }\n\n    \/\/ Returns true if the rectangles match, false otherwise.\n    function rectanglesEqual(rect1, rect2) {\n        if (!rect1 &#038;&#038; !rect2) return true;\n        if (!rect1) return false;\n        if (!rect2) return false;\n        if (rect1.top != rect2.top) return false;\n        if (rect1.bottom != rect2.bottom) return false;\n        if (rect1.left != rect2.left) return false;\n        if (rect1.right != rect2.right) return false;\n        if (rect1.width != rect2.width) return false;\n        if (rect1.height != rect2.height) return false;\n        return true;\n    }\n\n    \/\/ If the user triple-clicks a paragraph, we will often get a selection that includes the next paragraph after the\n    \/\/ selected one, but only up to offset 0 in that paragraph. This causes the built in getBoundingClientRect to give a\n    \/\/ box that includes the whole trailing paragraph, even though none of it is actually selected. Instead, we'll build\n    \/\/ our own bounding rectangle that omits the trailing box.\n    \/\/ @TODO: Currently this computes a box that is *too big* if you pass it a range that doesn't have start and\/or end\n    \/\/ offsets that are 0, because it will select the entire beginning and ending node, instead of jsut the selected\n    \/\/ portion.\n    function computeAlternateBoundingBox(range) {\n\n        \/\/ If the end of selection isn't at offset 0 into an element node (rather than a text node), then we just return the\n        \/\/ original matching rectangle.\n        if ((range.endOffset !== 0) ||\n            (range.endContainer &#038;&#038; range.endContainer.nodeType !== Evernote.Node.ELEMENT_NODE) ||\n            ( range.startContainer &#038;&#038; range.startContainer &#038;&#038; range.startContainer.getBoundingClientRect) ||\n            ( range.endContainer &#038;&#038; range.endContainer.getBoundingClientRect) ||\n            ( range.commonAncestorContainer &#038;&#038; range.commonAncestorContainer.getBoundingClientRect)\n            ) {\n            var rect = Evernote.ElementExtension.getBoundingClientRect(range);\n\n            \/\/ In ie8 and older getBoundingClientRect takes into account text only. If there is an image or other element\n            \/\/ at the bound of selection, it will be ignored during calculation of rect coordinates. Here, we fix it.\n            if (range.startContainer &#038;&#038; range.startContainer.nodeType == Evernote.Node.ELEMENT_NODE) {\n                var startNodeRect = Evernote.ElementExtension.getBoundingClientRect(range.startContainer);\n                if (startNodeRect.height > rect.height) rect = Evernote.Utils.unionRectangles(rect, startNodeRect)\n            }\n            if (range.endContainer &#038;&#038; range.endContainer.nodeType == Evernote.Node.ELEMENT_NODE) {\n                var endNodeRect = Evernote.ElementExtension.getBoundingClientRect(range.endContainer);\n                if (endNodeRect.height > rect.height) rect = Evernote.Utils.unionRectangles(rect, endNodeRect)\n            }\n\n            if(rect.top == 0 &#038;&#038; rect.bottom == 0 &#038;&#038; rect.left == 0 &#038;&#038; rect.right == 0) {\n                if(range.commonAncestorContainer &#038;&#038; range.commonAncestorContainer.getBoundingClientRect) {\n                    rect = range.commonAncestorContainer.getBoundingClientRect();\n                } else if(range.startContainer &#038;&#038; range.startContainer.getBoundingClientRect) {\n                    rect = range.startContainer.getBoundingClientRect();\n                } else if(range.endContainer &#038;&#038; range.endContainer.getBoundingClientRect) {\n                    rect = range.endContainer.getBoundingClientRect();\n                }\n            }\n            var mutableRect = {\n                top: rect.top,\n                bottom: rect.bottom,\n                left: rect.left,\n                right: rect.right,\n                width: rect.width,\n                height: rect.height\n            };\n            return mutableRect;\n        }\n\n        \/\/ This is the one we don't want.\n        var endElementRect = null;\n        try {\n            endElementRect = Evernote.ElementExtension.getBoundingClientRect(range.endContainer);\n        }\n        catch(ex) {\n            Evernote.Logger.warn(\"Couldn't get a bounding client rect for our end element, maybe it's a text node.\");\n        }\n\n        \/\/ We look for a rectangle matching our end element, and if we find it, we don't copy it to our list to keep.\n        \/\/ You'd think we could just grab the last element in range.getClientRects() here and trim that one, which might be\n        \/\/ true, but the spec makes no claim that these are returned in order, so I don't want to rely on that.\n        \/\/ We keep track if we remove a rectangle, as we're only trying to remove one for the trailnig element. If there are\n        \/\/ more than one matching rectangle, we want to keep all but one of them.\n        var foundEnd = false;\n        var keptRects = [];\n        var initialRects = range.getClientRects();\n        for (var i = 0; i < initialRects.length; i++) {\n            if (rectanglesEqual(endElementRect, initialRects[i]) &#038;&#038; !foundEnd) {\n                foundEnd = true;\n            }\n            else {\n                keptRects.push(initialRects[i]);\n            }\n        }\n\n        \/\/ Now compute our new bounding box and return that.\n        if (keptRects.length == 0) return Evernote.ElementExtension.getBoundingClientRect(range);\n        if (keptRects.length == 1) return keptRects[0];\n\n        var rect = keptRects[0];\n        for (var i = 1; i < keptRects.length; i++) {\n            rect = unionRectangles(rect, keptRects[i]);\n        }\n\n        return rect;\n    }\n\n    \/\/ If every edge of the rectangle is in negative space,\n    function rectIsOnScreen(rect) {\n        \/\/ rtl pages have actual content in \"negative\" space. This case could be handled better.\n        if (document.dir == \"rtl\") {\n            return false;\n        }\n        \/\/ If both top and bottom are in negative space, we can't see this.\n        if (rect.bottom < 0 &#038;&#038; rect.top < 0) {\n            return false;\n        }\n        \/\/ Or, if both left and right are in negative space, we can't see this.\n        if (rect.left < 0 &#038;&#038; rect.right < 0) { return false; } \/\/ Probably visible. return true; } function applyElementRect(element, rect) { var newRect = rect; var tempRect = Evernote.ElementExtension.getBoundingClientRect(element); \/\/ We skip anything with an area of one px or less. This is anything that has \"display: none\", or single pixel \/\/ images for loading ads and analytics and stuff. Most hidden items end up at 0:0 and will stretch our rectangle \/\/ to the top left corner of the screen if we include them. Sometimes single pixels are deliberately placed off \/\/ screen. if ((tempRect.width * tempRect.height) > 1) {\n            newRect = unionRectangles(Evernote.ElementExtension.getBoundingClientRect(element), rect);\n        }\n        if (element.children) {\n            for (var i = 0; i < element.children.length; i++) {\n                newRect = applyElementRect(element.children[i], newRect);\n            }\n        }\n        return newRect;\n    }\n\n    \/\/ In the case of positioned elements, a bounding box around an element doesn't necessarily contain its child\n    \/\/ elements, so we have this method to combine all of these into one bigger box. ContentVeil calls this function.\n    function computeDescendantBoundingBox(element) {\n        if (!element) return {top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0};\n\n        var rect  = Evernote.ElementExtension.getBoundingClientRect(element)\n        return applyElementRect(element, rect);\n    }\n\n    function previewSelection(sel) {\n\n        var selection;\n        var selectionFrame;\n        if(sel) {\n            selection = sel;\n        }\n        else if (typeof Evernote.pageInfo !== undefined) {\n            selection = Evernote.pageInfo.getSelection();\n            \/\/ If our selection is in a frame or iframe, we'll compute an offset relative to that, so we need to adjust it by\n            \/\/ the offset of the frame.\n            selectionFrame = Evernote.pageInfo.getSelectionFrame();\n        }\n\n        contentVeil.reset();\n\n        var frameRect = null;\n        if (selectionFrame) {\n            frameRect = Evernote.ElementExtension.getBoundingClientRect(selectionFrame);\n        }\n\n        var range, rect, i;\n\n        \/\/ If !selection, then something has gone awry.\n        if (selection) {\n            clear();\n            contentVeil.reset();\n            \/\/ We attempt to highlight each selection, but this hasn't been tested for more than a single selection.\n            for (i = 0; i < Evernote.Utils.Selection.getRangeCount(selection); i++) { range = Evernote.Utils.Selection.getRangeAt(selection, i); rect = computeAlternateBoundingBox(Evernote.Utils.fixIERangeObject(range)); rect.top += document.documentElement.scrollTop; rect.bottom += document.documentElement.scrollTop; rect.left += document.documentElement.scrollLeft; rect.right += document.documentElement.scrollLeft; \/\/ Actual adjustment mentioned earlier regarding frames. if (frameRect) { rect.left += frameRect.left; rect.right += frameRect.left; rect.top += frameRect.top; rect.bottom += frameRect.top; } contentVeil.revealStaticRect(rect, selectionFrame, false); contentVeil.show(); } } contentVeil.show(); contentVeil.hideAllActiveObjects(); } function getSnippetText() { return snippet; } \/\/ Public API: this.getArticleElement = getArticleElement; this.looksInteresting = looksInteresting; this.computeDescendantBoundingBox = computeDescendantBoundingBox; this.previewArticle = previewArticle; this.previewFullPage = previewFullPage; this.previewSelection = previewSelection; this.previewUrl = previewUrl; this.clear = clear; this.previewNudge = nudgePreview; this.showOverlay = showOverlay; this.getSnippetText = getSnippetText; } \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ElementExtension = { querySelector : function(selector, doc) { if(!doc) { doc = document; } if(doc.querySelector) { return doc.querySelector(selector); } else { var head = doc.documentElement.firstChild; var styleTag = doc.createElement(\"STYLE\"); head.appendChild(styleTag); doc.__qsResult = []; styleTag.styleSheet.cssText = selector + \"{x:expression(document.__qsResult.push(this))}\"; window.scrollBy(0, 0); head.removeChild(styleTag); var result = []; for (var i in doc.__qsResult) result.push(doc.__qsResult[i]); return result; } }, getComputedStyle : function(element, pseudoElement, win) { var pseudo = pseudoElement; var target = win; if(!target) target = window; if(!pseudo) { pseudo = null; } if(target.getComputedStyle) return target.getComputedStyle(element, pseudo); if(element.currentStyle) { try { var fixedElement = Evernote.Utils.cloneObject(element.currentStyle); fixedElement['fontSize'] = Evernote.Utils.getIEComputedStyle(element, 'fontSize'); return fixedElement; } catch (err) { return element.currentStyle; } } return null; }, hasParentNode : function(element) { return element.parentNode &#038;&#038; element.parentNode.nodeType != 9 &#038;&#038; element.parentNode.nodeType != 11; }, getBoundingClientRect : function(element) { if(element &#038;&#038; element.getBoundingClientRect) { var rect = element.getBoundingClientRect(); var width = rect.width || element.offsetWidth || element.boundingWidth; var height = rect.height || element.offsetHeight || element.boundingHeight; return { left : rect.left, right : rect.right, top : rect.top, bottom : rect.bottom, width : width, height : height } } return null; }, hasAttribute : function(node, attrName) { if(node) { if(node.hasAttribute) { return node.hasAttribute(attrName); } if(node.attributes) { var attrValue = node.attributes[attrName]; return typeof attrValue != typeof undefined; } } } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.ArrayExtension = {\n    indexOf : function(element, searchStr) {\n        if(!element) {\n            return -1;\n        }\n        if (element.indexOf)\n            return element.indexOf(searchStr);\n        for(var i = 0; i < element.length; i++) {\n            if(element[i] == searchStr)\n                return i;\n        }\n        return -1;\n    },\n\n    containsCaseIgnore : function(element, searchStr) {\n        if(!element) {\n            return false;\n        }\n        for(var i = 0; i < element.length; i++) { if(element[i].toLowerCase() == searchStr.toLowerCase()) return true; } return false; }, remove : function(arr, element) { var elementPosition = Evernote.ArrayExtension.indexOf(arr, element); if(elementPosition != -1) { var rest = arr.slice(elementPosition + 1 || arr.length); arr.length = elementPosition; return arr.push.apply(arr, rest); } }, filter : function(arr, fun) { var len = arr.length >>> 0;\n        if (typeof fun != \"function\")\n            throw new TypeError();\n\n        var res = [];\n        var thisp = arguments[1];\n        for (var i = 0; i < len; i++) { if (i in arr) { var val = arr[i]; if (fun.call(thisp, val, i, arr)) { res.push(val); } } } return res; } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.StyleElementExtension = {\n    getPropertyValue : function(styleObj, propertyName) {\n        var props = propertyName;\n        if(!(props instanceof Array)) {\n            props = [propertyName];\n        }\n        Evernote.Logger.debug(\"Evernote.StyleElementExtension.getPropertyValue: number of properties to check \" + props.length);\n        for(var i = 0; i < props.length; i++) { var propName = props[i]; Evernote.Logger.debug(\"Evernote.StyleElementExtension.getPropertyValue: property name is \" + propName); var val; if(styleObj.getPropertyValue) { val = styleObj.getPropertyValue(propName); Evernote.Logger.debug(\"Evernote.StyleElementExtension.getPropertyValue: value from getPropertyValue is \" + val); if(val) return val; } val = styleObj[propName]; Evernote.Logger.debug(\"Evernote.StyleElementExtension.getPropertyValue: value from styleObj \" + val); if(val) return val; } } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.GlobalUtils = {};\n(function(){\n    var urlMatcher = \/^(.*?):\\\/\\\/((www\\.)?(.*?))(:\\d+)?(\\\/.*?)(\\?.*)?$\/;\n\n    var BAD_FAV_ICON_URLS = {\"http:\/\/localhost\/favicon.ico\": true};\n\n    Evernote.GlobalUtils.componentizeUrl = function(url) {\n        var data = {\n            protocol: null,\n            domain: null,\n            domainNoWww: null,\n            port: null,\n            path: null,\n            queryString: null\n        };\n        var matches = urlMatcher.exec(url);\n        data.protocol = matches[1];\n        data.domain = matches[2];\n        data.domainNoWww = matches[4];\n        data.port = matches[5];\n        data.path = matches[6];\n        data.queryString = matches[7];\n        return data;\n    };\n\n    Evernote.GlobalUtils.getMessageCode = function(messageConst) {\n        Evernote.Logger.debug(\"getMessageCode: \" + messageConst);\n        return Evernote.Messages[messageConst];\n    };\n\n    Evernote.GlobalUtils.absolutizeImages = function(element, path) {\n        if(path) {\n            Evernote.Utils.changeBackgroundImage(element, Evernote.Addin.getPath(\"resources\") + path);\n        }\n        else if(element.attributes &#038;&#038; element.attributes[\"background-image\"]) {\n            \/\/ TODO: replace \"oldlipper\" with universal path\n            Evernote.Utils.changeBackgroundImage(element, Evernote.Addin.getPath(\"resources\") + 'oldclipper\/' + element.attributes[\"background-image\"].value);\n        }\n        Evernote.Logger.debug(\"absolutizeImages: walk through children\");\n        for (var i = 0; i < element.children.length; i++) {\n            Evernote.GlobalUtils.absolutizeImages(element.children[i]);\n        }\n        Evernote.Logger.debug(\"absolutizeImages: end\");\n    };\n\n    Evernote.GlobalUtils.localize = function(element) {\n        var node = element.nodeName.toLowerCase();\n        if (node == \"input\" || node == \"textarea\") {\n            var type = element.type;\n            if (node == \"textarea\") type = \"textarea\";\n            switch (element.type) {\n                case \"text\":\n                case \"textarea\":\n                case \"button\":\n                case \"submit\":\n                case \"search\":\n                    if (element.attributes &#038;&#038; element.attributes[\"placeholder\"]) {\n                        var localizedMessage = Evernote.Addin.getLocalizedMessage(Evernote.GlobalUtils.getMessageCode(element.attributes[\"placeholder\"].value));\n                        Evernote.Logger.debug(\"localizedMessage is \" + localizedMessage);\n                        if (localizedMessage) {\n                            try {\n                                element.attributes[\"placeholder\"].value = localizedMessage;\n                            } catch(e) {\n                                var placeHolderAttr = document.createAttribute(\"placeholder\");\n                                placeHolderAttr.nodeValue = localizedMessage;\n                                element.setAttribute(\"placeholder\", localizedMessage);\n                            }\n                        }\n                    }\n\n                    if (element.attributes &#038;&#038; element.attributes[\"message\"]) {\n                        var localizedMessage = Evernote.Addin.getLocalizedMessage(Evernote.GlobalUtils.getMessageCode(element.attributes[\"message\"].value));\n                        Evernote.Logger.debug(\"localizedMessage is \" + localizedMessage);\n                        if (localizedMessage) {\n                            element.value = localizedMessage;\n                        }\n                    }\n                    break;\n\n                \/\/ unlocalizable.\n                case \"checkbox\":\n                case \"password\":\n                case \"hidden\":\n                case \"radio\":\n                    break;\n\n                default:\n                    throw new Error(\"We need to localize the value of input elements.\");\n            }\n        }\n\n        else if (element.attributes &#038;&#038; element.attributes[\"message\"]) {\n            var localizedMessage = Evernote.Addin.getLocalizedMessage(Evernote.GlobalUtils.getMessageCode(element.attributes[\"message\"].value));\n            if (localizedMessage) {\n                element.innerHTML = localizedMessage;\n            } else {\n                element.innerHTML = 'l10n error'; \/\/ to spot if something goes wrong\n            }\n        }\n\n        if (element.title){\n            var localizedTitle = Evernote.Addin.getLocalizedMessage(Evernote.GlobalUtils.getMessageCode(element.title));\n            if (localizedTitle) {\n                element.title = localizedTitle;\n            }\n        }\n\n        for (var i = 0; i < element.children.length; i++) {\n            Evernote.GlobalUtils.localize(element.children[i]);\n        }\n    };\n\n    Evernote.GlobalUtils.getQueryParams = function(url) {\n        var data = Evernote.GlobalUtils.componentizeUrl(url);\n        var queryString = data.queryString;\n        var params = {};\n        if (!queryString) {\n            return params;\n        };\n        queryString = queryString.substr(1); \/\/ Don't want the question mark.\n        queryString = queryString.split(\"#\")[0]; \/\/ Get rid of any fragment identifier.\n        var pairs = queryString.split(\"&#038;\");\n        var i;\n        for (i = 0; i < pairs.length; i++) {\n            var item = pairs[i].split(\"=\");\n            if (item[1]) {\n                item[1] = item[1].replace(\/\\+\/g, \" \");\n            }\n            params[item[0].toLowerCase()] = item[1];\n        }\n        return params;\n    };\n\n    Evernote.GlobalUtils.escapeXML = function(str) {\n        var map = {\n            \"&#038;\" : \"&amp;\",\n            \"<\" : \"&lt;\", \">\" : \"&gt;\",\n            \"\\\"\" : \"&quot;\",\n            \"'\" : \"&apos;\"\n        };\n\n        var a = str.split(\"\");\n        for (var i = 0; i < a.length; i++) { if (map[a[i]]) { a[i] = map[a[i]]; } } return a.join(\"\"); }; Evernote.GlobalUtils.decodeXML = function(str) { str = str.replace(\/&amp;apos;\/g, \"&#39;\"); str = str.replace(\/&amp;quot;\/g, \"&#34;\"); str = str.replace(\/&amp;lt;\/g, \"&#60;\"); str = str.replace(\/&amp;gt;\/g, \"&#62;\"); return str; }; Evernote.GlobalUtils.cropImage = function( data ) { var img = new Image; img.onload = function(){ var canvas=document.createElement(\"canvas\"); canvas.width=Math.min(150,data.width); canvas.height=Math.min(150,data.height); canvas.getContext(\"2d\").drawImage(img ,Math.max(0,(data.width-150)\/2),Math.max(0,(data.height-150)\/2),canvas.width,canvas.height,0,0,canvas.width,canvas.height); return canvas.toDataURL(); \/\/ Not working. Cross origin policy forbids toDataUrl() method. }; img.src = data.src; }; Evernote.GlobalUtils.createUrlClipContent = function(title, url, favIcoUrl, snippet) { var titleAttr = (title) ? Evernote.GlobalUtils.escapeXML(title) : \"\"; var urlStr = Evernote.GlobalUtils.escapeXML(url); var snip = snippet; if (snip.length > 275) {\n            snip = snip.substr(0, 275-3) + '...';\n        }\n\n        snip = Evernote.GlobalUtils.escapeXML(snip);\n\n        var contentStyle = 'text-align:left;padding:15px;font-size:12px;font-family:Verdana;max-width:370px;color:black;background-color:white;box-sizing:content-box;display:block;background-repeat:no-repeat;';\n        var titleStyle = 'white-space:nowrap;font-size:14px;font-weight:bold;overflow-x:hidden;text-overflow:ellipsis;height:24px;';\n        var hrStyle = 'border-top-width:1px;border-top-style:solid;border-top-color:#d8d8d8;height:0;width:100%;';\n        var imgStyle = 'position:relative;display:inline-block;float:left;width:150px;height:150px;margin:15px 30px 0 0;overflow:hidden;';\n        var contStyle = 'display:inline-block;vertical-align:top;margin:15px 0 0;width:364px;';\n        var linkDivStyle = 'padding:0px 0px 11px 0px;';\n        var faviconStyle = 'float:left;width:16px; height:16px; margin-right:9px; background-size:16px 16px;background-repeat: no-repeat; background-position:left center;';\n        var linkStyle = 'display:inline-block;text-decoration:none;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:rgb(12, 12, 12);width:325px;';\n        var snipStyle ='word-wrap:break-word;line-height:normal;text-align:left;font-size:12px';\n\n        var imgDiv = '';\n        var titleDiv = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkTitle\" style=\"' + titleStyle + '\">' + titleAttr + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n        var hrDiv = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkDivider\" style=\"' + hrStyle + '\">&#160;<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n\n        Evernote.pageInfo.getBiggestImage(function(data) {\n            if (data &#038;&#038; data.src) {\n                var im = '<img decoding=\"async\" src=\"' + data.src + '\" width=\"150\"\/>';\n                imgDiv =  '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkImage\" style=\"'+ imgStyle +'\">' + im + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n                contentStyle = contentStyle.replace('max-width:370px','max-width:562px');\n            }\n        });\n\n        var link = '<a style=\"' + linkStyle + '\" href=\"' + urlStr+ '\">' + urlStr + '<\/a>';\n        var favicon = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div style=\"' + faviconStyle + 'background-image:url('+ favIcoUrl + ');\">&#160;<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n        var linkDiv = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkLink\" style=\"' + linkDivStyle + '\">' + favicon + link + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n' ;\n        var snipDiv = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkSnippet\" style=\"' + snipStyle + '\">' + snip + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n        var contDiv = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkContent\" style=\"' + contStyle + '\">' + linkDiv + snipDiv + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n        var clearDiv = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div style=\"clear:both\"\/>\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>'\n\n        var content = '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div id=\"evernoteBookmarkContainer\" style=\"' + contentStyle + '\">' + titleDiv + hrDiv + imgDiv + contDiv + clearDiv + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n        return content;\n    };\n\n    Evernote.GlobalUtils.executeOnDomReady = function(callback) {\n        Evernote.JQuery(document).ready(function() {\n            callback();\n        });\n    };\n\n    Evernote.GlobalUtils.isDocumentLoaded = function(doc) {\n        return doc.readyState == \"complete\" || doc.readyState == \"interactive\";\n    };\n})();\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/**\n * Global utilities.\n *\/\nEvernote.Utils = {\n    _prevTime : null,\n\n    getIEComputedStyle : function(elem, prop) {\n        \/\/Dean Edwards method. See first comment here: http:\/\/bit.ly\/cMSs9R\n\n        var value = elem.currentStyle[prop] || 0;\n        var leftCopy = elem.style.left;\n        var runtimeLeftCopy = elem.runtimeStyle.left;\n\n        elem.runtimeStyle.left = elem.currentStyle.left;\n        elem.style.left = (prop === \"fontSize\") ? \"1em\" : value;\n        value = elem.style.pixelLeft + \"px\";\n\n        elem.style.left = leftCopy;\n        elem.runtimeStyle.left = runtimeLeftCopy;\n        return value\n    },\n\n    sendMessageToPopup : function( message ){\n        Evernote.JQuery(\"#\" + Constants.CLIP_DIALOG_ID).trigger(message);\n    },\n\n    pushTimeWithPrefix : function(prefix) {\n        var time = new Date;\n        var passed;\n\n        time = time.getTime();\n        passed = time - this._prevTime;\n        this._prevTime = time;\n        console.log(prefix + ': ' + passed + 'ms');\n    },\n\n    cloneObject : function(obj){\n        if(obj == null || typeof(obj) != 'object')\n            return obj;\n        if(obj.constructor == Array)\n            return [].concat(obj);\n        var temp = {};\n        for(var key in obj)\n            temp[key] = this.cloneObject(obj[key]);\n        return temp;\n    },\n\n    saveSelection : function(win) {\n        Evernote.Logger.debug( \"Utils.SaveSelection()\" );\n        var selectionFinder = new Evernote.SelectionFinder(win.document);\n        selectionFinder.find( true );\n        if(selectionFinder.hasSelection()) {\n            return Evernote.Utils.cloneRange(selectionFinder.getRange());\n        }\n        return null;\n    },\n\n    clearSelection : function(doc) {\n        if(doc.getSelection) {\n            doc.getSelection().removeAllRanges();\n        }\n    },\n\n    \/**\n     * Make selection of passed range in document.\n     * @param doc - DOM object\n     * @param range - selection range\n     *\/\n    selectRange : function(doc, range) {\n        if(doc.getSelection) {\n            doc.getSelection().addRange(range);\n        }\n        else if (doc.selection &#038;&#038; range) {\n            range.select();\n        }\n    },\n\n    \/**\n     * Creates copy of selection range only if it supports it, otherwise returns same range\n     * @param range - Range object\n     * @return {Range}\n     *\/\n    cloneRange : function(range) {\n        Evernote.Logger.debug(\"cloneRange: start\");\n        if(range &#038;&#038; range.cloneRange) {\n            return range.cloneRange();\n        }\n        if(range.duplicate) {\n            Evernote.Logger.debug(\"cloneRange: result = \" + range.duplicate());\n            return range.duplicate();\n        }\n        return range;\n    },\n\n    \/**\n     * Checks whether selection is presented.\n     * @param win - window object that should be checked.\n     * @return true - if selection is presented, false otherwise.\n     *\/\n    hasSelection : function(win) {\n        Evernote.Logger.debug( \"Utils.hasSelection()\" );\n        var selectionFinder = new Evernote.SelectionFinder(win.document)\n        if ( selectionFinder.hasSelection() ) {\n            return true;\n        }\n        else {\n            selectionFinder.find( true );\n            return selectionFinder.hasSelection();\n        }\n    },\n\n    \/**\n     * Gets favicon url from the document (if any)\n     * @param doc - document to inspect.\n     * @return url to the favicon or null.\n     *\/\n    getFavIconUrl : function(doc) {\n        var links = doc.getElementsByTagName(\"link\");\n        var i;\n        for (i = 0; i < links.length; i++) { if (links[i].rel) { var rels = links[i].rel.toLowerCase().split(\/\\s+\/); if (Evernote.ArrayExtension.indexOf(rels, \"icon\") !== -1) { \/\/ Found it! return links[i].href; } } } return null; }, \/** * If passed string length is more than length argument, than string is trimmed to length and dots are added * (total length of the returned string does not exceed specified length). * @param str - string to trim * @param length - max number of characters in the string * @param addition - text to be added to truncated string * @return {*} *\/ cutToLength : function(str, length, addition) { if(!addition) { addition = \"...\"; } if(str.length > length) {\n            return (str.substring(0, length-3) + addition);\n        }\n        return str;\n    },\n\n    \/**\n     * Change new line symbol to html \n     *\/\n    newLineToBr : function(str) {\n        return str.replace(\/(\\r\\n|\\n|\\r)\/gm, \"\n\");\n    },\n\n    \/**\n     * Encodes html specific characters (<, >, &#038;, etc.) in specified string\n     * @param str - string to encode.\n     * @return new string with encoded characters.\n     *\/\n    htmlEncode : function( str ) {\n        var result = \"\";\n        for ( var i = 0; i < str.length; i++ ) { var charcode = str.charCodeAt( i ); var aChar = str[ i ]; if(!aChar) { aChar = str.charAt(i); } if(charcode >= 55296 )\n                result += aChar;\n            else if ( charcode > 0x7f ) {\n                result += \"&#\" + charcode + \";\";\n            }\n            else if ( aChar == '>' ) {\n                result += \"&gt;\";\n            }\n            else if ( aChar == '<' ) {\n                result += \"&lt;\";\n            }\n            else if ( aChar == '&#038;' ) {\n                result += \"&amp;\";\n            }\n            else {\n                result += str[ i ] ? str[ i ] : str.charAt(i);\n            }\n        }\n\n        return result;\n    },\n\n    \/**\n     * Absolutize specified url by specified base.\n     * @param base - base url\n     * @param href - relative url (from base)\n     *\/\n    makeAbsolutePath : function ( base, href ) {\n        function parseURI( url ) {\n            var m = String( url ).replace( \/^\\s+|\\s+$\/g, '' ).match( \/^([^:\\\/?#]+:)?(\\\/\\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?\/ );\n            \/\/ authority = '\/\/' + user + ':' + pass '@' + hostname + ':' port\n            return (m ? {\n                href : m[ 0 ] || '',\n                protocol : m[ 1 ] || '',\n                authority : m[ 2 ] || '',\n                host : m[ 3 ] || '',\n                hostname : m[ 4 ] || '',\n                port : m[ 5 ] || '',\n                pathname : m[ 6 ] || '',\n                search : m[ 7 ] || '',\n                hash : m[ 8 ] || ''\n            } : null);\n        }\n\n        function absolutizeURI( base, href ) {\/\/ RFC 3986\n            function removeDotSegments( input ) {\n                var output = [];\n                input.replace( \/^(\\.\\.?(\\\/|$))+\/, '' )\n                    .replace( \/\\\/(\\.(\\\/|$))+\/g, '\/' )\n                    .replace( \/\\\/\\.\\.$\/, '\/..\/' )\n                    .replace( \/\\\/?[^\\\/]*\/g, function ( p ) {\n                        if ( p === '\/..' ) {\n                            output.pop();\n                        }\n                        else {\n                            output.push( p );\n                        }\n                    } );\n                return output.join( '' ).replace( \/^\\\/\/, input.charAt( 0 ) === '\/' ? '\/' : '' );\n            }\n\n            href = parseURI( href || '' );\n            base = parseURI( base || '' );\n\n            return !href || !base ? null : (href.protocol || base.protocol) +\n                (href.protocol || href.authority ? href.authority : base.authority) +\n                removeDotSegments( href.protocol || href.authority || href.pathname.charAt( 0 ) === '\/' ? href.pathname :\n                    (href.pathname ? ((base.authority &#038;&#038; !base.pathname ? '\/' : '') +\n                        base.pathname.slice( 0, base.pathname.lastIndexOf( '\/' ) + 1 ) + href.pathname) : base.pathname) ) +\n                (href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) +\n                href.hash;\n        }\n        return absolutizeURI( base, href );\n\n    },\n\n    getNestedDocuments : function( doc ) {\n        Evernote.Logger.debug( \"Utils.getNestedDocuments()\" );\n\n        var docs = [ ];\n        try {\n            var frames = ( doc ) ? doc.getElementsByTagName( \"frame\" ) : [ ];\n            for ( var i = 0; i < frames.length; ++i ) {\n                if ( frames[ i ].contentDocument ) {\n                    docs.push( frames[ i ].contentDocument );\n                }\n            }\n\n            var iframes = ( doc ) ? doc.getElementsByTagName( \"iframe\" ) : [ ];\n            for ( i = 0; i < iframes.length; ++i ) {\n                if ( iframes[ i ].contentDocument ) {\n                    docs.push( iframes[ i ].contentDocument );\n                }\n            }\n        } catch (e) {\n            Evernote.Logger.error(\"getNestedDocuments failed with error \" + e);\n        }\n        Evernote.Logger.debug( \"Utils.getNestedDocuments() end\" );\n        return docs;\n\n    },\n\n    isSupportedUrl : function(url) {\n        return url.indexOf(\"http\") == 0;\n    },\n\n    getFontSizeInPixels : function(elementFontSize) {\n        function computedStyle(element, property){\n            var s = false;\n            if(window.getComputedStyle){\n                s = window.getComputedStyle(element, null).getPropertyValue(property);\n            } else if(element.currentStyle){\n                var p = property.split('-');\n                var str = new String('');\n                for(var i = 0; i < p.length; i++){ str += (i > 0)?(p[i].substr(0, 1).toUpperCase() + p[i].substr(1)):p[i];\n                }\n                s = element.currentStyle[str];\n            }\n            return s;\n        }\n\n        function getPercentageSize(size) {\n            var currentFontSize = parseFloat(size);\n            var htmlFontSize = 16;\n            var htmlElement = document.getElementsByTagName(\"html\");\n            if(htmlElement &#038;&#038; htmlElement.length > 0) {\n                var htmlComputedFontSize = computedStyle(htmlElement[0], \"font-size\");\n                if(htmlComputedFontSize &#038;&#038; htmlComputedFontSize.indexOf(\"%\") == -1) {\n                    htmlFontSize = Evernote.Utils.getFontSizeInPixels(htmlComputedFontSize);\n                }\n            }\n            return htmlFontSize * currentFontSize \/ 100;\n        }\n\n        var size = elementFontSize;\n        if(size.indexOf(\"em\") > -1) {\n            var defFont = computedStyle(document.body, \"font-size\");\n            if(defFont.indexOf(\"pt\") > -1){\n                defFont = Math.round(parseInt(defFont)*96\/72);\n            } else if(defFont.indexOf(\"%\") > -1)  {\n                defFont = getPercentageSize(defFont);\n            } else{\n                defFont = parseInt(defFont);\n            }\n            size = Math.round(defFont * parseFloat(size));\n        }\n        else if(size.indexOf(\"pt\") > -1){\n            size = Math.round(parseInt(size)*96\/72)\n        } else if(size.indexOf(\"%\") > -1) {\n            size = getPercentageSize(size);\n        }\n        return parseInt(size);\n    },\n\n    innerWidth : function() {\n        if(window.innerWidth)\n            return window.innerWidth;\n\n        var doc= (document.body.clientWidth)? document.body: document.documentElement;\n        return doc.clientWidth;\n    },\n\n    innerHeight : function() {\n        if(window.innerHeight)\n            return window.innerHeight;\n\n        var doc= (document.body.clientHeight)? document.body: document.documentElement;\n        return doc.clientHeight;\n    },\n\n    scrollTop : function() {\n        var doc = document.body.scrollTop ? document.body : document.documentElement;\n        return doc.scrollTop;\n    },\n\n    scrollLeft : function() {\n        var doc = document.body.scrollLeft ? document.body : document.documentElement;\n        return doc.scrollLeft;\n    },\n\n    \/**\n     * Stopped propagation of keydown events for passed selector.\n     * @param selector - could be element or jquery selector.\n     *\/\n    hardInput : function(selector) {\n        this.elem = Evernote.JQuery(selector);\n        this.elem.keydown(function(e) {\n            e.stopPropagation();\n        });\n    },\n\n    isQuirkMode : function() {\n        return document.compatMode == \"BackCompat\" &#038;&#038; !Evernote.BrowserDetection.isIE11();\n    },\n\n    isQuirkModeNew : function() {\n        return document.compatMode == \"BackCompat\" &#038;&#038; Evernote.BrowserDetection.isLessThanIE9();\n    },\n\n    isInstanceOf : function(obj, type) {\n        if(obj &#038;&#038; type) {\n            try {\n                return obj instanceof type;\n            } catch (e) {\n                return type.toString().indexOf(typeof obj) != -1;\n            }\n        }\n        return false;\n    },\n\n    changeBackgroundImage : function(element, localpath) {\n        if(element.style) {\n            element.style.backgroundImage = \"url('file:\/\/\/\" + localpath.replace(\/\\\\\/g, \"\/\").replace(\/\\s\/g, \"%20\") + \"')\";\n        }\n    },\n\n    format: function(str) {\n        var args = arguments;\n        return str.replace(\/\\{(\\d+)\\}\/g, function (m, n) { return args[(n | 0)+1]; });\n    },\n\n    fixIERangeObject : function(range,win) { \/\/Only for IE8 and below.\n        win=win || window;\n\n        if(!range) return null;\n        if(!range.startContainer &#038;&#038; win.document.selection) { \/\/IE8 and below\n\n            var _findTextNode=function(parentElement,text) {\n                \/\/Iterate through all the child text nodes and check for matches\n                \/\/As we go through each text node keep removing the text value (substring) from the beginning of the text variable.\n                var container=null,offset=-1;\n                for(var node=parentElement.firstChild; node; node=node.nextSibling) {\n                    if(node.nodeType==3) {\/\/Text node\n                        var find=node.nodeValue;\n                        var pos=text.indexOf(find);\n                        if(pos==0 &#038;&#038; text!=find) { \/\/text==find is a special case\n                            text=text.substring(find.length);\n                        } else {\n                            container=node;\n                            offset=text.length-1; \/\/Offset to the last character of text. text[text.length-1] will give the last character.\n                            break;\n                        }\n                    }\n                }\n                \/\/Debug Message\n                \/\/alert(container.nodeValue);\n                return {node: container,offset: offset}; \/\/nodeInfo\n            };\n\n            var rangeCopy1=range.duplicate(), rangeCopy2=range.duplicate(); \/\/Create a copy\n            var rangeObj1=range.duplicate(), rangeObj2=range.duplicate(); \/\/More copies :P\n\n            rangeCopy1.collapse(true); \/\/Go to beginning of the selection\n            rangeCopy1.moveEnd('character',1); \/\/Select only the first character\n            rangeCopy2.collapse(false); \/\/Go to the end of the selection\n            rangeCopy2.moveStart('character',-1); \/\/Select only the last character\n\n            \/\/Debug Message\n            \/\/ alert(rangeCopy1.text); \/\/Should be the first character of the selection\n            var parentElement1=rangeCopy1.parentElement(), parentElement2=rangeCopy2.parentElement();\n\n            \/\/If user clicks the input button without selecting text, then moveToElementText throws an error.\n            if(window.HTMLInputElement &#038;&#038; (parentElement1 instanceof window.HTMLInputElement || parentElement2 instanceof HTMLInputElement)) {\n                return null;\n            }\n            rangeObj1.moveToElementText(parentElement1); \/\/Select all text of parentElement\n            rangeObj1.setEndPoint('EndToEnd',rangeCopy1); \/\/Set end point to the first character of the 'real' selection\n            rangeObj2.moveToElementText(parentElement2);\n            rangeObj2.setEndPoint('EndToEnd',rangeCopy2); \/\/Set end point to the last character of the 'real' selection\n\n            var text1=rangeObj1.text; \/\/Now we get all text from parentElement's first character upto the real selection's first character\n            var text2=rangeObj2.text; \/\/Here we get all text from parentElement's first character upto the real selection's last character\n\n            var nodeInfo1=_findTextNode(parentElement1,text1);\n            var nodeInfo2=_findTextNode(parentElement2,text2);\n\n            \/\/ todo: dirty fix\n            if (!nodeInfo1.node) {\n                nodeInfo1.node = parentElement1;\n            }\n\n            if (!nodeInfo2.node) {\n                nodeInfo2.node = parentElement2;\n            }\n\n            \/\/Finally we are here\n            range.startContainer=nodeInfo1.node;\n            range.startOffset=nodeInfo1.offset;\n            range.endContainer=nodeInfo2.node;\n            range.endOffset=nodeInfo2.offset+1; \/\/End offset comes 1 position after the last character of selection.\n        }\n        return range;\n    },\n\n    unionRectangles : function(rect1, rect2) {\n        var rect = {\n            top: (Math.min(rect1.top, rect2.top)),\n            bottom: (Math.max(rect1.bottom, rect2.bottom)),\n            left: (Math.min(rect1.left, rect2.left)),\n            right: (Math.max(rect1.right, rect2.right))\n        };\n        rect.width = rect.right - rect.left;\n        rect.height = rect.bottom - rect.top;\n\n        return rect;\n    },\n\n    fixedPosition : function(win, el, topOffset, immediate) {\n        function applyPosition(elem) {\n            if(elem) {\n                var scrollPosition = win.document.documentElement.scrollTop || win.document.body.scrollTop;\n                var offset;\n                if(typeof topOffset == \"function\") {\n                    offset = topOffset();\n                } else {\n                    offset = scrollPosition + topOffset;\n                }\n                elem.animate({top: offset}, 100);\n            }\n        }\n\n        if(el) {\n            var elem = Evernote.JQuery(el);\n            if(Evernote.Utils.isQuirkMode())  {\n                elem.css(\"position\", \"absolute\");\n                if (win.attachEvent)\n                    win.attachEvent(\"onscroll\", function() {applyPosition(elem);});\n                else if (win.addEventListener)\n                    win.addEventListener(\"scroll\", function() {applyPosition(elem);}, false);\n                else\n                    Evernote.Logger.error( \"Utils.fixedPosition() can't attachEvent\" );\n                if(immediate) {\n                    applyPosition(elem);\n                }\n            }\n        }\n    },\n\n    mergeCustomComboBoxStrings : function(notebook, owner, ownedByStr, maxLen) {\n\n        var totalLen = notebook.length;\n        if (owner.length) {\n            \/\/ format: \"space\",\"(\",\"<owned by localize string>\",\"space\",\"<owner>\",\")\"\n            \/\/ magic number \"4\" is: \"space\",\"(\",\"space\",\")\"\n            totalLen += ownedByStr.length + owner + 4;\n        }\n\n        if (totalLen <= maxLen) {\n            return {\n                note: notebook,\n                own: \"\",\n                title: \"\"\n            };\n        }\n\n        var half = maxLen \/ 2 - 2;\n\n        if (owner.length == 0) {\n            return {\n                note: notebook.substr(0, half) + \"...\" + notebook.substring(notebook.length - half, notebook.length),\n                own: \"\",\n                title: notebook\n            };\n        }\n\n        var ownerFormatStr = \"(\" + ownedByStr + \" \" + owner + \")\";\n        var title = notebook + ownerFormatStr;\n        var resultString = title.substr(0, half) + \"...\" + title.substr(title.length - half);\n\n        if (notebook.length <= half) {\n            return  {\n                note: notebook,\n                own: \"...\" + title.substr(title.length - notebook.length),\n                title: notebook + \" \" + ownerFormatStr\n            };\n        }else if (ownerFormatStr <= half) { return { note: notebook.substr(0, maxLen - ownerFormatStr.length) + \"...\", own: ownerFormatStr, title: notebook + \" \" + ownerFormatStr }; }else { return { note: resultString.substr(0, resultString.length - half), own: resultString.substr(half + 3), title: notebook + \" \" + ownerFormatStr }; } }, setEvernoteLogo : function(selector) { var serverLocation = Evernote.Addin.getServerLocation(); Evernote.Logger.debug(\"Evernote server location is \" + serverLocation); if (serverLocation.length &#038;&#038; serverLocation.indexOf(\"international\") == -1) { var evernoteLogoEl = Evernote.JQuery(selector); if (evernoteLogoEl) { var imageFileName = \"oldclipper\/images\/web-clipper-logo_\" + serverLocation + \".png\"; this.changeBackgroundImage(evernoteLogoEl.get(0), Evernote.Addin.getPath(\"resources\") + imageFileName); } } }, Selection : { getRangeCount : function(selection) { if(selection.rangeCount) { return selection.rangeCount; } return 1; }, getRangeAt : function(selection, pos) { if(selection.getRangeAt) { selection.getRangeAt(pos); } return selection; }, getCommonAncestorContainer : function(range) { if(range.commonAncestorContainer) { return range.commonAncestorContainer; } else if(range.parentElement) { return range.parentElement(); } return null; } } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClipperActions = { CLIP_URL : \"0\", CLIP_FULL_PAGE: \"1\", CLIP_ARTICLE: \"2\", CLIP_SELECTION: \"3\", \/\/ Selection is not supported by default CLIP_IMAGE: \"4\", \/\/ Image too CLIP_SIMPLIFIED_ARTICLE: \"5\", CLIP_SCREEN_SHOT: \"6\" }; Evernote.ArticleSelectionOptions = { ENABLED : \"0\", DISABLED : \"1\", ENABLED_WITHOUT_HINTS : \"2\" }; Evernote.Trigger = { ENABLED : true, DISABLED : false }; Evernote.Options = { oneClickMode: false, action: { bydefault: \"2\", lastUsedEnable: true, lastUsed: \"article\" }, tags: { alwaysEnable: false, alwaysData: \"\" }, notebooks: { lastUsed: -1, lastUsedEnable: true, bydefault: \"\" }, skitch: { lastUsedColor: \"\" }, hints: { permanentScreenCapture : true }, postClip : { show : false }, \/** * Return string representation of the object (you can use it in load method to restore object from string). *\/ _serialize: function() { \/\/return JSON.stringify(this, null, '\\t'); CNN.com has own JSON.stringify with parse errors function strObj( obj ) { var i = 0; var optArr = []; for (var prop in obj) { if (obj.hasOwnProperty(prop) &#038;&#038; typeof obj[prop] != 'function') { var value; if (typeof obj[prop] == 'object') { value = strObj(obj[prop]); } else if (typeof obj[prop] == 'string') { var tempStr = obj[prop]; tempStr = tempStr.replace(\/\\\\\/g, \"\\\\\\\\\"); tempStr = tempStr.replace(\/\\\"\/g, \"\\\\\\\"\"); value = '\"' + tempStr + '\"'; } else { value = obj[prop]; } optArr[i] = '\"' + prop + '\":' + value; i++; } } return '{' + optArr.toString() + '}'; } return strObj(this); }, load : function() { var optionsContent = Evernote.FS.getOptionsFileContent(); this._load(optionsContent); Evernote.Logger.debug('Load options ' + JSON.stringify(this, null, '\\t')); }, _load : function(str) { if(str) { try { var options; options = JSON.parse(str); for (var prop in options) { if (options[prop] &#038;&#038; options.hasOwnProperty(prop)) { this[prop] = options[prop]; } } } catch(e){ \/\/ ignore } } }, setScreenCaptureHintNonPermanent : function(){ this.hints.permanentScreenCapture = false; this.save(); }, setDefaultAction : function(action) { this.action.bydefault = action; this.setLastUsedActionDisabled(); this.save(); }, setDefaultNotebook : function(notebook) { this.notebooks.bydefault = notebook; this.setLastUsedNotebookDisabled(); this.save(); }, setNotebook : function(notebookUid) { this.notebooks.lastUsed = notebookUid; this.save(); }, setLastUsedNotebookEnabled : function() { if (this.notebooks.lastUsedEnable == Evernote.Trigger.DISABLED) { this.notebooks.lastUsedEnable = Evernote.Trigger.ENABLED; } this.save(); }, setLastUsedNotebookDisabled : function() { if (this.notebooks.lastUsedEnable == Evernote.Trigger.ENABLED) { this.notebooks.lastUsedEnable = Evernote.Trigger.DISABLED; } this.save(); }, setLastUsedAction : function(action) { this.action.lastUsed = action; this.save(); }, setLastUsedActionEnabled : function () { if (this.action.lastUsedEnable == Evernote.Trigger.DISABLED) { this.action.lastUsedEnable = Evernote.Trigger.ENABLED; } this.save(); }, setLastUsedActionDisabled : function() { if (this.action.lastUsedEnable == Evernote.Trigger.ENABLED) { this.action.lastUsedEnable = Evernote.Trigger.DISABLED; } }, setOneClickClipping : function(condition) { if (condition) { this.oneClickMode = Evernote.Trigger.ENABLED; } else { this.oneClickMode = Evernote.Trigger.DISABLED; } this.save(); }, setAlwaysTagsEnabled : function (condition) { if (condition) { this.tags.alwaysEnable = Evernote.Trigger.ENABLED; } else { this.tags.alwaysEnable = Evernote.Trigger.DISABLED; } this.save(); }, setAlwaysTagsString : function (str) { this.tags.alwaysData = str; this.save(); }, setPostClipDialogEnabled : function () { if (this.postClip.show == Evernote.Trigger.DISABLED) { this.postClip.show = Evernote.Trigger.ENABLED; } this.save(); }, setPostClipDialogDisabled : function () { if (this.postClip.show == Evernote.Trigger.ENABLED) { this.postClip.show = Evernote.Trigger.DISABLED; } this.save(); }, setLastUsedSkitchColor : function(color) { this.skitch.lastUsedColor = color; this.save(); }, save : function() { Evernote.Logger.debug('Save options: ' + JSON.stringify(this, null, '\\t')); var jsonSer = this._serialize(); Evernote.FS.writeOptionsToFile(jsonSer); } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.BrowserDetection = { isIE11 : function() { return navigator.userAgent.indexOf(\"Trident\/7.0\") != -1 }, isIE10 : function() { return navigator.userAgent.indexOf(\"MSIE 10\") != -1; }, isIE7 : function() { return navigator.userAgent.indexOf(\"MSIE 7.0\") != -1 &#038;&#038; navigator.userAgent.indexOf(\"Trident\/7.0\") == -1; }, isIE8 : function() { return navigator.userAgent.indexOf(\"MSIE 8.0\") != -1 &#038;&#038; navigator.userAgent.indexOf(\"Trident\/7.0\") == -1; }, isIE9 : function() { return navigator.userAgent.indexOf(\"MSIE 9.0\") != -1 &#038;&#038; navigator.userAgent.indexOf(\"Trident\/7.0\") == -1; }, isLessThanIE9 : function() { return Evernote.BrowserDetection.isIE7() || Evernote.BrowserDetection.isIE8() }, isIE10orGreater : function() { return Evernote.BrowserDetection.isIE10() || Evernote.BrowserDetection.isIE11() } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.Node = { ELEMENT_NODE : 1, TEXT_NODE : 3 }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.Share = { _DEFAULT_WIDTH : 650, _DEFAULT_HEIGHT : 650, _DEFAULT_TYPE : 'popup', _openWindow : function( url, width, height ) { var w = width || this._DEFAULT_WIDTH; var h = height || this._DEFAULT_HEIGHT; var t = this._DEFAULT_TYPE; var params = 'width=' + w + ',height=' + h + ',type=' + t + ',left=200,top=200,resizable=yes'; Evernote.Logger.debug('Open ' + url + ' with params: ' + params); window.open(url, null, params); }, toSocial : function ( id, link , title) { Evernote.Logger.debug('Evernote.Share.toSocial ' + id + ' and link: ' + link + ', title: ' + title); var shareUrl; if ( id == 'facebook') { shareUrl = \"https:\/\/www.facebook.com\/sharer\/sharer.php?u=\" + encodeURIComponent(link); this._openWindow( shareUrl, 626, 436 ); } else if (id == 'twitter') { shareUrl = \"https:\/\/twitter.com\/intent\/tweet?text=\" + encodeURIComponent(title) + \"&#038;url=\" + encodeURIComponent(link); this._openWindow( shareUrl, 550, 420 ); } else if (id == 'linkedin') { shareUrl = \"http:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=\" + encodeURIComponent(link) + \"&#038;title=\" + encodeURIComponent(title); this._openWindow( shareUrl, 900, 570 ); } else if (id == 'weibo') { shareUrl = \"http:\/\/service.weibo.com\/share\/share.php?url=\" + encodeURIComponent(link) + \"&#038;title=\" + encodeURIComponent(title); this._openWindow( shareUrl, 650, 650 ); } } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.PostClipPopup = function(doc) {\n\n    var elem = Evernote.JQuery('#' + Constants.POST_CLIP_DIALOG_ID);\n    var clipboard_container = elem.find('#' + 'evn-clipboardCopy-container');\n\n    var titleField = elem.find('.noteTitle');\n    var link = Evernote.pageInfo.getUrl();\n    var shareTitle = 'error';\n\n    \/\/ subscribe to response from addin\n    Evernote.ResponseReceiver.subscribe(this);\n\n    var _title = '';\n    var _notebook = '';\n    var clipping_message = Evernote.Addin.getLocalizedMessage(Evernote.Messages.CLIPPING);\n    var clipped_message = Evernote.Addin.getLocalizedMessage(Evernote.Messages.CLIPPED);\n\n    var message = elem.find('.clippedMessage');\n    var closeButton = elem.find('.closeCross');\n    var openButton  = elem.find('#openButton');\n    var shareButton  = elem.find('#shareButton');\n    var shareIcons = elem.find('.shareButton');\n\n    var cbInput = elem.find('.evn-pcp-clipboard-input');\n    var cbMessage = elem.find('.evn-pcp-clipboard-message');\n    var cbButton = elem.find('.evn-pcp-clipboard-button');\n\n    var errorLink = elem.find('#evn-show-logs');\n    var errorMsg = elem.find('.evn-error-desc');\n\n    function showLogs() {\n        var logFile = Evernote.Addin.getPath(\"logfile\");\n        Evernote.Addin.openLocalFile(logFile, BrowserNavConstants.NAVOPENNEWTAB);\n    }\n\n    function modifyToCurrentIE() {\n        if (document.documentMode == '9') {\n            elem.addClass('evn-iexplorer9');\n        } else if (document.documentMode == '7' || Evernote.BrowserDetection.isIE7()) {\n            elem.addClass('evn-iexplorer7');\n        }\n    }\n\n    function finishPostClip () {\n        endProcessingAndClose();\n\/\/        if (Evernote.Options.postClip.show == true) {\n\/\/            endProcessing();\n\/\/        } else {\n\/\/            endProcessingAndClose();\n\/\/        }\n    }\n\n    function localize() {\n        Evernote.GlobalUtils.localize(elem.get(0));\n    }\n\n    function copyToClipboard(){\n        var clipSucceed = window.clipboardData.setData('Text', link);\n\n        var isAllowed = window.clipboardData.getData('Text');\n        if (isAllowed == \"\") { \/\/ Could be empty, or failed\n            \/\/ Verify failure\n            if (!window.clipboardData.setData('Text', 'test_string'))\n                isAllowed = null;\n        }\n\n        if (clipSucceed &#038;&#038; isAllowed) {\n            clipboard_container.addClass('evn-success');\n            cbMessage.text(Evernote.Addin.getLocalizedMessage(Evernote.Messages.URL_COPIED));\n        } else {\n            clipboard_container.addClass('evn-failed');\n            cbMessage.text(Evernote.Addin.getLocalizedMessage(Evernote.Messages.DISABLED));\n        }\n\n    }\n\n    function handleShareIconClick ( evt ) {\n        var id = evt.srcElement.id || Evernote.JQuery(evt.target).closest('table').attr('id');\n\n        if (id == 'clipboard') {\n            elem.addClass('evn-clipboard-mode');\n        } else {\n            Evernote.Share.toSocial( id , link, shareTitle);\n        }\n    }\n\n    function fillOutPopup(title, notebook) {\n        _title = title;\n        _notebook = notebook;\n\n        titleField.html(title);\n        cbInput.val(link);\n        shareTitle = title;\n    }\n\n    function renderErrorMessage( error ) {\n\n        if (error.code == Evernote.ErrorCodes.AUTHENTICATION_ERROR) {\n            errorMsg.html(error.message);\n        }\n\n        elem.removeClass('processing');\n        elem.addClass('evn-error-mode');\n    }\n\n    function processError(error) {\n        renderErrorMessage(error);\n        elem.show();\n        return true;\n    }\n\n    function endProcessing() {\n        elem.removeClass('processing');\n        Evernote.ClearlyController.removeHighlighted();\n        message.html(clipped_message + ' ' + _notebook);\n    }\n\n    function endProcessingAndClose() {\n        elem.removeClass('processing').addClass('withoutShare');\n        Evernote.ClearlyController.removeHighlighted();\n        message.html(clipped_message + ' ' + _notebook);\n\n        setTimeout(function(){\n            hide();\n        }, 1000);\n    }\n\n    function setProcessing() {\n        elem.addClass('processing');\n        message.html('<span class=\"evn-processing-status\">' + clipping_message + '<\/span>' + _title);\n    }\n\n    function show() {\n        setProcessing();\n        addListeners();\n        elem.show();\n        elem.addClass('visible');\n    }\n\n    function hide() {\n        removeListeners();\n        elem.hide();\n        elem.removeClass('visible');\n        elem.removeClass('evn-error-mode');\n        elem.removeClass('withoutShare');\n        elem.removeClass('evn-clipboard-mode');\n        clipboard_container.removeClass();\n        cbMessage.text(Evernote.Addin.getLocalizedMessage(Evernote.Messages.SOURCE_LINK));\n    }\n\n    function onClickOutside(e) {\n        if (Evernote.JQuery(e.target).closest('#' + Constants.POST_CLIP_DIALOG_ID).length == 0) {\n            hide();\n        }\n    }\n\n    function onKeyPressed(e) {\n        if (e.keyCode == 27) {\n            hide();\n        }\n    }\n\n    function onDataReceived(response) {\n        if (response.type == 'clipped') {\n            finishPostClip();\n        }\n    }\n\n    function addListeners() {\n        Evernote.JQuery(document).on('click', onClickOutside);\n        Evernote.JQuery(document).on('keydown',onKeyPressed);\n    }\n\n    function removeListeners() {\n        Evernote.JQuery(document).off('click',onClickOutside);\n        Evernote.JQuery(document).off('keydown',onKeyPressed);\n    }\n\n    closeButton.click(hide);\n    shareIcons.click(handleShareIconClick);\n    cbButton.click(copyToClipboard);\n\n    errorLink.click(showLogs);\n\n    elem.on('errorShown', hide);\n\n    localize();\n    modifyToCurrentIE();\n\n    this.fillOutPopup = fillOutPopup;\n    this.endProcessing = endProcessing;\n    this.endProcessingAndClose = endProcessingAndClose;\n    this.show = show;\n    this.hide = hide;\n\n    this.processError = processError;\n    this.onDataReceived = onDataReceived;\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.Messages = {\n    CLIP_SELECTION: 113,\t\t\t\/\/ Save Selection\n    CLIP_URL: 115,\t\t\t\t\t\/\/ Save URL\n    CLIP_FULL_PAGE: 116,\t\t\t\/\/ Save Full Page\n    CLIP_ARTICLE: 117,\t\t\t\t\/\/ Save Article\n    ENTER: 118,\t\t\t\t\t\t\/\/ enter\n    OPTIONS: 119,\t\t\t\t\t\/\/ Options\n    DEFAULT_ACTION: 120,\t\t\t\/\/ Default action\n    ARTICLE_SELECTION: 121,\t\t\t\/\/ Article selection\n    ENABLED: 122,\t\t\t\t\t\/\/ Enabled\n    DISABLED: 123,\t\t\t\t\t\/\/ Disabled\n    ENABLED_NO_HINTS: 124,\t\t\t\/\/ Enabled (no hints)\n    ARTICLE_SELECTION_HINT: 125,\t\/\/ When enabled, you can modify article selection using your keyboard before make a clip. Enabling with \"no hints\" will prevent displaying the informational message. When disabled - you cannot make any adjustments to the automatic article selection.\n    EXPAND_SELECTION: 126,\t\t\t\/\/ expand selection\n    SHRINK_SELECTION: 127,\t\t\t\/\/ shrink selection\n    MOVE_SELECTION: 128,\t\t\t\/\/ move selection\n    CLIP_ARTICLE_HINT: 129,\t\t\t\/\/ clip article\n    CLIPPING: 130,\t\t\t\t\t\/\/ Clipping\n    UNSUPPORTED_SCHEMA: 131,\t\t\/\/ Clipping from this location is not supported.\n    UNTITLED_NOTE: 132,\t\t\t\t\/\/ Untitled note\n    ADD_TAGS: 133,\t\t\t\t\t\/\/ Add tags\n    ADD_REMARK: 134,\t\t\t\t\/\/ Add remark\n    OWNED_BY: 135,\t\t\t\t\t\/\/ owned by\n    SHARED_NOTEBOOKS: 136,\t\t\t\/\/ Shared Notebooks\n    BUSINESS_NOTEBOOKS: 137,\t\t\/\/ Business Notebooks\n    LOADING_TAGS: 140,\t\t\t\t\/\/ Loading tags...\n    LOGIN_FAILED: 141,\t\t\t\t\/\/ You need to be signed in to Evernote desktop to clip webpages\n    CLOSE: 142,\t\t\t\t\t\t\/\/ \u0110\u2014\u0110\u00b0\u0110\u015f\u0143\u20ac\u0143\u2039\u0143\u201a\u0143\u015a\n    LOADING_NOTEBOOKS: 146,\t\t\t\/\/ \u0110\u00b7\u0110\u00b0\u0110\u0142\u0143\u20ac\u0143\u0083\u0110\u00b6\u0110\u00b0\u0143\u017d \u0110\u00b1\u0110\u00bb\u0110\u013e\u0110\u015f\u0110\u02dd\u0110\u013e\u0143\u201a\u0143\u2039...\n    CLIP_FAILED_TITLE: 147,\t\t\t\/\/ \u0110\u0165\u0110\u00b5 \u0143\u0083\u0110\u00b4\u0110\u00b0\u0110\u00bb\u0110\u013e\u0143\u0081\u0143\u015a \u0143\u0081\u0110\u013e\u0143\u2026\u0143\u20ac\u0110\u00b0\u0110\u02dd\u0110\u00b8\u0143\u201a\u0143\u015a \u0110\u00b7\u0110\u00b0\u0110\u013d\u0110\u00b5\u0143\u201a\u0110\u015f\u0143\u0083.\n    VERSION: 148,\t\t\t\t\t\/\/ \u0110\u2019\u0110\u00b5\u0143\u20ac\u0143\u0081\u0110\u00b8\u0143\u0179\n    LIMIT_TAGS: 150,\t\t\t\t\/\/ You've entered the maximum number of tags\n    CLIP_HEADER: 151,\t\t\t\t\/\/ Clip\n    SKITCH_HEADER: 152,\t\t\t\t\/\/ Annotate\n    ORGANIZE_HEADER: 153,\t\t\t\/\/ Organize\n    SAVE_BUTTON: 154,\t\t\t\t\/\/ Save\n    CLIP_SCREEN_SHOT: 155,\t\t\t\/\/ Screenshot\n    NOTEBOOK_SEARCH: 156,\t\t\t\/\/ Find a notebook\n    SHARE_BUTTON: 157,\t\t\t\t\/\/ Share\n    ARTICLE: 158,\t\t\t\t\t\/\/ Article\n    SIMPLIFIED_ARTICLE: 159,\t\t\/\/ Simplified Article\n    SELECTION: 160,\t\t\t\t\t\/\/ Selection\n    URL: 161,\t\t\t\t\t\t\/\/ Bookmark\n    SCREENSHOT: 162,\t\t\t\t\/\/ Screen Capture\n    SOURCE_LINK: 163,\t\t\t\t\/\/ Source link\n    URL_COPIED: 164,\t\t\t\t\/\/ Url copied to clipboard\n    FULL_PAGE: 165,\t\t\t\t\t\/\/ Full Page\n    TAGS : 166,                     \/\/ Tag selection\n    CLIP_ACTION : 167,              \/\/ Default clip action\n    LOADING : 168,                  \/\/ Loading...\n    ALWAYS_START_IN : 169,          \/\/ Always start in\n    ALWAYS_ADD_TAGS : 170,          \/\/ Always tag with\n    LAST_USED_ACTION : 171,         \/\/ Last Used Action\n    COPYRIGHT : 172,                \/\/ Copyright 2009-2013 Evernote Corporation. All rights reserved.\n    PRIVACY_POLICY : 173,           \/\/ Privacy Policy\n    TERMS_OF_SERVICE : 174,         \/\/ Terms of Service\n    EXPAND : 175,                   \/\/ Expand the article selection\n    CONTRACT : 176,                 \/\/ Contract the article selection\n    ADD_TAG : 177,                  \/\/ Add tag\n    LIMIT_TAGS_SHORT : 178,         \/\/ Max 20 tags\n    TAGS_NOT_SUPPORTED : 179,       \/\/ Tags not supported\n    DONE : 180,                     \/\/ Done\n    ARROW :181,                     \/\/ Shape tool\n    COLOR :182,                     \/\/ Colors\n    STAMP_REJECT :183,              \/\/ Stamp tool\n    CROP :184,                      \/\/ Crop\n    HIGHLIGHTER :185,               \/\/ HTML Highlighter\n    MARKER :186,                    \/\/ Marker tool\n    PIXELATE :187,                  \/\/ Pixelator tool\n    TEXT :188,                      \/\/ Type tool\n    ZOOM_IN :189,                   \/\/ Zoom In\n    ZOOM_OUT :190,                  \/\/ Zoom Out\n    ZOOM_RESET :191,                \/\/ Reset\n    ZOOM_TIP :192,                  \/\/ Tip: Hold Ctrl while clicking to pan\n    CROP_APPLY :193,                \/\/ Apply\n    CROP_CANCEL :194,               \/\/ Cancel\n    SCREENSHOT_CAPTURED :195,       \/\/ Screenshot captured\n    SAVING : 196,                   \/\/ Saving...\n    IMAGE_HIGHLIGHTER : 197,        \/\/ Image highlighter\n    FORBIDDEN : 198,                \/\/ Not allowed for this action\n    SETTINGS : 200,                 \/\/ Settings\n    ONE_CLICK_CLIPPING: 201,        \/\/ 1-click Clipping\n    ONE_CLICK_CLIPPING_DESC: 202,   \/\/ ~~~ Put description here ~~~\n    NOTEBOOK_SELECTION: 203,        \/\/ Notebook Selection\n    LAST_USED_NOTEBOOK: 204,        \/\/ Last used notebook\n    SCREEN_CAPTURE_TOAST: 205,      \/\/ Single <b>click<\/b> to capture full screen\nor <b>drag<\/b> a region and release\n    CLIPPED: 206,                   \/\/ Clipped to\n    TAKE_A_SCREENSHOT: 207,         \/\/ Take a Screenshot\n    DEFAULT_NOTEBOOK: 208,          \/\/ default notebook\n    ERROR_LOGS: 209,                \/\/ Error logs\n    VIEW_LOGS: 210,                 \/\/ View Logs\n    LOGS_DESCRIPTION: 211,          \/\/ If you contact Evernote Support, they may ask you to view these logs to help diagnose a problem\n    COPY_TO_CLIPBOARD: 212,         \/\/ Copy to clipboard\n    AFTER_CLIP: 213,                \/\/ After clip\n    SHOW_POST_CLIP_DESC: 214,       \/\/ Show successful clip dialog\n    CLOSE_POST_CLIP_DESC: 215,      \/\/ Automatically close clipper\n    LEGAL: 216,                     \/\/ Legal\n    LEGAL_HEADER: 217,              \/\/ Web Clipper uses the following open source software\n    CLIP_ERROR: 218,                \/\/ Cannot save clip\n    VIEW_REPORT: 219                \/\/ View Crash Report\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.ResponseReceiver = {\n    parsers : [],\n    receivers : [],\n\n    onResponse: function(str) {\n        Evernote.Logger.debug(\"Response received\" + str);\n        for(var i = 0; i < Evernote.ResponseReceiver.parsers.length; i++) {\n            if(Evernote.ResponseReceiver.parsers[i].canParse &#038;&#038; Evernote.ResponseReceiver.parsers[i].canParse(str)) {\n                Evernote.ResponseReceiver.notify(Evernote.ResponseReceiver.parsers[i].parse(str));\n            }\n        }\n    },\n\n    registerParser: function(parser) {\n        Evernote.ResponseReceiver.parsers.push(parser);\n    },\n\n    subscribe: function(receiver) {\n        Evernote.ResponseReceiver.receivers.push(receiver);\n    },\n\n    notify: function(data) {\n        for(var i=0; i < Evernote.ResponseReceiver.receivers.length; i++) { Evernote.ResponseReceiver.receivers[i].onDataReceived(data); } } }; function EvernoteGlobalReceiver(str) { Evernote.ResponseReceiver.onResponse(str); } \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.NotebookResponseParser = {\n    parse : function(str) {\n        str = Evernote.GlobalUtils.decodeXML(str);\n        var xmlDom = Evernote.JQuery(str);\n        var result = [];\n        var type = xmlDom.attr(\"type\");\n        if(xmlDom.length == 1) {\n            var notebooks = xmlDom.find(\"notebook\");\n            for(var i = 0; i < notebooks.length; i++) { var notebook = Evernote.JQuery(notebooks[i]); var notebookObj = Evernote.NotebookResponseParser.createNotebook(type,notebook); if(notebookObj) { result.push(notebookObj); } } } else if(xmlDom.length > 1) {\n            for(var i = 1; i < xmlDom.length - 1; i += 2) { var notebook = Evernote.JQuery(xmlDom[i]); var notebookObj = Evernote.NotebookResponseParser.createNotebook(type, notebook); if(notebookObj) { result.push(notebookObj); } } } return new Evernote.Response(\"notebooks\", result); }, createNotebook : function(type, notebook) { var notebookType; var notebookTypeText; switch (type) { case \"personal\": notebookType = Evernote.NotebookTypes.PERSONAL; notebookTypeText = Evernote.NotebookTypes.PERSONAL_TEXT; break; case \"business\": notebookType = Evernote.NotebookTypes.BUSINESS; notebookTypeText = Evernote.NotebookTypes.BUSINESS_TEXT; break; case \"linked\": notebookType = Evernote.NotebookTypes.LINKED; notebookTypeText = Evernote.NotebookTypes.LINKED_TEXT; break; } var hidden = false; var writableAttrValue = notebook.attr(\"writable\"); if (notebookType == Evernote.NotebookTypes.BUSINESS) { return null } if(notebookType == Evernote.NotebookTypes.LINKED) { var business = notebook.attr(\"business\"); if(business &#038;&#038; ((business | 0) == 1)) { notebookType = Evernote.NotebookTypes.BUSINESS; notebookTypeText = Evernote.NotebookTypes.BUSINESS_TEXT; } } if(notebookType == Evernote.NotebookTypes.LINKED || notebookType == Evernote.NotebookTypes.BUSINESS) { if(!writableAttrValue || (writableAttrValue | 0) != 1) { if(notebookType == Evernote.NotebookTypes.LINKED) return null; else { hidden = true; } } } var owner = notebook.attr(\"owner\"); if (owner &#038;&#038; owner == Evernote.evernotePopup._user) owner = undefined; return new Evernote.Notebook( notebookType, notebook.attr(\"name\"), notebook.attr(\"uid\"), notebook.attr(\"stack\"), owner, hidden, notebookTypeText ); }, canParse: function(str) { var request = Evernote.JQuery(str).attr(\"request\"); return (request &#038;&#038; (request == \"get_notebooks\")); } }; Evernote.ResponseReceiver.registerParser(Evernote.NotebookResponseParser); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.AddNoteResponseParser = { parse : function(str) { Evernote.Logger.debug(\"AddNoteResponseParser: response\" + str); var xmlDom = Evernote.JQuery(str); var result = xmlDom.attr(\"notebook_name\"); return new Evernote.Response(\"clipped\", result); }, canParse: function(str) { var request = Evernote.JQuery(str).attr(\"request\"); return request &#038;&#038; (request == \"add_note\"); } }; Evernote.ResponseReceiver.registerParser(Evernote.AddNoteResponseParser); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ProcessIDResponseParser = { parse : function(str) { Evernote.Logger.debug(\"ProcessIDResponseParser: response\" + str); var xmlDom = Evernote.JQuery(str); var result = xmlDom.attr(\"process_id\"); return new Evernote.Response(\"process_id\", result); }, canParse: function(str) { var request = Evernote.JQuery(str).attr(\"request\"); return request &#038;&#038; (request == \"get_process_id\"); } }; Evernote.ResponseReceiver.registerParser(Evernote.ProcessIDResponseParser); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ErrorResponseParser = { parse : function(str) { Evernote.Logger.warn(\"Received error \" + str); var error = Evernote.JQuery(str); var errorCode = error.attr(\"code\"); var errorMessage = null; var problem = null; if(error.length == 1) { var problems = error.find(\"problem\"); if(problems &#038;&#038; problems.length > 0) {\n                problem = Evernote.JQuery(problems[0]);\n            }\n        }\n        else if(error.length > 2) {\n            errorMessage = error[2].toString();\n        }\n        if(problem) {\n            errorMessage = problem.text();\n        } else if(!errorMessage) {\n            errorMessage = error.attr(\"details\");\n        }\n        switch (errorCode) {\n            case Evernote.ErrorCodes.AUTHENTICATION_ERROR :\n                errorMessage = Evernote.Addin.getLocalizedMessage(Evernote.Messages.LOGIN_FAILED);\n                break;\n            case Evernote.ErrorCodes.CLIP_ERROR :\n                errorMessage = Evernote.Addin.getLocalizedMessage(Evernote.Messages.CLIP_FAILED_TITLE) + \"\\n\" + errorMessage;\n        }\n        var msg = {\n            message: errorMessage,\n            code: errorCode\n        };\n\n        return new Evernote.Response(\"error\", msg);\n    },\n\n    canParse: function(str) {\n        var request = Evernote.JQuery(str).get(0);\n        return (request &#038;&#038; (request.nodeName == \"ERROR\"));\n    }\n};\n\nEvernote.ResponseReceiver.registerParser(Evernote.ErrorResponseParser);\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.ErrorHandler = {\n\n    getHandler: function() {\n        return [Evernote.Addin, Evernote.evernotePopup, Evernote.evernotePostClipPopup, Evernote.AlertErrorHandler];\n    },\n\n    onDataReceived : function(response) {\n        if(response.type) {\n            if(response.type == \"error\") {\n                this.notifyHandlers(response.data);\n\n            }\n        }\n    },\n\n    notifyHandlers : function(error) {\n        for(var i = 0; i < this.getHandler().length; i++) { var handler = this.getHandler()[i]; if(handler &#038;&#038; handler.processError &#038;&#038; handler.processError(error)) { return; } } } }; Evernote.ResponseReceiver.subscribe(Evernote.ErrorHandler); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.Response = function(type, data) { this.type = type; this.data = data; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.FS = { _addon : null, init : function(addon) { this._addon = addon; }, \/** * Write content to the specified path. * @param content - content, that should be written to *\/ writeOptionsToFile : function(content) { if (!this._addon) return; try { this._addon.WriteOptionsContent(content ); } catch (e) { Evernote.Logger.error( \"FS.writeOptionsToFile() failed \" + e ); } }, \/** * Read content of the file specified by path. * @return {string} - content of the file *\/ getOptionsFileContent : function() { if (!this._addon) return null; try { return this._addon.ReadOptionsContent(); } catch (e) { Evernote.Logger.error( \"FS.getOptionsFileContent() failed \" + e ); } return null; } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/\/\"use strict\"; Evernote.AbstractElementSerializer = function AbstractElementSerializer( node, nodeStyle ) { this.initialize( node, nodeStyle ); }; Evernote.AbstractElementSerializer.isResponsibleFor = function( \/*navigator*\/ ) { return false; }; Evernote.AbstractElementSerializer.prototype._node = null; Evernote.AbstractElementSerializer.prototype._nodeStyle = null; Evernote.AbstractElementSerializer.prototype.handleInheritance = function( child\/*, parent *\/) { Evernote.ElementSerializerFactory.ClassRegistry.push( child ); }; Evernote.AbstractElementSerializer.prototype.initialize = function( node, nodeStyle ) { this._node = node; this._nodeStyle = nodeStyle; }; Evernote.AbstractElementSerializer.prototype.serialize = function( \/*docBase*\/ ) { return \"\"; }; Evernote.AbstractElementSerializer.prototype.getImageUrl = function() { return \"\"; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/\/\"use strict\";\n\nEvernote.ElementSerializerFactory = {\n    getImplementationFor : function( node ) {\n        for ( var i = 0; i < this.ClassRegistry.length; ++i ) { if ( this.ClassRegistry[ i ].isResponsibleFor( node ) ) { return this.ClassRegistry[ i ]; } } return null; } }; Evernote.ElementSerializerFactory.ClassRegistry = [ ]; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/\/\"use strict\"; Evernote.ClipStylingStrategy = function ClipStylingStrategy( ) { this.initialize( ); }; Evernote.ClipStylingStrategy.prototype.initialize = function( ) { }; Evernote.ClipStylingStrategy.prototype.styleForNode = function( \/*node, root, fullPage, clipStyleType*\/ ) { return null; }; Evernote.ClipStylingStrategy.prototype.getNodeView = function ( node ) { var doc = node.ownerDocument; return (doc.defaultView) ? doc.defaultView : null; }; Evernote.ClipStylingStrategy.prototype.getNodeStyle = function( node, filterFn, pseudo ) { Evernote.Logger.debug( \"ClipStylingStrategy.getNodeStyle()\" ); var style = new Evernote.ClipStyle(); if ( pseudo != \"\" ) { return style; } if ( node &#038;&#038; typeof node.nodeType == 'number' &#038;&#038; node.nodeType == 1 ) { var view = this.getNodeView( node ); style = new Evernote.ClipStyle( Evernote.ElementExtension.getComputedStyle( node, null, view ), filterFn ); } return style; }; Evernote.ClipStyleType = { NodeStyle : 0x01, InheritedFontStyle: 0x02, InheritedBgStyle: 0x04, AllStyle : 0x01 | 0x02 | 0x04, Default : 0x01 | 0x02 }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClipFullStylingStrategy = function ClipFullStylingStrategy( ) { this.initialize( ); }; Evernote.inherit( Evernote.ClipFullStylingStrategy, Evernote.ClipStylingStrategy, true ); Evernote.ClipFullStylingStrategy.prototype.styleForNode = function ( node, root, fullPage, clipStyleType ) { Evernote.Logger.debug( \"ClipStylingStrategy.styleForNode()\" ); if ( clipStyleType == null ) { clipStyleType = Evernote.ClipStyleType.Default; } var bodyStyles = new Evernote.ClipStyle( [ ], function ( prop, value ) { return value != \"\" } ); var inhFontStyles = new Evernote.ClipStyle( [ ] ); var inhBgStyles = [ ]; if ( (clipStyleType &#038; Evernote.ClipStyleType.NodeStyle) == Evernote.ClipStyleType.NodeStyle ) { Evernote.Logger.debug( \"ClipStylingStrategy.styleForNode(): get node style\" ); try { if ( node.nodeName.toLowerCase() == \"body\" ) { for ( var attrName in Evernote.ClipStyle.STYLE_ATTRIBUTES ) { if ( Evernote.ElementExtension.hasAttribute(node, attrName) ) { var cssPropName = Evernote.ClipStyle.STYLE_ATTRIBUTES[ attrName ]; var style = { }; style[ cssPropName ] = node.getAttribute( attrName ); bodyStyles.addStyle( style ); } } } } catch(e) { Evernote.Logger.error(\"ClipFullStylingStrategy.styleForNode failed to get attributes from body due to error \" + e); } var evaluatedStyles = this.getNodeStyle( node ); if ( node.nodeName.toLowerCase() == \"table\" &#038;&#038; !evaluatedStyles.getStyle( \"font-size\" ) ) { evaluatedStyles.addStyle( {\"font-size\":\"1em\"} ); } if ( node.nodeName.toLowerCase() == \"img\" ) { style = new Evernote.ClipStyle( Evernote.ElementExtension.getComputedStyle( node, null, this.getNodeView( node ) ), function ( prop, value ) { return value != \"\" } ); evaluatedStyles.addStyle( { height:style.getStyle( \"height\" ) } ); evaluatedStyles.addStyle( { width:style.getStyle( \"width\" ) } ); } if ( evaluatedStyles.getStyle( \"background-image\" ) ) { var regExp = \/url\\((.*?)\\)\/; evaluatedStyles.addStyle( { \"background-image\": Evernote.StyleElementExtension.getPropertyValue(Evernote.ElementExtension.getComputedStyle( node, null, this.getNodeView( node ) ), Evernote.IEStylePropertiesMapping.getPropertyNameFor(\"background-image\") ).replace( regExp, \"url('$1')\").replace(\/('\")|(\"')|('')\/g, \"'\")} ); } if ( evaluatedStyles.getStyle( \"height\" ) == \"100%\" &#038;&#038; Evernote.StyleElementExtension.getPropertyValue(Evernote.ElementExtension.getComputedStyle( node, null, this.getNodeView( node ) ), \"height\" ) == \"0px\" ) { evaluatedStyles.addStyle( { height:\"0px\" } ); } bodyStyles.mergeStyle( evaluatedStyles, true ); } if ( node == root &#038;&#038; !fullPage ) { if ( (clipStyleType &#038; Evernote.ClipStyleType.InheritedFontStyle) == Evernote.ClipStyleType.InheritedFontStyle ) { Evernote.Logger.debug( \"ClipStylingStrategy.styleForNode(): get inherited font style\" ); inhFontStyles = this.inheritFontForNode( node, true ); Evernote.Logger.debug( \"ClipStylingStrategy.styleForNode(): inherited fonts \" ); } if ( (clipStyleType &#038; Evernote.ClipStyleType.InheritedBgStyle) == Evernote.ClipStyleType.InheritedBgStyle ) { Evernote.Logger.debug( \"ClipStylingStrategy.styleForNode(): get inherited bg style\" ); inhBgStyles = this.inheritBackgroundForNode( node, true ); } } bodyStyles.mergeStyle( inhFontStyles, true ); return { nodeStyle:bodyStyles, inheritedFonts:inhFontStyles, inheritedBackground:inhBgStyles, evaluated:bodyStyles }; }; Evernote.ClipFullStylingStrategy.prototype.getNodeStyle = function ( node, filterFn, pseudo ) { Evernote.Logger.debug( \"ClipStylingStrategy.getNodeStyle()\" ); if ( pseudo == null || typeof pseudo == \"undefined\" ) { pseudo = \"\"; } var style = new Evernote.ClipStyle([ ], filterFn); Evernote.Logger.debug( \"Pseudo : \" + pseudo ); if ( pseudo == \"\" &#038;&#038; node &#038;&#038; typeof node.nodeType == 'number' &#038;&#038; node.nodeType == 1 ) { var view = this.getNodeView( node ); style = new Evernote.ClipStyle( Evernote.ElementExtension.getComputedStyle( node, null, view ), filterFn ); } return style; }; Evernote.ClipFullStylingStrategy.prototype.inheritFontForNode = function ( node, recur ) { Evernote.Logger.debug( \"ClipFullStylingStrategy.inheritFontForNode()\" ); var fontStyle = new Evernote.ClipStyle(); if ( !node ) { return fontStyle; } var parent = node; var styles = [ ]; var nodes = [ ]; var dynamicUnit = [\"%\", \"em\"]; var sizeUnitRegExp = \/(.*?)(em|%|px|pt)\/; while ( parent ) { nodes.push( parent ); styles.push( new Evernote.ClipStyle( this.getNodeStyle( parent ), function ( prop, value ) { return (Evernote.ArrayExtension.indexOf(Evernote.ClipStyle.INHERITED_STYLES, prop ) > 0 &#038;&#038; value != \"inherit\" );\n        } ) );\n\n        Evernote.Logger.debug( \"Inh parent style:\" + styles[styles.length - 1].toString() );\n\n        if ( !recur || parent == document.body ) {\n            break;\n        }\n        else {\n            parent = parent.parentElement;\n        }\n    }\n\n    \/\/merge styles starting from low-priority parent styles\n    Evernote.Logger.debug( \"Styles inh for processing:\" + (styles.length - 1) );\n    for ( var i = styles.length - 1; i >= 0; i-- ) {\n        var style = styles[ i ];\n        var fontSize = fontStyle.getStyle( \"font-size\" );\n        var overFontStyle = style.getStyle( \"font-size\" );\n        Evernote.Logger.debug( \"fontSize:\" + fontSize + \"    ;overFontStyle: \" + overFontStyle );\n        if ( fontSize &#038;&#038; overFontStyle ) {\n            var resFontSize = fontSize.match( sizeUnitRegExp );\n            if ( resFontSize == null ) {\n                continue;\n            }\n            var sizeVal = resFontSize[1];\n            var sizeUnit = resFontSize[2];\n            var resOverFontSize = overFontStyle.match( sizeUnitRegExp );\n\n            if ( resOverFontSize == null ) {\n                continue;\n            }\n            var overSizeVal = resOverFontSize[1];\n            var overSizeUnit = resOverFontSize[2];\n\n            if ( Evernote.ArrayExtension.indexOf(dynamicUnit, overSizeUnit ) != -1 ) {\n                if ( overSizeUnit == \"%\" ) {\n                    style.addStyle( { \"font-size\":(parseFloat( sizeVal ) * parseFloat( overSizeVal ) \/ 100).toString() + sizeUnit } );\n                }\n                else {\n                    style.addStyle( { \"font-size\":(parseFloat( sizeVal ) * parseFloat( overSizeVal )).toString() + ((sizeUnit != \"em\") ? sizeUnit : overSizeUnit) } );\n                }\n            }\n            Evernote.Logger.debug( \"Style: \" + i + \"   ;Eval inh style:\" + style.toString() );\n        }\n\n        fontStyle.mergeStyle( style, true );\n    }\n\n    return fontStyle;\n};\n\nEvernote.ClipFullStylingStrategy.prototype.inheritBackgroundForNode = function ( node, recur ) {\n    Evernote.Logger.debug( \"ClipFullStylingStrategy.inheritBackgroundForNode()\" );\n\n    var bgStyle = new Evernote.ClipStyle();\n    if ( !node ) {\n        return bgStyle;\n    }\n\n    var parent = node;\n    var styles = [ ];\n    var nodes = [ ];\n    var topElement = (document.body.parentNode) ? document.body.parentNode : document.body;\n    try {\n        while ( parent ) {\n            nodes.push( parent );\n            var filterFn = function ( prop, value ) {\n                return !(prop == \"background-repeat\" &#038;&#038; (value == \"no-repeat\" || value == \"repeat-y\"));\n            };\n            var nodeStyle = new Evernote.ClipStyle( this.getNodeStyle( parent ), filterFn, Evernote.ClipStyle.CSS_GROUP.getExtForStyle( \"background\" ) );\n\n            if ( !nodeStyle.getStyle( \"background-repeat\" ) ) {\n                nodeStyle.removeStyle( \"background-image\" );\n            }\n            if ( !nodeStyle.getStyle( \"background-color\" ) &#038;&#038; parent.getAttribute( \"bgcolor\" ) ) {\n                Evernote.Logger.debug( \"Set bgcolor attribute: \" + parent.getAttribute( \"bgcolor\" ) );\n                nodeStyle.addStyle( {\"background-color\":parent.getAttribute( \"bgcolor\" )} );\n            }\n\n            nodeStyle = this.evalBgPosition( node, parent, nodeStyle );\n            if ( nodeStyle.getStylesNames().length > 0 ) {\n                styles.push( nodeStyle );\n                Evernote.Logger.debug( \"Add inh bg style \" + nodeStyle.toString() );\n            }\n\n            if ( !recur || parent == topElement ) {\n                break;\n            }\n            else {\n                parent = parent.parentNode;\n            }\n        }\n    } catch(e) {\n        Evernote.Logger.error(\"ClipFullStylingStrategy.prototype.inheritBackgroundForNode failed to error \" + e);\n    }\n\n    return styles;\n};\n\nEvernote.ClipFullStylingStrategy.prototype.evalBgPosition = function ( node, inhNode, nodeBgStyle ) {\n    Evernote.Logger.debug( \"Dettermining background image offset\" );\n\n    var strPosToPercent = {\n        \"center\":\"50%\",\n        \"top\":\"0%\",\n        \"bottom\":\"100%\",\n        \"right\":\"100%\",\n        \"left\":\"0%\"\n    };\n\n    var regExp = \/url\\((.*?)\\)\/;\n    var bgImage = nodeBgStyle.getStyle( \"background-image\" );\n    if ( !regExp.test( nodeBgStyle.getStyle( \"background-image\" ) ) || (bgImage &#038;&#038; nodeBgStyle.getStyle( \"background-image\" ).indexOf( \"data:image\" ) >= 0) ) {\n        Evernote.Logger.debug( \"bgStyle: \" + nodeBgStyle.toString() );\n        return nodeBgStyle;\n    }\n\n    nodeBgStyle.addStyle( { \"background-image\": Evernote.StyleElementExtension.getPropertyValue(Evernote.ElementExtension.getComputedStyle( inhNode, null, this.getNodeView( inhNode ) ), Evernote.IEStylePropertiesMapping.getPropertyNameFor(\"background-image\") ).replace( regExp, \"url('$1')\" ) } );\n\n    var actualImage = new Image();\n    actualImage.src = nodeBgStyle.getStyle( \"background-image\" ).match( regExp )[ 1 ].replace( \/[\"']\/g, \"\" );\n    var bgNodeRect = this.getOffsetRect( inhNode );\n    var nodeRect = this.getOffsetRect( node );\n    var yDelta = nodeRect.top - bgNodeRect.top;\n    var xDelta = nodeRect.left - bgNodeRect.left;\n\n    var bgNodeBgPosX = 0;\n    var bgNodeBgPosY = 0;\n    var origPosX = 0;\n    var origPosY = 0;\n\n    if ( nodeBgStyle.getStyle( \"background-position\" ) ) {\n        var bgPosition = nodeBgStyle.getStyle( \"background-position\" ).split( \" \" );\n        bgNodeBgPosX = strPosToPercent[bgPosition[ 0 ]] != null ? strPosToPercent[bgPosition[ 0 ]] : bgPosition[ 0 ];\n        bgNodeBgPosY = strPosToPercent[bgPosition[ 1 ]] != null ? strPosToPercent[bgPosition[ 1 ]] : bgPosition[ 1 ];\n\n        if ( bgNodeBgPosX &#038;&#038; bgNodeBgPosX.indexOf( \"%\" ) > 0 ) {\n            origPosX = parseInt( bgNodeRect.width ) * (parseInt( bgNodeBgPosX ) \/ 100);\n            origPosX -= parseInt(actualImage.width) * (parseInt(bgNodeBgPosX) \/ 100);\n        }\n        else {\n            origPosX = parseInt( bgNodeBgPosX );\n        }\n\n        if ( bgNodeBgPosY &#038;&#038; bgNodeBgPosY.indexOf( \"%\" ) > 0 ) {\n            origPosY = parseInt( bgNodeRect.height ) * (parseInt( bgNodeBgPosY ) \/ 100);\n            origPosY -= parseInt(actualImage.height) * (parseInt(bgNodeBgPosY) \/ 100);\n        }\n        else {\n            origPosY = parseInt( bgNodeBgPosY );\n        }\n    }\n\n    if ( isNaN( origPosX ) ) {\n        origPosX = 0;\n    }\n    if ( isNaN( origPosY ) ) {\n        origPosY = 0;\n    }\n\n    var xOffset = 0 - xDelta + origPosX;\n    var yOffset = 0 - yDelta + origPosY;\n\n    nodeBgStyle.addStyle( { \"background-position\":(xOffset + \"px \" + yOffset + \"px\") } );\n    Evernote.Logger.debug( \"bgStyle: \" + nodeBgStyle.toString() );\n    return nodeBgStyle;\n};\n\nEvernote.ClipFullStylingStrategy.prototype.getOffsetRect = function ( elem ) {\n    Evernote.Logger.debug( \"ClipCSSStyleWalker.getOffsetRect()\" );\n\n    var box = Evernote.ElementExtension.getBoundingClientRect(elem);\n    var body = elem.ownerDocument.body;\n    var docElem = elem.ownerDocument.documentElement;\n\n    var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n    var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n\n    var clientTop = docElem.clientTop || body.clientTop || 0;\n    var clientLeft = docElem.clientLeft || body.clientLeft || 0;\n\n    var top = box.top + scrollTop - clientTop;\n    var left = box.left + scrollLeft - clientLeft;\n\n    return { top:Math.round( top ), left:Math.round( left ), width:box.width, height:box.height };\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/\/\"use strict\"; Evernote.ClipRules = { isNoKeepNodeAttr : function( attribute, nodeName, node ) { if ( !attribute ) { return true; } var attrName = attribute.name.toLowerCase(); var attrValue = attribute.value.toLowerCase(); if((node.nodeName.toUpperCase() == \"SPAN\" || node.nodeName.toUpperCase() == \"A\") &#038;&#038; node.getElementsByTagName( \"IMG\" ).length > 0) {\n            nodeName = \"div\";\n        }\n        var attributesToKeepForNode = this.KEEP_NODE_ATTRIBUTES[nodeName];\n        if(attributesToKeepForNode) {\n            var keepAttributeForNode = typeof attributesToKeepForNode[attrName] != 'undefined';\n        }\n        return typeof this.NOKEEP_NODE_ATTRIBUTES[ attrName ] != 'undefined'\n            || !keepAttributeForNode\n            || attrName.substring( 0, 2 ) == \"on\"\n            || attrName.indexOf(\"xml\") == 0\n            || attrValue.indexOf(\"function(\") >= 0\n            || (attrName == \"href\" &#038;&#038; attrValue.substring( 0, 11 ) == \"javascript:\");\n    },\n\n    isConditionalNode : function( node ) {\n        return node &#038;&#038; typeof this.CONDITIONAL_NODES[ node.nodeName.toUpperCase() ] != 'undefined';\n    },\n\n    translateNode : function( node ) {\n        var nodeName = this.NODE_NAME_TRANSLATIONS[ node.nodeName.toUpperCase() ] || node.nodeName.toUpperCase();\n        return (typeof this.SUPPORTED_NODES[ nodeName ] != \"undefined\") ? nodeName.toLowerCase() : this.NODE_NAME_TRANSLATIONS[ \"*\" ].toLowerCase();\n    },\n\n    isSupportedNode : function( node ) {\n        return node &#038;&#038; typeof this.SUPPORTED_NODES[ node.nodeName.toUpperCase() ] != 'undefined';\n    },\n\n    isRejectedNode : function( node ) {\n        return node &#038;&#038; typeof this.REJECTED_NODES[ node.nodeName.toUpperCase() ] != 'undefined';\n    },\n\n    isNonAncestorNode : function( node ) {\n        return node &#038;&#038; typeof this.NON_ANCESTOR_NODES[ node.nodeName.toUpperCase() ] != 'undefined';\n    },\n\n    isSelfClosingNode : function( node ) {\n        return node &#038;&#038; typeof this.SELF_CLOSING_NODES[ node.nodeName.toUpperCase() ] != 'undefined';\n    }\n};\n\nEvernote.ClipRules.KEEP_NODE_ATTRIBUTES = {\n    \"a\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"accesskey\": null,\n        \"charset\": null,\n        \"type\": null,\n        \"name\": null,\n        \"href\": null,\n        \"hreflang\": null,\n        \"rel\": null,\n        \"rev\": null,\n        \"shape\": null,\n        \"coords\": null,\n        \"target\": null\n    },\n\n    \"abbr\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"acronym\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"address\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"area\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"accesskey\": null,\n        \"shape\": null,\n        \"coords\": null,\n        \"href\": null,\n        \"nohref\": null,\n        \"alt\": null,\n        \"target\": null\n    },\n\n    \"b\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"bdo\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"big\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"blockquote\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"cite\": null\n    },\n\n    \"br\" : {\n        \"title\": null,\n        \"clear\": null\n    },\n\n    \"caption\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\": null\n    },\n\n    \"center\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"cite\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"code\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"col\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"span\" : null,\n        \"width\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null\n    },\n\n    \"colgroup\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"span\" : null,\n        \"width\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null\n    },\n\n    \"dd\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"del\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"cite\" : null,\n        \"datetime\" : null\n    },\n\n    \"dfn\" : {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"div\" : {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"dl\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"compact\" : null\n    },\n\n    \"dt\": {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"em\": {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"font\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"size\" : null,\n        \"color\" : null,\n        \"face\" : null\n    },\n\n    \"h1\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"h2\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"h3\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"h4\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"h5\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"h6\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"hr\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"noshade\" : null,\n        \"size\" : null,\n        \"width\" : null\n    },\n\n    \"i\": {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"img\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"src\" : null,\n        \"alt\" : null,\n        \"name\" : null,\n        \"longdesc\" : null,\n        \"height\" : null,\n        \"width\" : null,\n        \"usemap\" : null,\n        \"ismap\" : null,\n        \"align\" : null,\n        \"border\" : null,\n        \"hspace\" : null,\n        \"vspace\" : null\n    },\n\n    \"en-media\": {\n        \"type\" : null,\n        \"hash\" : null,\n        \"title\" : null,\n        \"dir\" : null,\n        \"alt\" : null,\n        \"longdesc\" : null,\n        \"height\" : null,\n        \"width\" : null,\n        \"usemap\" : null,\n        \"align\" : null,\n        \"border\" : null,\n        \"hspace\" : null,\n        \"vspace\" : null\n    },\n\n    \"ins\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"cite\" : null,\n        \"datetime\" : null\n    },\n\n    \"kbd\": {\n        \"title\": null,\n        \"dir\" : null\n    },\n\n    \"li\": {\n        \"title\": null,\n        \"dir\" : null,\n        \"type\" : null,\n        \"value\" : null\n    },\n\n    \"map\": {\n        \"dir\" : null,\n        \"title\" : null,\n        \"name\" : null\n    },\n\n    \"ol\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"type\" : null,\n        \"compact\" : null,\n        \"start\" : null\n    },\n\n    \"p\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null\n    },\n\n    \"pre\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"width\" : null\n    },\n\n    \"s\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"samp\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"small\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"span\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"strike\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"strong\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"sub\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"sup\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"table\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"summary\" : null,\n        \"width\" : null,\n        \"border\" : null,\n        \"cellspacing\" : null,\n        \"cellpadding\" : null,\n        \"align\" : null,\n        \"bgcolor\" : null\n    },\n\n    \"tbody\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null\n    },\n\n    \"td\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null,\n        \"abbr\" : null,\n        \"rowspan\" : null,\n        \"colspan\" : null,\n        \"nowrap\" : null,\n        \"bgcolor\" : null,\n        \"width\" : null,\n        \"height\" : null\n    },\n\n    \"tfoot\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null\n    },\n\n    \"th\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null,\n        \"abbr\" : null,\n        \"rowspan\" : null,\n        \"colspan\" : null,\n        \"nowrap\" : null,\n        \"bgcolor\" : null,\n        \"width\" : null,\n        \"height\" : null\n    },\n\n    \"thead\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null\n    },\n\n    \"tr\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"align\" : null,\n        \"char\" : null,\n        \"charoff\" : null,\n        \"valign\" : null,\n        \"bgcolor\" : null\n    },\n\n    \"tt\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"u\": {\n        \"title\" : null,\n        \"dir\" : null\n    },\n\n    \"ul\": {\n        \"title\" : null,\n        \"dir\" : null,\n        \"type\" : null,\n        \"compact\" : null\n    },\n\n    \"var\": {\n        \"title\" : null,\n        \"dir\" : null\n    }\n};\n\nEvernote.ClipRules.NOKEEP_NODE_ATTRIBUTES = {\n    \"style\" : null,\n    \"tabindex\" : null\n};\n\nEvernote.ClipRules.CONDITIONAL_NODES = {\n    \"EMBED\" : null,\n    \"OBJECT\" : null,\n    \"IMG\" : null,\n    \"VIDEO\" : null\n};\n\nEvernote.ClipRules.NODE_NAME_TRANSLATIONS = {\n    \"HTML\" : \"DIV\",\n    \"BODY\" : \"DIV\",\n    \"FORM\" : \"DIV\",\n    \"CANVAS\" : \"DIV\",\n    \"CUFON\" : \"DIV\",\n    \"EMBED\" : \"IMG\",\n    \"BUTTON\" : \"SPAN\",\n    \"INPUT\" : \"SPAN\",\n    \"LABEL\" : \"SPAN\",\n    \"BDI\" : \"SPAN\",\n    \"IMG\" : \"EN-MEDIA\",\n    \"*\" : \"DIV\"\n};\n\nEvernote.ClipRules.SUPPORTED_NODES = {\n    \"A\" : null,\n    \"ABBR\" : null,\n    \"ACRONYM\" : null,\n    \"ADDRESS\" : null,\n    \"AREA\" : null,\n    \"B\" : null,\n    \"BUTTON\" : null,\n    \"BDO\" : null,\n    \"BIG\" : null,\n    \"BLOCKQUOTE\" : null,\n    \"BR\" : null,\n    \"CAPTION\" : null,\n    \"CENTER\" : null,\n    \"CITE\" : null,\n    \"CODE\" : null,\n    \"COL\" : null,\n    \"COLGROUP\" : null,\n    \"DD\" : null,\n    \"DEL\" : null,\n    \"DFN\" : null,\n    \"DIV\" : null,\n    \"DL\" : null,\n    \"DT\" : null,\n    \"EM\" : null,\n    \"FONT\" : null,\n    \"FORM\" : null,\n    \"H1\" : null,\n    \"H2\" : null,\n    \"H3\" : null,\n    \"H4\" : null,\n    \"H5\" : null,\n    \"H6\" : null,\n    \"HR\" : null,\n    \"HTML\" : null,\n    \"I\" : null,\n    \"IMG\" : null,\n    \"EN-MEDIA\" : null,\n    \"INPUT\" : null,\n    \"INS\" : null,\n    \"KBD\" : null,\n    \"LI\" : null,\n    \"MAP\" : null,\n    \"OL\" : null,\n    \"P\" : null,\n    \"PRE\" : null,\n    \"Q\" : null,\n    \"S\" : null,\n    \"SAMP\" : null,\n    \"SMALL\" : null,\n    \"SPAN\" : null,\n    \"STRIKE\" : null,\n    \"STRONG\" : null,\n    \"SUB\" : null,\n    \"SUP\" : null,\n    \"TABLE\" : null,\n    \"TBODY\" : null,\n    \"TD\" : null,\n    \"TFOOT\" : null,\n    \"TH\" : null,\n    \"THEAD\" : null,\n    \"TR\" : null,\n    \"TT\" : null,\n    \"U\" : null,\n    \"UL\" : null,\n    \"VAR\" : null\n};\n\nEvernote.ClipRules.REJECTED_NODES = {\n    \"SCRIPT\" : null,\n    \"LINK\" : null,\n    \"IFRAME\" : null,\n    \"STYLE\" : null,\n    \"SELECT\" : null,\n    \"OPTION\" : null,\n    \"OPTGROUP\" : null,\n    \"NOSCRIPT\" : null,\n    \"PARAM\" : null,\n    \"HEAD\" : null,\n    \"EVERNOTEDIV\" : null,\n    \"CUFONTEXT\" : null,\n    \"NOEMBED\" : null\n};\n\nEvernote.ClipRules.NON_ANCESTOR_NODES = {\n    \"OL\" : null,\n    \"UL\" : null,\n    \"LI\" : null\n};\n\nEvernote.ClipRules.SELF_CLOSING_NODES = {\n    \"IMG\" : null,\n    \/\/\"INPUT\" : null,\n    \"BR\" : null\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/**\n * ClipStyle is a container for CSS styles. It is able to add and remove\n * CSSStyleRules (and parse CSSRuleList's for rules), as well as\n * CSSStyleDeclaration's and instances of itself.\n * ClipStyle provides a mechanism to serialize itself via toString(), and\n * reports its length via length property. It also provides a method to clone\n * itself and expects to be manipulated via addStyle and removeStyle.\n *\/\nEvernote.ClipStyle = function ClipStyle( css, filterFn, styleList ) {\n    this.initialize( css, filterFn, styleList );\n};\n\nEvernote.ClipStyle.STYLES = [\n    \"background\", \"background-attachment\", \"background-clip\", \"background-color\", \"background-image\", \"background-origin\", \"background-position-x\", \"background-position-y\", \"background-position\", \"background-repeat\", \"background-size\",\n    \"border-bottom\", \"border-bottom-color\", \"border-bottom-left-radius\", \"border-bottom-right-radius\", \"border-bottom-style\", \"border-bottom-width\",\n    \"border-left\", \"border-left-color\", \"border-left-style\", \"border-left-width\",\n    \"border-right\", \"border-right-color\", \"border-right-style\", \"border-right-width\",\n    \"border-top\", \"border-top-color\", \"border-top-left-radius\", \"border-top-right-radius\", \"border-top-style\", \"border-top-width\",\n    \"border-collapse\", \"border-spacing\", \"bottom\", \"box-shadow\",\n    \"caption-side\", \"clear\", \"clip\", \"color\", \"content\", \"counter-increment\", \"counter-reset\", \"cursor\",\n    \"direction\", \"display\",\n    \"empty-cells\",\n    \"float\", \"font\", \"font-family\", \"font-size\", \"font-size-adjust\", \"font-stretch\", \"font-style\", \"font-variant\", \"font-weight\",\n    \"height\",\n    \"ime-mode\",\n    \"left\", \"letter-spacing\", \"line-height\", \"list-style\", \"list-style-image\", \"list-style-position\", \"list-style-type\",\n    \"margin\", \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\", \"marker-offset\", \"max-height\", \"max-width\", \"min-height\", \"min-width\",\n    \"opacity\", \"outline\", \"outline-color\", \"outline-offset\", \"outline-style\", \"outline-width\", \"overflow\", \"overflow-x\", \"overflow-y\",\n    \"padding\", \"padding-bottom\", \"padding-left\", \"padding-right\", \"padding-top\", \"page-break-after\", \"page-break-before\", \"pointer-events\", \"position\",\n    \"resize\", \"right\",\n    \"table-layout\", \"text-align\", \"text-anchor\", \"text-decoration\", \"text-indent\", \"text-overflow\", \"text-shadow\", \"text-transform\", \"top\",\n    \"vertical-align\", \"visibility\",\n    \"white-space\", \"width\", \"word-spacing\", \"word-wrap\",\n    \"z-index\"\n];\n\nEvernote.ClipStyle.NO_INHERIT_STYLES = {\n    \"*\":[ \"background\", \"background-image\", \"background-color\", \"background-position\", \"background-repeat\",\n        \"border-bottom\", \"border-bottom-color\", \"border-bottom-left-radius\", \"border-bottom-right-radius\", \"border-bottom-style\", \"border-bottom-width\",\n        \"border-left\", \"border-left-color\", \"border-left-style\", \"border-left-width\",\n        \"border-right\", \"border-right-color\", \"border-right-style\", \"border-right-width\",\n        \"border-top\", \"border-top-color\", \"border-top-left-radius\", \"border-top-right-radius\", \"border-top-style\", \"border-top-width\",\n        \"border-collapse\", \"border-spacing\", \"bottom\",\n        \"clear\",\n        \"display\",\n        \"float\",\n        \"height\",\n        \"left\", \"list-style\",\n        \"margin\", \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\",\n        \"padding\", \"padding-bottom\", \"padding-left\", \"padding-right\", \"padding-top\",\n        \"right\",\n        \"text-decoration\", \"top\",\n        \"width\" ],\n    \"img\":[ \"height\", \"width\" ]\n};\n\nEvernote.ClipStyle.CSS_GROUP = {\n    \"margin\":[ \"left\", \"right\", \"top\", \"bottom\" ],\n    \"padding\":[ \"left\", \"right\", \"top\", \"bottom\" ],\n    \"border\":[ \"width\", \"style\", \"color\" ],\n    \"border-bottom\":[ \"width\", \"style\", \"color\" ],\n    \"border-top\":[ \"width\", \"style\", \"color\" ],\n    \"border-right\":[ \"width\", \"style\", \"color\" ],\n    \"border-left\":[ \"width\", \"style\", \"color\" ],\n    \"border-image\":[ \"outset\", \"repeat\", \"slice\", \"source\", \"width\" ],\n    \"background\":[ \"attachment\", \"color\", \"image\", \"position\", \"repeat\", \"clip\", \"origin\", \"size\" ],\n    \"font\":[ \"family\", \"size\", \"style\", \"variant\", \"weight\", \"size-adjust\", \"stretch\", \"+line-height\" ],\n    \"list-style\":[ \"image\", \"position\", \"type\" ]\n};\n\nEvernote.ClipStyle.CSS_GROUP.getExtForStyle = function ( name ) {\n    var list = this[ name ];\n    var extList = [ ];\n\n    if ( list ) {\n        for ( var i = 0; i < list.length; ++i ) { if ( list[ i ].indexOf( \"+\" ) >= 0 ) {\n                var tmp = list[ i ];\n                extList.push( tmp.replace( \"+\", \"\" ) );\n            }\n            else {\n                extList.push( name + \"-\" + list[ i ] );\n            }\n        }\n        return extList;\n    }\n\n    return null;\n};\n\nEvernote.ClipStyle.STYLE_ATTRIBUTES = {\n    \"bgcolor\":\"background-color\",\n    \"text\":\"color\"\n};\n\nEvernote.ClipStyle.INHERITED_STYLES = [\n    \"azimuth\",\n    \"border-collapse\", \"border-spacing\",\n    \"caption-side\", \"color\", \"cursor\",\n    \"direction\",\n    \"elevation\", \"empty-cells\",\n    \"font-family\", \"font-size\", \"font-style\", \"font-weight\", \"font\",\n    \"letter-spacing\", \"line-height\", \"list-style-image\", \"list-style-position\", \"list-style-type\", \"list-style\",\n    \"orphans\",\n    \"pitch-range\", \"pitch\",\n    \"quotes\",\n    \"richness\",\n    \"speak-header\", \"speak-numeral\", \"speak-punctuation\", \"speak\", \"speak-rate\", \"stress\",\n    \"text-align\", \"text-indent\", \"text-transform\",\n    \"visibility\", \"voice-family\", \"volume\",\n    \"white-space\", \"widows\", \"word-spacing\"\n];\n\nEvernote.ClipStyle.prototype._collection = null;\nEvernote.ClipStyle.prototype._filterFn = null;\nEvernote.ClipStyle.prototype._styleList = null;\n\nEvernote.ClipStyle.prototype.initialize = function ( css, filterFn, styleList ) {\n    Evernote.Logger.debug( \"ClipStyle.initialize()\" );\n\n    this._collection = new Evernote.StylesCollection();\n    Evernote.Logger.debug( \"ClipStyle.initialize: collection initialized()\" );\n    this._filterFn = (typeof filterFn == \"function\") ? filterFn : null;\n    this._styleList = (styleList != null) ? styleList : Evernote.ClipStyle.STYLES;\n    if(css) {\n        if ( window.CSSStyleDeclaration &#038;&#038; css instanceof window.CSSStyleDeclaration ) {\n            this.addStyle( css, this._styleList );\n        }\n        else if ( window.CSSStyleRule &#038;&#038; css instanceof window.CSSStyleRule ) {\n            this.addStyle( css.style, this._styleList );\n        }\n        else if ( (window.CSSRuleList &#038;&#038; css instanceof window.CSSRuleList) || css instanceof Array ) {\n            for ( var i = 0; i < css.length; ++i ) { this.addStyle( css[ i ].style, this._styleList ); } } else if ( typeof css == 'object' &#038;&#038; css != null ) { this.addStyle( css, this._styleList ); } } Evernote.Logger.debug( \"ClipStyle.initialize() end \"); }; Evernote.ClipStyle.prototype.fixBackground = function ( prop, value ) { if(prop &#038;&#038; value) { if(prop.indexOf(\"background-image\") != -1 &#038;&#038; value.indexOf(\"url\") != -1) { Evernote.Logger.debug(\"Start replace\"); var regExp = \/url\\((.*?)\\)\/; var res = value.replace(regExp, \"url('$1')\").replace(\/('\")|(\"')|('')\/g, \"'\"); Evernote.Logger.debug(\"End replace\"); return Evernote.GlobalUtils.escapeXML(res); } } return value; }; Evernote.ClipStyle.prototype.addStyle = function ( style, styleList ) { Evernote.Logger.debug( \"ClipStyle.addStyle()\" ); if ( window.CSSStyleDeclaration &#038;&#038; style instanceof window.CSSStyleDeclaration &#038;&#038; style.length > 0 ) {\n        var list = (styleList != null) ? styleList : this._styleList;\n        for ( var i = 0; i < list.length; ++i ) {\n            var prop = list[ i ];\n            var value = Evernote.StyleElementExtension.getPropertyValue(style, prop );\n            var importantPriority = !!((style.getPropertyPriority(prop) == 'important'));\n            value = this.fixBackground(prop, value);\n            this.addSimpleStyle( prop, value, importantPriority );\n        }\n    }\n    else if ( style instanceof Evernote.ClipStyle ) {\n        list = (styleList != null) ? styleList : style.getStylesNames();\n        for ( var i = 0; i < list.length; ++i ) {\n            var prop = list[ i ];\n            value = style.getStyle( prop );\n            importantPriority = style.isImportant( prop );\n            value = this.fixBackground(prop, value);\n            this.addSimpleStyle( prop, value, importantPriority );\n        }\n    }\n    else if ( typeof style == 'object' &#038;&#038; style != null ) {\n        list = (styleList != null) ? styleList : style;\n        for ( var prop in list ) {\n            \/\/ In some cases, attempt to get currentStyle.outline ( or outlineWidth ) property in IE8 throws\n            \/\/ 'unspecified error' and crash whole serilization process. So we wrap it into try {...} catch.\n\n            try {\n                if ( list.hasOwnProperty( prop ) ) {\n                    var usedStyle = style[ prop ];\n                    var pName = prop;\n                    if(!usedStyle) {\n                        usedStyle = style [list[prop]];\n                        pName = list[prop];\n                        if(!usedStyle) {\n                            var propName = Evernote.IEStylePropertiesMapping.getPropertyNameFor(list[prop]);\n                            if(propName) {\n                                usedStyle = style[propName[1]];\n                            }\n                        }\n                    }\n                    usedStyle = this.fixBackground(pName, usedStyle);\n                    this.addSimpleStyle( pName, usedStyle );\n                }\n            }  catch (err) {}\n        }\n    }\n};\n\nEvernote.ClipStyle.prototype.removeStyle = function ( style ) {\n    Evernote.Logger.debug( \"ClipStyle.removeStyle()\" );\n    if(style) {\n        if ( window.CSSStyleDeclaration &#038;&#038; Evernote.Utils.isInstanceOf(style, window.CSSStyleDeclaration) || style instanceof Array ) {\n            for ( var i = 0; i < style.length; ++i ) {\n                this.removeSimpleStyle( style[ i ] );\n            }\n        }\n        else if ( style instanceof Evernote.ClipStyle ) {\n            var stylesNames = style.getStylesNames();\n            for ( i = 0; i < stylesNames.length; ++i ) {\n                this.removeSimpleStyle( stylesNames[ i ] );\n            }\n        }\n        else if ( typeof style == 'string' ) {\n            this.removeSimpleStyle( style );\n        }\n    }\n    Evernote.Logger.debug(\"ClipStyle.removeStyle() end\")\n};\n\nEvernote.ClipStyle.prototype.mergeStyle = function ( style, override ) {\n    Evernote.Logger.debug( \"ClipStyle.mergeStyle()\" );\n\n    if ( style instanceof Evernote.ClipStyle ) {\n        var stylesNames = style.getStylesNames();\n        for ( var i = 0; i < stylesNames.length; ++i ) {\n            var styleName = stylesNames[ i ];\n            var styleValue = this._collection.getStyle( styleName );\n            if ( styleValue == null || override || (style.isImportant( styleName ) &#038;&#038; !this._collection.isImportant( styleName )) ) {\n                var newValue = style.getStyle( styleName );\n                if ( style.isImportant( styleName ) ) {\n                    this._collection.addStyle( styleName, newValue, true );\n                }\n                else if ( override &#038;&#038; !this._collection.isImportant( styleName ) ) {\n                    this._collection.addStyle( styleName, newValue, false );\n                }\n                else if ( styleValue == null &#038;&#038; !override ) {\n                    this._collection.addStyle( styleName, newValue, style.isImportant( styleName ) );\n                }\n            }\n        }\n    }\n};\n\nEvernote.ClipStyle.prototype.getStylesNames = function () {\n    return this._collection.getStylesNames();\n};\n\nEvernote.ClipStyle.prototype.getStyle = function ( prop ) {\n    return this._collection.getStyle( prop );\n};\n\nEvernote.ClipStyle.prototype.isImportant = function ( prop ) {\n    return this._collection.isImportant( prop );\n};\n\nEvernote.ClipStyle.prototype.addSimpleStyle = function ( prop, value, importantPriority ) {\n    if ( typeof this._filterFn == \"function\" &#038;&#038; !this._filterFn( prop, value ) ) {\n        return;\n    }\n    var impl = Evernote.StylesReplacementRegistry.getImplementationFor(prop);\n    if(impl &#038;&#038; impl.getValue) {\n        value = impl.getValue(value);\n    }\n    this._collection.addStyle( prop, value, importantPriority );\n};\n\nEvernote.ClipStyle.prototype.removeSimpleStyle = function ( prop ) {\n    this._collection.removeStyle( prop );\n};\n\nEvernote.ClipStyle.prototype.toString = function () {\n    var str = \"\";\n    var stylesNames = this.getStylesNames();\n    for ( var i = 0; i < stylesNames.length; ++i ) { var styleName = stylesNames[ i ]; var value = this._collection.getStyle( styleName ); if ( value != null &#038;&#038; value.length > 0 ) {\n            str += styleName + \":\" + value + \";\";\n        }\n    }\n\n    return str;\n};\n\nEvernote.ClipStyle.CSSDefaultStyle = {\n    \"background-attachment\": \"scroll\",\n    \"background-color\" : \"transparent\",\n    \"background-image\" : \"none\",\n    \"background-position-x\" : \"0px\",\n    \"background-position-y\" : \"0px\",\n    \"background-repeat\" : \"repeat\",\n    \"border-bottom-style\" : \"none\",\n    \"border-bottom-width\" : \"medium\",\n    \"border-left-style\" : \"none\",\n    \"border-left-width\" : \"medium\",\n    \"border-right-style\" : \"none\",\n    \"border-right-width\" : \"medium\",\n    \"border-top-style\" : \"none\",\n    \"border-top-width\" : \"medium\",\n    \"border-collapse\" : \"separate\",\n    \"bottom\" : \"auto\",\n    \"clear\" : \"none\",\n    \"height\" : \"auto\",\n    \"left\" : \"auto\",\n    \"margin-bottom\" : \"0px\",\n    \"margin-left\" : \"0px\",\n    \"margin-right\" : \"0px\",\n    \"margin-top\" : \"0px\",\n    \"max-height\" : \"none\",\n    \"max-width\" : \"none\",\n    \"min-height\" : \"0px\",\n    \"min-width\" : \"0px\",\n    \"overflow\" : \"visible\",\n    \"overflow-x\" : \"visible\",\n    \"overflow-y\" : \"visible\",\n    \"padding\" : \"0px\",\n    \"padding-bottom\" : \"0px\",\n    \"padding-left\" : \"0px\",\n    \"padding-right\" : \"0px\",\n    \"padding-top\" : \"0px\",\n    \"page-break-before\" : \"auto\",\n    \"page-break-after\" : \"auto\",\n    \"position\" : \"static\",\n    \"right\" : \"auto\",\n    \"text-align\" : \"left\",\n    \"text-decoration\" : \"none\",\n    \"text-indent\" : \"0px\",\n    \"text-overflow\" : \"clip\",\n    \"top\" : \"auto\",\n    \"width\" : \"auto\"\n};\n\nEvernote.ClipStyle.prototype.removeDefaultCssStyle = function () {\n    var stylesNames = this.getStylesNames();\n    for ( var i = 0; i < stylesNames.length; ++i ) { var styleName = stylesNames[ i ]; var defaultCssValue = Evernote.ClipStyle.CSSDefaultStyle[styleName]; var value = this.getStyle( styleName ); if (!value) continue; if (defaultCssValue == value) { this.removeStyle(styleName); } } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClipStyleProperty = function ClipStyleProperty( name, value, isImportant ) { this.initialize( name, value, isImportant ); }; Evernote.ClipStyleProperty.prototype.initialize = function( name, value, isImportant ) { if ( typeof name == \"string\" &#038;&#038; typeof value == \"string\" ) { this._name = name; this._value = value; } this._isImportant = (isImportant) ? true : false; }; Evernote.ClipStyleProperty.prototype._name = null; Evernote.ClipStyleProperty.prototype._value = null; Evernote.ClipStyleProperty.prototype._isImportant = null; Evernote.ClipStyleProperty.prototype.name = function() { return this._name; }; Evernote.ClipStyleProperty.prototype.value = function() { return this._value; }; Evernote.ClipStyleProperty.prototype.isImportant = function() { return this._isImportant; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/** * Represents DOM parser that could able to traverse the DOM node tree from specified root. * @param tab - current window object * @param range - current selection on the page (if any) * @constructor *\/ Evernote.DomParser = function DomParser( tab, range ) { this.initialize( tab, range ); }; Evernote.DomParser.prototype._tab = null; \/** * Update current parser data * @param tab - current window object * @param range - current selection on the page (if any) *\/ Evernote.DomParser.prototype.initialize = function ( tab, range ) { Evernote.Logger.debug( \"DomSerializer.initialize()\" ); this._tab = tab; this._range = range; }; \/** * Determines if passed node should be serialized. * Node should not be initialized if one of the following is true: * - node is rejected according to configuration * - there is the selection on the page and this node is out of selection range. * @param node - DOM node * @return {Boolean} *\/ Evernote.DomParser.prototype.isNodeForSerialize = function ( node ) { if ( !node || Evernote.ClipRules.isRejectedNode( node ) || node.id == \"evernoteContentClipperWait\" ) { return false; } if(Evernote.ClipperElementsIdentifiers.match(node)) { Evernote.Logger.debug(\"Node is rejected because it is clipper information \" + node.id); return false; } return (!this._range || this.isNodeInRange( node )) ? true : false; }; \/** * Determines whether passed node is inside the selection range. Returns true if it is, false otherwise. * @param node - DOM node * @return {Boolean} *\/ Evernote.DomParser.prototype.isNodeInRange = function ( node ) { Evernote.Logger.debug( \"DomParser.isNodeInRange()\" ); var nodeRange, endsAfterNodeStart, startsBeforeNodeEnd; if (typeof node.ownerDocument.createRange == 'function') { \/\/ ie9, ie10, ie11 if ( node &#038;&#038; this._range ) { nodeRange = node.ownerDocument.createRange(); \/\/ create new selection from node, or node content try { nodeRange.selectNode( node ); } catch ( e ) { nodeRange.selectNodeContents( node ); } \/\/ compare boundary points of selection and current node. endsAfterNodeStart = this._range.compareBoundaryPoints( Range.START_TO_END, nodeRange ) == 1; startsBeforeNodeEnd = this._range.compareBoundaryPoints( Range.END_TO_START, nodeRange ) == -1; return endsAfterNodeStart &#038;&#038; startsBeforeNodeEnd; } } else { \/\/ ie7 , ie8 nodeRange = node.ownerDocument.body.createTextRange(); try { nodeRange.moveToElementText(node); } catch (e) { \/\/ [object Text] \/\/ probably, here should be analog for createRange().selectNodeContents(); return true; } endsAfterNodeStart = this._range.compareEndPoints('EndToStart', nodeRange) == 1; startsBeforeNodeEnd = this._range.compareEndPoints('StartToEnd', nodeRange) == -1; return endsAfterNodeStart &#038;&#038; startsBeforeNodeEnd; } return false; \/\/ not found. }; \/** * Determines whether passed node is visible on the page. * @param node - DOM node. * @return {Boolean} *\/ Evernote.DomParser.prototype.isNodeVisible = function ( node ) { Evernote.Logger.debug( \"DomParser.isNodeVisible()\" ); if ( !node ) { return false; } var compStyles = Evernote.ElementExtension.getComputedStyle( node, null, this._tab ); return Evernote.StyleElementExtension.getPropertyValue(compStyles, \"display\" ) != \"none\"; }; Evernote.DomParser.prototype.parseAsync = function ( root, fullPage, serializer, callback ) { var PARSING_TIMEOUT_INTERVAL = 1000; \/\/milliseconds if (!callback) { this.parse(root, fullPage, serializer); return; } if ( !root ) { throw new Error( \"No root element for parsing\" ); } var node = root; var parentNode = null; var thizz = this; var asyncParser = function() { var parsingEnd = true; var startTimeParsing = new Date().getTime(); while ( node ) { if ( node != root &#038;&#038; node.parentNode ) { parentNode = node.parentNode.serializedNode; } if ( thizz.isNodeForSerialize( node ) ) { if ( node.nodeType == Evernote.Node.TEXT_NODE ) { serializer.textNode( node, thizz._range ); } else if ( node.nodeType == Evernote.Node.ELEMENT_NODE &#038;&#038; thizz.isNodeVisible( node ) ) { node.serializedNode = serializer.startNode( new Evernote.SerializedNode( node, parentNode ), root, fullPage ); if ( node.hasChildNodes() ) { node = node.childNodes[ 0 ]; continue; } else { serializer.endNode( node.serializedNode ); if ( node.serializedNode ) { try { delete node.serializedNode; } catch(e) { \/\/If we are failed to delete the property, than just set it to undefined node.serializedNode = undefined; } } } } } \/** * Check if there is a next node available and it is not the root *\/ if ( node.nextSibling &#038;&#038; node != root ) { node = node.nextSibling; } else if ( node != root ) { while ( node.parentNode &#038;&#038; node != root ) { node = node.parentNode; try { serializer.endNode( node.serializedNode ); } catch (err) { node.serializedNode = undefined; continue; }; try { delete node.serializedNode; } catch (e) { \/\/If we are failed to delete the property, than just set it to undefined node.serializedNode = undefined; } if ( node.nextSibling &#038;&#038; node != root ) { node = node.nextSibling; break; } } if ( node == root ) { break; } } else { break; } var endTimeParsing = new Date().getTime(); if ( (endTimeParsing - startTimeParsing) >= PARSING_TIMEOUT_INTERVAL ) {\n                Evernote.Logger.debug(\"Parsing interval timeout: \" + (endTimeParsing - startTimeParsing));\n                parsingEnd = false;\n                break;\n            }\n        }\n\n        if (parsingEnd) {\n            Evernote.Logger.debug(\"Parsing end\");\n            callback();\n        }else {\n            Evernote.Logger.debug(\"Parsing repeat\");\n            setTimeout(asyncParser, 0);\n        }\n    };\n    setTimeout(asyncParser, 0);\n};\n\n\/**\n * Starts parsing from specified root.\n * @param root - starting DOM node.\n * @param fullPage - is user selects to serialize the full page\n * @param serializer - current serializer to be used to serialize the DOM node to string\n *\/\nEvernote.DomParser.prototype.parse = function ( root, fullPage, serializer ) {\n    Evernote.Logger.debug( \"DomParser.parse()\" );\n\n    if ( !root ) {\n        throw new Error( \"No root element for parsing\" );\n    }\n\n    var node = root;\n    var parentNode = null;\n\n    while ( node ) {\n        if ( node != root &#038;&#038; node.parentNode ) {\n            parentNode = node.parentNode.serializedNode;\n        }\n\n        if ( this.isNodeForSerialize( node ) ) {\n            if ( node.nodeType == Evernote.Node.TEXT_NODE ) {\n                serializer.textNode( node, this._range );\n            }\n            else if ( node.nodeType == Evernote.Node.ELEMENT_NODE &#038;&#038; this.isNodeVisible( node ) ) {\n                node.serializedNode = serializer.startNode( new Evernote.SerializedNode( node, parentNode ), root, fullPage );\n                if ( node.hasChildNodes() ) {\n                    node = node.childNodes[ 0 ];\n                    continue;\n                }\n                else {\n                    serializer.endNode( node.serializedNode );\n                    if ( node.serializedNode ) {\n                        try {\n                            delete node.serializedNode;\n                        } catch(e) {\n                            \/\/If we are failed to delete the property, than just set it to undefined\n                            node.serializedNode = undefined;\n                        }\n                    }\n                }\n            }\n        }\n\n        \/**\n         * Check if there is a next node available and it is not the root\n         *\/\n        if ( node.nextSibling &#038;&#038; node != root ) {\n            node = node.nextSibling;\n        }\n        else if ( node != root ) {\n            while ( node.parentNode &#038;&#038; node != root ) {\n                node = node.parentNode;\n                try {\n                    serializer.endNode( node.serializedNode );\n                } catch (err) {\n                    node.serializedNode = undefined;\n                    continue;\n                };\n\n                try {\n                    delete node.serializedNode;\n                } catch (e) {\n                    \/\/If we are failed to delete the property, than just set it to undefined\n                    node.serializedNode = undefined;\n                }\n\n                if ( node.nextSibling &#038;&#038; node != root ) {\n                    node = node.nextSibling;\n                    break;\n                }\n            }\n\n            if ( node == root ) {\n                break;\n            }\n        }\n        else {\n            break;\n        }\n    }\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.NodeSerializer = function NodeSerializer( tab, styleStrategy, includeBg , isRange) {\n    this.initialize( tab, styleStrategy, includeBg , isRange);\n};\n\nEvernote.NodeSerializer.prototype._tab = null;\nEvernote.NodeSerializer.prototype._styleStrategy = null;\nEvernote.NodeSerializer.prototype._docBase = null;\nEvernote.NodeSerializer.prototype._imagesUrls = null;\nEvernote.NodeSerializer.prototype._isRange = null;\nEvernote.NodeSerializer.prototype._serializedDom = \"\";\nEvernote.NodeSerializer.prototype._includeBgStyles = true;\n\nEvernote.NodeSerializer.prototype.initialize = function ( tab, styleStrategy, includeBg ,isRange ) {\n    Evernote.Logger.debug( \"DomSerializer.initialize()\" );\n\n    this._tab = tab;\n    this._styleStrategy = (styleStrategy instanceof Evernote.ClipStylingStrategy) ? styleStrategy : null;\n    this._imagesUrls = [ ];\n    this._includeBgStyles = ( includeBg != null ) ? includeBg : true;\n    this._isRange = ( isRange != null ) ? isRange : false;\n    this.getDocumentBase();\n};\n\nEvernote.NodeSerializer.prototype.startNode = function ( serializedNode, root, fullPage ) {\n    Evernote.Logger.debug( \"Start to serialize node :\" + serializedNode.node.nodeName + \", class = \" + serializedNode.node.className + \", id = \" + serializedNode.node.id );\n    try {\n        var node = serializedNode.node;\n        if ( Evernote.ClipRules.isConditionalNode( node ) &#038;&#038; Evernote.ElementSerializerFactory.getImplementationFor( node ) != null ) {\n            var result = this.serializeConditionalNode( node, root, fullPage );\n            this._serializedDom += result.content;\n            \/\/ hack for desktop Win client\n            if ( result.imageUrl ) {\n                this._imagesUrls.push( result.imageUrl );\n            }\n            serializedNode.setStyle(result.nodeStyle);\n            return serializedNode;\n        }\n\n        if ( node.nodeName.toLowerCase() == \"embed\" ) {\n            var src = node.getAttribute( \"src\" );\n            if ( src &#038;&#038; (src.indexOf(\".swf\", src.length - \".swf\".length) !== -1) ) {\n                serializedNode.setStyle(new Evernote.ClipStyle());\n                return serializedNode;\n            }\n        }\n\n        if ( node.nodeName.toLowerCase() == \"img\" ) {\n            var src = node.getAttribute( \"src\" );\n\n            if (src &#038;&#038; src.indexOf('&#038;') != -1) {\n                src =  src.slice(0, src.indexOf('&#038;'));\n            }\n\n            var absoluteSource = Evernote.Utils.makeAbsolutePath(this._docBase, src).replace(\/\\s\/g, \"%20\");\n            node.setAttribute( \"type\", \"put-media-type-here-for-\" + absoluteSource);\n            node.setAttribute( \"hash\", \"put-hash-type-here-for-\" + absoluteSource);\n            node.setAttribute( \"src\", src);\n\n            if ( src &#038;&#038; src.indexOf( \"data:image\" ) < 0 ) { this._imagesUrls.push( src ); } } var attrsStr = this.serializeAttributes( node ); var stylesStr = \"\"; var nodeName = Evernote.ClipRules.translateNode( node ); if ( this._styleStrategy ) { var nodeStyle = this._styleStrategy.styleForNode( node, root, fullPage, Evernote.ClipStyleType.Default ).evaluated; var inhBgStyle = null; if ( this._includeBgStyles ) inhBgStyle = this._styleStrategy.styleForNode( node, root, fullPage, Evernote.ClipStyleType.InheritedBgStyle ).inheritedBackground; if ( inhBgStyle != null ) for ( var inhI = inhBgStyle.length - 1; inhI >= 0; inhI-- ) {\n                    var inhStyle = inhBgStyle[inhI];\n                    this._serializedDom += \"\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div \" + this.serializeStyles( node, inhStyle ) + \" >\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\";\n                    serializedNode.translateTo.push( \"div\" );\n                }\n\n            var pseudoStyle = this._styleStrategy.getNodeStyle( node, null, \":before\" );\n\n            if ( fullPage &#038;&#038; node.nodeName.toLowerCase() == \"body\" ) {\n                var wrapBodyStyle = new Evernote.ClipStyle( nodeStyle, null, Evernote.ClipStyle.CSS_GROUP.getExtForStyle( \"background\" ) );\n                this._serializedDom += \"<\" + \"div\" + \" \" + this.serializeStyles( node, wrapBodyStyle ) + \" >\";\n                serializedNode.translateTo.push( \"div\" );\n                var bgGroup = Evernote.ClipStyle.CSS_GROUP.getExtForStyle( \"background\" );\n                for ( var ind in bgGroup ) {\n                    if ( bgGroup.hasOwnProperty( ind ) ) {\n                        nodeStyle.removeStyle( bgGroup[ind] );\n                    }\n                }\n            }\n\n            \/\/ Bug 47705. dirty fix, may cause problems in some cases.\n            if (this._isRange) {\n                nodeStyle.addSimpleStyle('height', node.currentStyle.height);\n            }\n\n            if ( !fullPage &#038;&#038; node == root ) {\n                nodeStyle.removeStyle( \"float\" );\n            }\n            if ( !serializedNode.node.hasChildNodes() &#038;&#038; !(nodeStyle.getStyle( \"height\" ) || node.getAttribute( \"height\" )) ) {\n                nodeStyle.addStyle( {height:\"0px\"} );\n            }\n            if ( !serializedNode.node.hasChildNodes() &#038;&#038; !(nodeStyle.getStyle( \"width\" ) || node.getAttribute( \"width\" )) ) {\n                nodeStyle.addStyle( {width:\"0px\"} );\n            }\n            if(nodeStyle.getStyle(\"position\") == \"fixed\") {\n                nodeStyle.addStyle({position: \"absolute\"});\n            }\n\n            if ( (node.nodeName.toUpperCase() == \"SPAN\"\/* || node.nodeName.toUpperCase() == \"A\"*\/) &#038;&#038; node.getElementsByTagName( \"IMG\" ).length > 0) {\n                nodeName = \"div\";\n                if ( !nodeStyle.getStyle( \"display\" ) )\n                    nodeStyle.addStyle( {display:\"inline\"} );\n            }\n            if (node.nodeName.toUpperCase() == \"TH\" || node.nodeName.toUpperCase() == \"TD\") {\n                nodeStyle.addStyle( {display:\"table-cell\"} );\n            }\n\n            nodeStyle.removeDefaultCssStyle();\n\n            this._serializedDom += this.serializePseudoElement( node, pseudoStyle );\n            stylesStr = this.serializeStyles( node, nodeStyle );\n\n            if ( (nodeName.toLowerCase() == \"div\" \/*|| nodeName.toLowerCase() == \"span\"*\/) &#038;&#038; nodeStyle.getStyle( \"float\" ) &#038;&#038; nodeStyle.getStyle( \"float\" ) != \"none\" &#038;&#038; serializedNode.parentNode &#038;&#038; node.parentNode.nodeName.toLowerCase() != \"a\" ) {\n                if ( !serializedNode.node.nextSibling || serializedNode.node.nextSibling.nodeType == 3 )\n                    serializedNode.parentNode.isInlineBlock = true;\n            }\n        }\n\n        Evernote.Logger.debug( node.nodeName + \" \" + attrsStr + \" -> \" + nodeName + \" \" + stylesStr );\n\n        this._serializedDom += \"<\" + nodeName + \" \" + attrsStr + \" \" + stylesStr + \" >\";\n\n        serializedNode.setStyle(nodeStyle);\n        serializedNode.translateTo.push( nodeName );\n        return serializedNode;\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"Failed to start serialize node :\" + e );\n        throw e;\n    }\n};\n\nEvernote.NodeSerializer.prototype.serializePseudoElement = function ( node, pseudoStyle ) {\n    try {\n        var nodeName = Evernote.ClipRules.translateNode( node );\n        if ( pseudoStyle.getStylesNames().length > 0 ) {\n            var content = \"&nbsp;\";\n            if ( pseudoStyle.getStyle( \"content\" ) ) {\n                content = pseudoStyle.getStyle( \"content\" );\n                pseudoStyle.removeStyle( \"content\" );\n            }\n            var beforeStylesStr = this.serializeStyles( node, pseudoStyle );\n            return \"<\" + nodeName + \" \" + beforeStylesStr + \" >\" + content.replace( \/\"\/g, '' ) + \"<\/\" + nodeName + \">\";\n        }\n        return \"\";\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"Failed to  serialize pseudo element :\" + e );\n        throw e;\n    }\n};\n\nEvernote.NodeSerializer.prototype.textNode = function ( node, range ) {\n    this._serializedDom += this.serializeTextNode( node, range );\n};\n\nEvernote.NodeSerializer.prototype.endNode = function ( serializedNode ) {\n    try {\n        Evernote.Logger.debug( \"end serialize node :\" + serializedNode.translateTo );\n\n        if ( serializedNode.isInlineBlock ) {\n            var name = \"div\";\n            if ( serializedNode.node.nodeName.toLowerCase() == \"ul\" ) {\n                name = \"li\"\n            }\n            this._serializedDom += \"<\" + name + \" style=\\\"clear: both; width: 0px; height: 0px;\\\">\" + \"&nbsp;\" + \"<\/\" + name + \">\"\n        }\n\n        var node = serializedNode.node;\n        var serializedPseudo = \"\";\n        var pseudoStyle = new Evernote.ClipStyle();\n        if ( this._styleStrategy ) {\n            pseudoStyle = this._styleStrategy.getNodeStyle( node, null, \":after\" );\n            if ( pseudoStyle.getStylesNames().length > 0 ) {\n                var floatStyle = serializedNode.getStyle().getStyle( \"float\" );\n                if ( floatStyle &#038;&#038; !pseudoStyle.getStyle( \"float\" ) )\n                    pseudoStyle.addStyle( { \"float\" : floatStyle } );\n\n                if ( node.nodeName.toLowerCase() == \"ul\" )\n                    serializedPseudo = this.serializePseudoElement( document.createElement( \"div\" ), pseudoStyle );\n            }\n        }\n\n        while ( serializedNode.translateTo.length > 0 ) {\n            var nodeName = serializedNode.translateTo.pop();\n            if ( !Evernote.ClipRules.isSelfClosingNode( serializedNode.node ) ) {\n                if ( !serializedNode.node.hasChildNodes() )\n                    this._serializedDom += \"&nbsp;\";\n            }\n\n            if ( nodeName.toLowerCase() == \"ul\" ) {\n                this._serializedDom += this.serializePseudoElement( document.createElement( \"li\" ), pseudoStyle );\n            }\n            this._serializedDom += \"<\/\" + nodeName + \">\";\n        }\n\n        this._serializedDom += serializedPseudo;\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"Failed to end serialize node :\" + e );\n        throw e;\n    }\n};\n\nEvernote.NodeSerializer.prototype.serializeTextNode = function ( node, range ) {\n    Evernote.Logger.debug( \"DomSerializer.serializeTextNode()\" );\n\n    try {\n        var nodeValue = node.nodeValue;\n        if ( !range ) {\n            return Evernote.Utils.htmlEncode( nodeValue );\n        }\n        else {\n            if ( range.startContainer == node &#038;&#038; range.startContainer == range.endContainer ) {\n                return Evernote.Utils.htmlEncode( nodeValue.substring( range.startOffset, range.endOffset ) );\n            }\n            else if ( range.startContainer == node ) {\n                return Evernote.Utils.htmlEncode( nodeValue.substring( range.startOffset ) );\n            }\n            else if ( range.endContainer == node ) {\n                return Evernote.Utils.htmlEncode( nodeValue.substring( 0, range.endOffset ) );\n            }\n            else if ( range.commonAncestorContainer != node ) {\n                return Evernote.Utils.htmlEncode( nodeValue );\n            }\n        }\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"DomSerializer.serializeTextNode() failed \" + e );\n        throw e;\n    }\n\n    return \"\";\n};\n\nEvernote.NodeSerializer.prototype.serializeConditionalNode = function ( node, root, fullPage ) {\n    Evernote.Logger.debug( \"DomSerializer.serializeConditionalNode()\" );\n    var impl = Evernote.ElementSerializerFactory.getImplementationFor( node );\n    if ( typeof impl == 'function' ) {\n        var nodeStyle = (this._styleStrategy) ? this._styleStrategy.styleForNode( node, root, fullPage ).evaluated : null;\n        if (nodeStyle)\n            nodeStyle.removeDefaultCssStyle();\n        var serializer = new impl( node, nodeStyle );\n        var content = serializer.serialize( this._docBase );\n        var imageUrl = serializer.getImageUrl();\n\n        return { content:content, imageUrl:imageUrl, nodeStyle:nodeStyle };\n    }\n\n    return { content:\"\", imageUrl:\"\", nodeStyle:new Evernote.ClipStyle() };\n};\n\nEvernote.NodeSerializer.prototype.serializeAttributes = function ( node ) {\n    Evernote.Logger.debug( \"DomSerializer.serializeAttributes()\" );\n\n    try {\n        var attrs = node.attributes;\n        var str = \"\";\n\n        for ( var i = 0; i < attrs.length; ++i ) {\n            if ( !Evernote.ClipRules.isNoKeepNodeAttr( attrs[ i ], Evernote.ClipRules.translateNode( node ), node ) ) {\n                var attrValue = (attrs[ i ].value) ? Evernote.GlobalUtils.escapeXML( attrs[ i ].value ) : \"\";\n                if ( (attrs[ i ].name.toLowerCase() == \"src\" || attrs[ i ].name.toLowerCase() == \"href\") &#038;&#038; attrValue.toLowerCase().indexOf( \"http\" ) != 0 ) {\n                    attrValue = Evernote.Utils.makeAbsolutePath( this._docBase, attrValue );\n                }\n                str += \" \" + attrs[ i ].name.toLowerCase() + \"=\\\"\" + attrValue + \"\\\"\";\n            }\n        }\n\n        return str;\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"DomSerializer.serializeAttributes() failed: error = \" + e );\n    }\n\n    return \"\";\n};\n\nEvernote.NodeSerializer.prototype.serializeStyles = function ( node, nodeStyle ) {\n    Evernote.Logger.debug( \"DomSerializer.serializeStyles()\" );\n\n    try {\n        var str = \"\";\n        if(node.nodeName.toLowerCase() == \"map\") {\n            \/\/Map should not have style attribute according to Evernote DTD\n            return \"\";\n        }\n        if ( node &#038;&#038; nodeStyle instanceof Evernote.ClipStyle ) {\n            str += \" style=\\\"\" + nodeStyle.toString().replace( \/\"\/g, \"\" ) + \"\\\"\";\n        }\n        return str;\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"DomSerializer.serializeStyles() failed: error = \" + e );\n        throw e;\n    }\n    return \"\";\n};\n\nEvernote.NodeSerializer.prototype.getDocumentBase = function () {\n    Evernote.Logger.debug( \"DomSerializer.getDocumentBase()\" );\n\n    if ( !this._docBase ) {\n        var baseTags = this._tab.document.getElementsByTagName( \"base\" );\n        for ( var i = 0; i < baseTags.length; ++i ) {\n            var baseTag = baseTags[ i ];\n            if ( typeof baseTag == 'string' &#038;&#038; baseTag.indexOf( \"http\" ) == 0 ) {\n                this._docBase = baseTag;\n            }\n            if ( this._docBase ) {\n                break;\n            }\n        }\n\n        if ( !this._docBase ) {\n            var location = this._tab.document.location;\n            this._docBase = location.protocol + \"\/\/\" + location.host + location.pathname.replace( \/[^\\\/]+$\/, \"\" );\n        }\n    }\n\n    return this._docBase;\n};\n\nEvernote.NodeSerializer.prototype.getImagesUrls = function () {\n    return this._imagesUrls;\n};\n\nEvernote.NodeSerializer.prototype.getSerializedDom = function () {\n    return '\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<div style=\"position: relative;\">' + this._serializedDom.replace(\/[^\\u0009\\u000a\\u000d\\u0020-\\uD7FF\\uE000-\\uFFFD]+\/g, \"\") + '<\/div>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n';\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/\/\"use strict\"; Evernote.SerializedNode = function SerializedNode( node, parent ) { this.node = node; this._parentSerializedNode = parent; this.translateTo = [ ]; }; Evernote.SerializedNode.prototype.translateTo = null; Evernote.SerializedNode.prototype.node = null; Evernote.SerializedNode.prototype._parentSerializedNode = null; Evernote.SerializedNode.prototype.setStyle = function ( clipStyle ) { this._clipStyle = clipStyle; }; Evernote.SerializedNode.prototype.getStyle = function () { return this._clipStyle; }; Evernote.SerializedNode.prototype.parentNode = function () { return this._parentSerializedNode; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ \/\/\"use strict\"; Evernote.StylesCollection = function StylesCollection() { this._styles = { }; }; Evernote.StylesCollection.prototype._styles = null; Evernote.StylesCollection.prototype.addStyle = function( name, value, isImportant ) { if ( typeof name == \"string\" &#038;&#038; typeof value == \"string\" ) { Evernote.Logger.debug( \"StylesCollection.addStyle(): name = \" + name + \", value = \" + value + \", isImportant = \" + isImportant ); this._styles[ name ] = new Evernote.ClipStyleProperty( name, value, isImportant); } }; Evernote.StylesCollection.prototype.getStyle = function( name ) { if ( typeof name == \"string\" ) { Evernote.Logger.debug( \"StylesCollection.getStyle(): name = \" + name + \" value: \" + ((typeof this._styles[ name ] != \"undefined\") ? this._styles[ name ].value() : null) ); return (typeof this._styles[ name ] != \"undefined\") ? this._styles[ name ].value() : null; } return null; }; Evernote.StylesCollection.prototype.removeStyle = function( name ) { if ( typeof name == \"string\" ) { Evernote.Logger.debug( \"StylesCollection.removeStyle(): name = \" + name ); this._styles[ name ] = null; delete this._styles[ name ]; } }; Evernote.StylesCollection.prototype.isImportant = function( name ) { if ( typeof name == \"string\" ) { return (typeof this._styles[ name ] != \"undefined\") ? this._styles[ name ].isImportant() : false; } }; Evernote.StylesCollection.prototype.getStylesNames = function() { Evernote.Logger.debug( \"StylesCollection.getStylesNames()\" ); var stylesNames = [ ]; for ( var key in this._styles ) { if ( this._styles[ key ] != null ) { stylesNames.push( key ); } } return stylesNames; }; Evernote.StylesCollection.prototype.getStylesNumber = function() { Evernote.Logger.debug( \"StylesCollection.getStylesNumber()\" ); var num = 0; for ( var key in this._styles ) { if ( this._styles[ key ] != null ) { ++num; } } return num; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.DataImageSerializer = function DataImageSerializer( node, nodeStyle ) {\n    if ( !nodeStyle ) {\n        nodeStyle = new Evernote.ClipStyle();\n    }\n\n    this.initialize( node, nodeStyle );\n};\n\nEvernote.inherit( Evernote.DataImageSerializer, Evernote.AbstractElementSerializer, true );\n\nEvernote.DataImageSerializer.isResponsibleFor = function( node ) {\n    try {\n        if ( node &#038;&#038; node.nodeType == Evernote.Node.ELEMENT_NODE &#038;&#038; node.nodeName.toLowerCase() == \"img\" ) {\n            var src = node.getAttribute( \"src\" );\n            if ( src &#038;&#038; src.indexOf( \"data:image\" ) != -1 ) {\n                return true;\n            }\n        }\n    } catch(e) {\n        Evernote.Logger.error(\"DataImageSerializer.isResponsibleFor failed due to error \" + e);\n    }\n    return false;\n};\n\nEvernote.DataImageSerializer.prototype.serialize = function( \/*docBase*\/ ) {\n    Evernote.Logger.debug( \"DataImageSerializer.serialize()\" );\n\n    try {\n        this._nodeStyle.addStyle( { \"background-image\" : \"url('\" + this._node.getAttribute( \"src\" ) + \"')\",\n            \"width\" : this._node.offsetWidth + \"px\",\n            \"height\" : this._node.offsetHeight + \"px\",\n            \"background-repeat\" : \"no-repeat\",\n            \"display\" : \"block\" } );\n\n        return \"<span style=\\\"\" + this._nodeStyle.toString().replace( \/\"\/g, \"\" ) + \"\\\"\" + \">&nbsp;<\/span>\";\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"DataImageSerializer.serialize() failed: error = \" + e );\n    }\n\n    return \"\";\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.VideoElementSerializer = function VideoElementSerializer( node, nodeStyle ) {\n    this.initialize( node, nodeStyle );\n};\n\nEvernote.inherit( Evernote.VideoElementSerializer, Evernote.AbstractElementSerializer, true );\n\nEvernote.VideoElementSerializer.isResponsibleFor = function( node ) {\n    return node &#038;&#038; node.nodeType == Evernote.Node.ELEMENT_NODE &#038;&#038; node.nodeName.toLowerCase() == \"video\";\n};\n\nEvernote.VideoElementSerializer.prototype.serialize = function( \/*docBase*\/ ) {\n    Evernote.Logger.debug( \"VideoElementSerializer.serialize()\" );\n\n    try {\n        var width = this._node.offsetWidth;\n        var height = this._node.offsetHeight;\n        var doc = this._node.ownerDocument;\n\n        var canvas = doc.createElement( \"CANVAS\" );\n        canvas.width = width;\n        canvas.height = height;\n\n        var context = canvas.getContext( \"2d\" );\n        context.drawImage( this._node, 0, 0, width, height );\n\n        var dataUrl = canvas.toDataURL( \"image\/png\" );\n        context.clearRect( 0, 0, width, height );\n\n        this._nodeStyle.addStyle( { \"background-image\" : \"url('\" + dataUrl + \"')\",\n            \"width\" : width + \"px\",\n            \"height\" : height + \"px\",\n            \"display\" : \"block\" } );\n\n        return \"<a style=\\\"\" + this._nodeStyle.toString().replace( \/\"\/g, \"\" ) + \"\\\"\" + \"href='\" + doc.defaultView.location.href + \"'>&nbsp;<\/a>\";\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"VideoElementSerializer.serialize() failed: error = \" + e );\n    }\n\n    return \"\";\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\n\/**\n * Serializes DOM element into an img pointing to the thumbnail of the video\n *\n * Video ids are used for obtaining thumbnails via\n * https:\/\/i2.ytimg.com\/vi\/cAcxHQalWOw\/hqdefault.jpg. These ids can be\n * obtained from:\n *\n *\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<pre>\r\n *   - the URL of the document containing EMBED\r\n *   - iframe's src attribute that embeds the video via an iframe\r\n *   - src attribute of the embed object (though on actualy youtube.com it's not possible)\r\n *<\/pre>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n *\n * Sample URLs are:\n *\n *\n\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<pre>\r\n * http: \/\/www.youtube.com\/embed\/IWJJBwKhvp4?wmode=opaque&amp;rel=0\r\n * http: \/\/www.youtube.com\/v\/YZEbBZ2IrXE?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1\r\n * http: \/\/www.youtube.com\/v\/J3mjFSTsKiM&amp;hl=en&amp;fs=1\r\n * http:\/\/www.youtube.com\/watch?v=cAcxHQalWOw\r\n * http:\/\/www.youtube.com\/user\/IFiDieApp?v=sdzCELofGgE&#038;feature=pyv\r\n *<\/pre>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\n\n\n *\/\n\nEvernote.YoutubeElementSerializer = function YoutubeElementSerializer( doc, node, nodeStyle ) {\n    this.initialize( doc, node, nodeStyle );\n};\n\nEvernote.inherit( Evernote.YoutubeElementSerializer, Evernote.AbstractElementSerializer, true );\n\nEvernote.YoutubeElementSerializer.WATCH_URL_REGEX = \/^https?:\\\/\\\/www\\.youtube\\.com\\\/watch\\?.*v=([^&#038;]+)\/i;\nEvernote.YoutubeElementSerializer.USER_CHANNEL_URL_REGEX = \/^https?:\\\/\\\/www\\.youtube\\.com\\\/user\\\/([a-zA-Z0-9]+)\\?v=([^&#038;]+)\/i;\nEvernote.YoutubeElementSerializer.EMBED_URL_REGEX = \/^https?:\\\/\\\/www\\.youtube\\.com\\\/embed\\\/([^\\\/\\?&#038;]+)\/i;\nEvernote.YoutubeElementSerializer.VIDEO_URL_REGEX = \/^https?:\\\/\\\/www\\.youtube\\.com\\\/v\\\/([^\\\/\\?&#038;]+)\/i;\nEvernote.YoutubeElementSerializer.POSSIBLE_CONTAINER_NODES = [ \"OBJECT\" ];\nEvernote.YoutubeElementSerializer.VIDEO_NODES = [ \"EMBED\", \"IFRAME\" ];\nEvernote.YoutubeElementSerializer.WATCH_URL = \"http:\/\/www.youtube.com\/watch?v=$videoId$\";\nEvernote.YoutubeElementSerializer.USER_CHANNEL_URL = \"http:\/\/www.youtube.com\/user\/$userId$?v=$videoId$\";\nEvernote.YoutubeElementSerializer.DEFAULT_THUMB_URL = \"https:\/\/i2.ytimg.com\/vi\/$videoId$\/default.jpg\";\nEvernote.YoutubeElementSerializer.HQ_THUMB_URL = \"https:\/\/i2.ytimg.com\/vi\/$videoId$\/hqdefault.jpg\";\nEvernote.YoutubeElementSerializer.DEFAULT_THUMB_WIDTH = 120;\nEvernote.YoutubeElementSerializer.DEFAULT_THUMB_HEIGHT = 90;\n\nEvernote.YoutubeElementSerializer.isResponsibleFor = function( node ) {\n    var params = this.extractVideoParamsFromNode( node );\n    return (params) ? true : false;\n};\n\nEvernote.YoutubeElementSerializer.extractVideoParamsFromNode = function( node ) {\n    Evernote.Logger.debug( \"YoutubeElementSerializer.extractVideoIdFromNode()\" );\n    try {\n        if ( node &#038;&#038; node.nodeType == Evernote.Node.ELEMENT_NODE ) {\n            var view = window;\n            try {\n                view = node.ownerDocument.defaultView;\n            }\n            catch ( e ) {\n            }\n\n            var matches = null;\n            if ( view &#038;&#038; (node.nodeName.toLowerCase() == \"embed\" || node.nodeName.toLowerCase() == \"object\") &#038;&#038; view.location ) {\n                if ( (matches = view.location.href.match( this.WATCH_URL_REGEX )) &#038;&#038; matches[ 1 ] ) {\n                    return matches[ 1 ];\n                }\n                else if ( (matches = view.location.href.match( this.USER_CHANNEL_URL_REGEX )) &#038;&#038; matches[ 1 ] &#038;&#038; matches[ 2 ] ) {\n                    return [ matches[ 1 ], matches[ 2 ] ];\n                }\n            }\n            else {\n                var videoNode = this.findVideoNode( node );\n                if ( videoNode ) {\n                    var src = videoNode.getAttribute( \"src\" );\n                    if ( src &#038;&#038; (matches = src.match( this.EMBED_URL_REGEX )) &#038;&#038; matches[ 1 ] ) {\n                        return matches[ 1 ];\n                    }\n                    else if ( src &#038;&#038; (matches = src.match( this.VIDEO_URL_REGEX )) &#038;&#038; matches[ 1 ] ) {\n                        return matches[ 1 ];\n                    }\n                }\n            }\n        }\n    } catch(e) {\n        Evernote.Logger.error(\"failed to YoutubeElementSerializer.extractVideoParamsFromNode due to error \" + e);\n    }\n\n    return null;\n};\n\nEvernote.YoutubeElementSerializer.findVideoNode = function( node ) {\n    Evernote.Logger.debug( \"YoutubeElementSerializer.findVideoNode()\" );\n\n    if ( node &#038;&#038; node.nodeType == Evernote.Node.ELEMENT_NODE ) {\n        if ( Evernote.ArrayExtension.indexOf(this.VIDEO_NODES,  node.nodeName.toUpperCase() ) >= 0 ) {\n            return node;\n        }\n        else if ( Evernote.ArrayExtension.indexOf(this.POSSIBLE_CONTAINER_NODES, node.nodeName.toUpperCase() ) >= 0 ) {\n            try {\n                var it = node.ownerDocument.createNodeIterator( node, NodeFilter.SHOW_ELEMENT, null, false );\n                var next = null;\n\n                while ( next = it.nextNode() ) {\n                    if ( Evernote.ArrayExtension.indexOf(this.VIDEO_NODES, next.nodeName.toUpperCase() ) >= 0 ) {\n                        return next;\n                    }\n                }\n            } catch(e) {\n                \/\/We ignore exception here, because if node iterator is not supported, than we could skip old pages (not Youtube).\n                return null;\n            }\n        }\n    }\n\n    return null;\n};\n\nEvernote.YoutubeElementSerializer.prototype._imageUrl = \"\";\n\nEvernote.YoutubeElementSerializer.prototype.serialize = function( \/*docBase*\/ ) {\n    Evernote.Logger.debug( \"YoutubeElementSerializer.serialize()\" );\n\n    try {\n        var userId = null;\n        var videoId = null;\n        var params = this.constructor.extractVideoParamsFromNode( this._node );\n        if ( params instanceof Array ) {\n            userId = params[ 0 ];\n            videoId = params[ 1 ];\n        }\n        else if ( typeof params == \"string\" ) {\n            videoId = params;\n        }\n\n        if ( videoId ) {\n            var thumbUrl = null;\n            var w = 0;\n            var h = 0;\n\n            if ( this._nodeStyle ) {\n\n                var view = window;\n                try {\n                    view = this._node.ownerDocument.defaultView;\n                }\n                catch ( e ) {\n                }\n\n                var computedStyles = Evernote.ElementExtension.getComputedStyle( this._node, null, view );\n\n                w = parseInt( Evernote.StyleElementExtension.getPropertyValue(computedStyles, \"width\" ) );\n                w = (isNaN( w )) ? 0 : w;\n\n                h = parseInt( Evernote.StyleElementExtension.getPropertyValue(computedStyles, \"height\" ) );\n                h = (isNaN( h )) ? 0 : h;\n\n                if ( w < this.constructor.DEFAULT_THUMB_WIDTH || h < this.constructor.DEFAULT_THUMB_HEIGHT ) {\n                    thumbUrl = this.getDefaultThumbnailUrl( videoId );\n                }\n                else {\n                    thumbUrl = this.getHQThumbnailUrl( videoId );\n                }\n            }\n            else {\n                thumbUrl = this.getDefaultThumbnailUrl( videoId );\n            }\n\n            if ( thumbUrl ) {\n                var styleStr = (this._nodeStyle instanceof Evernote.ClipStyle) ? (\"style=\\\"\" + this._nodeStyle.toString() + \"\\\"\") : \"\";\n                var attrs = this._node.attributes;\n                var attrStr = \"\";\n\n                for ( var i = 0; i < attrs.length; ++i ) { var attr = attrs[ i ]; if(Evernote.ClipRules.KEEP_NODE_ATTRIBUTES[\"a\"][attr.name]) { attrStr += attr.name; if ( attr.value ) { attrStr += \"=\" + attr.value; } attrStr += \" \"; } } var href = ( userId ) ? this.getUserChannelUrl( userId, videoId ) : this.getWatchUrl( videoId ); var imgAttrStr = \"\"; if ( w &#038;&#038; h ) { var k = w \/ h; \/\/ scale by height if ( k > this.constructor.DEFAULT_THUMB_WIDTH \/ this.constructor.DEFAULT_THUMB_HEIGHT ) {\n                        imgAttrStr += \"height=\\\"\" + h + \"\\\"\";\n                    }\n                    else { \/\/ scale by width\n                        imgAttrStr += \"width=\\\"\" + w + \"\\\"\";\n                    }\n                }\n\n                this._imageUrl = thumbUrl;\n                return \"<a \" + styleStr + \" \" + attrStr + \" href=\\\"\" + href + \"\\\"><img src=\\\"\" + thumbUrl + \"\\\" \" + imgAttrStr + \"\/><\/a>\";\n            }\n        }\n    }\n    catch ( e ) {\n        Evernote.Logger.error( \"YoutubeElementSerializer.serialize() failed: error = \" + e );\n    }\n\n    return \"\";\n};\n\nEvernote.YoutubeElementSerializer.prototype.getDefaultThumbnailUrl = function( videoId ) {\n    return this.constructor.DEFAULT_THUMB_URL.replace( \/\\$videoId\\$\/, videoId );\n};\n\nEvernote.YoutubeElementSerializer.prototype.getHQThumbnailUrl = function( videoId ) {\n    return this.constructor.HQ_THUMB_URL.replace( \/\\$videoId\\$\/, videoId );\n};\n\nEvernote.YoutubeElementSerializer.prototype.getWatchUrl = function( videoId ) {\n    return this.constructor.WATCH_URL.replace( \/\\$videoId\\$\/, videoId );\n};\n\nEvernote.YoutubeElementSerializer.prototype.getUserChannelUrl = function( userId, videoId ) {\n    return this.constructor.USER_CHANNEL_URL.replace( \/\\$userId\\$\/, userId ).replace( \/\\$videoId\\$\/, videoId );\n};\n\nEvernote.YoutubeElementSerializer.prototype.getImageUrl = function() {\n    return this._imageUrl;\n};\n\/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.IEStylePropertiesMapping = { _mapping : { \"background-attachment\" : \"backgroundAttachment\", \"background-color\" : \"backgroundColor\", \"background-image\" : \"backgroundImage\", \"background-repeat\" : \"backgroundRepeat\", \"background-position-x\" : \"backgroundPositionX\", \"background-position-y\" : \"backgroundPositionY\", \"border-bottom-color\" : \"borderBottomColor\", \"border-bottom-style\" : \"borderBottomStyle\", \"border-bottom-width\" : \"borderBottomWidth\", \"border-left-color\" : \"borderLeftColor\", \"border-left-style\" : \"borderLeftStyle\", \"border-left-width\" : \"borderLeftWidth\", \"border-right-color\" : \"borderRightColor\", \"border-right-style\" : \"borderRightStyle\", \"border-right-width\" : \"borderRightWidth\", \"border-top-color\" : \"borderTopColor\", \"border-top-style\" : \"borderTopStyle\", \"border-top-width\" : \"borderTopWidth\", \"border-collapse\" : \"borderCollapse\", \"font-family\" : \"fontFamily\", \"font-size\" : \"fontSize\", \"font-style\" : \"fontStyle\", \"font-weight\" : \"fontWeight\", \"float\" : \"styleFloat\", \"ime-mode\" : \"imeMode\", \"letter-spacing\" : \"letterSpacing\", \"line-height\" : \"lineHeight\", \"list-style-image\" : \"listStyleImage\", \"list-style-position\" : \"listStylePosition\", \"list-style-type\" : \"listStyleType\", \"margin-bottom\" : \"marginBottom\", \"margin-left\" : \"marginLeft\", \"margin-right\" : \"marginRight\", \"margin-top\" : \"marginTop\", \"max-height\" : \"maxHeight\", \"max-width\" : \"maxWidth\", \"min-height\" : \"minHeight\", \"min-width\" : \"minWidth\", \"overflow-x\" : \"overflowX\", \"overflow-y\" : \"overflowY\", \"padding-bottom\" : \"paddingBottom\", \"padding-left\" : \"paddingLeft\", \"padding-right\" : \"paddingRight\", \"padding-top\" : \"paddingTop\", \"page-break-after\" : \"pageBreakAfter\", \"page-break-before\" : \"pageBreakBefore\", \"table-layout\" : \"tableLayout\", \"text-align\" : \"textAlign\", \"text-decoration\" : \"textDecoration\", \"text-indent\" : \"textIndent\", \"text-overflow\" : \"textOverflow\", \"text-transform\" : \"textTransform\", \"vertical-align\" : \"verticalAlign\", \"white-space\" : \"whiteSpace\", \"word-spacing\" : \"wordSpacing\", \"word-wrap\" : \"wordWrap\", \"z-index\" : \"zIndex\" }, getPropertyNameFor: function(styleName) { return [styleName, this._mapping[styleName]]; }, getPropertiesList: function() { return this._mapping; } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.StylesReplacementRegistry = { registry: [], getImplementationFor: function(name) { if(name) { return this.registry[name]; } return null; }, register: function(name, impl) { this.registry[name] = impl; } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.FontSizeReplacement = {\n\n    SUPPORTED_FONT_SIZES: [\"em\", \"%\", \"pt\", \"px\"],\n\n    getValue: function(val) {\n        if(typeof val != \"string\")\n            return val;\n        if(this.isCalculationRequired(val)) {\n            return Evernote.Utils.getFontSizeInPixels(val) + \"px\";\n        } else {\n            \/\/Do not set browser dependant CSS since it does not supported by Evernote Chromium Viewer.\n            return null;\n        }\n    },\n\n    isCalculationRequired: function(val) {\n        for(var i = 0; i < this.SUPPORTED_FONT_SIZES.length; i++) { if(val.indexOf(this.SUPPORTED_FONT_SIZES[i]) != -1) { return true; } } return false; } }; Evernote.StylesReplacementRegistry.register(\"font-size\", Evernote.FontSizeReplacement); \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ClipperElementsIdentifiers = { _clipperElementsIds : [Constants.CLIP_DIALOG_ID, Constants.OPTIONS_DIALOG_ID, Constants.ATTR_DIALOG_ID, Constants.CLIP_DIALOG_NEW_ID, Constants.POST_CLIP_DIALOG_ID], match: function(node) { if(node &#038;&#038; node.id) { var position = Evernote.ArrayExtension.indexOf(this._clipperElementsIds, node.id); if(position) { return position != -1; } } return false; } }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[\nEvernote.NotebooksLoader = {\n\n    notebooks: [],\n\n    \/\/ TODO: add cache;\n\n    getNotebookByUid: function(uid) {\n        Evernote.ResponseReceiver.subscribe(this);\n        Evernote.Addin.getNotebooks(document);\n        for(var i = 0; i < this.notebooks.length; i++) { if(this.notebooks[i].uid == uid) { return this.notebooks[i]; } } return null; }, onDataReceived: function(response) { if(response.type) { if(response.type == \"notebooks\") { this.notebooks = this.notebooks.concat(response.data); } } } }; Evernote.NotebooksPopupLoader = function( subscriber , doc ) { this.subscriber = subscriber; this.doc = doc; this.cache = []; }; Evernote.NotebooksPopupLoader.prototype.getNotebooksAsync = function( onSuccess ) { var self = this; var countNotebooksResponse = 0; Evernote.Addin.getNotebooksAsync(function(response, args) { if (Evernote.NotebookResponseParser.canParse(response)) { var res = Evernote.NotebookResponseParser.parse(response); countNotebooksResponse++; self.subscriber.updateNotebooks.call(self.subscriber, res.data); if (countNotebooksResponse == 3) { onSuccess(); } } }); }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.Notebook = function(type, name, uid, stack, author, hidden, typeText) { this.type = type; this.name = name; this.uid = uid; this.stack = stack; this.author = author; this.hidden = hidden; this.typeText = typeText; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.Tag = function(name, uid) { this.name = name; this.uid = uid; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.NotebookTypes = { PERSONAL: 1, PERSONAL_TEXT: 'pers', BUSINESS: 2, BUSINESS_TEXT: 'biz', LINKED: 3, LINKED_TEXT: 'linked' }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.ErrorCodes = { AUTHENTICATION_ERROR: \"LoginFailure\", CLIP_ERROR: \"NoteImportFailure\", CONNECTION_FAILED: \"ConnectionAttemptFailed\" }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ Evernote.AuthenticatedException = function(msg){ this.msg = msg; this.code = Evernote.ErrorCodes.AUTHENTICATION_ERROR; }; \/\/ ]]><\/script><script defer=\"defer\" type=\"text\/javascript\" charset=\"ANSI\">\/\/ <![CDATA[ try { Evernote.Addin.init(EvernoteExternal.Addin); Evernote.Addin.resetAuthenticatedState(); Evernote.FS.init(EvernoteExternal.Addin); Evernote.Logger = Evernote.LoggerConfigurator.getLogger(); if(!Evernote.JQuery) Evernote.JQueryLoader.initJQuery(); window.jQueryForClearlyComponent = Evernote.JQuery; initClearly(window); \/\/ todo: create bulletproof function for popup close before context-clipping. if (Evernote.evernotePopup) Evernote.evernotePopup.hide(); if (Evernote.SkitchController) Evernote.SkitchController.clearSkitch(); Evernote.Logger.debug(\"Init EnClipper\"); Evernote.EnClipper.init(); Evernote.Logger.debug(\"EnClipper initialized\"); Evernote.pageInfo = new PageInfo(); if (!Evernote.contentPreviewer) Evernote.contentPreviewer = new ContentPreview(); Evernote.Options.load(); Evernote.evernotePostClipPopup = new Evernote.PostClipPopup( document ); if (EvernoteExternal.Addin.isServerAvailable()) { Evernote.Clipper.clipWithOptions(EvernoteExternal.clipOptions); } } catch(e) { throw e; } \/\/ ]]><\/script><\/p>\n<div id=\"_clearly_component__next_pages_container\"><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/chamberlain-anglo-german-agreement.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-330 alignright\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/chamberlain-anglo-german-agreement.jpg\" alt=\"chamberlain-anglo-german-agreement\" width=\"263\" height=\"192\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/chamberlain-anglo-german-agreement.jpg 263w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/chamberlain-anglo-german-agreement-260x190.jpg 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/chamberlain-anglo-german-agreement-160x117.jpg 160w\" sizes=\"auto, (max-width: 263px) 100vw, 263px\" \/><\/a>V\u0161ichni evrop\u0161t\u00ed dipl<span class=\"hps\">omat\u00e9<\/span> <span class=\"hps\">nar\u00e1z poru\u0161ili<\/span> <span class=\"hps\">smlouvy<\/span> <span class=\"hps\">sv\u00fdch vlastn\u00edch<\/span> <span class=\"hps\">zem\u00ed<\/span> <span class=\"hps\">s N\u011bmeckem<\/span>, <span class=\"hps\">co\u017e m\u011blo\u00a0 sv\u011bd\u010dilo o<\/span> pot\u0159eb\u011b m\u00edrnit <span class=\"hps\">Hitlerovu bezohlednost<\/span>\u00a0<span class=\"hps atn\">(<\/span>nebo si to alespo\u0148 <span class=\"hps\">mysleli<\/span>). <span class=\"hps\">Hitler by<\/span> <span class=\"hps\">se\u00a0<\/span><span class=\"hps\">pozd\u011bji<\/span> <span class=\"hps\">chovat<\/span> <span class=\"hps\">p\u0159esn\u011b<\/span> <span class=\"hps\">stejn\u00fdm zp\u016fsobem<\/span>, <span class=\"hps\">ale je<\/span> <span class=\"hps\">d\u016fle\u017eit\u00e9 si uv\u011bdomit,<\/span> <span class=\"hps\">\u017ee\u00a0<\/span><span class=\"hps\">v \u017e\u00e1dn\u00e9m p\u0159\u00edpad\u011b<\/span> nebyl\u00a0<span class=\"hps\">prvn\u00ed<\/span>. <span class=\"hps\">Tato situace<\/span> <span class=\"hps\">byla je\u0161t\u011b<\/span> <span class=\"hps\">dramati\u010dt\u011bj\u0161\u00ed<\/span>, proto\u017ee <span class=\"hps\">Britov\u00e9 byli<\/span> <span class=\"hps\">p\u0159ipraveni<\/span> <span class=\"hps\">bojovat proti N\u011bmc\u016fm<\/span> <span class=\"hps\">nejen<\/span> <span class=\"hps\">za<\/span> <span class=\"hps\">Pol\u00e1ky<\/span> <span class=\"hps atn\">&#8222;<\/span>&#8211; <span class=\"hps\">Velk\u00e1 Brit\u00e1nie<\/span> <span class=\"hps\">nab\u00eddla stejn\u011b tak i\u00a0zaji\u0161t\u011bn\u00ed\u00a0 Rumunska<\/span><span class=\"hps\">. <\/span>Francouzi se\u00a0 k britsk\u00e9mu prot\u011bj\u0161ku p\u0159ipojili stejn\u00fdmi z\u00e1rukami. T<span class=\"hps\">o<\/span> <span class=\"hps\">znamenalo, \u017ee<\/span> <span class=\"hps\">Brit\u00e1nie<\/span> <span class=\"hps\">a Francie<\/span>\u00a0<span class=\"hps\">ma\u0159\u00ed<\/span> <span class=\"hps\">n\u011bmeckou zahrani\u010dn\u00ed politiku<\/span> <span class=\"hps\">na v\u0161ech front\u00e1ch<\/span>. <span class=\"hps\">Bez<\/span> <span class=\"hps\">povolen\u00ed<\/span> <span class=\"hps\">z Lond\u00fdna<\/span>, a <span class=\"hps\">ani\u017e by riskovali<\/span> <span class=\"hps\">v\u00e1lku<\/span> <span class=\"hps\">s Angli\u00ed<\/span>, byly <span class=\"hps\">n\u011bmeck\u00e9<\/span>\u00a0<span class=\"hps\">ruce sv\u00e1zan\u00e9<\/span>. <span class=\"hps\">Krom\u011b,<\/span> <span class=\"hps\">samoz\u0159ejm\u011b<\/span>,\u00a0<span class=\"hps\">jedin\u00e9ho sm\u011bru<\/span>, ve kter\u00e9m <span class=\"hps\">n\u011bmeck\u00e1<\/span> <span class=\"hps\">arm\u00e1da<\/span> <span class=\"hps\">mohla vyrazit<\/span>, ani\u017e by to<span class=\"hps\"> urazilo<\/span> <span class=\"hps\">p\u00e1ny<\/span> <span class=\"hps\">v Lond\u00fdn\u011b.<\/span><\/div>\n<div>Ale vytrval\u00fd tlak na Hitlera selhal. Ve sv\u00e9m slavn\u00e9m projevu <strong>28. dubna 1939, se F\u00fchrer z\u0159ekl <a href=\"http:\/\/en.wikipedia.org\/wiki\/German%E2%80%93Polish_Non-Aggression_Pact\" target=\"_blank\" rel=\"noopener\">Polsko-n\u011bmeck\u00e9ho paktu o\u00a0ne\u00fato\u010den\u00ed<\/a>, stejn\u011b jako <a href=\"http:\/\/en.wikipedia.org\/wiki\/Anglo-German_Naval_Agreement\" target=\"_blank\" rel=\"noopener\">Anglo-n\u011bmeck\u00e9 n\u00e1mo\u0159n\u00ed dohody<\/a> (18.6.1935\u00a0\u00a0pozn.). Ale neud\u011blal to, proto\u017ee by &#8222;cht\u011bl ovl\u00e1dnout sv\u011bt&#8220;, ale proto, \u017ee Pol\u00e1ci a Britov\u00e9 pr\u00e1v\u011b smlouvy s\u00a0N\u011bmeckem zlomili (i kdy\u017e neofici\u00e1ln\u011b), podpisem dohody s sebou.<\/strong><\/div>\n<div>Sp\u00ed\u0161e ne\u017e se znovu podrobit &#8222;opatrovnictv\u00ed&#8220;\u00a0Brit\u00e1nie, Hitler vydal jeho &#8222;ochr\u00e1nc\u016fm&#8220; v\u00fdzvu. Rozhodl se odstranit Polsko, jako sv\u00e9ho\u00a0nep\u0159edv\u00eddateln\u00e9ho a nep\u0159\u00e1telsk\u00e9ho souseda. Nicm\u00e9n\u011b, Hitler nebyl idiot. Velmi dob\u0159e si pamatoval 1.sv\u011btovou v\u00e1lku, a nikdy by se nerozhodl za\u00fato\u010dit na Polsko a z\u00e1rove\u0148 \u010delit vyhl\u00eddce\u00a0boj\u016f na dvou front\u00e1ch (proti Sov\u011btsk\u00e9mu svazu na stran\u011b jedn\u00e9, a proti Brit\u00e1nii a ve Francii na stran\u011b druh\u00e9). Aby takov\u00fd krok ud\u011blal, musel b\u00fdt p\u0159esv\u011bd\u010den o tom, \u017ee ani\u00a0Lond\u00fdn, ani\u00a0Pa\u0159\u00ed\u017e\u00a0se za\u00a0Pol\u00e1ky nepostav\u00ed. V takov\u00e9m p\u0159\u00edpad\u011b, by Britov\u00e9 a Francouzi\u00a0z\u016fstali na vedlej\u0161\u00ed v\u00e1le\u010dn\u00e9 koleji, a (v souladu se sv\u00fdmi star\u00fdmi pl\u00e1ny)\u00a0vstoupili\u00a0do boje teprve pot\u00e9, co by Rusov\u00e9 a N\u011bmci\u00a0navz\u00e1jem vykrv\u00e1celi.<\/div>\n<div><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-335 alignleft\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw-300x185.jpg\" alt=\"warsaw\" width=\"300\" height=\"185\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw-300x185.jpg 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw-560x345.jpg 560w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw-260x160.jpg 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw-160x99.jpg 160w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/warsaw.jpg 700w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/div>\n<div><\/div>\n<div>Polsko bylo odsouzeno sd\u00edlet osud \u010ceskoslovenska a Rakouska. Pol\u00e1ci m\u011bli b\u00fdt ob\u011btov\u00e1ni na olt\u00e1\u0159 praktick\u00e9 politicky. Lond\u00fdn\u00a0pohnul Var\u0161avu k p\u0159eru\u0161en\u00ed jej\u00edho &#8222;p\u0159\u00e1telstv\u00ed&#8220; s N\u011bmeckem, a pot\u00e9 bylo hlavn\u00edm \u00fakolem, udr\u017eet polsko-n\u011bmeckou krizi v pot\u0159ebn\u00e9m nap\u011bt\u00ed. Velk\u00e1 Brit\u00e1nie sl\u00edbila Polsku\u00a0podporu a pomoc, ale ve skute\u010dnosti\u00a0nehnula ani prstem.Britov\u00e9 se za\u010dali to\u010dit na\u00a0ratifikaci <a href=\"http:\/\/en.wikipedia.org\/wiki\/Anglo-Polish_military_alliance\" target=\"_blank\" rel=\"noopener\">Polsko-britsk\u00e9 smlouvy<\/a>. Ta byla podeps\u00e1na 6. dubna 1939, ale v praxi m\u011bla vstoupit v platnost (tj. b\u00fdt ratifikov\u00e1na) a\u017e\u00a025. srpna.<\/div>\n<div><\/div>\n<div>Lond\u00fdn a Pa\u0159\u00ed\u017e nem\u011bli v\u016fbec z\u00e1jem\u00a0na zni\u010den\u00ed agresivn\u00edho n\u011bmeck\u00e9ho wehrmachtu, ale sp\u00ed\u0161e v zaji\u0161t\u011bn\u00ed jeho halasn\u00e9ho v\u00edt\u011bzstv\u00ed nad arm\u00e1dou jejich spojence, Polska. Polsk\u00e1\u00a0 zdrcuj\u00edc\u00ed por\u00e1\u017eka m\u011bla b\u00fdt rychl\u00e1 a m\u011bla m\u00edt za n\u00e1sledek minim\u00e1ln\u00ed krveprolit\u00ed pro n\u011bmeckou arm\u00e1du. &#8222;Rychl\u00e1&#8220; &#8211; proto\u017ee N\u011bmci nebyli p\u0159ipraveni na dlouhou v\u00e1lku a ani nem\u011bli dostate\u010dn\u00e9 z\u00e1soby zbran\u00ed a &#8222;nekrvav\u00e1&#8220; &#8211; tak, \u017ee Hitler by v z\u00e1sad\u011b mohl p\u0159ej\u00edt p\u0159\u00edmo odtud do SSSR. V p\u0159\u00edpad\u011b, \u017ee by n\u011bmeck\u00e1 arm\u00e1da utrp\u011bla katastrof\u00e1ln\u00ed ztr\u00e1ty v Polsku, nebyla by\u00a0p\u0159ipravena j\u00edt do v\u00e1lky s Ruskem \/ SSSR.<\/div>\n<div><\/div>\n<div><strong>Britsk\u00e1 a francouzsk\u00e1 politika nebyla zam\u011b\u0159ena na vytvo\u0159en\u00ed hnut\u00ed odporu, kter\u00fd by zajistil Hitlerovu rychlou por\u00e1\u017eku, ale byla sp\u00ed\u0161e zam\u00fd\u0161lena na vytvo\u0159en\u00ed nep\u0159\u00edzniv\u00e9ho prost\u0159ed\u00ed pro n\u011bmeck\u00e9 vyhlazen\u00ed Polska.<\/strong><br \/>\nV dal\u0161\u00ed kapitole budeme zkoumat nejzaj\u00edmav\u011bj\u0161\u00edch obdob\u00ed v p\u0159edve\u010der druh\u00e9 sv\u011btov\u00e9 v\u00e1lky &#8211; diplomatickou aktivitu v l\u00e9t\u011b roku 1939, kter\u00e1 vyvrcholila v neslavn\u00fd <a href=\"Britov\u00e9%20a Francouzi politika nebyla zam\u011b\u0159ena na vytvo\u0159en\u00ed hnut\u00ed odporu, kter\u00fd by zajistil Hitler rychlou por\u00e1\u017eku, ale byl sp\u00ed\u0161e zam\u00fd\u0161lel vytvo\u0159it nejp\u0159\u00edzniv\u011bj\u0161\u00ed prost\u0159ed\u00ed pro n\u011bmeck\u00e9 vyhlazen\u00ed Polska.\" target=\"_blank\" rel=\"noopener\">Molotov-Ribbentrop\u016fv pakt.<\/a><\/div>\n<div><\/div>\n<div><em>Pozn\u00e1mka<\/em><\/div>\n<div><em>Den pot\u00e9, kdy byla podeps\u00e1na Mnichovsk\u00e1 dohoda, britsk\u00fd premi\u00e9r Neville Chamberlain, pozval Hitlera k soukrom\u00e9mu rozhovoru. Najednou vyt\u00e1hl z kapsy list pap\u00edru: &#8222;My, n\u011bmeck\u00fd V\u016fdce a kancl\u00e9\u0159 a britsk\u00fd premi\u00e9r, jsme dnes m\u011bli dal\u0161\u00ed sch\u016fzku a uzn\u00e1v\u00e1me dohodu, \u017ee ot\u00e1zka Anglo-n\u011bmeck\u00fdch vztah\u016f je nejd\u016fle\u017eit\u011bj\u0161\u00ed pro ob\u011b zem\u011b, a stejn\u011b tak pro Evropu, &#8222;p\u00ed\u0161e se v dokumentu. A &#8222;dohoda podepsan\u00e1 v\u010dera v noci a Anglo-n\u011bmeck\u00e1 n\u00e1mo\u0159n\u00ed dohoda&#8220; byly pova\u017eov\u00e1ny v\u016fdci obou zem\u00ed, za &#8222;Symbol touhy&#8220; obou n\u00e1rod\u016f &#8222;nikdy mezi sebou nev\u00e9st v\u00e1lku.&#8220; Historici obvykle &#8222;zapom\u00ednaj\u00ed&#8220; na tento dokument. Nicm\u00e9n\u011b, tato nevnucen\u00e1 dohoda zaji\u0161\u0165ovala Hitlerovu agresi sm\u011brem na v\u00fdchod. Chamberlain\u016fv n\u00e1vrat do Lond\u00fdna je \u010dasto l\u00ed\u010den v historick\u00fdch dokument\u00e1rn\u00edch filmech. Stoj\u00ed u sv\u00e9ho letounu, t\u0159ese kusem pap\u00edru ve vzduchu, a hlasit\u011b prohla\u0161uje: <strong>&#8222;M\u00edr pro na\u0161i dobu!&#8220;<\/strong> A div\u00e1ci si mysl\u00ed, \u017ee britsk\u00fd premi\u00e9r dr\u017e\u00ed kopii Mnichovsk\u00e9 dohody. Ve skute\u010dnosti ale <strong>Neville Chamberlain sv\u00edr\u00e1 tento dopln\u011bk Britsko-n\u011bmeck\u00e9 deklarace.<\/strong><\/em><\/div>\n<div><\/div>\n<div><a href=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/MunichAgreement.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-352 aligncenter\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/MunichAgreement-300x228.jpg\" alt=\"MunichAgreement\" width=\"587\" height=\"451\" \/><\/a><\/div>\n<div>\n<hr \/>\n<p align=\"LEFT\">Oklaman\u00e9 Polsko (V)<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/orientalreview.org\/2015\/04\/18\/episode-15-poland-betrayed-v\/\" target=\"_blank\" rel=\"noopener\">origin\u00e1l<\/a><\/p>\n<p align=\"LEFT\">zdroj &#8211; vlastn\u00ed p\u0159eklad 30.4.2015<\/p>\n<p align=\"LEFT\">Nikolaj Starikov (Rusko) <a href=\"http:\/\/sk.wikipedia.org\/wiki\/Nikolaj_Viktorovi%C4%8D_Starikov\" target=\"_blank\" rel=\"noopener\">SK<\/a> RU<\/p>\n<p>Jak\u00e9 probl\u00e9my zaneprazd\u0148ovaly l\u00eddry sv\u011btov\u00fdch mocnost\u00ed v pr\u016fb\u011bhu jara\u00a01939?<\/p>\n<\/div>\n<div>\u00a0Hitlerov\u00fdm prim\u00e1rn\u00edm \u00fakolem bylo, neutralizovat hrozbu vstupu Sov\u011btsk\u00e9ho svazu do v\u00e1lky. Doufat, \u017ee Anglie a Francie by op\u011bt zradila sv\u00e9 spojence &#8211; Polsko, V\u016fdce se\u00a0zam\u011b\u0159il na\u00a0eliminaci polsk\u00e9 hrozby bez rizika st\u0159etu s Rusy. Potom by bylo mo\u017en\u00e9 op\u011bt usednout k jednac\u00edmu stolu s Brity, ale v t\u00e9to chv\u00edli vy\u017eadoval a trval na jedn\u00e1n\u00ed jako\u00a0jako rovn\u00fd s rovn\u00fdm.<\/div>\n<div>\u00a0Stalin\u016fv prim\u00e1rn\u00ed \u00fakolem byl p\u0159esn\u011b stejn\u00fd &#8211; neutralizovat nebezpe\u010d\u00ed n\u011bmeck\u00e9ho \u00fatoku na Sov\u011btsk\u00fd svaz. Stalin by samoz\u0159ejm\u011b vstoupit do smlouvy o spojenectv\u00ed s Franci\u00ed, Polskem a Angli\u00ed. Ale my v\u00edme, \u017ee vedouc\u00ed p\u0159edstavitel\u00e9 z\u00e1padn\u00edch demokraci\u00edch by nikdy tuto smlouvu nepodepsali. A to je p\u0159esn\u011b tak, jak se to odehr\u00e1valo. I kdy\u017e nevyhnutelnost n\u011bmeck\u00e9ho \u00fatoku ji\u017e nebylo mo\u017en\u00e9 ignorovat, Polsko poslu\u0161n\u011b n\u00e1sledovalo lond\u00fdnskou radu a odm\u00edtlo podepsat spojeneckou smlouvu se Sov\u011btsk\u00fdm svazem.\u00a0 V\u00fdsledkem bylo, \u017ee Stalin nem\u011bl \u017e\u00e1dnou jinou mo\u017enost ne\u017e dohodu s Hitlerem.<\/div>\n<div>\u00a0Brit\u0161t\u00ed a francouz\u0161t\u00ed diplomat\u00e9 pokra\u010dovali\u00a0v jejich prvo\u0159ad\u00e9m \u00fakolu, kter\u00fdm bylo, postavit N\u011bmecko proti Rusku. T\u00edmto pl\u00e1nem byla provedena m\u00edrn\u00e1 \u00fapravaM\u00edrn\u00e1 \u00faprava byla provedena s t\u00edmto pl\u00e1nem, dan\u00e1 V\u016fdcov\u00fdm\u00a0ned\u00e1vn\u00fdm chov\u00e1n\u00edm, ale jeho podstata z\u016fstala zcela nezm\u011bn\u011bna. Bylo rozhodnuto vyprovokovat Hitlera k \u00fatoku na Polsko, po kter\u00e9m by automaticky n\u00e1sledoval\u00a0sov\u011btsko-n\u011bmeck\u00fd konflikt. Nicm\u00e9n\u011b, Hitler nebyl idiot. Pamatoval si velmi dob\u0159e\u00a01. sv\u011btovou v\u00e1lku a nikdy by se nerozhodl za\u00fato\u010dit na Polsko a \u010delit vyhl\u00eddce boje na dvou front\u00e1ch (proti Sov\u011btsk\u00e9mu svazu na jedn\u00e9 stran\u011b a proti Brit\u00e1nii\u00a0s Franci\u00ed na stran\u011b druh\u00e9).\u00a0Aby takov\u00fd krok u\u010dinil, musel b\u00fdt p\u0159esv\u011bd\u010den o tom, \u017ee ani v Lond\u00fdn\u011b ani v Pa\u0159\u00ed\u017ei by se za Pol\u00e1ky nep\u0159imlouvali. V takov\u00e9m p\u0159\u00edpad\u011b by\u00a0Britov\u00e9 a Francouzi\u00a0z\u016fstali stranou v\u00e1le\u010dn\u00fdch operac\u00ed a (v souladu se sv\u00fdmi star\u00fdmi pl\u00e1ny) by vstoupili do boje a\u017e pot\u00e9, co by Rusov\u00e9 a N\u011bmci navz\u00e1jem vykrv\u00e1cela.<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_896\" style=\"width: 203px\" class=\"wp-caption alignright\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=896\" rel=\"attachment wp-att-896\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-896\" class=\"wp-image-896 size-full\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/RIAN_archive_409024_Soviet_diplomat_Maxim_Litvinov-193x300.jpg\" alt=\"\" width=\"193\" height=\"300\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/RIAN_archive_409024_Soviet_diplomat_Maxim_Litvinov-193x300.jpg 193w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/RIAN_archive_409024_Soviet_diplomat_Maxim_Litvinov-193x300-160x249.jpg 160w\" sizes=\"auto, (max-width: 193px) 100vw, 193px\" \/><\/a><p id=\"caption-attachment-896\" class=\"wp-caption-text\">Sov\u011btsk\u00fd lidov\u00fd komisa\u0159 zahrani\u010d\u00ed Maxim Litvinov (foto po\u0159\u00edzeno 1937)<\/p><\/div>\n<\/div>\n<div>\u00a0Od t\u00e9 doby, kdy jsme pochopili c\u00edle ka\u017ed\u00e9ho hr\u00e1\u010de v t\u00e9to politick\u00e9 h\u0159e, m\u016f\u017eeme \u0159\u00e1dn\u011b vyhodnotit I jejich \u010diny. Dne <strong>16.dubna 1939<\/strong> se Stalin sna\u017eil Evropan\u016fm navrhnout, aby v\u0161ichni podnikli kolektivn\u00ed kroky k zastaven\u00ed Hitlera.\u00a0Lidov\u00fd komisa\u0159 sov\u011btsk\u00e9ho ministerstva zahrani\u010d\u00ed Maxim Litvinov \u0159ekl britsk\u00e9mu velvyslanci, \u017ee je p\u0159ipraven p\u0159ijmout t\u0159\u00edstrann\u00fd pakt vz\u00e1jemn\u00e9 pomoci mezi Velkou Brit\u00e1ni\u00ed, Franci\u00ed a Sov\u011btsk\u00fdm svazem. Jednalo se o velmi specifick\u00e9 n\u00e1vrhy, co\u017e bylo pr\u00e1v\u011b d\u016fvodem, pro\u010d byly t\u00e9m\u011b\u0159 zcela nezodpov\u011bzeny.<\/div>\n<div>\u00a0<strong>30.dubna 1939<\/strong> se Hitler pokusil neofici\u00e1ln\u00edmi kan\u00e1ly naj\u00edt spole\u010dnou\u00a0\u0159e\u010d se sv\u00fdmi b\u00fdval\u00fdmi britsk\u00fdmi &#8222;p\u0159\u00e1teli&#8220; a varoval je, \u017ee bude jinak nucen jednat s Kremlem. Brity v\u0161ak\u00a0samotn\u00e1 my\u0161lenka smlouvy mezi nacisty a bol\u0161eviky velmi pobavila. M\u011bli dobr\u00fd d\u016fvod, pro\u010d se sna\u017eili postavit nejsiln\u011bj\u0161\u00edho oponenta komunismu do \u010dela\u00a0N\u011bmecka.<\/div>\n<div><\/div>\n<div>\u00a0<em>B\u011bhem 75 dn\u016f, kdy\u00a0doch\u00e1zelo k &#8222;v\u00fdm\u011bn\u011b n\u00e1zor\u016f&#8220; mezi sov\u011btsk\u00fdmi a z\u00e1padn\u00edmi diplomaty, Sov\u011btsk\u00fd svaz vyu\u017eil 16 dn\u00ed\u00a0k vypracov\u00e1n\u00ed sv\u00fdch odpov\u011bd\u00ed, zat\u00edmco z\u00e1padn\u00ed mocnosti\u00a0zb\u00fdvaj\u00edc\u00edch 59 dn\u016f s prodlevami a p\u0159etahov\u00e1n\u00edm. Britov\u00e9 a Francouzi p\u0159ich\u00e1zeli s um\u011bl\u00fdmi obt\u00ed\u017eemi, kter\u00e9 br\u00e1nily \u0159e\u0161en\u00ed z\u00e1kladn\u00edch probl\u00e9m\u016f, p\u0159esto\u017ee tyto p\u0159ek\u00e1\u017eky mohly b\u00fdt snadno p\u0159ekon\u00e1ny dobrou v\u016fl\u00ed a up\u0159\u00edmn\u00fdmi \u00famysly ze strany Anglie a Francie. A tak ot\u00e1leli a hr\u00e1li\u00a0o \u010das.<\/em><\/div>\n<div><\/div>\n<div>\u00a0Stalin\u00a0m\u011bl naprostou pravdu, kdy\u017e se domn\u00edval, \u017ee neexistuje \u017e\u00e1dn\u00e1 \u0161ance, \u017ee by brit\u0161t\u00ed a francouz\u0161t\u00ed hr\u00e1li f\u00e9rov\u00fdm zp\u016fsobem. Tak dos\u00e1hl kritick\u00e9ho z\u00e1v\u011bru, \u017ee nem\u011bl jinou mo\u017enost ne\u017e pokusit se vyjedn\u00e1vat s Hitlerem. Stalin dal <strong>3.kv\u011btna 1939<\/strong> Hitlerovi sv\u016fj prvn\u00ed sign\u00e1l &#8211; nahradil sou\u010dasn\u00e9ho lidov\u00e9ho komisa\u0159e pro zahrani\u010d\u00ed anglofila Maxima Litvinova,\u00a0Vyacheslavem Molotovem.<\/div>\n<div><\/div>\n<div>\u00a0Hitler ocenil tuto &#8222;substituci&#8220;. Po\u017eadavky N\u011bmecka byly jasn\u00e9 a jeho \u010diny prok\u00e1zaly hlubokou touhu, odstranit jakoukoli hrozbu z V\u00fdchodu. A Hitler m\u011bl d\u016fvod ke sp\u011bchu:\u00a0<strong>26.srpen 1939<\/strong> byl ji\u017e nastaven\u00a0datem invaze do Polska. N\u011bmci pot\u0159ebovali, aby p\u0159ed t\u00edmto datem byla podeps\u00e1na smlouva mezi N\u011bmeckem a Sov\u011btsk\u00fdm svazem. A \u010d\u00edm d\u0159\u00edve, t\u00edm l\u00e9pe. Proto byla politika N\u011bmecka velmi p\u0159esn\u00e1 a specifick\u00e1 ve sv\u00fdch c\u00edlech. Podstatu n\u011bmeck\u00fdch n\u00e1vrh\u016f a p\u0159\u00edstup k t\u00e9to situaci\u00a0nejl\u00e9pe ilustroje text telegramu, kter\u00fd n\u011bmeck\u00fd ministr zahrani\u010d\u00ed Joachim von Ribbentrop zaslal n\u011bmeck\u00e9mu velvyslanci v Moskv\u011b Friedrichu-Werneru Grafovi von der Schulenburg dne <strong>14.srpna 1939<\/strong>.<\/div>\n<div><\/div>\n<div>\u00a0<em>&#8222;Po\u017eaduji, abyste osobn\u011b zavolal\u00a0panu Molotovovi a sd\u011blil mu n\u00e1sleduj\u00edc\u00ed: Ideologick\u00e9 rozpory mezi N\u00e1rodn\u00edm socialistick\u00fdm N\u011bmeckem a Sov\u011btsk\u00fdm svazem byly v minul\u00fdch letech jedin\u00fdm d\u016fvodem, pro\u010d\u00a0N\u011bmecko a SSSR st\u00e1li proti sob\u011b\u00a0ve dvou odd\u011blen\u00fdch a nep\u0159\u00e1telsk\u00fdch t\u00e1borech &#8230; Obdob\u00ed rozpor\u016f v oblasti zahrani\u010dn\u00ed politiky m\u016f\u017ee b\u00fdt ukon\u010deno jednou prov\u017edy a cesta je otev\u0159en\u00e1 nov\u00e9mu druhu budoucnosti pro ob\u011b zem\u011b &#8230; \u017divotn\u00ed prostory N\u011bmecka a SSSR se navz\u00e1jem dot\u00fdkaj\u00ed, ale\u00a0jejich p\u0159irozen\u00e9 po\u017eadavky nejsou v rozporu &#8230; N\u011bmecko nem\u00e1 v\u016f\u010di Sov\u011btsk\u00e9mu Svazu \u017e\u00e1dn\u00e9 agresivn\u00ed z\u00e1m\u011bry. \u0158\u00ed\u0161sk\u00e1 vl\u00e1da je toho n\u00e1zoru, \u017ee mezi Baltsk\u00fdm a \u010cern\u00fdm mo\u0159em nen\u00ed ot\u00e1zka, kter\u00e1 nem\u016f\u017ee b\u00fdt vy\u0159e\u0161ena k \u00fapln\u00e9 spokojenosti obou zem\u00ed &#8230;\u00a0Z\u00e1va\u017en\u00fdm z\u00e1jmem\u00a0obou zem\u00ed je, aby se v budoucnu vyh\u00fdbaly ni\u010den\u00ed N\u011bmecka a Sov\u011btsk\u00e9ho svazu, co\u017e by\u00a0bylo vyu\u017eito pouze z\u00e1padn\u00edmi demokraciemi. Krize, kter\u00e1 byla v n\u011bmecko-polsk\u00fdch vztaz\u00edch vytvo\u0159ena anglickou politikou, stejn\u011b tak jako anglick\u00e1 agitace pro v\u00e1lku a pokusy o spojenectv\u00ed, kter\u00e9 jsou s touto politikou spojeny, vy\u017eaduj\u00ed rychl\u00e9 objasn\u011bn\u00ed n\u011bmecko-rusk\u00fdch vztah\u016f &#8230; .&#8220;<\/em><\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_897\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=897\" rel=\"attachment wp-att-897\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-897\" class=\"wp-image-897 size-full\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/57-300x226.jpg\" alt=\"\" width=\"300\" height=\"226\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/57-300x226.jpg 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/57-300x226-260x196.jpg 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/57-300x226-160x121.jpg 160w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-897\" class=\"wp-caption-text\">amb. Geo Bonnet (Francie), amb. Ivan Majsky (SSSR), Brit Lord Halifax.<\/p><\/div>\n<\/div>\n<div><\/div>\n<div>Co se d\u011blo v Lond\u00fdn\u011b a Pa\u0159\u00ed\u017ei b\u011bhem n\u011bmeck\u00e9 diplomatick\u00e9 \u010dinnosti? Tam se tak\u00e9 rozhodli uzav\u0159\u00edt dohodu se Sov\u011btsk\u00fdm svazem nebo konkr\u00e9tn\u011bji &#8211; znovu podstoupit podvodn\u00fd pokus o tuto &#8211; op\u011bt se hr\u00e1lo\u00a0o \u010das s jedin\u00fdm c\u00edlem: zabr\u00e1nit Sov\u011btsk\u00e9mu svazu a N\u011bmecku, aby podepsali smlouvu o ne\u00fato\u010den\u00ed. Koneckonc\u016f britsk\u00e9 zpravodajstv\u00ed dob\u0159e v\u011bd\u011blo, \u017ee <strong>26.srpen<\/strong> je datem n\u011bmeck\u00e9ho \u00fatoku na Polsko. Pokud se Hitler a Stalin dosud nedohodou, bylo velice pravd\u011bpodobn\u00e9, \u017ee mezi nimi\u00a0m\u016f\u017ee prob\u011bhnout v\u00e1lka. Tak\u017ee z\u00e1padn\u00ed diplomat\u00e9 se soust\u0159edili na &#8222;hru\u00a0o \u010das&#8220;.<\/div>\n<div><strong>23.\u010dervence 1939<\/strong> lord Halifax informoval sov\u011btsk\u00e9ho velvyslance ve Velk\u00e9 Brit\u00e1nii Ivana Majsk\u00e9ho, \u017ee vl\u00e1da Jeho Veli\u010denstva souhlasila se zah\u00e1jen\u00edm jedn\u00e1n\u00ed. Vyu\u017eili v\u0161echny prost\u0159edky, kter\u00e9 m\u011bli k dispozici, aby v\u011bci protahovali. Nap\u0159\u00edklad jejich delegace nelet\u011bla do Moskvy, ale cestovala\u00a0pomal\u00fdm osobn\u00edm n\u00e1kladn\u00edm \u010dlunem, lod\u00ed zvanou M\u011bsto Exeter. To se m\u016f\u017ee zd\u00e1t drobn\u00fdm probl\u00e9mem, ale jej\u00ed plavba trvala p\u011bt nebo \u0161est dn\u00ed &#8230;<\/div>\n<div>\u00a0V d\u016fsledku toho samotn\u00e1 jedn\u00e1n\u00ed neza\u010dala a\u017e do <strong>11.srpna<\/strong>. Tak\u00e9 v\u00fdb\u011br \u010dlen\u016f z\u00e1padn\u00ed delegace hovo\u0159\u00ed s\u00e1m za sebe. Sov\u011btsk\u00fd svaz poslal \u00fa\u0159edn\u00edky z nejvy\u0161\u0161\u00edch vojensk\u00fdch kruh\u016f: komisa\u0159e pro obranu Klimenta Voro\u0161ilova; n\u00e1\u010deln\u00edka \u0161t\u00e1bu Borise \u0160apo\u0161nikova; velitele n\u00e1mo\u0159nictva Nikolaje Kuzn\u011bcova a velitele letectva Aleksandra Loktionova. Britov\u00e9 a Francouzi v\u0161ak vyslali sv\u00e9 gener\u00e1ly &#8222;druh\u00e9ho sledu&#8220;. Ani to nebyla n\u00e1hoda a vzhledem k tomu, \u017ee vedouc\u00ed delegac\u00ed nedostali pravomoc podepsat dokumenty, bylo to je\u0161t\u011b &#8222;\u00fa\u010dinn\u011bj\u0161\u00ed.&#8220; Francouzsk\u00fd gener\u00e1l Aim\u00e9 Doumenc dostal pr\u00e1vo &#8222;vyjedn\u00e1vat &#8230; o v\u0161ech ot\u00e1zk\u00e1ch t\u00fdkaj\u00edc\u00edch se spolupr\u00e1ce mezi ozbrojen\u00fdmi silami dvou zem\u00ed &#8222;, ale britsk\u00fd admir\u00e1l Reginald Drax nem\u011bl v\u016fbec \u017e\u00e1dnou p\u00edsemnou pravomoc!<\/div>\n<div>\u00a0Tak pro\u010d p\u0159i\u0161el? To bylo zm\u00edn\u011bno v odstavci \u010d. 8 jeho pokyn\u016f: &#8222;Vyjedn\u00e1vejte co nejd\u00e9le to bude mo\u017en\u00e9.&#8220; Dal\u0161\u00ed odstavce jsou tak\u00e9 pom\u011brn\u011b zvl\u00e1\u0161tn\u00ed, &#8222;podporujte jedn\u00e1n\u00ed s nad\u011bj\u00ed, \u017ee sama budou dostate\u010dn\u011b odstra\u0161uj\u00edc\u00edmi&#8220; a &#8222;usilujte o maxim\u00e1ln\u00ed omezen\u00ed celkov\u00e9ho vyzn\u011bn\u00ed jak jen to bude mo\u017en\u00e9.&#8220;<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_898\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=898\" rel=\"attachment wp-att-898\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-898\" class=\"size-full wp-image-898\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/reginalddrax2-300x183.jpg\" alt=\"\" width=\"300\" height=\"183\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/reginalddrax2-300x183.jpg 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/reginalddrax2-300x183-260x159.jpg 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/reginalddrax2-300x183-160x98.jpg 160w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-898\" class=\"wp-caption-text\">P\u0159\u00edjezd britsko-francouzsk\u00e9 delegace do Moskvy, Srpen 1939<\/p><\/div>\n<\/div>\n<div>\u00a0Kdy\u017e z\u00e1padn\u00ed historici a politologov\u00e9 za\u010dali dlouze diskutovat o odpov\u011bdnosti Stalina a Sov\u011btsk\u00e9ho svazu za vypuknut\u00ed 2. sv\u011btov\u00e9 v\u00e1lky, obvykle se jim to nel\u00edb\u00ed. Hraj\u00ed na emoce sv\u00fdch \u010dten\u00e1\u0159\u016f a poslucha\u010d\u016f. Koneckonc\u016f ka\u017ed\u00fd si dnes dob\u0159e uv\u011bdomuje zv\u011brstva nacist\u016f a jejich zlo\u010diny. Tak\u017ee je Sov\u011btsk\u00fd svaz obvi\u0148ov\u00e1n z toho, \u017ee uzav\u0159el smlouvu o ne\u00fato\u010den\u00ed s takov\u00fdmi zloduchy. A proto\u017ee Hitler napadl Polsko t\u00fdden pot\u00e9, co podepsal tento dokument, nen\u00ed N\u011bmecko\u00a0jedinou zem\u00ed, kter\u00e1 m\u016f\u017ee b\u00fdt obvin\u011bna z agrese. Je to docela logick\u00e9. Pokud n\u011bkdo pomine n\u011bkolik &#8222;nev\u00fdznamn\u00fdch&#8220; bod\u016f.<\/div>\n<div><\/div>\n<div>\u00a01.Sov\u011btsk\u00fd svaz, ale i Anglie, Francie a dokonce i samotn\u00e9 Polsko m\u011blo s nacistick\u00fdm N\u011bmeckem sv\u00e9 vlastn\u00ed &#8222;pakty o\u00a0ne\u00fato\u010den\u00ed&#8220;. To je b\u011b\u017en\u00e1 praxe v mezin\u00e1rodn\u00edch vztaz\u00edch.<br \/>\n2. N\u011bmecko-polsk\u00e1 v\u00e1lka by jist\u011b za\u010dala, i kdyby Sov\u011btsk\u00fd svaz nepodepsal smlouvu s N\u011bmeckem.\u00a0Jen n\u011bkolik t\u00fddn\u016f pozd\u011bji, na podzim roku 1939, by SSSR byl nevyhnuteln\u011b k tomuto dohn\u00e1n &#8211; boj s Japonskem za\u010dal na ja\u0159e toho roku pot\u00e9, co Japonci za\u00fato\u010dili na Mongolsko.<\/div>\n<div><\/div>\n<div>\u00a0Pokud odm\u00edtneme pr\u00e1zdn\u00e1 slova moraliz\u00e1tor\u016f pro masy, kte\u0159\u00ed hraj\u00ed s fakty rychle a velmi voln\u011b, skon\u010d\u00edme u u hol\u00e9 pravdy. <strong>Stalin nem\u011bl jinou mo\u017enost ne\u017e podepsat dohodu s Hitlerem, aby odvr\u00e1til agresi od sv\u00e9 vlastn\u00ed zem\u011b.<\/strong><\/div>\n<div>\u00a0Koneckonc\u016f, Hitler nevedl v\u00e1lku kv\u016fli n\u011bjak\u00e9mu dokumentu, ke kter\u00e9mu byl naprosto lhostejn\u00fd, ale kv\u016fli desetilet\u00edm pe\u010dliv\u011b \u0159\u00edzen\u00e9 finan\u010dn\u00ed, politick\u00e9 a diplomatick\u00e9 pomoci, kter\u00e1 vy\u00fastila nejen v o\u017eiven\u00ed oslaben\u00e9ho N\u011bmecka, ale tak\u00e9 v bezprecedentn\u00ed n\u00e1r\u016fst jeho moci. A samoz\u0159ejm\u011b to nebyl SSSR ani Stalin, kter\u00fd poskytoval tuto pomoc, ale z\u00e1padn\u00ed mocnosti a bankovn\u00ed elita.<\/div>\n<div>\u00a0Stalin jednodu\u0161e nem\u011bl na v\u00fdb\u011br. Ale to nebyla pro Brity a Francouze pravda, jejich\u017e delegace p\u0159ijela do Moskvy k rozhovor\u016fm dlouho p\u0159ed Joachimem von Ribbentropem. Kdyby opravdu cht\u011bli uzav\u0159\u00edt smlouvu se Sov\u011btsk\u00fdm svazem, mohli tak u\u010dinit.<\/div>\n<div>\u00a0Stalin p\u0159ijal berl\u00ednskou nab\u00eddku, kdy\u017e si uv\u011bdomil, \u017ee s Brit\u00e1ni\u00ed a Franci\u00ed\u00a0smlouva nebude. N\u011bmeck\u00fd velvyslanec von der Schulenburg navrhl Molotovovi budouc\u00ed smlouvu <strong>19.srpna 1939 v 17:00 hod<\/strong>. Komisa\u0159 Molotov p\u0159edal dopis\u00a0od Stalina von Schulenburgovi. Do\u0161el k z\u00e1v\u011bru, \u017ee v posledn\u00edch n\u011bkolika letech p\u0159evzal celou angloamerickou politiku v\u016f\u010di Hitlerovi a hodil ji p\u0159es palubu: &#8222;Sov\u011btsk\u00e1 vl\u00e1da mi dovolila, abych v\u00e1s informoval, \u017ee souhlas\u00ed s t\u00edm, \u017ee pan von Ribbentrop p\u0159ijede do Moskvy\u00a0<strong>23.srpna<\/strong> leto\u0161n\u00edho roku. &#8222;<\/div>\n<div><\/div>\n<div>\u00a0Polsko bylo odsouzeno k z\u00e1niku. Brit\u00e1nie a Francie jej odsoudila k smrti, tak\u017ee jakmile by donutili Hitlera\u00a0v\u00e1lku zah\u00e1jit, byl by nasm\u011brov\u00e1n pot\u0159ebn\u00fdm sm\u011brem na v\u00fdchod. O n\u011bco v\u00edc ne\u017e\u00a0rok by trvalo, ne\u017e by i sama Francie za\u010dala trp\u011bt tak\u00e9 p\u016fvabem britsk\u00e9 politiky,\u00a0jej\u00edm podvodem a zradou.<\/div>\n<div><\/div>\n<div>\u00a0Ale ne\u017e Hitler vstoupil do Pa\u0159\u00ed\u017ee, byla na \u0159ad\u011b Var\u0161ava &#8230;<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_899\" style=\"width: 616px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=899\" rel=\"attachment wp-att-899\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-899\" class=\"wp-image-899\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/475025923263-n37262_jpg_690x518_q100.jpg\" alt=\"\" width=\"606\" height=\"465\" \/><\/a><p id=\"caption-attachment-899\" class=\"wp-caption-text\">Sov\u011btsk\u00fd lidov\u00fd komisa\u0159 pro zahrani\u010d\u00ed Vja\u010deslav Molotov podepisuje Sov\u011btsko-N\u011bmeck\u00fd pakt o ne\u00fato\u010den\u00ed 23.srpna 1939. Tento dokument s kone\u010dnou platnost\u00ed poh\u0159bil britisk\u00e9 ambice, postavit nacismus proti SSSR a znamenal v\u00fdznamnou por\u00e1\u017eku british diplomacie ve 20. stolet\u00ed\u2026<\/p><\/div>\n<\/div>\n<div>\n<hr \/>\n<p align=\"LEFT\">Oklaman\u00e9 Polsko (VI)<\/p>\n<p align=\"LEFT\"><a href=\"http:\/\/orientalreview.org\/2015\/04\/25\/episode-15-poland-betrayed-vi\/\" target=\"_blank\" rel=\"noopener\">origin\u00e1l<\/a><\/p>\n<p align=\"LEFT\">zdroj &#8211; vlastn\u00ed p\u0159eklad 03.09.2017<\/p>\n<p align=\"LEFT\">Nikolaj Starikov (Rusko) <a href=\"http:\/\/sk.wikipedia.org\/wiki\/Nikolaj_Viktorovi%C4%8D_Starikov\" target=\"_blank\" rel=\"noopener\">SK<\/a> RU<\/p>\n<\/div>\n<div><\/div>\n<div>\u00a0&#8230; Polsko utrp\u011blo drtivou por\u00e1\u017eku rychlost\u00ed sv\u011btla.\u00a0Kolony n\u011bmeck\u00fdch tank\u016f snadno prolomily obranu polsk\u00fdch diviz\u00ed a\u00a0za\u00fato\u010dily na pr\u016flom. Do <strong>8.z\u00e1\u0159\u00ed 1939<\/strong>, osm\u00e9ho dne v\u00e1lky, se\u00a0 obrn\u011bn\u00e9 jednotky G\u00f3t\u016f p\u0159ibl\u00ed\u017eily polsk\u00e9mu hlavn\u00edmu m\u011bstu. Var\u0161ava hrdinn\u011b odol\u00e1vala a\u017e do <strong>27.z\u00e1\u0159\u00ed<\/strong>, ale pot\u00e9 se vzdala. Vl\u00e1dn\u00ed elita, kter\u00e1 st\u00e1hla svou zemi do tohoto krveprolit\u00ed, nem\u011bla \u017e\u00e1dnou touhu projevit hrdinstv\u00ed. Ji\u017e <strong>5.z\u00e1\u0159\u00ed<\/strong> po obdr\u017een\u00ed prvn\u00edch zpr\u00e1v o tom, \u017ee do hlavn\u00edho m\u011bsta vj\u00ed\u017ed\u011bj\u00ed kolony tank\u016f, pol\u0161t\u00ed v\u016fdci uprchli do Lublinu a <strong>17.z\u00e1\u0159\u00ed<\/strong> unikli p\u0159es rumunskou hranici. V n\u00e1vaznosti na \u00fat\u011bk vl\u00e1dy\u00a0vy\u0161\u0161\u00ed velitel\u00e9 a gener\u00e1ln\u00ed \u0161t\u00e1b zb\u011bhli tak\u00e9. Nam\u00edsto sest\u0159elov\u00e1n\u00ed a ni\u010den\u00ed\u00a0n\u011bmeck\u00fdch letadel a um\u00edr\u00e1n\u00ed v bitv\u011b se ct\u00ed, bylo p\u0159ibli\u017en\u011b 500 polsk\u00fdch letadel zni\u010deno pro Rumunsko, Loty\u0161sko a Litvu.<\/div>\n<div>\u00a0V Polsku nebyla ozn\u00e1mena \u017e\u00e1dn\u00e1 mobilizace. Nebo p\u0159esn\u011bji, dva dny p\u0159ed v\u00e1lkou\u00a0<strong>29.srpna 1939<\/strong> se Polsko rozhodlo, \u017ee to ud\u011bl\u00e1.\u00a0Pak se ale znovu zamysleli. Plak\u00e1ty, kter\u00e9 u\u017e\u00a0visely ze zd\u00ed budov v polsk\u00fdch m\u011bstech a vesnic\u00edch, oznamuj\u00edc\u00ed po\u010d\u00e1tek mobilizace arm\u00e1dy, byly zni\u010deny. Pro\u010d pol\u0161t\u00ed v\u016fdci ud\u011blali n\u011bco tak zvl\u00e1\u0161tn\u00edho? Vzhledem k tomu, \u017ee brit\u0161t\u00ed a francouz\u0161t\u00ed velvyslanci ofici\u00e1ln\u011b po\u017e\u00e1dali Pol\u00e1ky, aby odlo\u017eili jak\u00e9koli ozn\u00e1men\u00ed o mobilizaci do <strong>31.srpna<\/strong>. Mezit\u00edm vedouc\u00ed p\u0159edstavitel\u00e9 z\u00e1padn\u00edch demokraci\u00ed dob\u0159e v\u011bd\u011bli, \u017ee n\u011bmeck\u00e1 invaze nastane brzy r\u00e1no <strong>1.z\u00e1\u0159\u00ed<\/strong>. Po\u017eadavek britsk\u00fdch a francouzsk\u00fdch diplomat\u016f m\u011bl pouze jedin\u00fd c\u00edl: usnadnit n\u011bmeck\u00e9 arm\u00e1d\u011b, aby vypo\u0159\u00e1dala s POlskem prvn\u00ed ranou.<\/div>\n<div>\n<div id=\"attachment_903\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=903\" rel=\"attachment wp-att-903\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-903\" class=\"size-full wp-image-903\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Wehrmacht-Poland-300x209.jpg\" alt=\"\" width=\"300\" height=\"209\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Wehrmacht-Poland-300x209.jpg 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Wehrmacht-Poland-300x209-260x181.jpg 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Wehrmacht-Poland-300x209-160x111.jpg 160w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-903\" class=\"wp-caption-text\">Voj\u00e1ci Wehrmachtu ni\u010d\u00ed polskou hrani\u010dn\u00ed z\u00e1voru 1.z\u00e1\u0159\u00ed 1939. Pol\u00e1ci si byli jist\u00ed, \u017ee jejich z\u00e1padn\u00ed &#8222;spojenci &#8220; jim poskytnou okam\u017eitou vojenskou pomoc, jejich nad\u011bje byly ale nepodlo\u017een\u00e9\u2026<\/p><\/div>\n<p>Pol\u00e1ci pochopili skute\u010dnost a vyst\u0159\u00edzliv\u011bli velmi rychle. Dne <strong>1.z\u00e1\u0159\u00ed 1939<\/strong>\u00a0hlava polsk\u00e9ho ministerstva zahrani\u010d\u00ed J\u00f3zef Beck,\u00a0onen mu\u017e, kter\u00fd m\u011bl\u00a0rozhoduj\u00edc\u00ed vliv v\u00a0polsko-n\u011bmeck\u00fdch rozhovorech n\u00e1hle odlet\u011bl do Lond\u00fdna nam\u00edsto Berl\u00edna, okam\u017eit\u011b odtud telefonoval britsk\u00e9mu velvyslanci ve Var\u0161av\u011b <a href=\"https:\/\/en.wikipedia.org\/wiki\/Howard_William_Kennard\" target=\"_blank\" rel=\"noopener\">Howardovi Kennardovi<\/a> a informoval ho, \u017ee v\u00e1lka mezi N\u011bmeckem a Polskem za\u010dala. Var\u0161ava \u010dekala okam\u017eitou reakci\u00a0spojenc\u016f a\u00a0ta p\u0159i\u0161la. Britov\u00e9 a Francouzi ozn\u00e1mili n\u011bmeck\u00e9 vl\u00e1d\u011b, \u017ee budou dodr\u017eovat sv\u00e9 z\u00e1vazky v\u016f\u010di Polsku, pokud N\u011bmci nezastav\u00ed invazi. <strong>Lond\u00fdn a Pa\u0159\u00ed\u017e sou\u010dasn\u011b uji\u0161\u0165ovali Berl\u00edn, \u017ee tyto pozn\u00e1mky jsou pouze varov\u00e1n\u00edm, nikoliv ultim\u00e1tem.<\/strong> Britsk\u00e9 a francouzsk\u00e9 ministerstvo zahrani\u010dn\u00edch v\u011bc\u00ed nad\u00e1le podporovala Hitlerovu iluzi, \u017ee nep\u016fjdou kv\u016fli Polsku\u00a0do v\u00e1lky. Jejich prim\u00e1rn\u00edm \u00fakolem nebylo zastavit n\u011bmeckou invazi, co\u017e by mohlo v\u00e9st k vyjedn\u00e1v\u00e1n\u00ed, ale naopak povzbudit dal\u0161\u00ed boje, aby Polsko bylo rychle zni\u010dilo n\u011bmeckou arm\u00e1dou, kter\u00e1 by se pak mohla objevit a\u017e na sov\u011btsk\u00e9 hranici. Navzdory skute\u010dnosti, \u017ee britsk\u00fd kr\u00e1l <strong>1.z\u00e1\u0159\u00ed<\/strong> podepsal p\u0159\u00edkaz k mobilizaci sv\u00e9 arm\u00e1dy, n\u00e1mo\u0159nictva a letectva a francouzsk\u00fd premi\u00e9r vydal podobnou vyhl\u00e1\u0161ku ve Francii, byl Hitler p\u0159esv\u011bd\u010den, \u017ee spojenci neza\u010dnou bojovat. Dokonce bylo mo\u017en\u00e9, \u017ee\u00a0nikdy nebude vyd\u00e1no \u017e\u00e1dn\u00e9 prohl\u00e1\u0161en\u00ed o v\u00e1lce. Pol\u00e1ci museli b\u00fdt co nejd\u0159\u00edve pora\u017eeni a pak by zmizel samotn\u00fd impuls ke konfliktu. A i kdyby byla form\u00e1ln\u011b zah\u00e1jena v\u00e1lka, bylo by mo\u017en\u00e9 znovu zah\u00e1jit jedn\u00e1n\u00ed se Z\u00e1padem pod n\u011bjakou z\u00e1minkou, jakmile bude Polsko zni\u010deno.<\/div>\n<div><\/div>\n<div>\u00a0Takto l\u00eddr N\u011bmecka vid\u011bl situaci. Ale nebyl jedin\u00fd, koho oklamaly man\u00e9vry z\u00e1padn\u00edch diplomat\u016f. <strong>Velmi pomalu\u00a0pol\u0161t\u00ed v\u016fdci za\u010dali ch\u00e1pat, \u017ee britsk\u00e9 a francouzsk\u00e9 p\u0159edv\u00e1le\u010dn\u00e9 sliby jsou pouh\u00fdmi pr\u00e1zdn\u00fdmi slovy. Kde bylo sl\u00edben\u00e9 letadlo? Pro\u010d leteck\u00e9 s\u00edly spojenc\u016f je\u0161t\u011b ne\u00fato\u010dily na n\u011bmeck\u00e9 c\u00edle? Pro\u010d Francie neposkytla Polsku pomoc podle\u00a0smlouvy? Kdy Francie vyhl\u00e1s\u00ed v\u00e1lku\u00a0agresorovi?<\/strong><\/div>\n<div>\u00a0Polsk\u00fd velvyslanec polo\u017eil tyto a dal\u0161\u00ed ot\u00e1zky francouzsk\u00e9mu ministru zahrani\u010d\u00ed <a href=\"https:\/\/en.wikipedia.org\/wiki\/Georges_Bonnet\" target=\"_blank\" rel=\"noopener\">Georgesovi Bonnetovi<\/a> ve francouzsk\u00e9m hlavn\u00edm m\u011bst\u011b. Bonnetova odpov\u011b\u010f jasn\u011b \u0159\u00edkala, \u017ee Pa\u0159\u00ed\u017e cht\u011bla Hitlerovi d\u00e1t n\u011bkolik dn\u00ed n\u00e1skok, aby n\u011bmeck\u00e1 arm\u00e1da nem\u011bla probl\u00e9my se zlomen\u00edm p\u00e1te\u0159e polsk\u00e9 arm\u00e1dy. Bonnet uvedl, \u017ee francouzsk\u00e1 vl\u00e1da by mohla poslat ultim\u00e1tum pouze po &#8222;rozhodnut\u00ed parlamentu, kter\u00fd se bude sch\u00e1zet odpoledne.&#8220; A toto ultim\u00e1tum, kter\u00e9 je\u0161t\u011b muselo b\u00fdt posl\u00e1no do Berl\u00edna, by neuplynulo a\u017e do uplynut\u00ed 48 hodin. A teprve tehdy by bylo mo\u017en\u00e9 vyhl\u00e1sit v\u00e1lku.<\/div>\n<div>\n<div id=\"attachment_904\" style=\"width: 230px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=904\" rel=\"attachment wp-att-904\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-904\" class=\"size-full wp-image-904\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/German_plane_bombing_Warsaw_1939-220x300.jpg\" alt=\"\" width=\"220\" height=\"300\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/German_plane_bombing_Warsaw_1939-220x300.jpg 220w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/German_plane_bombing_Warsaw_1939-220x300-160x218.jpg 160w\" sizes=\"auto, (max-width: 220px) 100vw, 220px\" \/><\/a><p id=\"caption-attachment-904\" class=\"wp-caption-text\">Zat\u00edmco Luftwaffe bombardovala Warsavu, britsk\u00e9 letectvo bylo zanepr\u00e1zdn\u011bno shazov\u00e1n\u00edm propagandistick\u00fdch let\u00e1k\u016f nad n\u011bmeck\u00fdmi m\u011bsty.<\/p><\/div>\n<\/div>\n<div>\u00a0Tato odpov\u011b\u010f zd\u011bsila polsk\u00e9ho velvyslance. Polsk\u00e9 zoufalstv\u00ed je snadn\u00e9 pochopit: ud\u011blali jsme v\u0161echno, co jste n\u00e1m \u0159ekli, ale te\u010f n\u00e1s bi\u010duj\u00ed za v\u0161e, co stoj\u00ed za to a nedost\u00e1v\u00e1me \u017e\u00e1dnou podporu. Pol\u00e1ci ztratili svou trp\u011blivost a u\u017e se neptali, ale nyn\u00ed po\u017eadovali to, co jim bylo sl\u00edbeno. Ve\u010der <strong>2.z\u00e1\u0159\u00ed<\/strong>, po sch\u016fzi francouzsk\u00e9ho parlamentu, se polsk\u00fd velvyslanec znovu obr\u00e1til na ministra Bonneta. Ten mu odpov\u011bd\u011bl, \u017ee ot\u00e1zka ultim\u00e1ta\u00a0N\u011bmecku mus\u00ed je\u0161t\u011b b\u00fdt projedn\u00e1na na zased\u00e1n\u00ed Rady ministr\u016f. &#8222;Pak polsk\u00fd velvyslanec ztratil svou m\u00edrnost a \u0159ekl Bonnetovi p\u0159esn\u011b to, co si o n\u011bm myslel a tak\u00e9 po\u017eadoval, aby\u00a0N\u011bmecko okam\u017eit\u011b dostalo ultim\u00e1tum.&#8220; P\u0159esn\u011b stejn\u00e1 sc\u00e9na byla zaznamen\u00e1na v britsk\u00e9m hlavn\u00edm m\u011bst\u011b. V noci <strong>3.z\u00e1\u0159\u00ed<\/strong> byl polsk\u00fd velvyslanec v Lond\u00fdn\u011b nucen okam\u017eit\u011b j\u00edt\u00a0k lordu Halifaxovi a p\u0159ipomenout mu z\u00e1vazky britsk\u00e9 vl\u00e1dy.<\/div>\n<div>\u00a0Pak\u00a0na Z\u00e1pad\u011b za\u010dala hanebn\u00e1 a\u00a0\u0161pinav\u00e1 hra politick\u00e1 hra, kter\u00e1 je\u00a0v historii zn\u00e1m\u00e1 jako\u00a0&#8222;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Phoney_War\" target=\"_blank\" rel=\"noopener\">Podivn\u00e1 v\u00e1lka<\/a>&#8222;.\u00a0Dne <strong>3.z\u00e1\u0159\u00ed 1939<\/strong>\u00a0Velk\u00e9 Brit\u00e1nie a Francie skute\u010dn\u011b vyhl\u00e1sily v\u00e1lku T\u0159et\u00ed \u0159\u00ed\u0161i. Polsk\u00e1 vojensk\u00e1 mise okam\u017eit\u011b opustila Var\u0161avu a odlet\u011bla do Lond\u00fdna. Je snadn\u00e9 si uv\u011bdomit, \u017ee pol\u0161t\u00ed gener\u00e1lov\u00e9 p\u0159i\u0161li, aby diskutovali o konkr\u00e9tn\u00edch spole\u010dn\u00fdch kroc\u00edch, kter\u00e9 maj\u00ed b\u00fdt podniknuty, aby bylo mo\u017eno zni\u010dit\u00a0agresora. M\u016f\u017eeme sotva pochopit emoce, kter\u00e9 tito vlastenci museli c\u00edtit. <strong>Polsk\u00e1 vojensk\u00e1 mise nav\u00edc \u010dekala cel\u00fd t\u00fdden p\u0159ed t\u00edm<\/strong>, ne\u017e byla p\u0159ijata britsk\u00fdm n\u00e1\u010deln\u00edkem\u00a0kr\u00e1lovsk\u00e9ho gener\u00e1ln\u00edho \u0161t\u00e1bu, gener\u00e1lem <a href=\"https:\/\/en.wikipedia.org\/wiki\/Phoney_War\" target=\"_blank\" rel=\"noopener\">Edmundem Ironsidem<\/a>!<\/div>\n<div>\u00a0Souhlasil s pohledem Pol\u00e1k\u016f, okam\u017eit\u011b jim \u0159ekl, \u017ee britsk\u00fd gener\u00e1ln\u00ed \u0161t\u00e1b nem\u00e1 \u017e\u00e1dn\u00fd z\u00e1m\u011br pom\u00e1hat Polsku a radil Pol\u00e1k\u016fm, aby kupovali zbran\u011b &#8230; z neutr\u00e1ln\u00edch zem\u00ed! V reakci na zu\u0159ivost Pol\u00e1k\u016f se gener\u00e1l Ironside trochu odhodlal a sl\u00edbil p\u0159id\u011blen\u00ed 10 000 zastaral\u00fdch pu\u0161ek Hotchkiss a 15-20 milion\u016f kazet. <strong>N\u011bmeck\u00e9 tanky z\u00e1vodily sm\u011brem k Var\u0161av\u011b a st\u00e1l\u00e9 \u00fatoky n\u011bmeck\u00fdch letadel zni\u010dily polsk\u00e9 divize obklopuj\u00edc\u00ed m\u011bsto. Aby Pro p\u0159e\u017eit\u00ed Polsko\u00a0pot\u0159ebovalo protitankov\u00e9 a protiletadlov\u00e9 zbran\u011b a st\u00edhac\u00ed letouny. Britov\u00e9 v\u0161ak v podstat\u011b nazna\u010dovali, \u017ee s n\u011bmeck\u00fdmi tanky a letadly\u00a0lze bojovat\u00a0zastaral\u00fdmi pu\u0161kami!<\/strong><\/div>\n<div>\u00a0Ale to nebylo v\u0161echno! Ve skute\u010dnosti se jejich zrada nezastavila! <strong>Britov\u00e9 nesl\u00edbili dod\u00e1n\u00ed zbyte\u010dn\u00fdch pu\u0161ek do Polska\u00a0dal\u0161\u00edch &#8230; 5-6 m\u011bs\u00edc\u016f!<\/strong> V re\u00e1ln\u00e9m sv\u011bt\u011b v\u0161ak v\u00e1lka mezi N\u011bmeckem a Polskem skon\u010dila za m\u00e9n\u011b ne\u017e m\u011bs\u00edc. Lond\u00fdnsk\u00e1 &#8222;pomoc&#8220; p\u0159edstavovala \u00fapln\u00fd nedostatek sl\u00edben\u00e9 pomoci. Polsko bylo nehanebn\u011b podvedeno sv\u00fdmi spojenci. A tato zrada u\u017e nevypad\u00e1 jako nevysloviteln\u00e1 hloupost nebo jednoduch\u00e1 slepota, jakmile \u010dlov\u011bk spr\u00e1vn\u011b porozum\u00ed skute\u010dn\u00fdm c\u00edl\u016fm Lond\u00fdna a Pa\u0159\u00ed\u017ee. Naopak byla\u00a0jejich zrada\u00a0logick\u00fdm v\u00fdsledkem ve\u0161ker\u00e9 p\u0159edv\u00e1le\u010dn\u00e9 diplomatick\u00e9 \u010dinnosti z\u00e1padn\u00edch vl\u00e1d a byla p\u0159irozen\u00fdm d\u016fsledkem britsk\u00e9 a francouzsk\u00e9 politiky.<\/div>\n<div>\u00a0<strong><em>Nen\u00ed pochyb o tom, \u017ee vedouc\u00ed p\u0159edstavitel\u00e9 Polska pln\u011b pochopili zlo\u010dinn\u00e9 jedn\u00e1n\u00ed sv\u00fdch spojenc\u016f. Jeden v\u00fdznamn\u00fd fakt: polsk\u00e1 exilov\u00e1 vl\u00e1da (v Pa\u0159\u00ed\u017ei a pozd\u011bji v Lond\u00fdn\u011b) byla slo\u017eena ze zcela odli\u0161n\u00fdch osobnost\u00ed ne\u017e p\u0159edv\u00e1le\u010dn\u00e9 veden\u00ed. D\u016fvod byl jednoduch\u00fd: ti, kte\u0159\u00ed byli zrazeni Brity, u\u017e s nimi necht\u011bli pracovat. A pro Brity bylo mnohem snaz\u0161\u00ed anga\u017eovat se s lidmi, jim\u017e nedali\u00a0\u017e\u00e1dn\u00e9 sliby.<\/em><\/strong><\/div>\n<div>\n<div id=\"attachment_905\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.nazor.org\/?attachment_id=905\" rel=\"attachment wp-att-905\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-905\" class=\"size-full wp-image-905\" src=\"http:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Polish_kid_in_the_ruins_of_Warsaw_September_1939.jpg\" alt=\"\" width=\"540\" height=\"403\" srcset=\"https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Polish_kid_in_the_ruins_of_Warsaw_September_1939.jpg 540w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Polish_kid_in_the_ruins_of_Warsaw_September_1939-300x224.jpg 300w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Polish_kid_in_the_ruins_of_Warsaw_September_1939-260x194.jpg 260w, https:\/\/www.nazor.org\/wp-content\/uploads\/2015\/04\/Polish_kid_in_the_ruins_of_Warsaw_September_1939-160x119.jpg 160w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><p id=\"caption-attachment-905\" class=\"wp-caption-text\">Polsk\u00fd chlapec ve zni\u010den\u00e9 Var\u0161av\u011b v roce 1939<\/p><\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><em>\u00a0<\/em><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0P\u0159\u00edb\u011bh 15. Oklaman\u00e9 Polsko (I) origin\u00e1l zdroj Nikolaj Starikov (Rusko) SK RU Pravda o ko\u0159enech n\u011bmecko-polsk\u00e9ho konfliktu, kter\u00fd vedl ke druh\u00e9 sv\u011btov\u00e9 v\u00e1lce, byla v\u017edy pe\u010dliv\u011b tutl\u00e1na. Aby se zakryla nechutn\u00e1 politick\u00e1 agenda z\u00e1padn\u00edch mocnost\u00ed, nechal se nejd\u0159\u00edve kolovat m\u00fdtus,&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.nazor.org\/?page_id=310\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":344,"menu_order":15,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-310","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/pages\/310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nazor.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=310"}],"version-history":[{"count":30,"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/pages\/310\/revisions"}],"predecessor-version":[{"id":906,"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/pages\/310\/revisions\/906"}],"up":[{"embeddable":true,"href":"https:\/\/www.nazor.org\/index.php?rest_route=\/wp\/v2\/pages\/344"}],"wp:attachment":[{"href":"https:\/\/www.nazor.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}