function file(id) { window.open("uploadfilefor"+id+".html",'myFilePlus', 'width=450,height=140,status=no,toolbar=no,menubar=no,scrollbars=no'); } function testdata() { if(document.getElementById("firstname").value!='' && document.getElementById("email").value!='' && document.getElementById("lastname").value!='' && document.getElementById("txtmes").value!='') { document.getElementById("sendForm").submit(); }else { alert("Заполните все поля!"); } } function checkmailnews() { if (!(/^[a-zA-Z][a-z0-9\-\_\.]{1,20}@[a-z0-9\-\_\.]{5,30}$/.test(document.getElementById("sendasknews").value))) { alert("Проверьте E-mail адрес!"); return false; } return true; } function checkfileupload() { name = document.getElementById('name').value; file = document.getElementById('file').value; if(file=='') { alert('Пожалуйста, выберете файл для загрузки'); return false; } } function chk() { if (document.getElementById("keyword").value == "") { alert('Введите ключевое слово или фразу!'); return false; } if (document.getElementById("keyword").value.length<=2) { alert('Введите более 2 символов!'); return false; } document.getElementById('searchForm').submit(); } function addpmenu(id) { window.open("tools_admin/editmenu.php?action=addme&idpm="+id,'myWin', 'width=450,height=150,status=no,toolbar=no,menubar=no,scrollbars=no'); } function addinnermenu(id) { window.open("tools_admin/actinnermenu.php?action=addme&idpm="+id,'myWin', 'width=450,height=150,status=no,toolbar=no,menubar=no,scrollbars=no'); } function editmenu(id) { window.open("tools_admin/editmenu.php?action=editmenu&idmenu="+id,'myWin', 'width=450,height=150,status=no,toolbar=no,menubar=no,scrollbars=no'); } function editinnermenu(id) { window.open("tools_admin/actinnermenu.php?action=editmenu&idmenu="+id,'myWin', 'width=450,height=150,status=no,toolbar=no,menubar=no,scrollbars=no'); } function addanswer(id) { window.open("tools_admin/admguest.php?action=addoneanswer&idquest="+id,'addanswer', 'width=450,height=325,status=no,toolbar=no,menubar=no,scrollbars=no'); } function editanswer(id) { window.open("tools_admin/admguest.php?action=editoneanswer&idquest="+id,'editanswer', 'width=450,height=325,status=no,toolbar=no,menubar=no,scrollbars=no'); } function addcat(id) { window.open("tools_admin/editcat.php?action=addcat&idcat="+id,'myWin', 'width=450,height=150,status=no,toolbar=no,menubar=no,scrollbars=no'); } function editcat(id) { window.open("tools_admin/editcat.php?action=editcat&idcat="+id,'myWin', 'width=450,height=144,status=no,toolbar=no,menubar=no,scrollbars=no'); } function addgoods(id) { window.open("tools_admin/editgoods.php?action=addgoods&idcat="+id,'addgoods', 'width=450,height=235,status=no,toolbar=no,menubar=no,scrollbars=no'); } function info(id) { window.open("infogoods.php?idgoods="+id,'infogoods', 'width=500,height=550,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes'); } function big(id) { window.open("building.php?id="+id,'building'+id, 'width=750,height=520,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'); } function getAbsolutePos(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; function __dlg_init(bottom) { var body = document.body; var body_height = 0; if (typeof bottom == "undefined") { var div = document.createElement("div"); body.appendChild(div); var pos = getAbsolutePos(div); body_height = pos.y; } else { var pos = getAbsolutePos(bottom); body_height = pos.y + bottom.offsetHeight; } if (!document.all) { var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; window.moveTo(x, y); window.innerWidth = body.offsetWidth + 5; window.innerHeight = body_height + 2; } else { var ch = body.clientHeight; var cw = body.clientWidth; var W = body.offsetWidth; var H = 2 * body_height - ch; var x = (screen.availWidth - W) / 2; var y = (screen.availHeight - H) / 2; window.moveTo(x, y); } }; function testregdata(frm) { if (frm.reg_name.value!='' && frm.reg_login.value!='' && frm.reg_email.value!='' && frm.reg_lastname.value!='' && frm.reg_pwd.value!='' && frm.reg_cppwd.value!='') { if(frm.reg_pwd.value==frm.reg_cppwd.value){ frm.submit(); } else{ alert("Проверьте правильность ввода пароля!"); } }else { alert("Заполните все обязательные поля!"); } }; function testeditdata(frm) { if (frm.reg_name.value!='' && frm.reg_login.value!='' && frm.reg_email.value!='' && frm.reg_lastname.value!='') { frm.submit(); } else { alert("Заполните все обязательные поля!"); } }; function checkmessage(frm) { if (frm.title.value!='' && frm.message.value!='') { frm.submit(); } else { alert("Заполните все поля!"); } }; function answer(frm) { answer0 = 'document.getElementById("an'+frm+'").style.display'; answer1 = eval(answer0); if(answer1=="none"){ ans = 'document.getElementById("an'+frm+'").style.display=""'; eval(ans); } else { ans = 'document.getElementById("an'+frm+'").style.display="none"'; eval(ans); } }; function checkinputadmin() { name = document.getElementById("login").value; password = document.getElementById("password").value; if(name=='') { alert('Пожалуйста, введите логин администратора!'); return false; } if(password=='') { alert('Пожалуйста, введите пароль администратора!'); return false; } } function createwin(wname,name,w,h) { myWin= window.open(name, wname, 'location=0,menubar=0,toolbar=0,resizable=0,scrollbars=0,width='+w+',height='+h+''); myWin.focus(); } function createwinse(wname,name,w,h) { myWin= window.open(name, wname, 'scrollbars=no,resizable=yes,status=no,width='+w+',height='+h+''); myWin.focus(); } function checkaddphoto() { name = document.getElementById("name_foto").value; info = document.getElementById("info_foto").value; userfile2 = document.getElementById("userfile_big").value; if(name=='') { alert('Наименование обязательно.'); return false; } if(info=='') { alert('Описание обязательно.'); return false; } if(userfile2=='') { alert('Фотография обязательна.'); return false; } if((name!='') && (info!='') && (userfile2!='')){document.getElementById('addFotoForm').submit();} } function checkeditphoto() { name = document.getElementById("name_foto").value; info = document.getElementById("info_foto").value; if(name=='') { alert('Наименование обязательно.'); return false; } if(info=='') { alert('Описание обязательно.'); return false; } if((name!='') && (info!='')){document.getElementById('editFotoForm').submit();} } function resize_win(img_width, img_height) { var dy = 100; var dx = 28; // Fit window fit_width = img_width - win_width; fit_height = img_height - win_height; if (fit_width > 0) { self.resizeTo(img_width + dx, win_height); win_width = img_width + dx; } if (fit_height > 0) { self.resizeTo(win_width, img_height + dy); win_height = img_height + dy; } // Center window x = (screen.width / 2) - (win_width / 2); y = (screen.height / 2) - (win_height / 2); self.moveTo(x, y); } function close_win() { myWin= close(); }