/*
	Author	: Michael Janea (www.michaeljanea.com)
	Version	: 1.2
*/

var fontawesome = '';
var icons = Array();
icons[0] = Array('fa-adjust', 'Adjust');
icons[1] = Array('fa-adn', 'A.D.N.');
icons[2] = Array('fa-align-center', 'Align Center');
icons[3] = Array('fa-align-justify', 'Align Justify');
icons[4] = Array('fa-align-left', 'Align Left');
icons[5] = Array('fa-align-right', 'Align Right');
icons[6] = Array('fa-ambulance', 'Ambulance');
icons[7] = Array('fa-anchor', 'Anchor');
icons[8] = Array('fa-android', 'Android');
icons[9] = Array('fa-angle-double-down', 'Angle Double Down');
icons[10] = Array('fa-angle-double-left', 'Angle Double Left');
icons[11] = Array('fa-angle-double-right', 'Angle Double Right');
icons[12] = Array('fa-angle-double-up', 'Angle Double Up');
icons[13] = Array('fa-angle-down', 'Angle Down');
icons[14] = Array('fa-angle-left', 'Angle Left');
icons[15] = Array('fa-angle-right', 'Angle Right');
icons[16] = Array('fa-angle-up', 'Angle Up');
icons[17] = Array('fa-apple', 'Apple');
icons[18] = Array('fa-archive', 'Archive');
icons[19] = Array('fa-arrow-circle-down', 'Arrow Circle Down');
icons[20] = Array('fa-arrow-circle-left', 'Arrow Circle Left');
icons[21] = Array('fa-arrow-circle-o-down', 'Arrow Circle Down (Inverted)');
icons[22] = Array('fa-arrow-circle-o-left', 'Arrow Circle Left (Inverted)');
icons[23] = Array('fa-arrow-circle-o-right', 'Arrow Circle Right (Inverted)');
icons[24] = Array('fa-arrow-circle-o-up', 'Arrow Circle Up (Inverted)');
icons[25] = Array('fa-arrow-circle-right', 'Arrow Circle Right');
icons[26] = Array('fa-arrow-circle-up', 'Arrow Circle Up');
icons[27] = Array('fa-arrow-down', 'Arrow Down');
icons[28] = Array('fa-arrow-left', 'Arrow Left');
icons[29] = Array('fa-arrow-right', 'Arrow Right');
icons[30] = Array('fa-arrows', 'Arrows');
icons[31] = Array('fa-arrows-alt', 'Arrows (Alt)');
icons[32] = Array('fa-arrows-h', 'Arrows (Horizontal)');
icons[33] = Array('fa-arrows-v', 'Arrows (vertical)');
icons[34] = Array('fa-arrow-up', 'Arrow Up');
icons[35] = Array('fa-asterisk', 'Asterisk');
icons[36] = Array('fa-automobile', 'Automobile');
icons[37] = Array('fa-backward', 'Backward');
icons[38] = Array('fa-ban', 'Ban');
icons[39] = Array('fa-bank', 'Bank');
icons[40] = Array('fa-bar-chart-o', 'Bar Chart');
icons[41] = Array('fa-barcode', 'Barcode');
icons[42] = Array('fa-bars', 'Bars');
icons[43] = Array('fa-beer', 'Beer');
icons[44] = Array('fa-behance', 'Behance');
icons[45] = Array('fa-behance-square', 'Behance Square');
icons[46] = Array('fa-bell', 'Bell');
icons[47] = Array('fa-bell-o', 'Bell (Inverted)');
icons[48] = Array('fa-bitbucket', 'Bitbucket');
icons[49] = Array('fa-bitbucket-square', 'Bitbucket Square');
icons[50] = Array('fa-bitcoin', 'Bitcoin');
icons[51] = Array('fa-bold', 'Bold');
icons[52] = Array('fa-bolt', 'Bolt');
icons[53] = Array('fa-bomb', 'Bomb');
icons[54] = Array('fa-book', 'Book');
icons[55] = Array('fa-bookmark', 'Bookmark');
icons[56] = Array('fa-bookmark-o', 'Bookmark (Inverted)');
icons[57] = Array('fa-briefcase', 'Briefcase');
icons[58] = Array('fa-btc', 'BTC');
icons[59] = Array('fa-bug', 'Bug');
icons[60] = Array('fa-building', 'Building');
icons[61] = Array('fa-building-o', 'Building (Inverted)');
icons[62] = Array('fa-bullhorn', 'Bullhorn');
icons[63] = Array('fa-bullseye', 'Bullseye');
icons[64] = Array('fa-cab', 'Cab');
icons[65] = Array('fa-calendar', 'Calendar');
icons[66] = Array('fa-calendar-o', 'Calendar (Inverted)');
icons[67] = Array('fa-camera', 'Camera');
icons[68] = Array('fa-camera-retro', 'Camera Retro');
icons[69] = Array('fa-car', 'Car');
icons[70] = Array('fa-caret-down', 'Caret Down');
icons[71] = Array('fa-caret-left', 'Caret Left');
icons[72] = Array('fa-caret-right', 'Caret Right');
icons[73] = Array('fa-caret-square-o-down', 'Caret Square Down');
icons[74] = Array('fa-caret-square-o-left', 'Caret Square Left');
icons[75] = Array('fa-caret-square-o-right', 'Caret Square Right');
icons[76] = Array('fa-caret-square-o-up', 'Caret Square Up');
icons[77] = Array('fa-caret-up', 'Caret Up');
icons[78] = Array('fa-certificate', 'Certificate');
icons[79] = Array('fa-chain', 'Chain');
icons[80] = Array('fa-chain-broken', 'Chain Broken');
icons[81] = Array('fa-check', 'Check');
icons[82] = Array('fa-check-circle', 'Check Circle');
icons[83] = Array('fa-check-circle-o', 'Check Circle (Inverted)');
icons[84] = Array('fa-check-square', 'Check Square');
icons[85] = Array('fa-check-square-o', 'Check Square (Inverted)');
icons[86] = Array('fa-chevron-circle-down', 'Chevron Circle Down');
icons[87] = Array('fa-chevron-circle-left', 'Chevron Circle Left');
icons[88] = Array('fa-chevron-circle-right', 'Chevron Circle Right');
icons[89] = Array('fa-chevron-circle-up', 'Chevron Circle Up');
icons[90] = Array('fa-chevron-down', 'Chevron Down');
icons[91] = Array('fa-chevron-left', 'Chevron Left');
icons[92] = Array('fa-chevron-right', 'Chevron Right');
icons[93] = Array('fa-chevron-up', 'Chevron Up');
icons[94] = Array('fa-child', 'Child');
icons[95] = Array('fa-circle', 'Circle');
icons[96] = Array('fa-circle-o', 'Circle (Inverted)');
icons[97] = Array('fa-circle-o-notch', 'Circle Notch');
icons[98] = Array('fa-circle-thin', 'Circle Thin');
icons[99] = Array('fa-clipboard', 'Clipboard');
icons[100] = Array('fa-clock-o', 'Clock');
icons[101] = Array('fa-cloud', 'Cloud');
icons[102] = Array('fa-cloud-download', 'Cloud Download');
icons[103] = Array('fa-cloud-upload', 'Cloud Upload');
icons[104] = Array('fa-cny', 'CNY');
icons[105] = Array('fa-code', 'Code');
icons[106] = Array('fa-code-fork', 'Code Fork');
icons[107] = Array('fa-codepen', 'Codepen');
icons[108] = Array('fa-coffee', 'Coffee');
icons[109] = Array('fa-cog', 'Cog');
icons[110] = Array('fa-cogs', 'Cogs');
icons[111] = Array('fa-columns', 'Columns');
icons[112] = Array('fa-comment', 'Comment');
icons[113] = Array('fa-comment-o', 'Comment (Inverted)');
icons[114] = Array('fa-comments', 'Comments');
icons[115] = Array('fa-comments-o', 'Comments (Inverted)');
icons[116] = Array('fa-compass', 'Compass');
icons[117] = Array('fa-compress', 'Compress');
icons[118] = Array('fa-copy', 'Copy');
icons[119] = Array('fa-credit-card', 'Credit Card');
icons[120] = Array('fa-crop', 'Crop');
icons[121] = Array('fa-crosshairs', 'Crosshairs');
icons[122] = Array('fa-css3', 'CSS3');
icons[123] = Array('fa-cube', 'Cube');
icons[124] = Array('fa-cubes', 'Cubes');
icons[125] = Array('fa-cut', 'Cut');
icons[126] = Array('fa-cutlery', 'Cutlery');
icons[127] = Array('fa-dashboard', 'Dashboard');
icons[128] = Array('fa-database', 'Database');
icons[129] = Array('fa-dedent', 'Dedent');
icons[130] = Array('fa-delicious', 'Delicious');
icons[131] = Array('fa-desktop', 'Desktop');
icons[132] = Array('fa-deviantart', 'Deviant Art');
icons[133] = Array('fa-digg', 'Digg');
icons[134] = Array('fa-dollar', 'Dollar');
icons[135] = Array('fa-dot-circle-o', 'Dot Circle');
icons[136] = Array('fa-download', 'Download');
icons[137] = Array('fa-dribbble', 'Dribble');
icons[138] = Array('fa-dropbox', 'Dropbox');
icons[139] = Array('fa-drupal', 'Drupal');
icons[140] = Array('fa-edit', 'Edit');
icons[141] = Array('fa-eject', 'Eject');
icons[142] = Array('fa-ellipsis-h', 'Ellipsis (Horizontal)');
icons[143] = Array('fa-ellipsis-v', 'Ellipsis (Vertical)');
icons[144] = Array('fa-empire', 'Empire');
icons[145] = Array('fa-envelope', 'Envelope');
icons[146] = Array('fa-envelope-o', 'Envelope (Inverted)');
icons[147] = Array('fa-envelope-square', 'Envelope Square');
icons[148] = Array('fa-eraser', 'Eraser');
icons[149] = Array('fa-eur', 'EUR');
icons[150] = Array('fa-euro', 'Euro');
icons[151] = Array('fa-exchange', 'Exchange');
icons[152] = Array('fa-exclamation', 'Exclamation');
icons[153] = Array('fa-exclamation-circle', 'Exclamation Circle');
icons[154] = Array('fa-exclamation-triangle', 'Exclamation Triangle');
icons[155] = Array('fa-expand', 'Expand');
icons[156] = Array('fa-external-link', 'External Link');
icons[157] = Array('fa-external-link-square', 'External Link Square');
icons[158] = Array('fa-eye', 'Eye');
icons[159] = Array('fa-eye-slash', 'Eye Slash');
icons[160] = Array('fa-facebook', 'Facebook');
icons[161] = Array('fa-facebook-square', 'Facebook Square');
icons[162] = Array('fa-fast-backward', 'Fast Backward');
icons[163] = Array('fa-fast-forward', 'Fast Forward');
icons[164] = Array('fa-fax', 'Fax');
icons[165] = Array('fa-female', 'Female');
icons[166] = Array('fa-fighter-jet', 'Fighter Jet');
icons[167] = Array('fa-file', 'File');
icons[168] = Array('fa-file-archive-o', 'File Archive');
icons[169] = Array('fa-file-audio-o', 'File Audio');
icons[170] = Array('fa-file-code-o', 'File Code');
icons[171] = Array('fa-file-excel-o', 'File Excel');
icons[172] = Array('fa-file-image-o', 'File Image');
icons[173] = Array('fa-file-movie-o', 'File Movie');
icons[174] = Array('fa-file-o', 'File');
icons[175] = Array('fa-file-pdf-o', 'File PDF');
icons[176] = Array('fa-file-photo-o', 'File Photo');
icons[177] = Array('fa-file-picture-o', 'File Picture');
icons[178] = Array('fa-file-powerpoint-o', 'File Powerpoint');
icons[179] = Array('fa-files-o', 'Files');
icons[180] = Array('fa-file-sound-o', 'File Sound');
icons[181] = Array('fa-file-text', 'File Text');
icons[182] = Array('fa-file-text-o', 'File Text (Inverted)');
icons[183] = Array('fa-file-video-o', 'File Video');
icons[184] = Array('fa-file-word-o', 'File Word');
icons[185] = Array('fa-file-zip-o', 'File Zip');
icons[186] = Array('fa-film', 'Film');
icons[187] = Array('fa-filter', 'Filter');
icons[188] = Array('fa-fire', 'Fire');
icons[189] = Array('fa-fire-extinguisher', 'Fire Extinguisher');
icons[190] = Array('fa-flag', 'Flag');
icons[191] = Array('fa-flag-checkered', 'Flag Checkered');
icons[192] = Array('fa-flag-o', 'Flag (Inverted)');
icons[193] = Array('fa-flash', 'Flash');
icons[194] = Array('fa-flask', 'Flask');
icons[195] = Array('fa-flickr', 'Flickr');
icons[196] = Array('fa-floppy-o', 'Floppy');
icons[197] = Array('fa-folder', 'Folder');
icons[198] = Array('fa-folder-o', 'Folder (Inverted)');
icons[199] = Array('fa-folder-open', 'Folder Open');
icons[200] = Array('fa-folder-open-o', 'Folder Open (Inverted)');
icons[201] = Array('fa-font', 'Font');
icons[202] = Array('fa-forward', 'Forward');
icons[203] = Array('fa-foursquare', 'Four Square');
icons[204] = Array('fa-frown-o', 'Frown');
icons[205] = Array('fa-gamepad', 'Gamepad');
icons[206] = Array('fa-gavel', 'Gavel');
icons[207] = Array('fa-gbp', 'GBP');
icons[208] = Array('fa-ge', 'GE');
icons[209] = Array('fa-gear', 'Gear');
icons[210] = Array('fa-gears', 'Gears');
icons[211] = Array('fa-gift', 'Gift');
icons[212] = Array('fa-git', 'Git');
icons[213] = Array('fa-github', 'Github');
icons[214] = Array('fa-github-alt', 'Github (Alt)');
icons[215] = Array('fa-github-square', 'Github Square');
icons[216] = Array('fa-git-square', 'Git Square');
icons[217] = Array('fa-gittip', 'Gittip');
icons[218] = Array('fa-glass', 'Glass');
icons[219] = Array('fa-globe', 'Globe');
icons[220] = Array('fa-google', 'Google');
icons[221] = Array('fa-google-plus', 'Google Plus');
icons[222] = Array('fa-google-plus-square', 'Google Plus Square');
icons[223] = Array('fa-graduation-cap', 'Graduation Cap');
icons[224] = Array('fa-group', 'Group');
icons[225] = Array('fa-hacker-news', 'Hacker News');
icons[226] = Array('fa-hand-o-down', 'Hand Down');
icons[227] = Array('fa-hand-o-left', 'Hand Left');
icons[228] = Array('fa-hand-o-right', 'Hand Right');
icons[229] = Array('fa-hand-o-up', 'Hand Up');
icons[230] = Array('fa-hdd-o', 'HDD');
icons[231] = Array('fa-header', 'Header');
icons[232] = Array('fa-headphones', 'Headphones');
icons[233] = Array('fa-heart', 'Heart');
icons[234] = Array('fa-heart-o', 'Heart (Inverted)');
icons[235] = Array('fa-history', 'History');
icons[236] = Array('fa-home', 'Home');
icons[237] = Array('fa-hospital-o', 'Hospital');
icons[238] = Array('fa-h-square', 'Hospital Square');
icons[239] = Array('fa-html5', 'HTML5');
icons[240] = Array('fa-image', 'Image');
icons[241] = Array('fa-inbox', 'Inbox');
icons[242] = Array('fa-indent', 'Indent');
icons[243] = Array('fa-info', 'Info');
icons[244] = Array('fa-info-circle', 'Info Circle');
icons[245] = Array('fa-inr', 'INR');
icons[246] = Array('fa-instagram', 'Instagram');
icons[247] = Array('fa-institution', 'Institution');
icons[248] = Array('fa-italic', 'Italic');
icons[249] = Array('fa-joomla', 'Joomla');
icons[250] = Array('fa-jpy', 'JPY');
icons[251] = Array('fa-jsfiddle', 'JS Fiddle');
icons[252] = Array('fa-key', 'Key');
icons[253] = Array('fa-keyboard-o', 'Keyboard');
icons[254] = Array('fa-krw', 'KRW');
icons[255] = Array('fa-language', 'Language');
icons[256] = Array('fa-laptop', 'Laptop');
icons[257] = Array('fa-leaf', 'Leaf');
icons[258] = Array('fa-legal', 'Legal');
icons[259] = Array('fa-lemon-o', 'Lemon');
icons[260] = Array('fa-level-down', 'Level Down');
icons[261] = Array('fa-level-up', 'Level Up');
icons[262] = Array('fa-life-bouy', 'Life Bouy');
icons[263] = Array('fa-life-ring', 'Life Ring');
icons[264] = Array('fa-life-saver', 'Life Saver');
icons[265] = Array('fa-lightbulb-o', 'Lightbulb');
icons[266] = Array('fa-link', 'Link');
icons[267] = Array('fa-linkedin', 'LinkedIn');
icons[268] = Array('fa-linkedin-square', 'LinkedIn Square');
icons[269] = Array('fa-linux', 'Linux');
icons[270] = Array('fa-list', 'List');
icons[271] = Array('fa-list-alt', 'List (Alt)');
icons[272] = Array('fa-list-ol', 'Ordered List');
icons[273] = Array('fa-list-ul', 'Unordered List');
icons[274] = Array('fa-location-arrow', 'Location Arrow');
icons[275] = Array('fa-lock', 'Lock');
icons[276] = Array('fa-long-arrow-down', 'Long Arrow Down');
icons[277] = Array('fa-long-arrow-left', 'Long Arrow Left');
icons[278] = Array('fa-long-arrow-right', 'Long Arrow Right');
icons[279] = Array('fa-long-arrow-up', 'Long Arrow Up');
icons[280] = Array('fa-magic', 'Magic');
icons[281] = Array('fa-magnet', 'Magnet');
icons[282] = Array('fa-mail-forward', 'Mail Forward');
icons[283] = Array('fa-mail-reply', 'Mail Reply');
icons[284] = Array('fa-mail-reply-all', 'Mail Reply All');
icons[285] = Array('fa-male', 'Male');
icons[286] = Array('fa-map-marker', 'Map Marker');
icons[287] = Array('fa-maxcdn', 'Max CDN');
icons[288] = Array('fa-medkit', 'Medkit');
icons[289] = Array('fa-meh-o', 'Meh');
icons[290] = Array('fa-microphone', 'Microphone');
icons[291] = Array('fa-microphone-slash', 'Microphone Slash');
icons[292] = Array('fa-minus', 'Minus');
icons[293] = Array('fa-minus-circle', 'Minus Circle');
icons[294] = Array('fa-minus-square', 'Minus Square');
icons[295] = Array('fa-minus-square-o', 'Minus Square (Inverted)');
icons[296] = Array('fa-mobile', 'Mobile');
icons[297] = Array('fa-mobile-phone', 'Mobile Phone');
icons[298] = Array('fa-money', 'Money');
icons[299] = Array('fa-moon-o', 'Moon');
icons[300] = Array('fa-mortar-board', 'Mortar Board');
icons[301] = Array('fa-music', 'Music');
icons[302] = Array('fa-navicon', 'Navicon');
icons[303] = Array('fa-openid', 'Open Id');
icons[304] = Array('fa-outdent', 'Outdent');
icons[305] = Array('fa-pagelines', 'Pageliens');
icons[306] = Array('fa-paperclip', 'Paperclip');
icons[307] = Array('fa-paper-plane', 'Paper Plane');
icons[308] = Array('fa-paper-plane-o', 'Paper Plane (Inverted)');
icons[309] = Array('fa-paragraph', 'Paragraph');
icons[310] = Array('fa-paste', 'Paste');
icons[311] = Array('fa-pause', 'Pause');
icons[312] = Array('fa-paw', 'Paw');
icons[313] = Array('fa-pencil', 'Pencil');
icons[314] = Array('fa-pencil-square', 'Pencil Square');
icons[315] = Array('fa-pencil-square-o', 'Pencil Square (Inverted)');
icons[316] = Array('fa-phone', 'Phone');
icons[317] = Array('fa-phone-square', 'Phone Square');
icons[318] = Array('fa-photo', 'Photo');
icons[319] = Array('fa-picture-o', 'Picture');
icons[320] = Array('fa-pied-piper', 'Pied Piper');
icons[321] = Array('fa-pied-piper-alt', 'Pied Piper (Alt)');
icons[322] = Array('fa-pied-piper-square', 'Pied Piper Square');
icons[323] = Array('fa-pinterest', 'Pinterest');
icons[324] = Array('fa-pinterest-square', 'Pinterest Square');
icons[325] = Array('fa-plane', 'Plane');
icons[326] = Array('fa-play', 'Play');
icons[327] = Array('fa-play-circle', 'Play Circle');
icons[328] = Array('fa-play-circle-o', 'Play Circle (Inverted)');
icons[329] = Array('fa-plus', 'Plus');
icons[330] = Array('fa-plus-circle', 'Plus Circle');
icons[331] = Array('fa-plus-square', 'Plus Square');
icons[332] = Array('fa-plus-square-o', 'Plus Square');
icons[333] = Array('fa-power-off', 'Power Off');
icons[334] = Array('fa-print', 'Print');
icons[335] = Array('fa-puzzle-piece', 'Puzzle Piece');
icons[336] = Array('fa-qq', 'QQ');
icons[337] = Array('fa-qrcode', 'QR Code');
icons[338] = Array('fa-question', 'Question');
icons[339] = Array('fa-question-circle', 'Question Circle');
icons[340] = Array('fa-quote-left', 'Quote Left');
icons[341] = Array('fa-quote-right', 'Quote Right');
icons[342] = Array('fa-ra', 'RA');
icons[343] = Array('fa-random', 'Random');
icons[344] = Array('fa-rebel', 'Rebel');
icons[345] = Array('fa-recycle', 'Recycle');
icons[346] = Array('fa-reddit', 'Reddit');
icons[347] = Array('fa-reddit-square', 'Reddit Square');
icons[348] = Array('fa-refresh', 'Refresh');
icons[349] = Array('fa-renren', 'Renren');
icons[350] = Array('fa-reorder', 'Reorder');
icons[351] = Array('fa-repeat', 'Repeat');
icons[352] = Array('fa-reply', 'Reply');
icons[353] = Array('fa-reply-all', 'Reply All');
icons[354] = Array('fa-retweet', 'Retweet');
icons[355] = Array('fa-rmb', 'RMB');
icons[356] = Array('fa-road', 'Road');
icons[357] = Array('fa-rocket', 'Rocket');
icons[358] = Array('fa-rotate-left', 'Rotate Left');
icons[359] = Array('fa-rotate-right', 'Rotate Right');
icons[360] = Array('fa-rouble', 'Rouble');
icons[361] = Array('fa-rss', 'RSS');
icons[362] = Array('fa-rss-square', 'RSS Square');
icons[363] = Array('fa-rub', 'Rub');
icons[364] = Array('fa-ruble', 'Ruble');
icons[365] = Array('fa-rupee', 'Rupee');
icons[366] = Array('fa-save', 'Save');
icons[367] = Array('fa-scissors', 'Scissors');
icons[368] = Array('fa-search', 'Search');
icons[369] = Array('fa-search-minus', 'Search Minus');
icons[370] = Array('fa-search-plus', 'Search Plus');
icons[371] = Array('fa-send', 'Send');
icons[372] = Array('fa-send-o', 'Send (Inverted)');
icons[373] = Array('fa-share', 'Share');
icons[374] = Array('fa-share-alt', 'Share (Alt)');
icons[375] = Array('fa-share-alt-square', 'Share Square (Alt)');
icons[376] = Array('fa-share-square', 'Share Square');
icons[377] = Array('fa-share-square-o', 'Share Square (Inverted)');
icons[378] = Array('fa-shield', 'Shield');
icons[379] = Array('fa-shopping-cart', 'Shopping Cart');
icons[380] = Array('fa-signal', 'Signal');
icons[381] = Array('fa-sign-in', 'Sign In');
icons[382] = Array('fa-sign-out', 'Sign Out');
icons[383] = Array('fa-sitemap', 'Sitemap');
icons[384] = Array('fa-skype', 'Skype');
icons[385] = Array('fa-slack', 'Slack');
icons[386] = Array('fa-sliders', 'Slider');
icons[387] = Array('fa-smile-o', 'Smile');
icons[388] = Array('fa-sort', 'Sort');
icons[389] = Array('fa-sort-alpha-asc', 'Sort Alpha Ascending');
icons[390] = Array('fa-sort-alpha-desc', 'Sort Alpha Descending');
icons[391] = Array('fa-sort-amount-asc', 'Sort Amount Ascending');
icons[392] = Array('fa-sort-amount-desc', 'Sort Amount Descending');
icons[393] = Array('fa-sort-asc', 'Sort Ascending');
icons[394] = Array('fa-sort-desc', 'Sort Descending');
icons[395] = Array('fa-sort-down', 'Sort Down');
icons[396] = Array('fa-sort-numeric-asc', 'Sort Numberic Ascending');
icons[397] = Array('fa-sort-numeric-desc', 'Sort Numberic Descending');
icons[398] = Array('fa-sort-up', 'Sort Up');
icons[399] = Array('fa-soundcloud', 'Soundcloud');
icons[400] = Array('fa-space-shuttle', 'Space Shuttle');
icons[401] = Array('fa-spinner', 'Spinner');
icons[402] = Array('fa-spoon', 'Spoon');
icons[403] = Array('fa-spotify', 'Spotify');
icons[404] = Array('fa-square', 'Square');
icons[405] = Array('fa-square-o', 'Square (Inverted)');
icons[406] = Array('fa-stack-exchange', 'Stack Exchange');
icons[407] = Array('fa-stack-overflow', 'Stack Overflow');
icons[408] = Array('fa-star', 'Star');
icons[409] = Array('fa-star-half', 'Star Half');
icons[410] = Array('fa-star-half-empty', 'Star Half Empty');
icons[411] = Array('fa-star-half-full', 'Star Half Full');
icons[412] = Array('fa-star-half-o', 'Star Half (Inverted)');
icons[413] = Array('fa-star-o', 'Star (Inverted)');
icons[414] = Array('fa-steam', 'Steam');
icons[415] = Array('fa-steam-square', 'Steam Square');
icons[416] = Array('fa-step-backward', 'Step Backward');
icons[417] = Array('fa-step-forward', 'Step Forward');
icons[418] = Array('fa-stethoscope', 'Stethoscope');
icons[419] = Array('fa-stop', 'Stop');
icons[420] = Array('fa-strikethrough', 'Strikethrough');
icons[421] = Array('fa-stumbleupon', 'Stumbleupon');
icons[422] = Array('fa-stumbleupon-circle', 'Stumbleupon Circle');
icons[423] = Array('fa-subscript', 'Subscript');
icons[424] = Array('fa-suitcase', 'Suitcase');
icons[425] = Array('fa-sun-o', 'Sun');
icons[426] = Array('fa-superscript', 'Superscript');
icons[427] = Array('fa-support', 'Support');
icons[428] = Array('fa-table', 'table');
icons[429] = Array('fa-tablet', 'Tablet');
icons[430] = Array('fa-tachometer', 'Tachometer');
icons[431] = Array('fa-tag', 'Tag');
icons[432] = Array('fa-tags', 'Tags');
icons[433] = Array('fa-tasks', 'Tasks');
icons[434] = Array('fa-taxi', 'Taxi');
icons[435] = Array('fa-tencent-weibo', 'Tencent Weibo');
icons[436] = Array('fa-terminal', 'Terminal');
icons[437] = Array('fa-text-height', 'Text Height');
icons[438] = Array('fa-text-width', 'Text Width');
icons[439] = Array('fa-th', 'TH');
icons[440] = Array('fa-th-large', 'TH Large');
icons[441] = Array('fa-th-list', 'TH List');
icons[442] = Array('fa-thumbs-down', 'Thumbs Down');
icons[443] = Array('fa-thumbs-o-down', 'Thumbs Down (Inverted)');
icons[444] = Array('fa-thumbs-o-up', 'Thumbs Up (Inverted)');
icons[445] = Array('fa-thumbs-up', 'Thumbs Up');
icons[446] = Array('fa-thumb-tack', 'Thumb Tack');
icons[447] = Array('fa-ticket', 'Ticket');
icons[448] = Array('fa-times', 'Times');
icons[449] = Array('fa-times-circle', 'Times Circle');
icons[450] = Array('fa-times-circle-o', 'Times Circle (Inverted)');
icons[451] = Array('fa-tint', 'Tint');
icons[452] = Array('fa-toggle-down', 'Toggle Down');
icons[453] = Array('fa-toggle-left', 'Toggle Left');
icons[454] = Array('fa-toggle-right', 'Toggle Right');
icons[455] = Array('fa-toggle-up', 'Toggle Up');
icons[456] = Array('fa-trash-o', 'Trash');
icons[457] = Array('fa-tree', 'Tree');
icons[458] = Array('fa-trello', 'Trello');
icons[459] = Array('fa-trophy', 'Trophy');
icons[460] = Array('fa-truck', 'Truck');
icons[461] = Array('fa-try', 'Try');
icons[462] = Array('fa-tumblr', 'Tumblr');
icons[463] = Array('fa-tumblr-square', 'Tumblr Square');
icons[464] = Array('fa-turkish-lira', 'Turkish Lira');
icons[465] = Array('fa-twitter', 'Twitter');
icons[466] = Array('fa-twitter-square', 'Twitter Square');
icons[467] = Array('fa-umbrella', 'Umbrella');
icons[468] = Array('fa-underline', 'Underline');
icons[469] = Array('fa-undo', 'Undo');
icons[470] = Array('fa-university', 'University');
icons[471] = Array('fa-unlink', 'Unlink');
icons[472] = Array('fa-unlock', 'Unlock');
icons[473] = Array('fa-unlock-alt', 'Unlock (Alt)');
icons[474] = Array('fa-unsorted', 'Unsorted');
icons[475] = Array('fa-upload', 'Upload');
icons[476] = Array('fa-usd', 'USD');
icons[477] = Array('fa-user', 'User');
icons[478] = Array('fa-user-md', 'User MD');
icons[479] = Array('fa-users', 'Users');
icons[480] = Array('fa-video-camera', 'Video Camera');
icons[481] = Array('fa-vimeo-square', 'Vimeo Square');
icons[482] = Array('fa-vine', 'Vine');
icons[483] = Array('fa-vk', 'VK');
icons[484] = Array('fa-volume-down', 'Volume Down');
icons[485] = Array('fa-volume-off', 'Volume Off');
icons[486] = Array('fa-volume-up', 'Volume Up');
icons[487] = Array('fa-warning', 'Warning');
icons[488] = Array('fa-wechat', 'Wechat');
icons[489] = Array('fa-weibo', 'Weibo');
icons[490] = Array('fa-weixin', 'Weixin');
icons[491] = Array('fa-wheelchair', 'Wheelchair');
icons[492] = Array('fa-windows', 'Windows');
icons[493] = Array('fa-won', 'Won');
icons[494] = Array('fa-wordpress', 'Wordpress');
icons[495] = Array('fa-wrench', 'Wrench');
icons[496] = Array('fa-xing', 'Xing');
icons[497] = Array('fa-xing-square', 'Xing Square');
icons[498] = Array('fa-yahoo', 'Yahoo');
icons[499] = Array('fa-yen', 'Yen');
icons[500] = Array('fa-youtube', 'Youtube');
icons[501] = Array('fa-youtube-play', 'Youtube Play');
icons[502] = Array('fa-youtube-square', 'Youtube Square');
icons[503] = Array('fa-angellist', 'Angel List');
icons[504] = Array('fa-area-chart', 'Area Chart');
icons[505] = Array('fa-at', 'At');
icons[506] = Array('fa-bell-slash', 'Bell Slash');
icons[507] = Array('fa-bell-slash-o', 'Bell Slash (Alt)');
icons[508] = Array('fa-bicycle', 'Bicycle');
icons[509] = Array('fa-binoculars', 'Binoculars');
icons[510] = Array('fa-birthday-cake', 'Brithday Cake');
icons[511] = Array('fa-bus', 'Bus');
icons[512] = Array('fa-calculator', 'Calculator');
icons[513] = Array('fa-cc', 'Credit Card');
icons[514] = Array('fa-cc-amex', 'American Express');
icons[515] = Array('fa-cc-discover', 'Discover');
icons[516] = Array('fa-cc-mastercard', 'Master Card');
icons[517] = Array('fa-cc-paypal', 'PayPal');
icons[518] = Array('fa-cc-stripe', 'Stripe');
icons[519] = Array('fa-cc-visa', 'Visa');
icons[520] = Array('fa-copyright', 'Copyright');
icons[521] = Array('fa-eyedropper', 'Eyedropper');
icons[522] = Array('fa-futbol-o', 'Football');
icons[523] = Array('fa-google-wallet', 'Google Wallet');
icons[524] = Array('fa-ils', 'ILS');
icons[525] = Array('fa-ioxhost', 'Iox Host');
icons[526] = Array('fa-lastfm', 'Last FM');
icons[527] = Array('fa-lastfm-square', 'Last FM Square');
icons[528] = Array('fa-line-chart', 'Line Chart');
icons[529] = Array('fa-meanpath', 'Meanpath');
icons[530] = Array('fa-newspaper-o', 'Newspaper');
icons[531] = Array('fa-pain-brush', 'Pain Brush');
icons[532] = Array('fa-paypal', 'PayPal');
icons[533] = Array('fa-pie-chart', 'Pie Chart');
icons[534] = Array('fa-plug', 'Plug');
icons[535] = Array('fa-shekel', 'Shekel');
icons[536] = Array('fa-sheqel', 'Sheqel');
icons[537] = Array('fa-slideshare', 'Slide Share');
icons[538] = Array('fa-soccer-ball-o', 'Soccer Ball');
icons[539] = Array('fa-toggle-off', 'Toggle Off');
icons[540] = Array('fa-toggle-on', 'Toggle On');
icons[541] = Array('fa-trash', 'Trash');
icons[542] = Array('fa-tty', 'TTY');
icons[543] = Array('fa-twitch', 'Twitch');
icons[544] = Array('fa-wifi', 'Wifi');
icons[545] = Array('fa-yelp', 'Yelp');
icons[546] = Array('fa-bed', 'Bed');
icons[547] = Array('fa-buysellads', 'Buy / Sell Ads');
icons[548] = Array('fa-cart-arrow-down', 'Cart Arrow Down');
icons[549] = Array('fa-cart-plus', 'Cart Plus');
icons[550] = Array('fa-connect-develop', 'Connect Develop');
icons[551] = Array('fa-dashcube', 'Dash Cube');
icons[552] = Array('fa-diamond', 'Diamond');
icons[553] = Array('fa-facebook-official', 'Facebook Official');
icons[554] = Array('fa-forumbee', 'Forum Bee');
icons[555] = Array('fa-heartbeat', 'Heartbeat');
icons[556] = Array('fa-hotel', 'Hotel');
icons[557] = Array('fa-leanpub', 'Lean Pub');
icons[558] = Array('fa-mars', 'Mars');
icons[559] = Array('fa-mars-double', 'Mars Double');
icons[560] = Array('fa-mars-stroke', 'Mars Stroke');
icons[561] = Array('fa-mars-stroke-h', 'Mars Stroke Horizontal');
icons[562] = Array('fa-mars-stroke-v', 'Mars Stroke Vertical');
icons[563] = Array('fa-medium', 'Medium');
icons[564] = Array('fa-mercury', 'Mercury');
icons[565] = Array('fa-motorcycle', 'Motorcycle');
icons[566] = Array('fa-neuter', 'Neuter');
icons[567] = Array('fa-pinterest-p', 'Pinterest');
icons[568] = Array('fa-sellsy', 'Sellsy');
icons[569] = Array('fa-server', 'Server');
icons[570] = Array('fa-ship', 'Ship');
icons[571] = Array('fa-shirtsinbulk', 'Shirts in Bulk');
icons[572] = Array('fa-simplybuilt', 'Simply Built');
icons[573] = Array('fa-skyatlas', 'Sky Atlas');
icons[574] = Array('fa-street-view', 'Street View');
icons[575] = Array('fa-subway', 'Subway');
icons[576] = Array('fa-train', 'Train');
icons[577] = Array('fa-transgender', 'Transgender');
icons[578] = Array('fa-transgender-alt', 'Transgender Alt');
icons[579] = Array('fa-user-plus', 'User Plus');
icons[580] = Array('fa-user-secret', 'User Secret');
icons[581] = Array('fa-user-times', 'User Times');
icons[582] = Array('fa-venus', 'Venus');
icons[583] = Array('fa-venus-double', 'Venus Double');
icons[584] = Array('fa-venus-mars', 'Venus Mars');
icons[585] = Array('fa-viacoin', 'Via Coin');
icons[586] = Array('fa-whatsapp', 'Whatsapp');
icons.sort();
var fontawesomeIcons = '';
for (var i = 0; i < icons.length; i++) {
    var newTitle = '';
    var ctr = 0;
    var title = icons[i][1];
    title = title.split(' ');
    for (var x = 0; x < title.length; x++) {
        ctr++;
        newTitle += ctr == 3 ? '<br />' : '';
        newTitle += title[x] + ' ';
        ctr = ctr == 3 ? 0 : ctr;
    }
    fontawesomeIcons += '<a href="#" onclick="klik(this);return false;" title="fa ' + icons[i][0] + '"><span class="fa ' + icons[i][0] + '"></span><div>' + newTitle + '</div></a>';
};

