window.addEvent('load', function(){ imgThumbClick(); }); function imgThumbClick(){ var divMain = $('main'); if(!divMain) return; var divTag = divMain.getElement('div.listVideo'); if(!divTag) return; var liLists = divTag.getElements('li'); if(!liLists.length) return; var divImg = divMain.getElement('div.playVideo'); if(!divImg) return; var h5Title = divMain.getElement('h5'); if(!h5Title) return; var firstVideo = divImg.getElement('a').href; divImg.setProperty('html', ''); var s1 = new SWFObject('videos/player.swf','myplayer','466','281','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam("displayheight","281"); s1.addParam("wmode", "transparent"); s1.addParam('flashvars','file='+ firstVideo +'&repeat=always&autostart=1&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0xec2c2b'); s1.write(divImg); /*liLists.each(function(liItem){ var aTags = liItem.getElements('a'); aTags.each(function(aItem){ aItem.addEvent('click', function(e){ e.stop(); s1 = new SWFObject('videos/player.swf','myplayer','466','281','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam("displayheight","281"); s1.addParam("wmode", "transparent"); s1.addParam('flashvars','file='+ aItem.href +'&repeat=always&autostart=1&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722'); s1.write(divImg); h5Title.setProperty('html', aItem.getProperty('title')); }); }); });*/ }