function change_div(did,act) { if(act==1) { $(did).getChildren('.tm1').set('class', 'tm1h fl'); $(did).getChildren('.tm2').set('class', 'tm2h fl'); $(did).getChildren('.tm3').set('class', 'tm3h fl'); } else { $(did).getChildren('.tm1h').set('class', 'tm1 fl'); $(did).getChildren('.tm2h').set('class', 'tm2 fl'); $(did).getChildren('.tm3h').set('class', 'tm3 fl'); } } function getId(id) { return document.getElementById(id) } function getTR(str){ return new Element('div', {html: '' + str + '
'}).getElement('tr'); } function HtmlToElement(str,tag){ return new Element('div', {html:str}).getElement(tag); } onerror = function(info, plik, linia) { //alert("plik : " + plik+"\nlinia : " + linia+"\ninfo : " + info); } function copy(id) { var objs = getId(id) var text =objs.value getId(id+"_send").value=text } function copy_sel(id,idx) { getId(id+"_send").options[idx].selected=true; } function counter_words(f, x, y,l) { if (f.value.length>x-1) { f.value = f.value.substr(0,x) } if(l<2) { getId("counter_"+y).value=x-f.value.length } else { var lc=getId('languages_list_input').value var lang=getId('main_languages').innerHTML; var ll=lang.split('~'); if(lc==ll[1]) getId("counter_"+y).value=x-f.value.length else getId('lang['+lc+'][counter_'+y+']').value=x-f.value.length } } function msg(text) { alert(text); } function loading_start() { var left=screen.width/2-300/2; var top=screen.height/2-200/2; if (window.pageYOffset != null) topy = window.pageYOffset; else if (document.body.scrollTop != null) topy = document.body.scrollTop; top=top+topy; getId('loading').style.display='block'; getId('loading').style.top=top+'px'; getId('loading').style.left=left+'px'; } function button_add() { var getp=getId('get_p').innerHTML; window.location.href='/panel/'+getp+'/edit/' } function button_back() { var getp=getId('get_p').innerHTML; window.location.href='/panel/'+getp+'/index/' } function to_num(t) { var p1=t.value; var re = /[^0-9.,]/gi; p1=p1.replace(re,''); var re = /,/gi; p1=p1.replace(re,'.'); t.value=p1; } function to_num_sto(t) { var p1=t.value; var re = /[^0-9.,]/gi; p1=p1.replace(re,''); var re = /,/gi; p1=p1.replace(re,'.'); if (p1>100) p1=100; t.value=p1; } function to_number(t) { var p1=t.value; var re = /[^0-9]/gi; p1=p1.replace(re,''); var re = /,/gi; p1=p1.replace(re,'.'); t.value=p1; } function email(email) { if (!email.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) { return false; } return true; } function poprawPNG() { var divf=getId('flags'); var divs = divf.getElementsByTagName('div'); for(var i=0; i