function searchIt() { var errors = false; q = document.search_form.q.value; if ( !isEmpty ( q ) || q == "wpisz frazę" || q.length < 3 ) { errors = true; document.search_form.q.focus(); alert ( "Proszę wpisać szukaną frazę składającą się przynajmniej z 3 znaków" ); } if ( errors == false ) { document.search_form.action="http://www.mediatop.pl/szukaj"; document.search_form.submit(); } } function clrSrch() { if ( document.search_form.q.value == "wpisz frazę" ) { document.search_form.q.value = ""; } } function searchIt2() { var errors = false; q = document.search_form2.q.value; if ( !isEmpty ( q ) || q.length < 3 ) { errors = true; document.search_form2.q.focus(); alert ( "Proszę wpisać szukaną frazę składającą się przynajmniej z 3 znaków" ); } if ( errors == false ) { document.search_form2.action="http://www.mediatop.pl/szukaj"; document.search_form2.submit(); } } function encMailto(v) { var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var m = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; v = v.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = keyStr.indexOf(v.charAt(i++)); enc2 = keyStr.indexOf(v.charAt(i++)); enc3 = keyStr.indexOf(v.charAt(i++)); enc4 = keyStr.indexOf(v.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; m = m + String.fromCharCode(chr1); if (enc3 != 64) { m = m + String.fromCharCode(chr2); } if (enc4 != 64) { m = m + String.fromCharCode(chr3); } } while (i < v.length); location.href="mailto:"+m; } function pokazCzas() { month = new Array ("stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia") day = new Array ("Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota") var now=new Date() var years=now.getFullYear() var months=now.getMonth() var days=now.getDay() var day_n=now.getDate() var hrs=now.getHours() var min=now.getMinutes() var sec=now.getSeconds() if (hrs<10) { hrs="0"+hrs } if (min<10) { min="0"+min } if (sec<10) { sec="0"+sec } document.getElementById("zegar").innerHTML=day[days]+", "+day_n+" "+month[months]+" "+years // document.getElementById("zegar2").innerHTML=day[days]+", "+day_n+" "+month[months]+" "+years // document.getElementById("zegar3").innerHTML=day[days]+", "+day_n+" "+month[months]+" "+years setTimeout("pokazCzas()",6000) } function clrLg() { if ( document.login_form.lg.value == "login" ) { document.login_form.lg.value = ""; } } function clrPw() { if ( document.login_form.pw.value == "hasło" ) { document.getElementById("pass_field").innerHTML=""; delayPWfocus(); } } function delayPWfocus() { setTimeout("setPWfocus()", 10); } function setPWfocus() { document.login_form.pw.focus(); } function clrEmail() { if ( document.newsletter_form.email.value == "e-mail" ) { document.newsletter_form.email.value = ""; } } function pollValidate() { var cnt = -1; var btn = document.poll_form.pool_vote; for (var i=btn.length-1; i > -1; i--) { if (btn[i].checked) {cnt = i; i = -1;} } if (cnt > -1) { document.poll_form.action = "http://www.mediatop.pl/pool_vote"; document.poll_form.submit(); } else { alert ("Przed oddaniem głosu proszę wybrać odpowiedź"); return; } } function showFAQ(nr) { if (document.layers) { current = (document.layers[nr].display == 'none') ? 'block' : 'none'; document.layers[nr].display = current; } else if (document.all) { current = (document.all[nr].style.display == 'none') ? 'block' : 'none'; document.all[nr].style.display = current; } else if (document.getElementById) { vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none'; document.getElementById(nr).style.display = vista; } } function showPoll(poll_nr) { move_x = ((screen.width / 2) - 320); move_y = ((screen.height / 2) - 125); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('http://www.mediatop.pl/pokaz_sonde,"+poll_nr+"', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=250,left = "+move_x+",top = "+move_y+"');"); } function displayPoll(poll_nr) { move_x = ((screen.width / 2) - 320); move_y = ((screen.height / 2) - 125); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('http://www.mediatop.pl/oddaj_glos,"+poll_nr+"', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=250,left = "+move_x+",top = "+move_y+"');"); } function isEmpty(v) { var re = /^\s{1,}$/g; if ((v.length==0) || (v==null) || ((v.search(re)) > -1)) { return false; } else { return true; } } function isNumeric(v) { var ValidChars = "0123456789."; var IsNumber=true; var Char; var j=0; for (i = 0; i < v.length && IsNumber == true; i++) { Char = v.charAt(i); if (ValidChars.indexOf(Char) == -1) { return false; } if (Char==".") { j++; if (j>1) { return false; } } if (v.charAt(v.length-1)=="." || v.charAt(0)=="." ) { return false; } } return true; } function doRegister1() { errors = false; var fname = document.register.fname.value; if ( !isEmpty (fname) ) { errors = true; alert ("Nie wypełniono pola: \"Imię\""); document.register.fname.focus(); return; } var sname = document.register.sname.value; if ( !isEmpty (sname) ) { errors = true; alert ("Nie wypełniono pola: \"Nazwisko\""); document.register.sname.focus(); return; } var id_nr = document.register.id_nr.value; if ( !isEmpty (id_nr) ) { errors = true; alert ("Nie wypełniono pola: \"Numer dowodu osobistego\""); document.register.id_nr.focus(); return; } var pesel = document.register.pesel.value; if ( !isEmpty (pesel) ) { errors = true; alert ("Nie wypełniono pola: \"PESEL\""); document.register.pesel.focus(); return; } var pcode = document.register.pcode.value; if ( !isEmpty (pcode) ) { errors = true; alert ("Nie wypełniono pola: \"Kod pocztowy\""); document.register.pcode.focus(); return; } var city = document.register.city.value; if ( !isEmpty (city) ) { errors = true; alert ("Nie wypełniono pola: \"Miejscowość\""); document.register.city.focus(); return; } var street = document.register.street.value; if ( !isEmpty (street) ) { errors = true; alert ("Nie wypełniono pola: \"Ulica\""); document.register.street.focus(); return; } var nr = document.register.nr.value; if ( !isEmpty (nr) ) { errors = true; alert ("Nie wypełniono pola: \"Numer lokalu\""); document.register.nr.focus(); return; } var phone = document.register.phone.value; var cell = document.register.cell.value; if ( !isEmpty (phone) && !isEmpty (cell) ) { errors = true; alert ("Nie wypołniono pola: \"Telefon stacjonarny\" lub \"Telefon komórkowy\"."); return; } var email = document.register.email.value; if ( !isEmpty (email) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.register.email.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email) || email.lastIndexOf("@")!= email.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.register.email.focus(); return; } } var position = document.register.position.value; if ( !isEmpty (position) ) { errors = true; alert ("Nie wypełniono pola: \"Stanowisko\""); document.register.position.focus(); return; } var name = document.register.name.value; if ( !isEmpty (name) ) { errors = true; alert ("Nie wypełniono pola: \"Nazwa\""); document.register.name.focus(); return; } var trade = document.register.trade.value; if ( !isEmpty (trade) ) { errors = true; alert ("Nie wypełniono pola: \"Branża\""); document.register.trade.focus(); return; } var nip = document.register.nip.value; if ( !isEmpty (nip) ) { errors = true; alert ("Nie wypełniono pola: \"NIP\""); document.register.nip.focus(); return; } var regon = document.register.regon.value; if ( !isEmpty (regon) ) { errors = true; alert ("Nie wypełniono pola: \"Regon\""); document.register.regon.focus(); return; } var pcode2 = document.register.pcode2.value; if ( !isEmpty (pcode2) ) { errors = true; alert ("Nie wypełniono pola: \"Kod pocztowy\""); document.register.pcode2.focus(); return; } var city2 = document.register.city2.value; if ( !isEmpty (city2) ) { errors = true; alert ("Nie wypełniono pola: \"Miejscowość\""); document.register.city2.focus(); return; } var street2 = document.register.street2.value; if ( !isEmpty (street2) ) { errors = true; alert ("Nie wypełniono pola: \"Ulica\""); document.register.street2.focus(); return; } var nr2 = document.register.nr2.value; if ( !isEmpty (nr2) ) { errors = true; alert ("Nie wypełniono pola: \"Numer lokalu\""); document.register.nr2.focus(); return; } var phone2 = document.register.phone2.value; if ( !isEmpty (phone2) ) { errors = true; alert ("Nie wypełniono pola: \"Numer telefonu\""); document.register.phone2.focus(); return; } var email2 = document.register.email2.value; if ( !isEmpty (email2) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.register.email2.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email) || email.lastIndexOf("@")!= email.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.register.email.focus(); return; } } var agreement = document.register.agreement.checked; if ( !agreement ) { errors = true; alert ("Aby się zarejestrować musisz zapoznać się z regulaminem KRU oraz regulaminem banku utworów"); return; } if ( errors == false ) { document.register.action = "http://www.mediatop.pl/bank_utworow,zarejestruj"; document.register.submit(); } } function doRegister2() { errors = false; var fname = document.register.fname.value; if ( !isEmpty (fname) ) { errors = true; alert ("Nie wypełniono pola: \"Imię\""); document.register.fname.focus(); return; } var sname = document.register.sname.value; if ( !isEmpty (sname) ) { errors = true; alert ("Nie wypełniono pola: \"Nazwisko\""); document.register.sname.focus(); return; } var email = document.register.email.value; if ( !isEmpty (email) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.register.email.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email) || email.lastIndexOf("@")!= email.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.register.email.focus(); return; } } var id_nr = document.register.id_nr.value; if ( !isEmpty (id_nr) ) { errors = true; alert ("Nie wypełniono pola: \"Numer dowodu osobistego\""); document.register.id_nr.focus(); return; } var pesel = document.register.pesel.value; if ( !isEmpty (pesel) ) { errors = true; alert ("Nie wypełniono pola: \"PESEL\""); document.register.pesel.focus(); return; } var company = document.register.company.value; if ( !isEmpty (company) ) { errors = true; alert ("Nie wypełniono pola: \"Nazwa reprezentowanej firmy\""); document.register.company.focus(); return; } var fee_nr = document.register.fee_nr.value; if ( !isEmpty (fee_nr) ) { errors = true; alert ("Nie wypełniono pola: \"Numer abonamentu\""); document.register.fee_nr.focus(); return; } var agreement = document.register.agreement.checked; if ( !agreement ) { errors = true; alert ("Aby się zarejestrować musisz zapoznać się z regulaminem KRU oraz regulaminem banku utworów"); return; } if ( errors == false ) { document.register.action = "http://www.mediatop.pl/bank_utworow,zarejestruj"; document.register.submit(); } } function doRegister3() { errors = false; var fname = document.register.fname.value; if ( !isEmpty (fname) ) { errors = true; alert ("Nie wypełniono pola: \"Imię\""); document.register.fname.focus(); return; } var sname = document.register.sname.value; if ( !isEmpty (sname) ) { errors = true; alert ("Nie wypełniono pola: \"Nazwisko\""); document.register.sname.focus(); return; } var job = document.register.job.value; if ( !isEmpty (job) ) { errors = true; alert ("Nie wypełniono pola: \"Zawód\""); document.register.job.focus(); return; } var job_address = document.register.job_address.value; if ( !isEmpty (job_address) ) { errors = true; alert ("Nie wypełniono pola: \"Miejsce pracy\""); document.register.job_address.focus(); return; } var position = document.register.position.value; if ( !isEmpty (position) ) { errors = true; alert ("Nie wypełniono pola: \"Stanowisko\""); document.register.position.focus(); return; } var id_nr = document.register.id_nr.value; if ( !isEmpty (id_nr) ) { errors = true; alert ("Nie wypełniono pola: \"Numer dowodu osobistego\""); document.register.id_nr.focus(); return; } var pesel = document.register.pesel.value; if ( !isEmpty (pesel) ) { errors = true; alert ("Nie wypełniono pola: \"PESEL\""); document.register.pesel.focus(); return; } var pcode = document.register.pcode.value; if ( !isEmpty (pcode) ) { errors = true; alert ("Nie wypełniono pola: \"Kod pocztowy\""); document.register.pcode.focus(); return; } var city = document.register.city.value; if ( !isEmpty (city) ) { errors = true; alert ("Nie wypełniono pola: \"Miejscowość\""); document.register.city.focus(); return; } var street = document.register.street.value; if ( !isEmpty (street) ) { errors = true; alert ("Nie wypełniono pola: \"Ulica\""); document.register.street.focus(); return; } var nr = document.register.nr.value; if ( !isEmpty (nr) ) { errors = true; alert ("Nie wypełniono pola: \"Numer lokalu\""); document.register.nr.focus(); return; } var phone = document.register.phone.value; var cell = document.register.cell.value; if ( !isEmpty (phone) && !isEmpty (cell) ) { errors = true; alert ("Nie wypołniono pola: \"Telefon stacjonarny\" lub \"Telefon komórkowy\"."); return; } var email = document.register.email.value; if ( !isEmpty (email) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.register.email.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email) || email.lastIndexOf("@")!= email.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.register.email.focus(); return; } } var agreement = document.register.agreement.checked; if ( !agreement ) { errors = true; alert ("Aby się zarejestrować musisz zapoznać się z regulaminem KRU oraz regulaminem banku utworów"); return; } if ( errors == false ) { document.register.action = "http://www.mediatop.pl/bank_utworow,zarejestruj"; document.register.submit(); } } function doRegister4() { errors = false; var login = document.register.login.value; if ( !isEmpty (login) ) { errors = true; alert ("Nie wypełniono pola: \"Login\""); document.register.login.focus(); return; } var login = document.getElementById('login_v').innerHTML; if ( login != "" ) { alert ("Popraw pole \"Login\""); return; } var pass1 = document.register.pass1.value; if ( !isEmpty (pass1) ) { errors = true; alert ("Nie wypełniono pola: \"Hasło\""); document.register.pass1.focus(); return; } if ( pass1.length < 6 ) { errors = true; alert ("Hasło powinno się składać minimum z 6 znaków"); document.register.pass1.value = ""; document.register.pass2.value = ""; document.register.pass1.focus(); return; } var pass2 = document.register.pass2.value; if ( !isEmpty (pass2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz hasło\""); document.register.pass2.focus(); return; } if ( pass2.length < 6 ) { errors = true; alert ("Hasło powinno się składać minimum z 6 znaków"); document.register.pass1.value = ""; document.register.pass2.value = ""; document.register.pass1.focus(); return; } if ( pass1 != pass2 ) { errors = true; alert ("Hasła różnią się od siebie. Proszę je poprawić."); document.register.pass1.value = ""; document.register.pass2.value = ""; document.register.pass1.focus(); return; } var email1 = document.register.email1.value; if ( !isEmpty (email1) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.register.email1.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email1) || email1.lastIndexOf("@")!= email1.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.register.email1.focus(); return; } } var email = document.getElementById('email1_v').innerHTML; if ( email != "" ) { alert ("Popraw pole \"e-mail\""); return; } var email2 = document.register.email2.value; if ( !isEmpty (email2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz e-mail\""); document.register.email2.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email2) || email2.lastIndexOf("@")!= email2.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.register.email2.focus(); return; } } if ( email1 != email2 ) { errors = true; alert ("Wpisane adresy \"e-mail\" różnią się od siebie"); document.register.email1.focus(); return; } var gender = document.register.gender.selectedIndex; if ( gender == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Płeć\""); document.register.gender.focus(); return; } var province = document.register.province.selectedIndex; if ( province == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Województwo\""); document.register.province.focus(); return; } var city = document.register.city.value; if ( !isEmpty (city) ) { errors = true; alert ("Nie wypełniono pola: \"Miejscowość\""); document.register.city.focus(); return; } var city_size = document.register.city_size.selectedIndex; if ( city_size == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Wielkość miejscowości\""); document.register.city_size.focus(); return; } var trade = document.register.trade.selectedIndex; if ( trade == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Branża\""); document.register.trade.focus(); return; } var job = document.register.job.selectedIndex; if ( job == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Zawód\""); document.register.job.focus(); return; } var interests = document.register.interests.selectedIndex; if ( interests == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Zainteresowania\""); document.register.interests.focus(); return; } var education = document.register.education.selectedIndex; if ( education == 0 ) { errors = true; alert ("Nie wypełniono pola: \"Wykształcenie\""); document.register.education.focus(); return; } var agreement = document.register.agreement.checked; if ( !agreement ) { errors = true; alert ("Aby się zarejestrować, musisz zaznaczyć że zapoznałeś /aś się z regulaminem Krajowego Rejestru Utworów i go akceptujesz."); return; } if ( errors == false ) { document.register.action = "http://www.mediatop.pl/zarejestruj"; document.register.submit(); } } function updateProfile4() { errors = false; var old_pass = document.profile.old_pass.value; var pass1 = document.profile.pass1.value; var pass2 = document.profile.pass2.value; if ( isEmpty (old_pass) || isEmpty (pass1) || isEmpty (pass2) ) { if ( !isEmpty (old_pass) ) { errors = true; alert ("Nie wypełniono pola: \"Bieżące hasło\""); document.profile.old_pass.focus(); return; } if ( !isEmpty (pass1) ) { errors = true; alert ("Nie wypełniono pola: \"Nowe hasło\""); document.profile.pass1.focus(); return; } if ( !isEmpty (pass2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz nowe hasło\""); document.profile.pass2.focus(); return; } if ( pass1.length < 6 || pass2.length < 6 ) { errors = true; alert ("Hasło powinno się składać minimum z 6 znaków"); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } if ( pass1 != pass2 ) { errors = true; alert ("Hasła różnią się od siebie. Proszę je poprawić."); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } } var email1 = document.profile.new_email1.value; if ( !isEmpty (email1) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.profile.new_email1.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email1) || email1.lastIndexOf("@")!= email1.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.profile.new_email1.focus(); return; } } var email = document.getElementById('new_email1_v').innerHTML; if ( email != "" ) { alert ("Popraw pole \"e-mail\""); document.profile.new_email1.focus(); return; } var email2 = document.profile.new_email2.value; if ( !isEmpty (email2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz e-mail\""); document.profile.new_email2.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email2) || email2.lastIndexOf("@")!= email2.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.profile.new_email2.focus(); return; } } if ( email1 != email2 ) { errors = true; alert ("Wpisane adresy \"e-mail\" różnią się od siebie"); document.profile.new_email1.focus(); return; } var city = document.profile.city.value; if ( !isEmpty (city) ) { errors = true; alert ("Nie wypełniono pola: \"Miejscowość\""); document.profile.city.focus(); return; } var agreement = document.profile.agreement.checked; if ( !agreement ) { errors = true; alert ("Aby uaktualnić profil, musisz zaznaczyć że zapoznałeś /aś się z regulaminem Krajowego Rejestru Utworów i go akceptujesz."); return; } if ( errors == false ) { document.profile.action = "http://www.mediatop.pl/konto_aktualizuj"; document.profile.submit(); } } function updateProfile5() { errors = false; var old_pass = document.profile.old_pass.value; var pass1 = document.profile.pass1.value; var pass2 = document.profile.pass2.value; if ( isEmpty (old_pass) || isEmpty (pass1) || isEmpty (pass2) ) { if ( !isEmpty (old_pass) ) { errors = true; alert ("Nie wypełniono pola: \"Bieżące hasło\""); document.profile.old_pass.focus(); return; } if ( !isEmpty (pass1) ) { errors = true; alert ("Nie wypełniono pola: \"Nowe hasło\""); document.profile.pass1.focus(); return; } if ( !isEmpty (pass2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz nowe hasło\""); document.profile.pass2.focus(); return; } if ( pass1.length < 6 || pass2.length < 6 ) { errors = true; alert ("Hasło powinno się składać minimum z 6 znaków"); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } if ( pass1 != pass2 ) { errors = true; alert ("Hasła różnią się od siebie. Proszę je poprawić."); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } } var email1 = document.profile.new_email1.value; if ( !isEmpty (email1) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.profile.new_email1.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email1) || email1.lastIndexOf("@")!= email1.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.profile.new_email1.focus(); return; } } var email = document.getElementById('new_email1_v').innerHTML; if ( email != "" ) { alert ("Popraw pole \"e-mail\""); document.profile.new_email1.focus(); return; } var email2 = document.profile.new_email2.value; if ( !isEmpty (email2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz e-mail\""); document.profile.new_email2.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email2) || email2.lastIndexOf("@")!= email2.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.profile.new_email2.focus(); return; } } if ( email1 != email2 ) { errors = true; alert ("Wpisane adresy \"e-mail\" różnią się od siebie"); document.profile.new_email1.focus(); return; } var agreement = document.profile.agreement.checked; if ( !agreement ) { errors = true; alert ("Aby uaktualnić profil, musisz zaznaczyć że zapoznałeś /aś się z regulaminem Krajowego Rejestru Utworów i go akceptujesz."); return; } if ( errors == false ) { document.profile.action = "http://www.mediatop.pl/konto_aktualizuj"; document.profile.submit(); } } function doLogin() { errors = false; var lg = document.login_form.lg.value; if ( !isEmpty (lg) || lg == "login" ) { errors = true; alert ("Nie wypełniono pola: \"login\""); document.login_form.lg.focus(); return; } var pw = document.login_form.pw.value; if ( !isEmpty (pw) || pw == "hasło" ) { errors = true; alert ("Nie wypełniono pola: \"hasło\""); document.login_form.pw.focus(); return; } if ( errors == false ) { document.login_form.action = "http://www.mediatop.pl/zaloguj"; document.login_form.submit(); } } function doLoginBank() { errors = false; var lg = document.login_form_bank.lg.value; if ( !isEmpty (lg) ) { errors = true; alert ("Nie wypełniono pola: \"login\""); document.login_form_bank.lg.focus(); return; } var pw = document.login_form_bank.pw.value; if ( !isEmpty (pw) ) { errors = true; alert ("Nie wypełniono pola: \"hasło\""); document.login_form_bank.pw.focus(); return; } if ( errors == false ) { document.login_form_bank.action = "http://www.mediatop.pl/zaloguj"; document.login_form_bank.submit(); } } function osadKolezenski(vote,bank_id,uid) { move_x = ((screen.width / 2) - 88); move_y = ((screen.height / 2) - 125); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('http://www.mediatop.pl/osad_kolezenski_glos,"+bank_id+","+vote+","+uid+"', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=176,height=250,left = "+move_x+",top = "+move_y+"');"); } function closePoll() { setTimeout ( "closePollWindow()", 1500 ); } function closePollWindow() { window.opener.location.reload(); self.close(); } function popUp(URL) { resx = (screen.width - 400) / 2; resy = (screen.height - 300) / 2; day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0, menubar=0,resizable=1,width=400,height=300,left = "+resx+",top = "+resy+"');"); } function popUpFS(URL) { resx = screen.width; resy = screen.height; day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1, menubar=1,resizable=1,width="+resx+",height="+resy+",left = 0,top = 0');"); } function showPicture(id,c) { popUp('http://www.mediatop.pl/pokaz_zdjecie,'+id+','+c); } function showGallery(n_id,p_id) { popUp('http://www.mediatop.pl/pokaz_galerie,'+n_id+','+p_id); } function expandComment(id) { var xml = null; var resp = document.getElementById('comment_'+id); resp.innerHTML = "wczytuję..."; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/expandcomment,"+id, true); xml.send(null); } changeSubject(id); return false; } function changeSubject(id) { var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb,"+id, true); xml.send(null); } return false; } function shrinkComment(id) { var resp = document.getElementById('comment_'+id); var shrink = resp.innerHTML.substring(0,150)+" (...)"; resp.innerHTML = shrink; var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb,"+id, true); xml.send(null); } } function trimComment() { if ( document.comments.comment.value.length > 2000 ) { document.comments.comment.value=document.comments.comment.value.substring(0,2000); document.comments.comment.scrollTop=document.comments.comment.scrollHeight; } } function addComment() { trimComment(); errors = false; var subject = document.comments.comment_subject.value; if ( !isEmpty (subject) ) { errors = true; alert ("Proszę wpisać temat"); document.comments.comment_subject.focus(); return; } var comment = document.comments.comment.value; if ( !isEmpty (comment) ) { errors = true; alert ("Proszę wpisać komentarz"); document.comments.comment.focus(); return; } if ( document.comments.comment_author ) { var author = document.comments.comment_author.value; if ( !isEmpty (author) ) { errors = true; alert ("Proszę się podpisać"); document.comments.comment_author.focus(); return; } } if ( errors == false ) { document.comments.action = "http://www.mediatop.pl/comment_add"; document.comments.submit(); } } function expandCommentArt(id) { var xml = null; var resp = document.getElementById('comment_'+id); resp.innerHTML = "wczytuję..."; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/expandcomment_art,"+id, true); xml.send(null); } changeSubjectArt(id); return false; } function changeSubjectArt(id) { var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_art,"+id, true); xml.send(null); } return false; } function shrinkCommentArt(id) { var resp = document.getElementById('comment_'+id); var shrink = resp.innerHTML.substring(0,150)+" (...)"; resp.innerHTML = shrink; var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_art,"+id, true); xml.send(null); } } function addCommentArt() { trimComment(); errors = false; var subject = document.comments.comment_subject.value; if ( !isEmpty (subject) ) { errors = true; alert ("Proszę wpisać temat"); document.comments.comment_subject.focus(); return; } var comment = document.comments.comment.value; if ( !isEmpty (comment) ) { errors = true; alert ("Proszę wpisać komentarz"); document.comments.comment.focus(); return; } if ( document.comments.comment_author ) { var author = document.comments.comment_author.value; if ( !isEmpty (author) ) { errors = true; alert ("Proszę się podpisać"); document.comments.comment_author.focus(); return; } } if ( errors == false ) { document.comments.action = "http://www.mediatop.pl/comment_add_art"; document.comments.submit(); } } function expandCommentRev(id) { var xml = null; var resp = document.getElementById('comment_'+id); resp.innerHTML = "wczytuję..."; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/expandcomment_rev,"+id, true); xml.send(null); } changeSubjectRev(id); return false; } function changeSubjectRev(id) { var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_rev,"+id, true); xml.send(null); } return false; } function shrinkCommentRev(id) { var resp = document.getElementById('comment_'+id); var shrink = resp.innerHTML.substring(0,150)+" (...)"; resp.innerHTML = shrink; var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_rev,"+id, true); xml.send(null); } } function addCommentRev() { trimComment(); errors = false; var subject = document.comments.comment_subject.value; if ( !isEmpty (subject) ) { errors = true; alert ("Proszę wpisać temat"); document.comments.comment_subject.focus(); return; } var comment = document.comments.comment.value; if ( !isEmpty (comment) ) { errors = true; alert ("Proszę wpisać komentarz"); document.comments.comment.focus(); return; } if ( document.comments.comment_author ) { var author = document.comments.comment_author.value; if ( !isEmpty (author) ) { errors = true; alert ("Proszę się podpisać"); document.comments.comment_author.focus(); return; } } if ( errors == false ) { document.comments.action = "http://www.mediatop.pl/comment_add_rev"; document.comments.submit(); } } function expandCommentBank(id) { var xml = null; var resp = document.getElementById('comment_'+id); resp.innerHTML = "wczytuję..."; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/expandcomment_bank,"+id, true); xml.send(null); } changeSubjectBank(id); return false; } function changeSubjectBank(id) { var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_bank,"+id, true); xml.send(null); } return false; } function shrinkCommentBank(id) { var resp = document.getElementById('comment_'+id); var shrink = resp.innerHTML.substring(0,150)+" (...)"; resp.innerHTML = shrink; var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_bank,"+id, true); xml.send(null); } } function addCommentBank() { trimComment(); errors = false; var subject = document.comments.comment_subject.value; if ( !isEmpty (subject) ) { errors = true; alert ("Proszę wpisać temat"); document.comments.comment_subject.focus(); return; } var comment = document.comments.comment.value; if ( !isEmpty (comment) ) { errors = true; alert ("Proszę wpisać komentarz"); document.comments.comment.focus(); return; } if ( document.comments.comment_author ) { var author = document.comments.comment_author.value; if ( !isEmpty (author) ) { errors = true; alert ("Proszę się podpisać"); document.comments.comment_author.focus(); return; } } if ( errors == false ) { document.comments.action = "http://www.mediatop.pl/comment_add_bank"; document.comments.submit(); } } function expandCommentJudgement(id) { var xml = null; var resp = document.getElementById('comment_'+id); resp.innerHTML = "wczytuję..."; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/expandcomment_judgement,"+id, true); xml.send(null); } changeSubjectJudgement(id); return false; } function changeSubjectJudgement(id) { var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_judgement,"+id, true); xml.send(null); } return false; } function shrinkCommentJudgement(id) { var resp = document.getElementById('comment_'+id); var shrink = resp.innerHTML.substring(0,150)+" (...)"; resp.innerHTML = shrink; var xml = null; var resp = document.getElementById('expandComment_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_judgement,"+id, true); xml.send(null); } } function addCommentJudgement() { trimComment(); errors = false; var subject = document.comments.comment_subject.value; if ( !isEmpty (subject) ) { errors = true; alert ("Proszę wpisać temat"); document.comments.comment_subject.focus(); return; } var comment = document.comments.comment.value; if ( !isEmpty (comment) ) { errors = true; alert ("Proszę wpisać komentarz"); document.comments.comment.focus(); return; } if ( document.comments.comment_author ) { var author = document.comments.comment_author.value; if ( !isEmpty (author) ) { errors = true; alert ("Proszę się podpisać"); document.comments.comment_author.focus(); return; } } if ( errors == false ) { document.comments.action = "http://www.mediatop.pl/comment_add_judgement"; document.comments.submit(); } } function showRSS(nr) { if (document.layers) { for (i=1; i < 4; i++) { if ( nr == i ) { document.layers["rss_"+i].display = 'block'; document.layers["rss_title_"+i].style.fontWeight = 'bold'; } else { document.layers["rss_"+i].display = 'none'; document.layers["rss_title_"+i].style.fontWeight = 'normal'; } } } else if (document.all) { for (i=1; i < 4; i++) { if ( nr == i ) { document.all["rss_"+i].style.display = 'block'; document.all["rss_title_"+i].style.fontWeight = 'bold'; } else { document.all["rss_"+i].style.display = 'none'; document.all["rss_title_"+i].style.fontWeight = 'normal'; } } } else if (document.getElementById) { for (i=1; i < 4; i++) { if ( nr == i ) { document.getElementById("rss_"+i).style.display = 'block'; document.getElementById("rss_title_"+i).style.fontWeight = 'bold'; } else { document.getElementById("rss_"+i).style.display = 'none'; document.getElementById("rss_title_"+i).style.fontWeight = 'normal'; } } } } function chngRmdSubCat(nr) { if (document.layers) { document.layers["reminder_0"].display = 'none'; for (i=0; i < 4; i++) { document.layers["reminder_"+i].display = 'none'; document.layers["reminderSubLink_"+i].style.fontWeight = 'normal'; } document.layers["reminder_"+nr].display = 'block'; document.layers["reminderSubLink_"+nr].style.fontWeight = 'bold'; } else if (document.all) { document.all["reminder_0"].style.display = 'none'; for (i=0; i < 4; i++) { document.all["reminder_"+i].style.display = 'none'; document.all["reminderSubLink_"+i].style.fontWeight = 'normal'; } document.all["reminder_"+nr].style.display = 'block'; document.all["reminderSubLink_"+nr].style.fontWeight = 'bold'; } else if (document.getElementById) { document.getElementById("reminder_0").style.display = 'none'; for (i=0; i < 4; i++) { document.getElementById("reminder_"+i).style.display = 'none'; document.getElementById("reminderSubLink_"+i).style.fontWeight = 'normal'; } document.getElementById("reminder_"+nr).style.display = 'block'; document.getElementById("reminderSubLink_"+nr).style.fontWeight = 'bold'; } } function showLeague(nr) { if (document.layers) { if ( nr == 1 || nr == 2 ) { document.layers["league_title_1"].style.fontWeight = 'bold'; document.layers["league_title_2"].style.fontWeight = 'normal'; document.layers["league_title_3"].style.fontWeight = 'normal'; } else if ( nr == 3 || nr == 4 ) { document.layers["league_title_1"].style.fontWeight = 'normal'; document.layers["league_title_2"].style.fontWeight = 'bold'; document.layers["league_title_3"].style.fontWeight = 'normal'; } else if ( nr == 5 || nr == 6 ) { document.layers["league_title_1"].style.fontWeight = 'normal'; document.layers["league_title_2"].style.fontWeight = 'normal'; document.layers["league_title_3"].style.fontWeight = 'bold'; } for (i=1; i < 7; i++) { if ( nr == i ) { document.layers["league_"+i].display = 'block'; } else { document.layers["league_"+i].display = 'none'; } } } else if (document.all) { if ( nr == 1 || nr == 2 ) { document.all["league_title_1"].style.fontWeight = 'bold'; document.all["league_title_2"].style.fontWeight = 'normal'; document.all["league_title_3"].style.fontWeight = 'normal'; } else if ( nr == 3 || nr == 4 ) { document.all["league_title_1"].style.fontWeight = 'normal'; document.all["league_title_2"].style.fontWeight = 'bold'; document.all["league_title_3"].style.fontWeight = 'normal'; } else if ( nr == 5 || nr == 6 ) { document.all["league_title_1"].style.fontWeight = 'normal'; document.all["league_title_2"].style.fontWeight = 'normal'; document.all["league_title_3"].style.fontWeight = 'bold'; } for (i=1; i < 7; i++) { if ( nr == i ) { document.all["league_"+i].style.display = 'block'; } else { document.all["league_"+i].style.display = 'none'; } } } else if (document.getElementById) { if ( nr == 1 || nr == 2 ) { document.getElementById("league_title_1").style.fontWeight = 'bold'; document.getElementById("league_title_2").style.fontWeight = 'normal'; document.getElementById("league_title_3").style.fontWeight = 'normal'; } else if ( nr == 3 || nr == 4 ) { document.getElementById("league_title_1").style.fontWeight = 'normal'; document.getElementById("league_title_2").style.fontWeight = 'bold'; document.getElementById("league_title_3").style.fontWeight = 'normal'; } else if ( nr == 5 || nr == 6 ) { document.getElementById("league_title_1").style.fontWeight = 'normal'; document.getElementById("league_title_2").style.fontWeight = 'normal'; document.getElementById("league_title_3").style.fontWeight = 'bold'; } for (i=1; i < 7; i++) { if ( nr == i ) { document.getElementById("league_"+i).style.display = 'block'; } else { document.getElementById("league_"+i).style.display = 'none'; } } } } function leagueNotVote() { alert ( "Aby oddać głos musisz być zalogowany" ); return; } function leagueVote(vote, id) { var errors = false; var league_form_name = document.getElementById("league_vote_"+id); if ( league_form_name.id.selectedIndex == 0 ) { errors = true; alert ( "Proszę wybrać osobę na którą chcesz oddać głos" ); return; } else { league_form_name.vote.value = vote; setTimeout ( "leagueVoteSubmit("+id+")", 100 ); } } function leagueVoteSubmit(id) { var league_form_name = document.getElementById("league_vote_"+id); league_form_name.action = "http://www.mediatop.pl/liga_branzowa_glosuj"; league_form_name.submit(); } function leagueAdd(id) { var league_form_name = document.getElementById("add_league_"+id); if ( !isEmpty ( league_form_name.league_name.value ) || league_form_name.league_name.value == "Twoja propozycja" ) { alert ( "Proszę wpisać swoją propozycję." ); league_form_name.league_name.focus(); return; } else { league_form_name.action = "http://www.mediatop.pl/liga_branzowa_dodaj"; league_form_name.submit(); } } function leagueClr(id) { var league_form_name = document.getElementById("add_league_"+id); if ( league_form_name.league_name.value == "Twoja propozycja" ) { league_form_name.league_name.value = ""; } } function showFull(art_id, category) { move_x = ((screen.width / 2) - 400); move_y = ((screen.height / 2) - 300); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('http://www.mediatop.pl/"+category+"_pelny,"+art_id+"', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = "+move_x+",top = "+move_y+"');"); } function printIt(art_id, category) { move_x = ((screen.width / 2) - 400); move_y = ((screen.height / 2) - 300); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('http://www.mediatop.pl/"+category+"_drukuj,"+art_id+"', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = "+move_x+",top = "+move_y+"');"); } function sendIt(art_id, art_url, category) { move_x = ((screen.width / 2) - 200); move_y = ((screen.height / 2) - 150); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('http://www.mediatop.pl/"+category+"_wyslij,"+art_id+"&url="+art_url+"', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=300,left = "+move_x+",top = "+move_y+"');"); } function sendNotify() { var errors = false; var email = document.news_send.snd_rcp_email.value; if ( !isEmpty (email) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail odbiorcy\""); document.news_send.snd_rcp_email.focus(); return; } else { chars = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; if (!chars.test(email) || email.lastIndexOf("@")!= email.indexOf("@") ) { errors = true; alert("Adres e-mail nie jest poprawny."); document.news_send.snd_rcp_email.focus(); return; } } var snd_name = document.news_send.snd_name.value; if ( !isEmpty (snd_name) ) { errors = true; alert ("Nie wypełniono pola: \"Twój podpis\""); document.news_send.snd_name.focus(); return; } var snd_code = document.news_send.snd_code.value; if ( !isEmpty (snd_code) ) { errors = true; alert ("Nie wypełniono pola: \"Kod zabezpieczający\""); document.news_send.snd_rcp_title.focus(); return; } if ( snd_code.length != 5 ) { errors = true; alert ("Pole: \"Kod zabezpieczający\" powinno zawierać 5 znaków"); document.news_send.snd_rcp_title.focus(); return; } if ( errors == false ) { document.news_send.action = "http://www.mediatop.pl/powiadomienie_wyslij"; document.news_send.submit(); } } function validateField(field) { if (field!='login' && field!='email1' && field!='new_email1') return false; var xml = null; var resp = document.getElementById(field+'_v'); var fieldValue = document.getElementById(field).value; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/"+field+","+fieldValue, true); xml.send(null); } return false; } function requestPrint() { setTimeout ( "timeoutPrint()", 1000 ); } function timeoutPrint() { self.print(); } function accountDelete() { var errors = false; var pass = document.account_delete.pass.value; if ( !isEmpty (pass) ) { errors = true; alert ("Nie wypełniono pola: \"Hasło\""); document.account_delete.pass.focus(); return; } if ( errors == false ) { conf = confirm ( "Czy na pewno chcesz usunąć swoje konto wraz z wszystkimi danymi osobowymi?" ); if ( conf ) { document.account_delete.action = "http://www.mediatop.pl/konto_usun"; document.account_delete.submit(); } } } function accountReminder() { var errors = false; var email = document.account_reminder.email.value; if ( !isEmpty (email) ) { errors = true; alert ("Nie wypełniono pola: \"e-mail\""); document.account_reminder.email.focus(); return; } if ( errors == false ) { document.account_reminder.action = "http://www.mediatop.pl/konto_przypomnij"; document.account_reminder.submit(); } } function updatePassword() { errors = false; var pass1 = document.profile.pass1.value; if ( !isEmpty (pass1) ) { errors = true; alert ("Nie wypełniono pola: \"Nowe hasło\""); document.profile.pass1.focus(); return; } if ( pass1.length < 6 ) { errors = true; alert ("Hasło powinno się składać minimum z 6 znaków"); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } var pass2 = document.profile.pass2.value; if ( !isEmpty (pass2) ) { errors = true; alert ("Nie wypełniono pola: \"Powtórz nowe hasło\""); document.profile.pass2.focus(); return; } if ( pass2.length < 6 ) { errors = true; alert ("Hasło powinno się składać minimum z 6 znaków"); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } if ( pass1 != pass2 ) { errors = true; alert ("Hasła różnią się od siebie. Proszę je poprawić."); document.profile.pass1.value = ""; document.profile.pass2.value = ""; document.profile.pass1.focus(); return; } if ( errors == false ) { document.profile.action = "http://www.mediatop.pl/konto_zmiana_hasla_ok"; document.profile.submit(); } } function enlargeCover ( cid, id ) { popUp('http://www.mediatop.pl/pokaz_okladke,'+cid+','+id); } function voteVideo(id, vote) { var resp = document.getElementById('vid_v_'+vote+'_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { if (isNumeric(xml.responseText)) { resp.innerHTML = xml.responseText; alert ("Dziękujemy za głos") } else alert ("Już oddano głos") } } xml.open("GET", "http://www.mediatop.pl/video_vote,"+id+","+vote, true); xml.send(null); } } function expandCommentVid(id) { var xml = null; var resp = document.getElementById('comment_'+id); resp.innerHTML = "wczytuję..."; if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = xml.responseText; } } xml.open("GET", "http://www.mediatop.pl/expandcomment_vid,"+id, true); xml.send(null); } changeSubjectVid(id); return false; } function changeSubjectVid(id) { var xml = null; var resp = document.getElementById('expandCommentVid_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_vid,"+id, true); xml.send(null); } return false; } function shrinkCommentVid(id) { var resp = document.getElementById('comment_'+id); var shrink = resp.innerHTML.substring(0,150)+" (...)"; resp.innerHTML = shrink; var xml = null; var resp = document.getElementById('expandCommentVid_'+id); if (window.XMLHttpRequest) xml = new XMLHttpRequest(); else if (window.ActiveXObject) xml = new ActiveXObject("Microsoft.XMLHTTP"); if (xml) { xml.onreadystatechange = function() { if (xml.readyState==4) { resp.innerHTML = '

'+xml.responseText+'

'; } } xml.open("GET", "http://www.mediatop.pl/expandcommentsb_vid,"+id, true); xml.send(null); } } function trimCommentVid() { if ( document.comments.comment.value.length > 2000 ) { document.comments.comment.value=document.comments.comment.value.substring(0,2000); document.comments.comment.scrollTop=document.comments.comment.scrollHeight; } } function addCommentVid() { trimCommentVid(); errors = false; var subject = document.comments.comment_subject.value; if ( !isEmpty (subject) ) { errors = true; alert ("Proszę wpisać temat"); document.comments.comment_subject.focus(); return; } var comment = document.comments.comment.value; if ( !isEmpty (comment) ) { errors = true; alert ("Proszę wpisać komentarz"); document.comments.comment.focus(); return; } if ( document.comments.comment_author ) { var author = document.comments.comment_author.value; if ( !isEmpty (author) ) { errors = true; alert ("Proszę się podpisać"); document.comments.comment_author.focus(); return; } } if ( document.comments.code ) { var code = document.comments.code.value; if ( !isEmpty (code) || code.length != 5 ) { errors = true; alert ("Proszę wpisać kod z obrazka"); document.comments.code.focus(); return; } } if ( errors == false ) { document.comments.action = "http://www.mediatop.pl/comment_add_vid"; document.comments.submit(); } } function reloadCode() { var image_o = new Image(); var date_o = new Date(); var m_time = date_o.getTime(); image_o.src="http://www.mediatop.pl/images/kod.php?"+m_time; document.getElementById('img_code').src = image_o.src; } function switchPAC(id) { var PACarray = new Array ('1', '2', '3', '4', '5', '6'); for (i=0; i < PACarray.length; i++) { if ( id == PACarray[i] ) { document.getElementById('ludzie_'+PACarray[i]).style.display='block'; } else { document.getElementById('ludzie_'+PACarray[i]).style.display='none'; } } } function switchCAC(id) { var CACarray = new Array ('1', '2', '3', '4', '5', '6'); for (i=0; i < CACarray.length; i++) { if ( id == CACarray[i] ) { document.getElementById('firmy_'+CACarray[i]).style.display='block'; } else { document.getElementById('firmy_'+CACarray[i]).style.display='none'; } } } var http_request = false; function makePOSTRequest(url, parameters, resultid) { var resp = document.getElementById(resultid); resp.innerHTML = '


Proszę czekać...

'; http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Nie mogę utworzyć instancji XMLHTTP'); return false; } http_request.onreadystatechange = function() { if (http_request.readyState == 4) { if (http_request.status == 200) { result = http_request.responseText; document.getElementById(resultid).innerHTML = result; } else { alert('Wystąpił problem z przetworzeniem żądania.'); } } } http_request.open('POST', url, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); http_request.send(parameters); } function startCallbackPeople() { document.getElementById('people_photo').innerHTML = '


Proszę czekać...

'; return true; } function completeCallbackPeople(response) { document.getElementById('people_photo').innerHTML = response; return true; } function deletePeoplePhoto() { makePOSTRequest("people_photo_delete.php", "", "people_photo"); } function startCallbackCompany() { document.getElementById('company_logo').innerHTML = '


Proszę czekać...

'; return true; } function completeCallbackCompany(response) { document.getElementById('company_logo').innerHTML = response; return true; } function deleteCompanyLogo() { makePOSTRequest("company_logo_delete.php", "", "company_logo"); }