function klik(el) {
    document.getElementsByClassName('fontawesomeClass')[0].getElementsByTagName('input')[0].value = el.getAttribute('title');
    a = document.getElementById('fontawesome');
    a = a.getElementsByTagName('a');
    for (i = 0; i < a.length; i++) {
        a[i].className = '';
    }
    el.className += 'active';
};

function searchIcon(val) {
    var aydi = document.getElementById('fontawesome');
    var klases = aydi.getElementsByTagName('a');
    for (var i = 0, len = klases.length, klas, klasNeym; i < len; i++) {
        klas = klases[i];
        klasNeym = klas.getAttribute('title');
        if (klasNeym && klasNeym.indexOf(val) >= 0) {
            klas.style.display = 'block';
        } else {
            klas.style.display = 'none';
        }
    }
};

function setSpanColor(color) {
    el = document.getElementById('fontawesome');
    el = el.getElementsByTagName('span');
    for (i = 0; i < el.length; i++) {
        el[i].setAttribute('style', 'color:' + color)
    }
};

function setCheckboxes() {
    klases = '';
    klases += document.getElementsByClassName('spinning')[0].getElementsByTagName('input')[0].checked ? ' fa-spin' : klases;
    klases += document.getElementsByClassName('fixedWidth')[0].getElementsByTagName('input')[0].checked ? ' fa-fw' : klases;
    klases += document.getElementsByClassName('bordered')[0].getElementsByTagName('input')[0].checked ? ' fa-border' : klases;
    klases += ' ' + document.getElementsByClassName('flippedRotation')[0].getElementsByTagName('select')[0].value;
    el = document.getElementById('fontawesome');
    el = el.getElementsByTagName('span');
    for (i = 0; i < el.length; i++) {
        el[i].className = el[i].parentNode.getAttribute('title') + klases;
    }
};

