var i, pasujace = [], odnosniki = document.getElementsByTagName('*') for (i in odnosniki) { if (odnosniki[i].className === 'ytmu') { pasujace[pasujace.length] = odnosniki[i]; var pasl = pasujace.length - 1; var ele = pasujace[pasl].innerHTML; if (ele.substring(0, 4) == 'http' || ele.substring(0, 4) == 'www.') { var typ = ele.indexOf('typek='); var typo = ele.charAt(typ+6); if (typo == '1') { var wout = ' width="0" '; var hout = ' height="0" '; } if (typo == '2') { var wout = ' width="30" '; var hout = ' height="25" '; } if (typo == '3') { var wout = ' width="150" '; var hout = ' height="25" '; } if (typo == '4') { var wout = ' width="640" '; var hout = ' height="25" '; } if (ele.indexOf('youtu.be') >= 0) { var poczatek = ele.indexOf('.be/') + 4; if (ele.indexOf('&') >= 0) { var koniec = ele.indexOf('&'); var temp = ele.substring(poczatek, koniec); } else var temp = ele.substring(poczatek); var eleout = temp; } else { var poczatek = ele.indexOf('v=') + 2; if (ele.indexOf('&') >= 0) { var koniec = ele.indexOf('v=') + 13; var temp = ele.substring(poczatek, koniec); } else var temp = ele.substring(poczatek); var eleout = temp; } var ap = ele.indexOf('autoplej='); var apo = ele.charAt(ap+9); if (typo == '1') apo = '1'; var kol = ele.indexOf('kolorek='); kolx = kol+8; kolx2 = kolx+6; var kolo = ele.substring(kolx, kolx2); if (kolo != '123456') var koloo = 'color2=0x'+kolo+'&color1=0x'+kolo+'&'; else var koloo = ''; var eleoutplus = 'http://www.youtube.com/v/'+eleout+'?version=0&hl=pl_PL&fs=1&rel=0&'+koloo+'autoplay='+apo; pasujace[pasl].innerHTML = ''; if (typo == '1') { pasujace[pasl].style.position = 'relative'; pasujace[pasl].style.left = '-999px'; } } } }