var id = 0; var krajProdukcji_max_id = 0; var filmOperator_id = 0; var filmRezyser_id = 0; var filmProducent_id = 0; var filmObsada_id = 0; var filmScenariusz_id = 0; var filmMontaz_id = 0; var filmScenografia_id = 0; var filmMuzyka_id = 0; var filmFestiwal_id = 0; var szkola_id = 0; var filmOpiekun_id = 0; var firmaProd_id = 0; var firmaDystPl_id = 0; var firmaDystPoza_id = 0; firmaProdKontakt = new Array(); firmaDystPlKontakt = new Array(); firmaDystPozaKontakt = new Array(); szkolaKontakt = new Array(); firmaProdKontakt[0] = 0; firmaDystPlKontakt[0] = 0; firmaDystPozaKontakt[0] = 0; szkolaKontakt[0] = 0; function checkEmail(object) { if ( object.className != 'req' && object.className != 'bladreq' ) return; allowcheck = /^.+@.+\..+$/; if ( trim(object.value) == '' ) { alert('Wymagane pole pozostało puste. Proszę wprowadzić poprawne dane.'); object.className = 'bladreq'; } else if ( !allowcheck.test(object.value)) { object.className = 'bladreq'; alert('Wprowadzone dane są niepoprawne. Proszę sprawdzić dane i wprowadzić ponownie.'); } else { object.className = 'req'; } } Array.prototype.inArray = function(v){ for(var i in this){ if(this[i] == v){ return true;} } return false; } function additionalInfoAlert() { alert('Uwaga! Po wypełnieniu pól na dane jakiejkolwiek osoby, firmy czy festiwalu, istnieje możliwość wpisania danych kolejnej osoby (np. drugiego reżysera), firmy lub festiwalu.'); } function checkName(e) { var KeyID = (window.event) ? event.keyCode : e.keyCode; notAllowed = new Array (32, 44, 47, 55, 59, 186, 188); if(notAllowed.inArray(KeyID) ){ additionalInfoAlert(); } } function checkRunningTime(object) { allowcheck = /^[0-9]{1,3}[,\.]{0,1}[0-9]{0,1}$/; if ( !allowcheck.test(object.value)) { object.className = 'bladreq'; alert('Sprawdź poprawność wprowadzonych danych'); } else { object.className = 'req'; } } function checkShow( inputsContainer, showId, onlyReq ) { showId = document.getElementById(showId); showId.style.display=""; inputsContainer = document.getElementById(inputsContainer); var lista = inputsContainer.getElementsByTagName('input'); for( i = 0; i < lista.length; i++ ) { if ( onlyReq && lista[i].className == 'req' && lista[i].value == '' ) { showId.style.display="none"; return; } else if ( !onlyReq && lista[i].value == '' ){ showId.style.display="none"; return; } } showId.style.display=""; } function potwierdz(submitId) { var potwierdzono = true; var a = arguments; for ( i = 1; i < a.length; i++ ){ var checkbox = document.getElementById(a[i]); if ( !checkbox.checked ) { potwierdzono = false; } } var submit = document.getElementById(submitId); if ( potwierdzono ) { submit.disabled=false; } else { submit.disabled=true; } } function ustawPole( select, pole ) { var s = document.getElementById(select); var wartosc = s.value; var p = document.getElementById(pole); if ( wartosc == "inny" || wartosc == "Inny" || wartosc == "other" || wartosc == "Other" ) { p.style.display=""; if ( s.id.indexOf('Festiwal') != -1 ) { p.className = "req"; p.style.color='gray'; p.value= 'Wpisz nazwę festiwalu'; } else if ( s.id.indexOf('jezykOryginalny') != -1 ) { p.style.color='gray'; p.value= 'Wpisz język'; }else if ( s.id.indexOf('szkola') != -1 ) { p.className = "req"; p.style.color='gray'; p.value= 'Wpisz nazwę szkoły'; } else { p.value= ''; } } else { if ( s.id.indexOf('Festiwal') != -1 ) { p.className = "text"; } p.value = wartosc; p.style.display="none"; } } function usunDomyslnyWpis ( object, wpis ) { obj = document.getElementById(object); if ( obj.value == wpis ) { obj.value = ''; obj.style.color = ''; } } function nieDotyczy( poleBlokowane, checkbox, nieDotyczyInfo ) { kalendarz = document.getElementById(poleBlokowane + 'Kalendarz'); object = document.getElementById(checkbox); poleTxt = document.getElementById(poleBlokowane); if ( object.checked ) { poleTxt.readOnly=true; poleTxt.value=nieDotyczyInfo; poleTxt.style.backgroundColor='#dddddd'; if ( kalendarz ) { kalendarz.style.display='none'; poleTxt.style.color='#dddddd'; poleTxt.value='0000.00.00'; } } else { poleTxt.readOnly=false; poleTxt.value=''; poleTxt.style.backgroundColor=''; if ( kalendarz ) { kalendarz.style.display='inline'; poleTxt.readOnly=true; poleTxt.style.color=''; } } } function usunChild(parent, child) { if (id = document.getElementById(child)) { document.getElementById(parent).removeChild(id); } } function dodajKraj(parentId, childGroupArrayId, childIndexArrayId ) { var id = childGroupArrayId + '[' + childIndexArrayId + ']'; if (!document.getElementById(id)) { var div = document.createElement('div'); div.setAttribute('id', id); document.getElementById(parentId).appendChild(div); var kraj = document.createElement('input'); kraj.setAttribute('type', 'text'); kraj.setAttribute('class', 'text'); kraj.className = 'text'; kraj.setAttribute('style', 'margin-top:5px;'); kraj.setAttribute('name', id) document.getElementById(id).appendChild(kraj); var del = document.createElement('a'); del.setAttribute('href','javascript:usunChild("' + parentId + '", "' + div.id + '");'); del.innerHTML = ' [Usuń]'; document.getElementById(id).appendChild(del); } } function trim(str) { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } function validForm() { var poprawny = true; lista = document.getElementsByTagName('input'); for(i = 0; i < lista.length; i++) { if ( lista[i].className == 'req' || lista[i].className == 'bladreq' ) { if ( trim(lista[i].value) == '' || lista[i].value == 'Wpisz język' || lista[i].value == 'Type in a language' || lista[i].value == 'Wpisz nazwę festiwalu' || lista[i].value == 'Type in a festival name' || lista[i].value == 'Wpisz nazwę szkoły' || lista[i].value == 'Type in a shool name' ) { lista[i].className = 'bladreq'; poprawny = false; } else if ( lista[i].name.indexOf('mail') != -1 ) { allowcheck = /^.+@.+\..+$/; if ( !allowcheck.test(lista[i].value) ) { lista[i].className = 'bladreq'; poprawny = false; } else { lista[i].className = 'req'; } } else if ( lista[i].name.indexOf('[Czas]') != -1 ) { // alert(lista[i].name); allowcheck = /^[0-9]{1,3}[,\.]{0,1}[0-9]{0,1}$/; if ( !allowcheck.test(lista[i].value) ) { lista[i].className = 'bladreq'; poprawny = false; } else { lista[i].className = 'req'; } } else { lista[i].className = 'req'; } } } lista = document.getElementsByTagName('textarea'); for(i = 0; i < lista.length; i++) { if ( lista[i].className == 'req' ) { if ( lista[i].value == '' ) { lista[i].className = 'bladreq'; poprawny = false; } else { lista[i].className = 'req'; } } } lista = document.getElementsByTagName('select'); for(i = 0; i < lista.length; i++) { if ( lista[i].className == 'req' || lista[i].className == 'bladreq' ) { if ( lista[i].value == '-------' || lista[i].value == '' ) { var spanId = lista[i].name + '_span'; span = document.getElementById(spanId); if (span){ span.className = 'selectblad'; } poprawny = false; } else { lista[i].className = 'req'; var spanId = lista[i].name + '_span'; span = document.getElementById(spanId); if (span){ span.className = 'select'; } } } } return poprawny; } function sprawdzDodajSzczegoly ( nazwa ) { var imieVal = document.getElementById(nazwa + 'Imie').value; var nazVal = document.getElementById(nazwa + 'Nazwisko').value; var email = document.getElementById(nazwa + 'Email'); if (email) { emailVal = email.value; } else { emailVal = ' '; } if ( nazVal != '' && imieVal != '' && emailVal != '' ) { szczegoly = document.getElementById(nazwa + 'Szczegoly'); if (szczegoly){ szczegoly.style.display = ''; return true; } } return false; } function show (id) { ob = document.getElementById(id); if ( ob ) { ob.style.display=''; } } function utworzTabele(container, id, grupa, nazwaGrupy, opcja_wymagane, stanowisko){ /* opcja_wymagane = 2 - imie - nazwisko - telefon - email */ if ( stanowisko == 1 ) { var stanowiskoStr = '' + 'Stanowisko:' + ''+ ''; } else { var stanowiskoStr = ''; } if ( nazwaGrupy != 'Obsada' && nazwaGrupy != 'Cast' && nazwaGrupy != 0 ){ var nazwaGrupyStr = '' + '' + nazwaGrupy + '' + ''+ ''; } else { var nazwaGrupyStr = ''; } var div = document.createElement('div'); div.setAttribute('id', grupa + '_' + id) document.getElementById(container).appendChild(div); var str = '
' + nazwaGrupyStr + '' + '' + ''+ ''+ '' + '' + ''+ ''+ ''+ ''+ ''+ ''+ stanowiskoStr + '' + '' + ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
Imię:
Nazwisko:
Email:'+ ' '+ '
Telefon:
Telefon komórkowy:
Fax:
Adres linia 1:
Adres linia 2:
Miasto:
Kod pocztowy:
Kraj:
[Usuń osobę]
'; document.getElementById(grupa + '_' + id).innerHTML = str; } function dodajFestiwal (container, id, grupa ) { var div = document.createElement('div'); div.setAttribute('id', grupa + '_' + id); document.getElementById(container).appendChild(div); var str = '
'+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '
Nazwa festiwalu:' + '' + '
' + '
Rok:' + '' + '
Sekcja:' + '' + '
Nagrody:' + '' + '
[Usuń festiwal]
'; document.getElementById(grupa + '_' + id).innerHTML = str; } function dodajFestiwalDok (container, id, grupa ) { var div = document.createElement('div'); div.setAttribute('id', grupa + '_' + id); document.getElementById(container).appendChild(div); var str = '
'+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '' + ''+ ''+ '' + '
Nazwa festiwalu:' + '' + '
' + '
Rok:' + '' + '
Sekcja:' + '' + '
Nagrody:' + '' + '
[Usuń festiwal]
'; document.getElementById(grupa + '_' + id).innerHTML = str; } function dodajFirme( container, id, grupa, tytul ) { var div = document.createElement('div'); div.setAttribute('id', container + '_' + id); document.getElementById(container).appendChild(div); var tytulNr = id + 1; var str = '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + /* '' + '' + '' + '' + */ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + tytul + ' (' + tytulNr + ')
Nazwa:
Telefon:
Telefon komórkowy:
Fax:
Strona internetowa:
Email:' + ' ' + '
Adres linia 1:
Adres linia 2:
Miasto:
Kod pocztowy:
Kraj:
Kontakt
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
Imię:' + '' + '
Nazwisko:' + ''+ '
Email:' + '' + '
Stanowisko:
Telefon:
Telefon komórkowy:
Fax:
Adres linia 1:
Adres linia 2:
Miasto:
Kod pocztowy:
Kraj:
' + '[Usuń firmę]' + '
' '
'; document.getElementById(container + '_' + id).innerHTML = str; } function nieDotyczyFirma ( firmaContainer, checkboxId ) { checkbox = document.getElementById( checkboxId ); container = document.getElementById( firmaContainer ); lista = container.getElementsByTagName('input'); if ( checkbox.checked ) { container.style.display='none'; } else { container.style.display=''; } for( i = 0; i < lista.length; i++ ) { if ( !checkbox.checked ) { lista[i].value=''; if ( lista[i].className == 'text nieAktywny' ) { lista[i].className = 'req'; } } if ( checkbox.checked ) { lista[i].value='Nie dotyczy'; if ( lista[i].className == 'req' || lista[i].className == 'bladreq' ) { lista[i].className = 'text nieAktywny'; } } } } function closeCalendar(e){ var obj = getEventTarget(e); datapicker = document.getElementById( 'datepicker' ); if( obj.id != 'dataPokazuPolskiegoKalendarz' && obj.id != 'dataPokazuZagranicznegoKalendarz' && obj.className != 'pickdateDontClose' && datapicker ) datapicker.style.display='none'; } if(window.attachEvent){ document.attachEvent('onclick', closeCalendar); }else if (window.addEventListener){ window.addEventListener('click', closeCalendar, false); } function getEventTarget(e) { var targ; if (!e) var e = window.event; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 3) // defeat Safari bug targ = targ.parentNode; return targ.parentNode; } function kopiujFirma ( from, to, checkbox, copyType ) { //copyType = 1 - kopiuje dane firmy, 0 dane osoby kontaktowej var fromLista = document.getElementById(from + 'Container').getElementsByTagName('input'); if( checkbox.checked == false ) { return; } for( i = 0; i < fromLista.length; i++ ) { var name = fromLista[i].name.substr(from.length + 3); if ( copyType == 0 && fromLista[i].name.indexOf('[Kontakt][0]') >= 0) { //Kopiowanie kontaktu do firmy var toList = document.getElementsByName(to + '[0]' + name); if ( toList[0] ) { toList[0].value=fromLista[i].value; } } else if ( copyType && fromLista[i].name.indexOf('[Kontakt]') < 0 ) { //Kopiowanie danych firmy var toList = document.getElementsByName(to + '[0]' + name); if ( toList[0] ) { toList[0].value=fromLista[i].value; } } else { continue; } } if ( copyType == 0 ) { sprawdzDodajSzczegoly(to + '[0][Kontakt][0]'); } checkShow(to + 'Container', to + 'Dodaj', 1); checkShow(to + 'KontaktContainer', to + 'KontaktDodaj', 1); } function toggle(toggleContainerId, checkboxId){ checkbox = document.getElementById( checkboxId ); container = document.getElementById( toggleContainerId ); if ( checkbox.checked ) { container.style.display='none'; } else { container.style.display=''; } }