var PopularPhotoLoader = Class.create({ albums: [{"id":"7973","name":"Nostradamus prophecies for 2016 coming true","url":"\/photo\/album\/7973\/","imgTag":"\"Nostradamus","photoCount":"11"},{"id":"7975","name":"Airbus \u0410321 crash in Egypt: Investigation begins","url":"\/photo\/album\/7975\/","imgTag":"\"Airbus","photoCount":"7"},{"id":"7976","name":"Russia marks Unity Day","url":"\/photo\/album\/7976\/","imgTag":"\"Russia","photoCount":"9"},{"id":"7974","name":"White dwarf destroys solar system","url":"\/photo\/album\/7974\/","imgTag":"\"White","photoCount":"4"},{"id":"7969","name":"Seascapes by Francesco Gola","url":"\/photo\/album\/7969\/","imgTag":"\"Seascapes","photoCount":"8"},{"id":"7968","name":"Syrian Army goes on offensive against ISIL","url":"\/photo\/album\/7968\/","imgTag":"\"Syrian","photoCount":"7"},{"id":"7965","name":"Modern architecture: Glass","url":"\/photo\/album\/7965\/","imgTag":"\"Modern","photoCount":"9"},{"id":"7971","name":"Dubai: Arab pearl amid endless desert","url":"\/photo\/album\/7971\/","imgTag":"\"Dubai:","photoCount":"8"},{"id":"7966","name":"Accidents of the week","url":"\/photo\/album\/7966\/","imgTag":"\"Accidents","photoCount":"7"},{"id":"7963","name":"Sukhoi fighter jets finish ISIS off in Syria","url":"\/photo\/album\/7963\/","imgTag":"\"Sukhoi","photoCount":"7"},{"id":"7967","name":"Japan Maritime Self-Defense Force","url":"\/photo\/album\/7967\/","imgTag":"\"Japan","photoCount":"12"},{"id":"7970","name":"NATO holds Trident Juncture 2015 drills","url":"\/photo\/album\/7970\/","imgTag":"\"NATO","photoCount":"8"},{"id":"7870","name":"Russia's youngest fleet started in the North","url":"\/photo\/album\/7870\/","imgTag":"\"Russia","photoCount":"7"},{"id":"7937","name":"History of Russian vodka in pictures","url":"\/photo\/album\/7937\/","imgTag":"\"History","photoCount":"8"},{"id":"7943","name":"Some creatures already live eternal life","url":"\/photo\/album\/7943\/","imgTag":"\"Some","photoCount":"7"},{"id":"7948","name":"This is dog's life","url":"\/photo\/album\/7948\/","imgTag":"\"This","photoCount":"8"},{"id":"7950","name":"The main Juma Mosque of Tatarstan and Kazan","url":"\/photo\/album\/7950\/","imgTag":"\"The","photoCount":"6"},{"id":"7952","name":"Supermoon lunar eclipse: Next one in 2033","url":"\/photo\/album\/7952\/","imgTag":"\"Supermoon","photoCount":"9"},{"id":"7958","name":"Rare and never-before-seen photos of Vladimir Putin","url":"\/photo\/album\/7958\/","imgTag":"\"Rare","photoCount":"12"},{"id":"7959","name":"America in the power of natural disasters","url":"\/photo\/album\/7959\/","imgTag":"\"America","photoCount":"7"},{"id":"7961","name":"Massive floods hit France and USA","url":"\/photo\/album\/7961\/","imgTag":"\"Massive","photoCount":"8"},{"id":"7962","name":"Rusia busy with Syria, NATO busy with drills","url":"\/photo\/album\/7962\/","imgTag":"\"Rusia","photoCount":"8"}], count: 5, horizontal: true, nodeId: 'gallery-id', newWindow: false, target: '_self', url: null, initialize: function(count, horizontal, nodeId, newWindow, url) { this.count = count; this.horizontal = horizontal; if (nodeId) this.nodeId = nodeId; if (newWindow) this.newWindow = newWindow; this.target = newWindow ? '_blank' : '_self'; if (url) this.url = url; this.render(); }, render: function() { var table = new Element('table', {'class' : 'frame', 'style' : 'width:100%;font-size:12px;'}); if (this.horizontal) var row = table.insertRow(-1); var limit = this.albums.length > this.count ? this.count : this.albums.length; this.albums.shuffle(); for (var i=0; i < limit; i++) { if (!this.horizontal) var row = table.insertRow(-1); var cell = row.insertCell(-1); cell.setAttribute('valign', 'top'); if (limit == 2) cell.setAttribute('style', 'width:50%'); if (this.albums[i].imgTag) { var a = new Element('a', {'href' : ((this.url ? this.url : '')+this.albums[i].url), 'target' : this.target}); a.innerHTML = this.albums[i].imgTag; cell.appendChild(a); } var a = new Element('a', {'href' : ((this.url ? this.url : '')+this.albums[i].url), 'target' : this.target}); a.appendChild(document.createTextNode(this.albums[i].name)); cell.appendChild(a); cell.appendChild(new Element('br')); var a = new Element('a', {'href' : ((this.url ? this.url : '')+this.albums[i].url), 'class' : 'hot', 'target' : this.target}); a.appendChild(document.createTextNode('('+this.albums[i].photoCount+' photos)')); cell.appendChild(a); } $(this.nodeId).innerHTML = ''; $(this.nodeId).appendChild(table); } });