function in_array(needle, haystack) {
    for (var i in haystack) {
        if (haystack[i] == needle) return true;
    }
    return false;
};
CKEDITOR.dialog.add('fontawesomeDialog', function(editor) {
    return {
        title: 'Insert Font Awesome',
        minWidth: 600,
        minHeight: 400,
        resizable: false,
        contents: [{
            id: 'insertFontawesome',
            label: 'insertFontawesome',
            elements: [{
                type: 'hbox',
                widths: ['50%', '50%'],
                children: [{
                    type: 'hbox',
                    widths: ['75%', '25%'],
                    children: [{
                        type: 'text',
                        id: 'colorChooser',
                        className: 'colorChooser',
                        label: 'Color',
                        onKeyUp: function(e) {
                            setSpanColor(e.sender.$.value);
                        },
                        setup: function(widget) {
                            color = widget.data.color != '' ? widget.data.color : '#000000';
                            this.setValue(color);
                            setSpanColor(color);
                        },
                        commit: function(widget) {
                            widget.setData('color', this.getValue());
                        }
                    }, {
                        type: 'button',
                        label: 'Select',
                        style: 'margin-top:1.35em',
                        onClick: function() {
                            editor.getColorFromDialog(function(color) {
                                document.getElementsByClassName('colorChooser')[0].getElementsByTagName('input')[0].value = color;
                                setSpanColor(color);
                            }, this);
                        }
                    }]
                }, {
                    type: 'text',
                    id: 'size',
                    className: 'size',
                    label: 'Size',
                    setup: function(widget) {
                        this.setValue(widget.data.size);
                    },
                    commit: function(widget) {
                        widget.setData('size', this.getValue());
                    }
                }]
            }, {
                type: 'hbox',
                widths: ['25%', '25%', '25%', '25%'],
                children: [{
                    type: 'checkbox',
                    id: 'spinning',
                    className: 'spinning cke_dialog_ui_checkbox_input',
                    label: 'Spinning',
                    value: 'true',
                    setup: function(widget) {
                        var klases = widget.data.class;
                        klases = klases.split(' ');
                        document.getElementsByClassName('spinning')[0].getElementsByTagName('input')[0].checked = in_array('fa-spin', klases) ? true : false;
                        setCheckboxes();
                    },
                    onClick: function() {
                        setCheckboxes();
                    }
                }, {
                    type: 'checkbox',
                    id: 'fixedWidth',
                    className: 'fixedWidth cke_dialog_ui_checkbox_input',
                    label: 'Fixed Width',
                    value: 'true',
                    setup: function(widget) {
                        var klases = widget.data.class;
                        klases = klases.split(' ');
                        document.getElementsByClassName('fixedWidth')[0].getElementsByTagName('input')[0].checked = in_array('fa-fw', klases) ? true : false;
                        setCheckboxes();
                    },
                    onClick: function() {
                        setCheckboxes();
                    }
                }, {
                    type: 'checkbox',
                    id: 'bordered',
                    className: 'bordered cke_dialog_ui_checkbox_input',
                    label: 'Bordered',
                    value: 'true',
                    setup: function(widget) {
                        var klases = widget.data.class;
                        klases = klases.split(' ');
                        document.getElementsByClassName('bordered')[0].getElementsByTagName('input')[0].checked = in_array('fa-border', klases) ? true : false;
                        setCheckboxes();
                    },
                    onClick: function() {
                        setCheckboxes();
                    }
                }, {
                    type: 'select',
                    id: 'flippedRotation',
                    className: 'flippedRotation cke_dialog_ui_checkbox_input',
                    label: 'Flipping and Rotating',
                    items: [
                        ['Normal', ''],
                        ['Rotate 90', 'fa-rotate-90'],
                        ['Rotate 180', 'fa-rotate-180'],
                        ['Rotate 270', 'fa-rotate-270'],
                        ['Flip Horizontal', 'fa-flip-horizontal'],
                        ['Flip Vertical', 'fa-flip-vertical']
                    ],
                    setup: function(widget) {
                        this.setValue(widget.data.flippedRotation ? widget.data.flippedRotation : '');
                    },
                    commit: function(widget) {
                        widget.setData('flippedRotation', this.getValue());
                    },
                    onClick: function() {
                        setCheckboxes();
                    }
                }]
            }, {
                type: 'text',
                id: 'fontawesomeSearch',
                className: 'fontawesomeSearch cke_dialog_ui_input_text',
                label: 'Search',
                onKeyUp: function(e) {
                    searchIcon(e.sender.$.value);
                }
            }, {
                type: 'text',
                id: 'fontawesomeClass',
                className: 'fontawesomeClass',
                style: 'display:none',
                setup: function(widget) {
                    var klases = '';
                    if (widget.data.class != '') {
                        klases = widget.data.class;
                        klases = klases.split(' ');
                        in_array('fa-border', klases) ? klases.splice(klases.indexOf('fa-border'), 1) : '';
                        in_array('fa-fw', klases) ? klases.splice(klases.indexOf('fa-fw'), 1) : '';
                        in_array('fa-spin', klases) ? klases.splice(klases.indexOf('fa-spin'), 1) : '';
                        in_array('fa-rotate-90', klases) ? klases.splice(klases.indexOf('fa-rotate-90'), 1) : '';
                        in_array('fa-rotate-180', klases) ? klases.splice(klases.indexOf('fa-rotate-180'), 1) : '';
                        in_array('fa-rotate-270', klases) ? klases.splice(klases.indexOf('fa-rotate-270'), 1) : '';
                        in_array('fa-flip-horizontal', klases) ? klases.splice(klases.indexOf('fa-flip-horizontal'), 1) : '';
                        in_array('fa-flip-vertical', klases) ? klases.splice(klases.indexOf('fa-flip-vertical'), 1) : '';
                        klases = klases.join(' ');
                    }
                    this.setValue(klases);
                },
                commit: function(widget) {
                    var klases = '';
                    klases += document.getElementsByClassName('spinning')[0].getElementsByTagName('input')[0].checked ? ' fa-spin' : klases;
                    klases += document.getElementsByClassName('fixedWidth')[0].getElementsByTagName('input')[0].checked ? ' fa-fw' : klases;
                    klases += document.getElementsByClassName('bordered')[0].getElementsByTagName('input')[0].checked ? ' fa-border' : klases;
                    klases += ' ' + document.getElementsByClassName('flippedRotation')[0].getElementsByTagName('select')[0].value;
                    widget.setData('class', this.getValue() + klases);
                }
            }, {
                type: 'html',
                html: '<div id="fontawesome">' + fontawesomeIcons + '</div>'
            }]
        }],
        onOk: function() {
            glyphs = document.getElementById('fontawesome');
            glyphs = glyphs.getElementsByTagName('a');
            for (i = 0; i < glyphs.length; i++) {
                glyphs[i].firstChild.className = glyphs[i].getAttribute('title');
                glyphs[i].className = '';
                glyphs[i].style.display = '';
                glyphs[i].getElementsByTagName('span')[0].style.color = '';
            }
        }
    }
});