/**
 * конструктор, на входе JSON-конфиг
 */function verifyCaptcha(a,b,c){numberLength=5;var d=new String($("#"+a).val());d.length==numberLength&&(captchaUrl="captcha_new.php",postString="type=check&",postString+="number="+$("#"+a).val()+"&",postString+="secret="+$("#"+b).val(),$.ajax({type:"POST",url:captchaUrl,data:postString,success:function(a){a=="OK"&&$("#"+c).val(1),a=="Error"&&$("#"+c).val(0)},dataType:"text"}))}function getCaptchaData(a,b,c,d){$("#"+d).val(""),captchaUrl="captcha_new.php",postString="type=text&",number=Math.round(Math.random()*89999),postString+="base="+number,$("#"+b).html("<img src="+a+""+captchaUrl+"?type=image&base="+number+"></img>"),$("#tmpLog").val(number),$.ajax({type:"POST",url:captchaUrl,data:postString,success:function(a){$("#"+c).val(a)},dataType:"text"})}function IsAllowFileExtension(a){var b=[".jpg",".gif",".jpeg",".bmp",".png",".tiff",".tif",".pdf",".doc"];if(b.indexOf(a)==-1){alert("Тип файла не поддерживается!");return!1}return!0}function confirmLogin(a,b){if(document.getElementById("nologin"))var c=document.getElementById("nologin").value;else var c=0;if(c==1)return!0;a.value=trim(a.value);var d=a.value,e=/^[0-9@a-zA-Z_\.\-]{1,}$/;if(d==""){alert(document.getElementById("fraze_no_login").value),a.focus();return!1}if(d.length<5){alert(document.getElementById("fraze_short_login").value),a.focus();return!1}if(!e.test(d)){b||(alert(document.getElementById("fraze_wrong_login").value),a.focus());return!1}return!0}function confirmPhone(a,b){var c=trim(a.value);if(c.length<4){b||alert(document.getElementById("fraze_no_correct_phone").value),a.focus();return!1}var d=/^[0-9-+()/:\s]{2,15}$/;if(!d.test(c)){b||alert(document.getElementById("fraze_confirm_phone").value),a.focus();return!1}return!0}function confirmCode(a,b){var c=trim(a.value);if(c==""){b||alert(document.getElementById("fraze_no_city_code").value),a.focus();return!1}var d=/^[0-9-+()/:\s]{1,15}$/;if(!d.test(c)){b||alert(document.getElementById("fraze_wrong_phone_city_code").value),a.focus();return!1}return!0}function confirmSite(a){var b=trim(a.value),c=/^[http]{0,4}[\:]{0,1}[\/\/]{0,2}([a-zA-Z0-9]+[\-\.]?)+[a-zA-Z0-9]+$/;if(!c.test(b)){if(b=="")return!0;alert(document.getElementById("fraze_confirm_site").value),a.focus();return!1}return!0}function confirmSkype(a){var b=trim(a.value),c=/^[0-9a-zA-Z_.]{1,}$/;if(!c.test(b)){if(b=="")return!0;alert(document.getElementById("fraze_confirm_skype").value),a.focus();return!1}return!0}function confirmICQ(a,b){var c=trim(a.value),d=/^[0-9/-]{5,13}$/;if(!d.test(c)){if(c=="")return!0;b||alert(document.getElementById("fraze_confirm_icq").value),a.focus();return!1}return!0}function confirmEmail(a,b){var c=trim(a.value),d=/^[-0-9a-zA-Z_.\-]+@[0-9a-zA-Z_^.\-]+\.[a-zA-Z]{2,6}$/;if(!d.test(c)){if(c=="")return!1;b||alert(document.getElementById("fraze_confirm_email").value),a.focus();return!1}return!0}function removeSomeInput(a,b,c,d,e){var f=document.getElementById(b),g="input_"+b+"_",h="check_"+b+"_",i="check_"+b+"_",j=a+"["+b+"]",k=a+"[check]["+b+"]",l=a+"["+b+"]",m="text_"+b,n;for(n=0;n<c.length;n++){var o=e+1;while(document.getElementById(j+"["+o+"]"+"["+c[n]+"]")){var p=o-1,q=document.getElementById(j+"["+p+"]"+"["+c[n]+"]"),r=document.getElementById(j+"["+o+"]"+"["+c[n]+"]");q.value=r.value,o++}}var o=e+1;while(document.getElementById(j+"["+o+"]"+"["+d+"]")){var p=o-1,s=document.getElementById(l+"["+p+"]"+"["+d+"]"),t=document.getElementById(l+"["+o+"]"+"["+d+"]");s.selectedIndex=t.selectedIndex,o++}var u=h+o;o--;var m="text_"+b+o,v=g+o;document.getElementById(k+"["+e+"]").checked=!0,document.getElementById(k+"["+o+"]").checked=!1;var w=document.getElementById(h+o),x=document.getElementById(m);x.className="regCommentNew";var y=document.getElementById(v),z=document.getElementById(u);f.removeChild(y),z&&f.removeChild(z)}function addSomeInput(a,b,c,d,e,f,g,h,j,k){var l=e-1,m=e+1,n=document.getElementById(b),o="text_"+b+e,p="text_"+b+m,q="input_"+b+"_",r="check_"+b+"_",s="select_"+b+"_",t=q+l,u=s+e,v=q+e,w=r+m,x=a+"["+b+"]",y=a+"[check]["+b+"]",z=a+"["+b+"]",A=y+"["+e+"]",B=z+"["+l+"]["+d+"]",C=z+"["+e+"]["+d+"]",D=y+"["+m+"]",E=document.getElementById(r+e),F=document.getElementById(o),G=F.cloneNode(!0);G.id=p;var H=document.getElementById(o+"_"+e),I=e+2;F.className="regCommentAct",G.className="regCommentNew";var J="<label for="+D+" id="+o+"_"+m+">"+g_phrase[f[I-2]]+"&nbsp;"+g+"</label>";G.innerHTML="",G.innerHTML=J;var K=document.createElement("div");K.setAttribute("id",v),K.style.marginLeft="3px";var L=document.createElement("span");L.setAttribute("id",u),L.style.paddingRight="4px";var M=document.getElementById(B),N="<select name='"+C+"' id='"+C+"' style='width:"+M.style.width+"'>"+M.innerHTML+"</select>";L.innerHTML=L.innerHTML+N,K.appendChild(L);for(i=0;i<c.length;i++){if(h[i]!=""){var O=document.createElement("span");O.innerHTML=h[i],O.fontSize="12px",O.style.color="gray",K.appendChild(O)}var P=x+"["+0+"]"+"["+c[i]+"]",Q=document.getElementById(P),R=x+"["+e+"]"+"["+c[i]+"]",S="";k&&(S=k[i]);var T="<input style='width:"+Q.style.width+"' id='"+R+"' value='"+S+"' name='"+R+"' type=text>",U=K.innerHTML;K.innerHTML=U+T}K.innerHTML="<nobr>"+K.innerHTML+"</nobr>",n.appendChild(K);if(j>e||!j){var V=document.createElement("div");V.setAttribute("id",w),V.className="regCheck";var W=document.createElement("input");W.type="checkbox",W.name=D,W.id=D,W.style.cursor="pointer";var X=!1;k&&(X=k),window.addEventListener?W.addEventListener("click",function(){actSomeInput(a,b,c,d,m,f,g,h,j,X)},!1):window.attachEvent&&W.attachEvent("onclick",function(){actSomeInput(a,b,c,d,m,f,g,h,j,X)}),V.appendChild(W),V.appendChild(G),n.appendChild(V)}}function actSomeInput(a,b,c,d,e,f,g,h,i,j){var k=a+"[check]["+b+"]",l=k+"["+e+"]",m=document.getElementById("count_inputs").value;if(i&&i>0||!i)document.getElementById(l).checked?(addSomeInput(a,b,c,d,e,f,g,h,i,j),m++):(removeSomeInput(a,b,c,d,e),m--);document.getElementById("count_inputs").value=m}function removeInput(a,b,c){var d=document.getElementById(b),e="input_"+b+"_",f="check_"+b+"_",g=a+"["+b+"]",h=a+"[check]["+b+"]",i=c+1;while(document.getElementById(g+"["+i+"]")){var j=i-1,k=document.getElementById(g+"["+j+"]"),l=document.getElementById(g+"["+i+"]");k.value=l.value,i++}var m=f+i;i--;var n="text_"+b+i,o=e+i;document.getElementById(h+"["+c+"]").checked=!0,document.getElementById(h+"["+i+"]").checked=!1;var p=document.getElementById(f+i),q=document.getElementById(n);q.className="regCommentNew";var r=document.getElementById(o),s=document.getElementById(m);d.removeChild(r),s&&d.removeChild(s)}function addInput(a,b,c,d,e,f){var g=c-1,h=c+1,i=document.getElementById(b),j="text_"+b+c,k="text_"+b+h,l="input_"+b+"_",m="check_"+b+"_",n=l+c,o=m+h,p=a+"["+b+"]",q=a+"[check]["+b+"]",r=p+"["+g+"]",s=q+"["+c+"]",t=p+"["+c+"]",u=q+"["+h+"]",v=document.getElementById(m+c),w=document.getElementById(j),x=w.cloneNode(!0);x.id=k;var y=c+2;w.className="regCommentAct",x.className="regCommentNew";var z="<label for="+u+" id="+j+"_"+h+" >"+g_phrase[d[y-2]]+"&nbsp;"+e+"</label>";x.innerHTML="",x.innerHTML=z;var A=document.createElement("div");A.setAttribute("id",n),A.style.margin="3px";var B=document.getElementById(r).size,C=document.getElementById(r).style.width,D=document.getElementById(r),E=D.cloneNode(!0);E.name=t,E.id=t,E.value="",A.appendChild(E),i.appendChild(A);if(f>c||!f){var F=document.createElement("div");F.setAttribute("id",o),F.className="regCheck";var G=document.createElement("input");G.type="checkbox",G.name=u,G.id=u,G.style.cursor="pointer",window.addEventListener?G.addEventListener("click",function(){actInput(a,b,h,d,e,f)},!1):window.attachEvent&&G.attachEvent("onclick",function(){actInput(a,b,h,d,e,f)}),F.appendChild(G),F.appendChild(x),i.appendChild(F)}}function actInput(a,b,c,d,e,f){var g=a+"[check]["+b+"]",h=g+"["+c+"]";if(f>c||!f)document.getElementById(h).checked?addInput(a,b,c,d,e,f):removeInput(a,b,c)}function clearInput(a){if(a.className=="regCommentInput"||a.id=="company[adress_city]")a.value="",a.className="regCommentInputBlack"}function checkFile(a,b,c,d,e,f,g,h,i,j,k){k!=1&&k!=0&&(k="");var l="new_ajax.php?mode=check_file&file_id="+b+"&is_checked="+a+"&date="+c,m=!0;JsHttpRequest.query(l,{operation:"confirm_login",type:d,number:e,seria:g,is_visible:k,comment:h,inn:f,company_code:j},function(a,c){var d=document.getElementById("file_check_img_"+b);closeFileCheckWindow(),document.getElementById("file_check_state_"+b).setAttribute("is_checked",a.is_checked);if(a.is_checked=="1"){var h="",i=0;g!=""&&(h+="Cерия "+g,i=1),e!=""&&(i==1&&(h+="  "),h+="№"+e,i=1),f!=""&&(i==1&&(h+="  "),h+="ИНН "+f),document.getElementById("file_name_info_"+b).innerHTML=h.length?h:document.getElementById("file_real_name_"+b).value,d.src="img/i_check_file.png",d.title="Файл проверен.",d.alt="Файл проверен.",alert("Вы успешно проверили файл."),window.location.href="/registration/view/"}else document.getElementById("file_name_info_"+b).innerHTML=document.getElementById("file_real_name_"+b).value,d.src="img/i_question_file.png",d.title="Файл непроверен.",d.alt="Файл непроверен.",alert("Вы изменили статус файла на НЕПРОВЕРЕННЫЙ.")},!0)}function doCheckFile(){var a=document.getElementById("file_id").value,b=document.getElementById("file_year"),c=b.options[b.selectedIndex].value,d=document.getElementById("file_month"),e=d.options[d.selectedIndex].value,f=document.getElementById("file_day"),g=f.options[f.selectedIndex].value,h=c+"-"+e+"-"+g+" 00:00:00",i=document.getElementById("doc_type"),j=i.options[i.selectedIndex].value,k=document.getElementById("first_type_of_doc").value;k!=j&&JsHttpRequest.query("http://files.della.su/index.php",{mode:"replace_file",file_id:a,file_type:k},function(a,b){},!0);var l=document.getElementById("doc_number").value,m=document.getElementById("doc_seria").value,n=document.getElementById("doc_comment").value,o=document.getElementById("doc_inn").value;if(document.getElementById("is_visible"))if(document.getElementById("is_visible").checked==1)var p=1;else var p=0;var q=document.getElementById("curr_company_code").value;checkFile("1",a,h,j,l,o,m,n,"",q,p)}function editFileByOperator(a){JsHttpRequest.query("new_ajax.php",{mode:"get_file_info",id:a},function(b,c){document.getElementById("file_id").value=a,document.getElementById("doc_inn").value=b.inn,b.is_visible==1?document.getElementById("is_visible").checked=!0:document.getElementById("is_visible").checked=!1,document.getElementById("doc_number").value=b.number,document.getElementById("doc_seria").value=b.seria,document.getElementById("doc_comment").value=b.comment;var d=document.getElementById("file_year"),e=b.year!="0000"?b.year-1990+1:0;d.options[e].selected=!0;var f=document.getElementById("file_month");f.selectedIndex=b.month;var g=document.getElementById("file_day");g.selectedIndex=b.day;var h=document.getElementById("doc_type");h.selectedIndex=b.type-1,document.getElementById("first_type_of_doc").value=b.type,showFileCheckWindow()},!0)}function checkFileByOperator(a,b){var c=document.getElementById("file_check_state_"+a).getAttribute("is_checked");c=="0"?c=="1":c=="0";if(c=="1")confirm("Вы хотите изменить статус файла на НЕПРОВЕРЕННЫЙ?")&&checkFile(0,a);else{document.getElementById("file_id").value=a,document.getElementById("doc_inn").value="",document.getElementById("doc_number").value="",document.getElementById("doc_seria").value="",document.getElementById("doc_comment").value="";var d=document.getElementById("doc_type");d.selectedIndex=0;var e=document.getElementById("file_year");e.selectedIndex=0;var f=document.getElementById("file_month");f.selectedIndex=0;var g=document.getElementById("file_day");g.selectedIndex=0,showFileCheckWindow()}}function closeFileCheckWindow(){hwndWFCH&&hwndWFCH.close()}function showFileCheckWindow(){var a={newWindowId:"testWndSC",header:{closeBtn:!0},positionX:null,positionY:null,height:null,width:400,bgDiv:{color:"#343434",opacity:10},cssStyleClass:"enterWnd",contentId:"check_file_window",onClose:function(){},thisObjName:"hwndWFCH"};hwndWFCH||(a.header.title="Проверка файла",hwndWFCH=new EvaxModalWindow(a)),hwndWFCH.show()}function generatePostStringForCheckingCaptcha(a){var b="captchaNumber",c="secretId",d=new String($("#"+b).val());captchaUrl="captcha_new.php";var e="type=check&";e+="number="+$("#"+b).val()+"&",e+="secret="+$("#"+c).val()+"&",e+="base="+$("#tmpLog").val()+"&",e+="from_registration="+a+"&",e+="name="+$("#data[contact_name]").val()+"&";return e}function showHideLayer(a){var b=document.getElementById(a);b.style.display=="block"?b.style.display="none":b.style.display="block"}function checkCodes(a){var b=document.getElementById("count_inputs").value;for(i=0;i<b;i++){var c=document.getElementById("contacts[phone]["+i+"][code_city]"),d=document.getElementById("contacts[phone]["+i+"][number]").value;if(d!=""&&!confirmCode(c))return!1}return!0}function confirmPassword(){var a=document.getElementById("data[password]"),b=document.getElementById("password_confirm");if(a.value!=b.value){alert(document.getElementById("fraze_confirm_pass").value);return!1}hwndW1.close();return!0}function checkPassword(a,b){if(document.getElementById("nologin"))var c=document.getElementById("nologin").value;else var c=0;if(c==1)return!0;a.value=trim(a.value);var d=a.value,e=/^[0-9a-zA-Z]{1,}$/,f=document.getElementById("data[login]").value;if(d.length<6){b||alert(document.getElementById("fraze_short_password").value),a.focus();return!1}if(!e.test(d)){b||alert(document.getElementById("fraze_short_password").value+" "+document.getElementById("fraze_wrong_pass").value),a.focus();return!1}if(f==d){b||alert(document.getElementById("fraze_wrong_password").value),a.focus();return!1}return!0}function trim(a){return a.replace(/(^\s+)|(\s+$)/g,"")}function checkConfirmPassword(){if(document.getElementById("nologin"))var a=document.getElementById("nologin").value;if(a==1)return!0;var b=document.getElementById("data[password]"),c=document.getElementById("password_confirm");if(b.value==""){alert(document.getElementById("fraze_view_confirm_password").value);return!1}if(c.value==""){alert(document.getElementById("fraze_no_confirm_pass").value);return!1}if(b.value!=c.value){alert(document.getElementById("fraze_confirm_pass").value);return!1}return!0}function changeStyleLabel(a,b){var c=document.getElementById(b);a.checked?c.className="regCommentAct":c.className="regCommentNew"}function activateRegistration(a,b){url="new_ajax.php?mode=activate_registration&id="+a,params="",JsHttpRequest.query(url,params,function(a,b){window.location.href=window.location.href},!0)}function changesInFiles(){document.getElementById("file_changes")&&(document.getElementById("file_changes").value=1)}function onStartUploadFile(a,b){document.getElementById("upload_file"+a).style.display="block";var c=document.getElementById("count_files"+a).value;return!0}function onUploadFile(a,b,c,d){document.getElementById("upload_file"+b).style.display="none";var e=document.getElementById("count_files"+b).value;if(c!="1")if(a!="0"){e++,document.getElementById("count_files"+b).value=e;var f=document.getElementById("file_container"+b),g=document.createElement("div");g.id="file_list_"+a;var h=document.createElement("table");h.setAttribute("cellpadding","0"),h.setAttribute("cellspacing","0"),h.setAttribute("border","0"),b=="1"?h.width="335":h.width="375";var i=document.createElement("tr"),j=document.createElement("td");j.width="18",j.innerHTML='<img src="img/i_question_file.png" height=12 id="file_check_img_'+a+'" alt="Файл непроверен." title="Файл непроверен.">',j.style.border="0";var k=document.createElement("td");k.width="20",k.style.border="0";var l=document.createElement("td");l.width="65",l.style.border="0";var m=document.createElement("td");m.className="point",m.style.border="0";var n=document.createElement("a");n.className="file_label",n.href="http://"+FILES_DELLA_DOMAIN+"/?f="+a,n.innerHTML=d.name,n.target="_blank";var o=document.createElement("span");o.onclick=function(){confirm("Вы действительно хотите удалить файл "+d.name)&&deleteFile(a,b);return!1},o.style.cursor="pointer",o.innerHTML="<img src='img/i_file_del.png' border=0 title='Удалить файл'>",k.appendChild(n),l.appendChild(o);var p=k.innerHTML;k.innerHTML="<nobr>"+p+"</nobr>",p=l.innerHTML,l.innerHTML="<nobr>"+p+"</nobr>",m.innerHTML="&nbsp;",i.appendChild(j),i.appendChild(k),i.appendChild(m),i.appendChild(l),h.appendChild(i),g.appendChild(h),f.appendChild(g)}else alert("Произошла ошибка при загрузке файла.");e>5&&(document.getElementById("control_to_upload_file_"+b).style.display="none")}function deleteFile(a,b){JsHttpRequest.query("new_ajax.php",{mode:"delete_file_for_company",hash:a},function(c,d){changesInFiles(),document.getElementById("file_list_"+a).style.display="none",alert("Файл "+c.name+" успешно удален.");var e=document.getElementById("count_files"+b).value;e--,e<=5&&(document.getElementById("control_to_upload_file_"+b).style.display="block"),document.getElementById("count_files"+b).value=e},!1)}function showCompanyFileWindow(a){var b={newWindowId:"wndCF",header:{closeBtn:!0},positionX:null,positionY:null,height:null,width:924,bgDiv:{color:"#343434",opacity:50},cssStyleClass:"enterWnd",contentId:"company_file_info",onClose:function(){var b=0;document.getElementById("file_changes")&&(b=document.getElementById("file_changes").value,document.getElementById("file_changes").value=0),a!=1&&b==1&&(window.location.href=ADD_PATH+"/registration/view/")},thisObjName:"hwndCFObj"};hwndCFObj||(b.header.title=g_phrase[1838],hwndCFObj=new EvaxModalWindow(b)),hwndCFObj.show()}function viewChangePassword(){showChangePassword()}function changePassword(a){var b=document.getElementById("old_password").value,c=document.getElementById("new_password").value,d=document.getElementById("new_password_confirm").value;if(!checkPassword(document.getElementById("new_password")))return!1;if(c!=d){alert(document.getElementById("fraze_wrong_new_pass").value);return!1}url="ajax_request.php?mode=registration_change_password&login="+a+"&old_pass="+b+"&new_pass="+c+"&menu_id=84";var e;JsHttpRequest.query(url,{},function(a,b){if(a.not_old_pass){alert(document.getElementById("fraze_wrong_old_pass").value);return!1}alert(document.getElementById("fraze_change_pass").value),hwndW3.close();return!0},!0)}function getResultForPassword(){if(document.getElementById("confirm_pass_check").value==0){alert(document.getElementById("fraze_confirm_pass").value);return!1}return!0}function showChangePassword(){var a={newWindowId:"testWnd3",header:{closeBtn:!0},positionX:null,positionY:null,height:null,width:530,bgDiv:{color:"#343434",opacity:10},cssStyleClass:"enterWnd",contentId:"change_password",onClose:function(){},thisObjName:"hwndW3"};hwndW3||(a.header.title=document.getElementById("change_pass_window_header").value,hwndW3=new EvaxModalWindow(a)),hwndW3.show()}function changeLoginInPassWindow(){var a=document.getElementById("edit_login").value;document.getElementById("button_change_pass").onclick=function(){changePassword(a)}}function deleteRegistration(a){url="new_ajax.php?mode=delete_registration&id="+a,params="",JsHttpRequest.query(url,params,function(a,b){a.txt!=""&&alert(a.txt)},!0)}function checkDataForUpdate(a){if(document.getElementById("data[contact_name]").value==""||document.getElementById("data[contact_name]").value=="Имя, Имя Отчество или ФИО"){alert(document.getElementById("fraze_contact_name").value);return!1}return checkPhones()?!0:!1}function checkDataForAdd(a){if(!a){if(!confirmLogin(document.getElementById("data[login]"),!1))return!1;if(!checkPassword(document.getElementById("data[password]"),!0)){alert(document.getElementById("fraze_wrong_pass").value);return!1}if(!checkConfirmPassword())return!1}if(a)var b=2;else var b="";if(document.getElementById("data[contact_name"+b+"]").value==""){alert(document.getElementById("fraze_contact_name").value);return!1}if(!confirmPhone(document.getElementById("contacts[phone][0][number]"),!0)){alert(document.getElementById("fraze_wrong_phone_number").value);return!1}if(!checkPhones())return!1;if(document.getElementById("captchaNumber")&&document.getElementById("captchaNumber").value==""){alert(document.getElementById("fraze_no_captcha").value);return!1}return!0}function checkPhones(){for(i=0;i<9;i++){var a=document.getElementById("contacts[phone]["+i+"][number]"),b=document.getElementById("contacts[phone]["+i+"][code_city]"),c=document.getElementById("contacts[phone]["+i+"][code]");if(a)if(a.value!=""||b.value!=""){if(!confirmPhone(a))return!1;if(!confirmCode(b))return!1;if(!confirmCode(c,1)){alert("Введите корректный код страны."),c.focus();return!1}}}return!0}function checkAllDataForNologinEmployer(){checkDataForAdd(!0)&&(document.getElementById("captchaNumber")?(postString=generatePostStringForCheckingCaptcha(0),$.ajax({type:"POST",url:"captcha_new.php",data:postString,success:function(a){a=="OK"&&document.getElementById("company_form").submit(),a=="Error"&&alert("Вы не правильно заполнили цифры на изображении.")},dataType:"text"})):document.getElementById("company_form").submit())}function checkAllDataForUpdateNormalEmployer(){checkDataForUpdate(!1)&&document.getElementById("company_form").submit()}function changeRegistrationAccess(){var a=document.getElementById("registration_access"),b=document.getElementById("registration_access_is_on"),c=document.getElementById("registration_access_is_off");a.value==1?(b.style.display="none",c.style.display="block",a.value=0):(b.style.display="block",c.style.display="none",a.value=1)}function showHideAccessFields(a){var b=document.getElementById("show_access"),c=document.getElementById("not_show_access");a==0?(b.style.display="block",c.style.display="none"):(b.style.display="none",c.style.display="block")}function switchForm(a,b){if(b==1)var c=Array("data[contact_name]");else var c=["data[contact_name]","data[login]","data[password]","password_confirm"];var d=Array("data[contact_name2]");document.getElementById("nologin").value=a;if(a==1){var e="nologin_header",f="login_header",g=d,h=c,i="nologin_star",j="login_star";document.getElementById("nologin_radio").checked=!0}else{var e="login_header",f="nologin_header",g=c,h=d,i="login_star",j="nologin_star";document.getElementById("login_radio").checked=!0}var k=[];k=getElementsByNameIE("td",e);for(var l=0;l<k.length;l++){var m=k[l];m.className="employer_act_header"}var n=getElementsByNameIE("td",f);for(var l=0;l<n.length;l++)m=n[l],m.className="employer_no_act_header";var o=getElementsByNameIE("span",i);for(var l=0;l<o.length;l++){var p=o[l];p.className="employer_act_star"}var q=getElementsByNameIE("span",j);for(var l=0;l<q.length;l++){var p=q[l];p.className="employer_no_act_star"}for(var l=0;l<g.length;l++)input=document.getElementById(g[l]),input.disabled=!1;for(var l=0;l<h.length;l++)input=document.getElementById(h[l]),input.disabled=!0;showHideAccessFields(a)}function getElementsByNameIE(a,b){var c=document.getElementsByTagName(a),d=[];for(i=0,iarr=0;i<c.length;i++)att=c[i].getAttribute("name"),att==b&&(d[iarr]=c[i],iarr++);return d}function checkAllDataForAddNormalEmployer(){var a=document.getElementById("data[login]"),b=!0,c=document.getElementById("employer_id").value;JsHttpRequest.query("ajax_request.php?mode=registration_confirm_login&login_name="+a.value+"&employer_id="+c,{},function(a,b){a.isset_login?(alert(document.getElementById("fraze_confirm_login").value),document.getElementById("data[login]").focus()):checkDataForAdd(!1)&&(document.getElementById("captchaNumber")?(postString=generatePostStringForCheckingCaptcha(0),$.ajax({type:"POST",url:"captcha_new.php",data:postString,success:function(a){a=="OK"&&document.getElementById("company_form").submit(),a=="Error"&&alert("Вы не правильно заполнили цифры на изображении.")},dataType:"text"})):document.getElementById("company_form").submit())},!0)}function checkAllDataForAddEmployer(){var a=document.getElementById("nologin").value;a==0?checkAllDataForAddNormalEmployer():checkAllDataForNologinEmployer()}function checkAllDataForUpdateEmployer(){var a=document.getElementById("nologin").value,b=document.getElementById("old_nologin").value;a==1?checkAllDataForNologinEmployer():a==0&&b==1?checkAllDataForAddNormalEmployer():checkAllDataForUpdateNormalEmployer()}function make_mobile_search_query_params(){var a="",b=0;document.getElementById("SelectVTruck")&&(b=document.getElementById("SelectVTruck").value);var c=0;document.getElementById("SelectWeightFrom")&&(c=document.getElementById("SelectWeightFrom").value);var d=0;document.getElementById("SelectWeightTo")&&(d=document.getElementById("SelectWeightTo").value);var e=document.getElementById("classicCargo_").checked?"cargo":"trans",f=!1,g=!1,h=!1,i="a",j="b",k="d",l="e",m="SelectCountryFrom1";if(document.getElementById(m)){var n=document.getElementById(m);h=n.options[n.selectedIndex].value;if(h&&h+0!=0){var o=n.options[n.selectedIndex].value;o==""?i+="0":i+=o;var p=document.getElementById("SelectRegionFrom1"),o=p.options[p.selectedIndex].value;o?j+=o:j+="0",f=!0}}var m="SelectCountryTo1";if(document.getElementById(m)){var n=document.getElementById(m);h=n.options[n.selectedIndex].value;if(h&&h+0!=0){var o=n.options[n.selectedIndex].value;o==""?k+="0":k+=o;var p=document.getElementById("SelectRegionTo1"),o=p.options[p.selectedIndex].value;o?l+=o:l+="0",g=!0}}j=="b0"&&(j="b"),l=="e0"&&(l="e"),a+=i+j+k+l,a+="f",a+="o",c!==0&&(c!=0&&(a+=c),a+="l",d!=0&&(a+=d));if(!g&&!f){alert(g_phrase[1030]);return!1}a+="h",b!==0&&(a+=b),e=="trans"?a+="k1":a+="k0",a+="m";return a}function find_me_some_mobile_treasures(){var a=make_mobile_search_query_params();if(!a)return!1;var b="http://"+DELLA_URL+ADD_PATH+"/results/?geo="+a;if(b)window.location=b;else return!1}function find_parent_with_class_name(a,b,c){var d=document.getElementById(a),e,f=0,g=c.toLowerCase(),h=b.toLowerCase();do{e=d.parentNode,d=e;if(!e||e.tagName.toLowerCase()=="body")return null;if(e.tagName.toLowerCase()==h&&e.className.toLowerCase().indexOf(g)!=-1)return e}while(f++<1e3)}function selectLanguage(a,b){$("#"+b+" option[value='"+SELECTED_COUNTRY_UID+"']").val()?$("#"+b+" option[value='"+SELECTED_COUNTRY_UID+"']").attr("selected","selected"):$("#"+b+" option[value='164']").attr("selected","selected")}function redraw_ownership(a,b){var c=$("#"+b),d=OWNERSHIP_LIST[a.options[a.selectedIndex].value];SELECTED_COUNTRY_UID=a.options[a.selectedIndex].value;while(c[0].hasChildNodes())c[0].removeChild(c[0].firstChild);var e=0;c[0].options[e++]=new Option("выбрать","0"),c[0].options[e++]=new Option("----------------------------------","0");if(d){c[0].disabled=!1;for(var f in d)c[0].options[e++]=new Option(d[f],f);c[0].options[e++]=new Option("----------------------------------","0")}else c[0].disabled=!0}function redraw_regions(a,b,c,d){var e=find_parent_with_class_name(a.id,"table","multisearchBlock"),f=e.getElementsByTagName("*");for(var g=0;g<f.length;g++)if((f[g].tagName+"").toLowerCase()=="select"){if(f[g].name=="SelectRegion")var h=f[g];if(f[g].name=="SelectCountry")var i=f[g]}var j=listCountries[i.options[i.selectedIndex].value],k=h;while(k.hasChildNodes())k.removeChild(k.firstChild);k.options[0]=new Option(g_phrase[108],"0");try{var l=j.regions}catch(m){l=!1}if(l){var n=1;k.disabled=!1,k.className=b?b:"active_select",d&&(k.options[n++]=new Option("------------------------------",0));for(var g in l)d?l[g][0]>0&&(k.options[n++]=new Option(l[g][1],l[g][0])):k.options[n++]=new Option(l[g][1],l[g][0])}else k.disabled=!0,k.className=c?c:"inactive_select"}function delBookmarkClick(a,b){if(!confirm(b))return!1;var c="http://"+DELLA_URL+ADD_PATH+"/search/bookmark/"+$("#bookmark_number").attr("value")+"/"+a+"/";if(c)window.location=c;else return!1}function find_me_some_treasures(){var a=make_short_search_query_url();if(a)window.location=a;else return!1}function make_short_search_query_url(){var a=make_short_search_query_params();if(!a)return!1;var b="http://"+DELLA_URL+ADD_PATH+"/search/"+a+".html";return b}function make_short_search_query_params(){var a="",b=0;document.getElementById("SelectCube")&&(b=document.getElementById("SelectCube").value);var c=0;document.getElementById("SelectVTruck")&&document.getElementById("SelectVTruck").value!=6&&(c=document.getElementById("SelectVTruck").value);var d=0;document.getElementById("SelectWeight")&&(d=document.getElementById("SelectWeight").value);var e=0;document.getElementById("SelectWeightFrom")&&(e=document.getElementById("SelectWeightFrom").value);var f=0;document.getElementById("SelectWeightTo")&&(f=document.getElementById("SelectWeightTo").value);var g=0;document.getElementById("SelectCubeFrom")&&(g=document.getElementById("SelectCubeFrom").value);var h=0;document.getElementById("SelectCubeTo")&&(h=document.getElementById("SelectCubeTo").value);var i=0;document.getElementById("calInputTextFrom")&&(i=document.getElementById("calInputTextFrom").getAttribute("datevalue").replace(/\//g,"-"));var j=0;document.getElementById("calInputTextTo")&&(j=document.getElementById("calInputTextTo").getAttribute("datevalue").replace(/\//g,"-"));var k=document.getElementById("classicCargo_").checked?"cargo":"trans",l=!1,m=!1,n=-1,o=-1,p=$("[name=marshrutteKeeperFrom] select"),q=$("[name=marshrutteKeeperTo] select"),r=$("[name=marshrutteKeeperFrom] [name=SelectCountry]"),s=$("[name=marshrutteKeeperFrom] [name=SelectRegion]"),t=$("[name=marshrutteKeeperTo] [name=SelectCountry]"),u=$("[name=marshrutteKeeperTo] [name=SelectRegion]"),v=!1,w="a",x="b",y="d",z="e";for(var A=1;A<=8;A++){var B="SelectCountryFrom"+A;if(document.getElementById(B)){var C=document.getElementById(B);v=C.options[C.selectedIndex].value;if(v&&v+0!=0){++n;var D=C.options[C.selectedIndex].value;D==""?w+="0":w+=D,A!=r.length&&(w+="l");var E=document.getElementById("SelectRegionFrom"+A),D=E.options[E.selectedIndex].value;D?x+=D:x+="0",A!=r.length&&(x+="l"),l=!0}}var B="SelectCountryTo"+A;if(document.getElementById(B)){var C=document.getElementById(B);v=C.options[C.selectedIndex].value;if(v&&v+0!=0){++o;var D=C.options[C.selectedIndex].value;D==""?y+="0":y+=D,A!=t.length&&(y+="l");var E=document.getElementById("SelectRegionTo"+A),D=E.options[E.selectedIndex].value;D?z+=D:z+="0",A!=t.length&&(z+="l"),m=!0}}}x=="b0"&&(x="b"),z=="e0"&&(z="e"),a+=w+x+y+z,a+="f";if(g!==0||h!==0)g!=0&&(a+=g),a+="l",h!=0&&(a+=h);a+="o";if(e!==0||f!==0)e!=0&&(a+=e),a+="l",f!=0&&(a+=f);if(!m&&!l){alert(g_phrase[1030]);return!1}a+="h",c!==0&&(a+=c),a+="i";if(i!==0||j!==0){var F=new Date,G=getDateObject(i),H=getDateObject(j),I=!0;F.getDate()==G.getDate()&&F.getMonth()==G.getMonth()&&F.getYear()==G.getYear()&&(F.getDate()==H.getDate()&&H.getMonth()-F.getMonth()==2&&F.getYear()==H.getYear()&&(I=!1),F.getDate()==H.getDate()&&H.getMonth()+12-F.getMonth()==2&&F.getYear()==H.getYear()-1&&(I=!1)),I&&(a+=convertDate(i),a+="l",a+=convertDate(j))}k=="trans"?a+="k1":a+="k0",a+="m";if(document.getElementById("bookmark_number")){var J=document.getElementById("bookmark_number").value;a+=J}return a}function getDateObject(a){var b=a.split("-"),c=b[0],d=b[1];d.substring(0,1)==0&&(d=d.substring(1));var e=b[2];e.substring(0,1)==0&&(e=e.substring(1));return new Date(c,d-1,e,17,35,22)}function convertDate(a){var b=a.split("-"),c=b[0].substring(2),d=b[1];d.length==1&&(d="0"+d);var e=b[2];e.length==1&&(e="0"+e);return c+d+e}function find_next_all(a,b,c){var d=b.toLowerCase(),e=c.toLowerCase();if(typeof a=="object")var f=a;else f=document.getElementById(a);var g=f.nextSibling,h=[];while(g)g.tagName&&g.tagName.toLowerCase()==d&&g.className.toLowerCase().indexOf(e)!=-1&&(h[h.length]=g),g=g.nextSibling;return h}function we_want_more(a,b,c){var d=a.id.substring(a.id.length-1),e=a.id.substring(0,a.id.length-1),f=$("table").filter("[class=multisearchBlock]"),g=$("#"+a.id+"").parents("table[class=multisearchBlock]")[0],h=g.parentNode,i=e.toLowerCase().indexOf("from")!=-1,j=$(g).find("label")[0],k=$(j).find("span")[0];if(a.checked){var l=d;l++;if(f.length>=8){a.checked=!1,alert(g_phrase[1029]);return!1}var m=g.cloneNode(!0);b&&(j.style.color=c?"#5b6264":"black",k.style.visibility="visible");var n=a.id.substring(0,a.id.length-1),o=$(m).find("select").filter("[name=SelectCountry]")[0].id.substring(0,$(m).find("select").filter("[name=SelectCountry]")[0].id.length-1),p=$(m).find("select").filter("[name=SelectRegion]")[0].id.substring(0,$(m).find("select").filter("[name=SelectRegion]")[0].id.length-1),q=$(m).find("input").filter("type=checkbox").prevObject[0];q.checked=!1,q.id=n+l+"";var r=$(m).find("label")[0];r.setAttribute("for",q.id),r.htmlFor=q.id;var s=$(m).find("select").filter("[name=SelectCountry]")[0];s.id=o+l,a.id.substring(0,a.id.length-1)=="cbxMoreFrom"?s.selectedIndex=document.getElementById("SelectCountryFrom"+d).selectedIndex:s.selectedIndex=document.getElementById("SelectCountryTo"+d).selectedIndex;var t=$(m).find
("select").filter("[name=SelectRegion]")[0];t.id=p+l,a.id.substring(0,a.id.length-1)=="cbxMoreFrom"?t.selectedIndex=document.getElementById("SelectRegionFrom"+d).selectedIndex:t.selectedIndex=document.getElementById("SelectRegionTo"+d).selectedIndex;var u=find_parent_with_class_name(a.id,"table","multisearchBlock");u==g&&h.appendChild(m)}else{var v=find_next_all(g,"table","multisearchBlock"),w=v[0],x=v[1];x?a.checked=!0:b&&(j.style.color="#949494",k.style.visibility="hidden"),h.removeChild(w)}}function showRequestSearchWnd(a){var b=$("#bookmark_number")[0],c=$("#state_scan_cb")[0];a?b.value=a:b.value=1,blockRequestsSycle=!0,hwndRequestSearch||(hwndCfg.header.title=g_phrase[937],hwndCfg.width=CURRENT_LANG=="kz"?857:757,hwndRequestSearch=new EvaxModalWindow(hwndCfg)),hwndRequestSearch.show();return!1}function JsHttpRequest_query(a,b,c,d){a+=a.indexOf("?")==-1?"?":"&";return JsHttpRequest.query(a,b,function(a,b){parse_json(a,b,d)},c)}function parse_json(a,b,c){a&&typeof c=="function"&&c(a,b),b&&(document.getElementById("tsetingdiv").innerHTML=b)}function nameoflog(){document.getElementById("nameoflog").innerHTML=document.getElementById("qwerty").value}function zaglushka(a){a?alert(g_phrase[964]):alert(g_phrase[965]);return!1}function go_to_classic_main_page(a,b){var c=a=="cargo"?"Cargo":"Trans",d=document.getElementById("SelectCountryFrom"+c).value,e=document.getElementById("SelectCountryTo"+c).value,f=document.getElementById("SelectRegionFrom"+c).value,g=document.getElementById("SelectRegionTo"+c).value,h="";if(!a){if(d==0&&e==0){alert("Укажите страну отправления либо страну прибытия");return!1}h=document.getElementById("classicCargo").checked?"cargo":"trans"}else h=a=="cargo"?"cargo":"trans";if(!b){var i=new String("http://"+DELLA_URL+ADD_PATH+"/classic/?");d!=0&&(i+="from_country="+d),f!=0&&(i+="&from_region="+f),e!=0&&(i+="&to_country="+e),g!=0&&(i+="&to_region="+g),h!="cargo"&&(i+="&order_type="+h)}else{var j=new String("http://"+DELLA_URL+ADD_PATH+"/search/"),i=new String(""),k="a",l="b",m="d",n="e";d!=0&&(k+=d),f!=0&&(l+=f),e!=0&&(m+=e),g!=0&&(n+=g),i+=k+l+m+n,i+="f",i+="l",i+="o",i+="l",i+="h",i+="0",i+="i",h=="trans"?i+="k1":i+="k0",i+="m1"}i!=""&&(i+=".html"),i=j+i,window.location=i}function country_change(a,b,c,d){var e=listCountries[a.options[a.selectedIndex].value],f=null;a.id=="SelectCountryFrom"?f="SelectRegionFrom":a.id=="SelectCountryTo"?f="SelectRegionTo":a.id=="SelectCountryFromTrans"?f="SelectRegionFromTrans":a.id=="SelectCountryToTrans"?f="SelectRegionToTrans":a.id=="SelectCountryToCargo"?f="SelectRegionToCargo":a.id=="SelectCountryFromCargo"&&(f="SelectRegionFromCargo"),!f&&d&&(f=d);var g=document.getElementById(f);while(g.hasChildNodes())g.removeChild(g.firstChild);g.options[0]=new Option(g_phrase[108],"0");try{var h=e.regions}catch(i){var h=!1}if(h){var j=1;g.disabled=!1,g.className=b?b:"active_select";for(var k in h)g.options[j++]=new Option(h[k][1],h[k][0])}else g.disabled=!0,g.className=c?c:"inactive_select"}function moveSelect(a,b){clearInterval(sIntVal),divs=a.getElementsByTagName("div"),selectedNumDivId!=-1&&selectDiv(document.getElementById(selectedNumDivId)),b==!0&&(selectedNumDivId<divs.length-1?(selectedNumDivId++,unSelectDiv(document.getElementById(selectedNumDivId))):(selectedNumDivId=0,unSelectDiv(document.getElementById(selectedNumDivId)))),b||(selectedNumDivId!=0&&selectedNumDivId!=-1?(selectedNumDivId--,unSelectDiv(document.getElementById(selectedNumDivId))):(selectedNumDivId=divs.length-1,unSelectDiv(document.getElementById(selectedNumDivId))))}function clickDiv(a,b,c,d,e){if(b){inp=document.getElementById(b.getAttribute("own"));if(d){inpNumber=inp.getAttribute("numberinp"),inpInOut=inp.getAttribute("inout"),inpRegion=document.getElementsByName("request[r"+inpInOut+"id]["+inpNumber+"]"),inpCountry=document.getElementsByName("request[c"+inpInOut+"id]["+inpNumber+"]"),inpCity=document.getElementsByName("request[cit"+inpInOut+"id]["+inpNumber+"]");if(c){var f=document.getElementById("citid"+selectedNumDivId);f&&(inpCity[0].value=f.value,f.getAttribute("rid")&&(inpRegion[0].value=f.getAttribute("rid")),f.getAttribute("cid")&&(inpCountry[0].value=f.getAttribute("cid")))}if($("#select_region_uid option")){var g=f.getAttribute("rid");$("#select_region_uid option[value='"+g+"']").val()?$("#select_region_uid option[value='"+g+"']").attr("selected","selected"):$("#select_region_uid option[value='0']").attr("selected","selected")}}c&&(inp.value=document.getElementById("span"+selectedNumDivId).innerHTML),e&&document.getElementById("span_r"+selectedNumDivId)&&(inp.value+=", "+document.getElementById("span_r"+selectedNumDivId).innerHTML),inp.setAttribute("flagReq",0),b.innerHTML="",b.style.display="none",selectedNumDivId=-1,clearInterval(sIntVal)}return!1}function unSelectDiv(a){isMouseOn=1;if(!a)return!1;selectedNumDivId!=-1&&selectDiv(document.getElementById(selectedNumDivId)),a.className="srs",selectedNumDivId=a.id}function selectDiv(a,b){isMouseOn=0;if(!a)return!1;a.className="sr",b==!0&&(selectedNumDivId=-1)}function inputGetPeep(a,b,c,d){function o(){typeof o.fWasBadPhraseDivDraw=="undefined"&&(o.fWasBadPhraseDivDraw=!1),typeof o.fWasBadPhraseDivClear=="undefined"&&(o.fWasBadPhraseDivClear=!1),text=g.value;if(!g.wasBckSpc&&text.length<2)return!1;rtplBadPhrase=["любой","будь-який"],itplBadPhraseMax=rtplBadPhrase.length-1;if(typeof text=="undefined")return!1;for(var c=0;c<=itplBadPhraseMax;c++){var e=text.indexOf(rtplBadPhrase[c],0);if(e!=-1){var f=!0;break}var f=!1}var p=document.getElementById("div_bad_phrase");if(p!=null)var q=!0;else var q=!1;if(f&&!o.fWasBadPhraseDivDraw){document.getElementById(k).style.display="block",document.getElementById(l).style.display="block",document.getElementById(k).innerHTML='<div onclick="" class="sr" style="cursor: default;" id="div_bad_phrase"> <span onclick="" class="srt" id="span0">'+g_phrase[1064]+"</span></div>",inputGetPeep.fWasBadPhraseDivDraw=!0,o.fWasBadPhraseDivDraw=!0,o.fWasBadPhraseDivClear=!1;return!0}if(f&&o.fWasBadPhraseDivDraw&&!q){document.getElementById(k).style.display="block",document.getElementById(l).style.display="block",document.getElementById(k).innerHTML='<div  onclick="return false;" class="sr" style="cursor: default;" id="div_bad_phrase"> <span onclick="return false;" class="srt" id="span0">'+g_phrase[1064]+"</span></div>",inputGetPeep.fWasBadPhraseDivDraw=!0,o.fWasBadPhraseDivDraw=!0,o.fWasBadPhraseDivClear=!1;return!0}if(f&&o.fWasBadPhraseDivDraw&&!o.fWasBadPhraseDivClear)return!0;!f&&o.fWasBadPhraseDivDraw&&!o.fWasBadPhraseDivClear&&(document.getElementById(k).style.display="none",document.getElementById(l).style.display="none",document.getElementById(k).innerHTML="",inputGetPeep.fWasBadPhraseDivDraw=!1,o.fWasBadPhraseDivDraw=!1,o.fWasBadPhraseDivClear=!0),url="ajax_drop_down.php?mode=city_hint_old";if(text!=n){n=text,selectedNumDivId=-1;if(text&&g.getAttribute("flagReq")!=0){var r=0;typeof SELECTED_COUNTRY_UID!="undefined"&&(r=SELECTED_COUNTRY_UID),m.setAttribute("own",a),params={mode:"city_hint_old",is_trans:b?1:0,name:text,input:a,isShowWp:d,cntr_uid:r},JsHttpRequest.query(url,params,function(a,b){h=!0,document.getElementById(k).style.display="none",document.getElementById(l).style.display="none",document.getElementById(k).innerHTML="";var c=0;a.hint_cities&&!i?(document.getElementById(k).style.display="block",document.getElementById(l).style.display="block",document.getElementById(k).innerHTML=a.hint_cities):(document.getElementById(k).innerHTML="",document.getElementById(k).style.display="none",document.getElementById(l).style.display="none");if(window.navigator.userAgent.indexOf("MSIE")!=-1&&a.hint_cities!=""&&j&&j.length)for(c=0;c<j.length;c++){var d=document.getElementById(j[c]);d&&(d.style.visibility="hidden")}},!1),selectedNumDivId=0}else{if(window.navigator.userAgent.indexOf("MSIE")!=-1&&j&&j.length)for(var s=0;s<j.length;s++){var t=document.getElementById(j[s]);t&&(t.style.visibility="visible")}document.getElementById(k).innerHTML="",document.getElementById(k).style.display="none"}}}function f(a){var b=a?a:window.event,d=b.charCode?a.charCode:b.keyCode;switch(d){case 27:escapeKey(k);return!1;case 38:if(document.getElementById(k).innerHTML=="")return!1;clearInterval(sIntVal),moveSelect(m);return!1;case 40:if(document.getElementById(k).innerHTML=="")return!1;clearInterval(sIntVal),moveSelect(m,!0);return!1;case 13:if(document.getElementById("div_bad_phrase")!=null)return!1;if(selectedNumDivId!=-1){g.value=document.getElementById("span"+selectedNumDivId).innerHTML,e&&document.getElementById("span_r"+selectedNumDivId)&&(g.value+=", "+document.getElementById("span_r"+selectedNumDivId).innerHTML);if(c){inpNumber=g.getAttribute("numberinp"),inpInOut=g.getAttribute("inout"),inpRegion=document.getElementsByName("request[r"+inpInOut+"id]["+inpNumber+"]"),inpCountry=document.getElementsByName("request[c"+inpInOut+"id]["+inpNumber+"]"),inpCity=document.getElementsByName("request[cit"+inpInOut+"id]["+inpNumber+"]");var f=document.getElementById("citid"+selectedNumDivId);f&&(inpCity[0].value=f.value,f.getAttribute("rid")&&(inpRegion[0].value=f.getAttribute("rid")),f.getAttribute("cid")&&(inpCountry[0].value=f.getAttribute("cid")))}escapeKey(k),clearInterval(sIntVal);if($("#select_region_uid option")){var h=f.getAttribute("rid");$("#select_region_uid option[value='"+h+"']").val()?$("#select_region_uid option[value='"+h+"']").attr("selected","selected"):$("#select_region_uid option[value='0']").attr("selected","selected")}}g.setAttribute("flagReq",0),clearInterval(sIntVal);return!1;case 9:break;case 8:g.wasBckSpc=1;break;default:c&&(inpNumber=g.getAttribute("numberinp"),inpInOut=g.getAttribute("inout"),inpRegion=document.getElementsByName("request[r"+inpInOut+"id]["+inpNumber+"]"),inpCountry=document.getElementsByName("request[c"+inpInOut+"id]["+inpNumber+"]"),inpCity=document.getElementsByName("request[cit"+inpInOut+"id]["+inpNumber+"]"),inpRegion[0].value="",inpCountry[0].value="",inpCity[0].value=""),g.wasBckSpc=0,g.setAttribute("flagReq",1),sIntVal=setInterval(o,1e3)}}var e=!1,g=document.getElementById(a);if(!!g){g.setAttribute("flagReq",1),g.onkeydown=f;var h=!1,i=!1,j=hideSelectList[a];g.onfocus=function(){g.className=="regCommentInput"&&(g.className="regCommentInputBlack"),sIntVal=setInterval(o,1e3),h=!1,i=!1},typeof inputGetPeep.fWasBadPhraseDivDraw=="undefined"&&(inputGetPeep.fWasBadPhraseDivDraw=!1),g.onblur=function(a){h||(i=!0),selectedNumDivId!=-1&&(isMouseOn==1&&!inputGetPeep.fWasBadPhraseDivDraw?clickDiv(!1,m,!0,c,e):clickDiv(!1,m,!1,c,e)),document.getElementById(k).innerHTML="",document.getElementById(k).style.display="none",document.getElementById(k+"x").style.display="none",selectedNumDivId=-1};var k=g.getAttribute("peepDiv"),l=k+"x",m=document.getElementById(k),n=""}}function escapeKey(a){document.getElementById(a).innerHTML="",document.getElementById(a).style.display="none",document.getElementById(a+"x").style.display="none",selectedNumDivId=-1;return!1}function initInputsTrans(a){inputGetPeep("cityIn[0]",!0,!0,1),inputGetPeep("cityIn[1]",!0,!0,1),inputGetPeep("cityIn[2]",!0,!0,1),inputGetPeep("cityIn[3]",!0,!0,1),inputGetPeep("cityIn[4]",!0,!0,1),inputGetPeep("cityIn[5]",!0,!0,1),inputGetPeep("cityIn[6]",!0,!0,1),inputGetPeep("cityIn[7]",!0,!0,1),inputGetPeep("cityOut[0]",!0,!0,1),inputGetPeep("cityOut[1]",!0,!0,1),inputGetPeep("cityOut[2]",!0,!0,1),inputGetPeep("cityOut[3]",!0,!0,1),inputGetPeep("cityOut[4]",!0,!0,1),inputGetPeep("cityOut[5]",!0,!0,1),inputGetPeep("cityOut[6]",!0,!0,1),inputGetPeep("cityOut[7]",!0,!0,1)}function initInputsCargo(){inputGetPeep("cityIn[0]",!0,!0,0),inputGetPeep("cityIn[1]",!0,!0,0),inputGetPeep("cityIn[2]",!0,!0,0),inputGetPeep("cityIn[3]",!0,!0,0),inputGetPeep("cityIn[4]",!0,!0,0),inputGetPeep("cityIn[5]",!0,!0,0),inputGetPeep("cityIn[6]",!0,!0,0),inputGetPeep("cityIn[7]",!0,!0,0),inputGetPeep("cityOut[0]",!0,!0,0),inputGetPeep("cityOut[1]",!0,!0,0),inputGetPeep("cityOut[2]",!0,!0,0),inputGetPeep("cityOut[3]",!0,!0,0),inputGetPeep("cityOut[4]",!0,!0,0),inputGetPeep("cityOut[5]",!0,!0,0),inputGetPeep("cityOut[6]",!0,!0,0),inputGetPeep("cityOut[7]",!0,!0,0)}function messagePager(a,b,c,d){if(typeof a=="undefined"||a=="")return!1;d==-1&&(document.getElementById("mess_prev").style.color="red"),d==1&&(document.getElementById("mess_next").style.color="red"),JsHttpRequest.query("new_ajax.php",{mode:"user_message",user_id:a,type:b,page_number:c},function(a){a&&a.html&&($("#message").html(a.html),showUserMessageWnd(a.user_name))},!0)}function messagesIsRead(a,b,c,d,e){var f=document.getElementById("delete_mess_dots"+c);e.style.color="red",f.style.color="red",JsHttpRequest.query("new_ajax.php",{mode:"user_message",status:"is_read",user_id:a,message_id:c},function(e){e&&(countMessages(a,c),messagePager(a,b,d))},!0)}function showMessage(a,b){var c;b==1?c=$("#partner_message_content"):c=$("#message_content"),c.css("color","red");if(typeof a=="undefined"||a=="")return!1;JsHttpRequest.query("new_ajax.php",{mode:"user_message",user_id:a,type:b},function(a){a&&(a.html?($("#message").html(a.html),showUserMessageWnd(a.user_name)):alert(g_phrase[1771]+"!"),c.css("color","#286B98"))},!0)}function countMessages(a,b){language_postfix=$("#language_postfix").val(),JsHttpRequest.query("new_ajax.php",{mode:"user_message",sub_mode:"count",user_id:a},function(a){a&&(typeof b!=undefined&&b!=""&&$("#message_"+b).css("display","none"),a.user_count==0&&a.partner_count==0?($("#main_menu_bottom").css("display","none"),$("#main_menu_bottom").removeClass("scroll_poplavok_menu")):($("#main_menu_bottom").addClass("scroll_poplavok_menu"),$("#main_menu_bottom").css("display","block")),a.user_count==0?($("#empty_messages").css("display","block"),$("#message_content").html(g_phrase[1772]),$("#message_content").css("background-color","transparent"),$("#message_content").bind("mouseover",function(){$("#message_content").css("background-color","#f4fefe")}),$("#message_content").bind("mouseout",function(){$("#message_content").css("background-color","transparent")})):($("#message_content").html(g_phrase[1772]+" ("+a.user_count+")"),$("#message_content").css("background-color","#ffeecc")),a.partner_count==0?($("#empty_messages").css("display","block"),$("#partner_message_content").html(g_phrase[2234]),$("#partner_message_content").css("background-color","transparent"),$("#partner_message_content").bind("mouseover",function(){$("#partner_message_content").css("background-color","#f4fefe")}),$("#partner_message_content").bind("mouseout",function(){$("#partner_message_content").css("background-color","transparent")})):($("#partner_message_content").html(g_phrase[2234]+" ("+a.partner_count+")"),$("#partner_message_content").css("background-color","#eeeeee")))},!0)}function showUserMessageWnd(a){hwndUserMessage||(hwndUserMessage=new EvaxModalWindow(hwndCfgUserMessage)),$("#UserMessage_title").html(g_phrase[1773]+" "+a),hwndUserMessage.show();return!1}function openResponseCloseMsg(){hwndUserMessage.close(),showResponseWnd()}function TopicSelect(){document.getElementById("response_topic").options[2].selected==!0?($("#response_text").css("display","none"),$("#response_place_cargo").css("display","none"),$("#response_place_transport").fadeIn("slow"),$("#send_response").css("display","none"),$("#send_response_disabled").fadeIn("slow")):document.getElementById("response_topic").options[3].selected==!0?($("#response_text").css("display","none"),$("#response_place_transport").css("display","none"),$("#response_place_cargo").fadeIn("slow"),$("#send_response").fadeOut("slow"),$("#send_response").css("display","none"),$("#send_response_disabled").fadeIn("slow")):($("#response_place_cargo").css("display","none"),$("#response_place_transport").css("display","none"),$("#response_text").fadeIn("slow"),$("#send_response_disabled").css("display","none"),$("#send_response").fadeIn("slow"))}function isValidEmail(a){var b=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;return a.match(b)}function sendresponse(a,b){if(typeof a=="undefined"||a=="")return!1;name=$("#response_name").val(),email=$("#response_email").val(),phone=$("#response_phone").val(),response=$("#response_response").val(),topic=$("#response_topic option:selected").val();if(name==""){alert(g_phrase[1747]),$("#response_name").focus();return!1}if(email==""){alert(g_phrase[1749]),$("#response_email").focus();return!1}valid=isValidEmail(email);if(valid==null){alert(g_phrase[1748]),$("#response_email").focus();return!1}if(topic>100){alert(g_phrase[1848]),$("#response_topic").focus();return!1}if(response==""){alert(g_phrase[1750]),$("#response_response").focus();return!1}JsHttpRequest.query("new_ajax.php",{mode:"response",name:name,email:email,phone:phone,topic_type:topic,response:response,user_id:a,page_url:b},function(a){a&&alert(g_phrase[1745]+"\n"+g_phrase[1746])},!0),$("#response_response").val(""),$("#response_topic option:first").attr("selected","selected"),hwndResponse.close()}function showResponseWnd(){hwndResponse||(hwndResponse=new EvaxModalWindow(hwndCfgResponse)),hwndResponse.positionY=125,hwndResponse.show();return!1}function goToMobileVersion(a){JsHttpRequest.query("new_ajax.php",{mode:"go_to_mobile_version"},function(b,c){window.location.href="http://mob.della."+a},!1)}function checkIfShowMobileLink(a){var b=477,c=0;if(screen.width<b||screen.height<b)c=1;document.getElementById("go_to_mob_version")&&c==1&&(document.getElementById("go_to_mob_version").style.display="")}function ChangeLanguage(a,b,c){var d=new Date;d.setMonth(d.getMonth()+12),document.cookie="USERLANG="+escape(b)+"; expires="+d.toGMTString()+"; path=/"+"; domain="+a,document.location=c}function liveinternet_cnt(){if(document.getElementById("liveintervetImg"))try{var a="http://counter.yadro.ru/hit?t44.1;r"+escape(document.referrer)+(typeof screen=="undefined"?"":";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+";"+Math.random();document.getElementById("liveintervetImg").src=a}catch(b){}}function selectBookmark(a,b){if(selectedBookmarkNum!=b){unUnderline(a),ToggleShowHideElem("dots_"+b),document.getElementById("bookmark_menu_"+b).style.color="#ff0000",selectedBookmarkNum=b;var c=["UaCargo","WorldCargo","UaTrans","WorldTrans"],d="ajax_request.php?mode=main_page_list",e={list:c[b],numBookmark:b};JsHttpRequest_query(d,e,!0,function(c,d){c&&(ReloadList(c),lightBookmarkTopFull(a,b),document.getElementById("hdr_real_time").innerHTML=hdr_real_time[b][0],document.getElementById("linkHeaderShowAllRequests").innerHTML=hdr_real_time[b][1],document.getElementById("linkHeaderShowAllRequests").href=hdr_real_time[b][2].replace(regexp_ua_id,document.getElementById("hdnUkrId").value)),b==2||b==3?document.getElementById("zirkaTop").style.display="none":document.getElementById("zirkaTop").style.display="block"})}}function ReloadList(a){$("#request_list").html(a.html),numBookmark=a.numBookmark;if(numBookmark==1||numBookmark==3)document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_eu.jpg')";else switch(CURRENT_LOCALE){case RU_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/ru_map_bg.jpg')";break;case UA_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/ukr_map_bg.jpg')";break;case BY_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/by_map_bg.jpg')";break;case KAZ_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/kz_map_bg.jpg')";break;case LIT_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/lt_map_bg.jpg')";break;case MDA_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/md_map_bg.jpg')";break;case TAJ_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/tj_map_bg.jpg')";break;case GE_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_ge.jpg')";break;case UZB_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_uzb.jpg')";break;case AZE_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_aze.jpg')";break;case ARM_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_arm.jpg')";break;case EE_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_ee.jpg')";break;case LAT_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_lat.jpg')";break;case TM_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_tm.jpg')";break;case KGZ_LOCALE:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_kgz.jpg')";break;default:document.getElementById("contentDiv").style.backgroundImage="url('/img/mp_classic/map_eu.jpg')"}ToggleShowHideElem("dots_"+numBookmark),document.getElementById("bookmark_menu_"+numBookmark).style.color="#517aac"}function ToggleShowHideElem(a,b){b==null&&(b="display"),id=document.getElementById(a),id!==null&&(b==="display"&&(id.style.display=="none"?id.style.display="":id.style.display="none"),b==="visibility"&&(id.style.visibility=="hidden"?id.style.visibility="visible":id.style.visibility="hidden"))}function unUnderline(a){a&&(a.style.textDecoration="none")}function underlineBookmarkMenu(a,b){b!=selectedBookmarkNum&&underline(a)}function underline(a){a&&(a.style.textDecoration="underline")}function showRecoverPwdWnd(){hwndLogin.close(),document.getElementById("loginEmail").value="";var a={newWindowId:"recoverPwdWnd",header:{closeBtn:!0},positionX:null,positionY:158,height:null,width:560,bgDiv:{color:"#343434",opacity:20},cssStyleClass:"enterWnd",contentId:"recoverPwdWndContent",onClose:function(){blockRequestsSycle=!1},thisObjName:"hwndRecoverPass"};hwndRecoverPass||(a.header.title=g_phrase[1023],hwndRecoverPass=new EvaxModalWindow(a)),hwndRecoverPass.show();return!1}function zaglushkaTesting(){alert(g_phrase[1022]);return!1}function showEnterWnd(a){blockRequestsSycle=!0,a||(a=0),a!=1&&(document.getElementById("login").value=""),document.getElementById("password").value="";var b={newWindowId:"enterWnd",header:{closeBtn:!0},positionX:null,positionY:158,height:null,width:560,bgDiv:{color:"#343434",opacity:20},cssStyleClass:"enterWnd",contentId:"enterWndContent",onClose:function(){blockRequestsSycle=!1},thisObjName:"hwndLogin"};hwndLogin||(b.header.title=g_phrase[1021],hwndLogin=new EvaxModalWindow(b)),hwndLogin.show(),document.getElementById("login").focus();return!1}function initCityInputs(){inputGetPeep("from_input",!1,!0,!0),inputGetPeep("to_input",!1,!0,!0),inputGetPeep("from_input2",!0,!0,!0),inputGetPeep("to_input2",!0,!0,!0),inputGetPeep("from_input_dist",!1,!0,!0),inputGetPeep("to_input_dist",!1,!0,!0)}function lightBookmarkTopFull(a,b){var c=b+1;document.getElementById("full_header").className="full_header_"+c}function remind_pwd_support(){var a=document.getElementById("remind_pwd_support_company_name").value,b=document.getElementById("remind_pwd_support_phone").value,c=document.getElementById("remind_pwd_support_contact_name").value;if(a==""){alert(g_phrase[1309]);return!1}if(c==""){alert(g_phrase[1311]);return!1}if(b==""){alert(g_phrase[1310]);return!1}var d="/ajax_request.php?mode=remind_pwd_support";JsHttpRequest_query(d,{company_name:a,phone:b,contact_name:c,login:g_login},!0,function(a){a.result==!1?zaglushka(!1):alert(g_phrase[1313])});return!0}function handle_remind_pwd(a,b){if(a.result=="no_such_login")alert(g_phrase[1025]+' "'+b+'" '+g_phrase[1026]);else{if(a.result=="login_has_not_email"){hwndRecoverPass.close();var c={newWindowId:"remindPwdSupportWnd",header:{closeBtn:!0},positionX:null,positionY:158,height:null,width:560,bgDiv:{color:"#343434",opacity:20},cssStyleClass:"enterWnd",contentId:"remindPwdSupportWndContent",onClose:function(){blockRequestsSycle=!1},thisObjName:"hwndRemindPwdSupport"};hwndRemindPwdSupport||(c.header.title=g_phrase[1023],hwndRemindPwdSupport=new EvaxModalWindow(c)),hwndRemindPwdSupport.show();return!1}a.result!=""&&a.result!=0?alert(g_phrase[1027]+' "'+b+'" '+g_phrase[1028]):zaglushkaTesting()}}function remind_pwd(){var a=document.getElementById("loginEmail").value;g_login=a;if(a==""){alert(g_phrase[1024]);return!1}var b="/ajax_request.php?mode=remind_pwd&login="+a;JsHttpRequest_query(b,null,!0,function(b){handle_remind_pwd(b,a)});return!1}function operatorNewScroll(){this.name.indexOf("della")>-1&&this.scroll(0,175)}function exit(a,b){confirm(g_phrase[2351])&&(window.location="/?login_mode=exit&login="+a+"&cookie_id="+b)}function enter(){var a=document.getElementById("login"),b=/^[\w\@\.\-]{5,}$/;if(b.test(a.value))document.getElementById("logForm").action=document.location.pathname,document.getElementById("logForm").submit();else{document.getElementById("errorMes").innerHTML="&nbsp;"+g_phrase[983],a.value="";return!1}}function EvaxModalWindow(a){a.header?(a.header.title?this.headerTitle=a.header.title:this.headerTitle="",a.header.closeBtn?this.headerCloseBtn=!0:this.headerCloseBtn=!1,this.showHeader=!0):this.showHeader=!1,a.positionX?this.positionX=a.positionX:this.positionX=null,a.positionY?this.positionY=a.positionY:this.positionY=null,a.width?this.width=a.width:this.width=null,a.height?this.height=a.height:this.height=null,a.bgDiv?(a.bgDiv.color?this.bgDivColor=a.bgDiv.color:this.bgDivColor="#ff0000",a.bgDiv.opacity?this.bgDivOpacity=a.bgDiv.opacity:this.bgDivopacity=50,this.showBgDiv=!0):this.showBgDiv=!1,a.cssStyleClass&&(this.cssStyleClass=a.cssStyleClass),a.newWindowId&&(this.newWindowId=a.newWindowId),a.contentId&&(this.contentId=a.contentId),a.thisObjName&&(this.thisObjName=a.thisObjName),a.onClose&&(this.onCloseEvt=a.onClose),this.createWindow()}EvaxModalWindow.prototype.close=function(){this.divElem.style.display="none",this.showBgDiv&&(this.overdivElem.style.display="none"),this.onCloseEvt();return!1},EvaxModalWindow.prototype.createWindow=function(){this.divElem=document.createElement("DIV"),this.divElem.className=this.cssStyleClass,this.divElem.id=this.newWindowId,this.width!==null&&(this.divElem.style.width=this.width+"px"),this.height!==null&&(this.divElem.style.height=this.height+"px");var a="";a+='<table class="karkas" width="100%" cellpadding="0" cellspacing="0" border="0">',a+='<tr id="'+this.divElem.id+'_header_tr">',a+='<td class="hdr_td" valign="middle">',a+='<div class="hdr" id="'+this.divElem.id+'_title">'+this.headerTitle+'</div><div class="close"><a href="#" onClick="'+this.thisObjName+'.close();return false;"><img border="0" src="/img/mp_classic/close_x.gif" /></a></div>',a+="</td>",a+="</tr>",a+="<tr>",a+='<td valign="top" class="content_td" id="'+this.divElem.id+"_content_container"+'">',a+="</td>",a+="</tr>",a+="</table>",this.divElem.innerHTML=a,document.body.appendChild(this.divElem),document.getElementById(this.newWindowId+"_content_container")&&(document.getElementById(this.newWindowId+"_content_container").appendChild(document.getElementById(this.contentId)),document.getElementById(this.contentId).style.display="block"),this.showHeader===!1&&(document.getElementById(this.divElem.id+"_header_tr").style.display="none")},EvaxModalWindow.prototype.setPosition=function(){this.positionX!==null?this.divElem.style.left=this.positionX+"px":this.divElem.style.left=Math.round(document.body.clientWidth/2-this.calcWidth(this.divElem)/2)+"px";var a=document.documentElement.scrollTop;a==0&&(a=document.body.scrollTop);if(this.positionY!==null)this.divElem.style.top=this.positionY+a+"px";else{var b=Math.round(a+this.getScreenHeightSeen()/2-this.calcHeight(this.divElem)/2);b>=0?this.divElem.style.top=b+"px":this.divElem.style.top=a+10+"px"}},EvaxModalWindow.prototype.createOverlay=function(){document.getElementById("overlay")?this.overdivElem=document.getElementById("overlay"):(this.overdivElem=document.createElement("DIV"),this.overdivElem.id="overlay",document.body.appendChild(this.overdivElem)),this.overdivElem&&this.showBgDiv&&(this.overdivElem.style.backgroundColor=this.bgDivColor,this.setOpacity(this.overdivElem,this.bgDivOpacity),this.overdivElem.style.height=this.getScreenHeight()+"px",this.overdivElem.style.display="block")},EvaxModalWindow.prototype.getScreenHeightSeen=function(){var a=0,b=0;window.innerHeight&&(a=window.innerHeight),document.body&&document.body.clientHeight&&(b=document.body.clientHeight);var c=Math.max(a,b);return c},EvaxModalWindow.prototype.getScreenHeight=function(){var a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),c=Math.max(a,b),d=0;window.innerHeight&&(d=window.innerHeight),c=Math.max(c,d);return c},EvaxModalWindow.prototype.show=function(){this.divElem.style.display="block",this.showBgDiv&&this.createOverlay(),this.setPosition()},EvaxModalWindow.prototype.hide=function(){this.divElem.style.display="none"},EvaxModalWindow.prototype.setOpacity=function(a,b){var c=this.$(a);c&&(typeof c.style.opacity=="string"&&(c.style.opacity=b/100),typeof c.style.filter=="string"&&(c.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")"),typeof c.style.MozOpacity=="string"&&(c.style.MozOpacity="0."+b),typeof c.style.KhtmlOpacity=="string"&&(c.style.KhtmlOpacity="0."+b),b==100&&(typeof c.style.MozOpacity=="string"?c.style.MozOpacity="1.0":typeof c.style.KhtmlOpacity=="string"&&(c.style.KhtmlOpacity="1.0")))},EvaxModalWindow.prototype.calcHeight=function(a){var b=this.$(a),c=0;b&&(b.offsetHeight?c=b.offsetHeight:b.clip&&b.clip.height?c=b.clip.height:b.style&&b.style.pixelHeight?c=b.style.pixelHeight:b.clientHeight&&(c=b.clientHeight));return parseInt(c,10)},EvaxModalWindow.prototype.calcWidth=function(a){var b=this.$(a),c=0,d="";b&&(b.offsetWidth?c=b.offsetWidth:b.clip&&b.clip.width?c=b.clip.width:b.style&&b.style.pixelWidth?c=b.style.pixelWidth:b.clientWidth&&(c=b.clientWidth));return parseInt(c,10)},EvaxModalWindow.prototype.$=function(a){var b=null;typeof a=="string"?document.getElementById(a)&&(b=document.getElementById(a)):typeof a=="object"&&a&&(b=a);return b};var cookie=" "+document.cookie,search=" della_request_v2=",lang=null,offset=0,end=0;cookie.length>0&&(offset=cookie.indexOf(search),offset!=-1&&(offset+=search.length,end=cookie.indexOf(";",offset),end==-1&&(end=cookie.length),lang=unescape(cookie.substring(offset,end)))),lang||alert(g_phrase[2252]+" "+g_phrase[2251]);var g_login="",hwndRemindPwdSupport=null,requestsCntOnePage=20,opacityDelay=150,oneRequestDelay=200,sclToWaitCnt=15,request_list_tr_num=0,request_list_tr_num_global=0,cklNum=0,timerHandler=null,namePartNum=0,hdrName="",sclToWait=sclToWaitCnt,blockRequestsSycle=!1,selectedBookmarkNum=0,hwndLogin=null,hwndRecoverPass=null,regexp_ua_id=new RegExp("{ua_id}","gi");$(document).click(function(a){if($(a.target).hasClass("my_menu")||$(a.target).parent().hasClass("my_menu")||$("#nav").is(":visible:not(:animated)"))if($.browser.msie)$("#nav").toggle(),$(".my_menu").toggleClass("opened");else{var b=$("#nav").is(":visible");b||$(".my_menu").toggleClass("opened"),$("#nav").slideToggle(function(){b&&$(".my_menu").toggleClass("opened")})}}),$(document).ready(function(){var a=[],b=["/img/my_menu_closed.png","/img/my_menu_opened.png","img/my_menu_bg_active.png"],c;for(c=0;c<b.length;c++)a[c]=new Image,a[c].src=b[c];$("#nav").click(function(a){a.stopPropagation()})});var hwndResponse=null,hwndCfgResponse={newWindowId:"Response",header:{title:"",closeBtn:!0},positionX:null,positionY:245,height:null,width:610,bgDiv:{color:"#343434",opacity:20},cssStyleClass:"enterWnd",contentId:"response_content_id",onClose:function(){},thisObjName:"hwndResponse"},hwndUserMessage=null,hwndCfgUserMessage={newWindowId:"UserMessage",header:{title:"",closeBtn:!0},positionX:null,positionY:59,height:null,width:800,bgDiv:{color:"#343434",opacity:20},cssStyleClass:"enterWnd",contentId:"user_message_content_id",onClose:function(){},thisObjName:"hwndUserMessage"},sIntVal=0,isMouseOn=0,hideSelectList={},selectedNumDivId=-1,swfobject=function(){function V(b){var c=/[\\\"<>\.;]/,d=c.exec(b)!=null;return d&&typeof encodeURIComponent!=a?encodeURIComponent(b):b}function U(a,b){if(!!x){var c=b?"visible":"hidden";t&&P(a)?P(a).style.visibility=c:T("#"+a,"visibility:"+c)}}function T(c,d,e,f){if(!y.ie||!y.mac){var g=i.getElementsByTagName("head")[0];if(!g)return;var h=e&&typeof e=="string"?e:"screen";f&&(v=null,w=null);if(!v||w!=h){var j=Q("style");j.setAttribute("type","text/css"),j.setAttribute("media",h),v=g.appendChild(j),y.ie&&y.
win&&typeof i.styleSheets!=a&&i.styleSheets.length>0&&(v=i.styleSheets[i.styleSheets.length-1]),w=h}y.ie&&y.win?v&&typeof v.addRule==b&&v.addRule(c,d):v&&typeof i.createTextNode!=a&&v.appendChild(i.createTextNode(c+" {"+d+"}"))}}function S(a){var b=y.pv,c=a.split(".");c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0;return b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function R(a,b,c){a.attachEvent(b,c),o[o.length]=[a,b,c]}function Q(a){return i.createElement(a)}function P(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function O(a){var b=P(a);if(b){for(var c in b)typeof b[c]=="function"&&(b[c]=null);b.parentNode.removeChild(b)}}function N(a){var b=P(a);b&&b.nodeName=="OBJECT"&&(y.ie&&y.win?(b.style.display="none",function(){b.readyState==4?O(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function M(a,b,c){var d=Q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function L(c,d,f){var g,h=P(f);if(y.wk&&y.wk<312)return g;if(h){typeof c.id==a&&(c.id=f);if(y.ie&&y.win){var i="";for(var j in c)c[j]!=Object.prototype[j]&&(j.toLowerCase()=="data"?d.movie=c[j]:j.toLowerCase()=="styleclass"?i+=' class="'+c[j]+'"':j.toLowerCase()!="classid"&&(i+=" "+j+'="'+c[j]+'"'));var k="";for(var l in d)d[l]!=Object.prototype[l]&&(k+='<param name="'+l+'" value="'+d[l]+'" />');h.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+i+">"+k+"</object>",n[n.length]=c.id,g=P(c.id)}else{var m=Q(b);m.setAttribute("type",e);for(var o in c)c[o]!=Object.prototype[o]&&(o.toLowerCase()=="styleclass"?m.setAttribute("class",c[o]):o.toLowerCase()!="classid"&&m.setAttribute(o,c[o]));for(var p in d)d[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"&&M(m,p,d[p]);h.parentNode.replaceChild(m,h),g=m}}return g}function K(a){var c=Q("div");if(y.win&&y.ie)c.innerHTML=a.innerHTML;else{var d=a.getElementsByTagName(b)[0];if(d){var e=d.childNodes;if(e){var f=e.length;for(var g=0;g<f;g++)(e[g].nodeType!=1||e[g].nodeName!="PARAM")&&e[g].nodeType!=8&&c.appendChild(e[g].cloneNode(!0))}}}return c}function J(a){if(y.ie&&y.win&&a.readyState!=4){var b=Q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(K(a),b),a.style.display="none",function(){a.readyState==4?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(K(a),a)}function I(b,c,d,e){u=!0,r=e||null,s={success:!1,id:d};var g=P(d);if(g){g.nodeName=="OBJECT"?(p=K(g),q=null):(p=g,q=d),b.id=f;if(typeof b.width==a||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==a||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";i.title=i.title.slice(0,47)+" - Flash Player Installation";var j=y.ie&&y.win?"ActiveX":"PlugIn",k="MMredirectURL="+h.location.toString().replace(/&/g,"%26")+"&MMplayerType="+j+"&MMdoctitle="+i.title;typeof c.flashvars!=a?c.flashvars+="&"+k:c.flashvars=k;if(y.ie&&y.win&&g.readyState!=4){var l=Q("div");d+="SWFObjectNew",l.setAttribute("id",d),g.parentNode.insertBefore(l,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}()}L(b,c,d)}}function H(){return!u&&S("6.0.65")&&(y.win||y.mac)&&!(y.wk&&y.wk<312)}function G(c){var d=null,e=P(c);if(e&&e.nodeName=="OBJECT")if(typeof e.SetVariable!=a)d=e;else{var f=e.getElementsByTagName(b)[0];f&&(d=f)}return d}function F(){var b=m.length;if(b>0)for(var c=0;c<b;c++){var d=m[c].id,e=m[c].callbackFn,f={success:!1,id:d};if(y.pv[0]>0){var g=P(d);if(g)if(S(m[c].swfVersion)&&!(y.wk&&y.wk<312))U(d,!0),e&&(f.success=!0,f.ref=G(d),e(f));else if(m[c].expressInstall&&H()){var h={};h.data=m[c].expressInstall,h.width=g.getAttribute("width")||"0",h.height=g.getAttribute("height")||"0",g.getAttribute("class")&&(h.styleclass=g.getAttribute("class")),g.getAttribute("align")&&(h.align=g.getAttribute("align"));var i={},j=g.getElementsByTagName("param"),k=j.length;for(var l=0;l<k;l++)j[l].getAttribute("name").toLowerCase()!="movie"&&(i[j[l].getAttribute("name")]=j[l].getAttribute("value"));I(h,i,d,e)}else J(g),e&&e(f)}else{U(d,!0);if(e){var n=G(d);n&&typeof n.SetVariable!=a&&(f.success=!0,f.ref=n),e(f)}}}}function E(){var c=i.getElementsByTagName("body")[0],d=Q(b);d.setAttribute("type",e);var f=c.appendChild(d);if(f){var g=0;(function(){if(typeof f.GetVariable!=a){var b=f.GetVariable("$version");b&&(b=b.split(" ")[1].split(","),y.pv=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)])}else if(g<10){g++,setTimeout(arguments.callee,10);return}c.removeChild(d),f=null,F()})()}else F()}function D(){k?E():F()}function C(b){if(typeof h.addEventListener!=a)h.addEventListener("load",b,!1);else if(typeof i.addEventListener!=a)i.addEventListener("load",b,!1);else if(typeof h.attachEvent!=a)R(h,"onload",b);else if(typeof h.onload=="function"){var c=h.onload;h.onload=function(){c(),b()}}else h.onload=b}function B(a){t?a():l[l.length]=a}function A(){if(!t){try{var a=i.getElementsByTagName("body")[0].appendChild(Q("span"));a.parentNode.removeChild(a)}catch(b){return}t=!0;var c=l.length;for(var d=0;d<c;d++)l[d]()}}var a="undefined",b="object",c="Shockwave Flash",d="ShockwaveFlash.ShockwaveFlash",e="application/x-shockwave-flash",f="SWFObjectExprInst",g="onreadystatechange",h=window,i=document,j=navigator,k=!1,l=[D],m=[],n=[],o=[],p,q,r,s,t=!1,u=!1,v,w,x=!0,y=function(){var f=typeof i.getElementById!=a&&typeof i.getElementsByTagName!=a&&typeof i.createElement!=a,g=j.userAgent.toLowerCase(),l=j.platform.toLowerCase(),m=l?/win/.test(l):/win/.test(g),n=l?/mac/.test(l):/mac/.test(g),o=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,p=!1,q=[0,0,0],r=null;if(typeof j.plugins!=a&&typeof j.plugins[c]==b)r=j.plugins[c].description,r&&(typeof j.mimeTypes==a||!j.mimeTypes[e]||!!j.mimeTypes[e].enabledPlugin)&&(k=!0,p=!1,r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),q[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10),q[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10),q[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof h.ActiveXObject!=a)try{var s=new ActiveXObject(d);s&&(r=s.GetVariable("$version"),r&&(p=!0,r=r.split(" ")[1].split(","),q=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]))}catch(t){}return{w3:f,pv:q,wk:o,ie:p,win:m,mac:n}}(),z=function(){!y.w3||((typeof i.readyState!=a&&i.readyState=="complete"||typeof i.readyState==a&&(i.getElementsByTagName("body")[0]||i.body))&&A(),t||(typeof i.addEventListener!=a&&i.addEventListener("DOMContentLoaded",A,!1),y.ie&&y.win&&(i.attachEvent(g,function(){i.readyState=="complete"&&(i.detachEvent(g,arguments.callee),A())}),h==top&&function(){if(!t){try{i.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}A()}}()),y.wk&&function(){if(!t){if(!/loaded|complete/.test(i.readyState)){setTimeout(arguments.callee,0);return}A()}}(),C(A)))}(),W=function(){y.ie&&y.win&&window.attachEvent("onunload",function(){var a=o.length;for(var b=0;b<a;b++)o[b][0].detachEvent(o[b][1],o[b][2]);var c=n.length;for(var d=0;d<c;d++)N(n[d]);for(var e in y)y[e]=null;y=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}();return{registerObject:function(a,b,c,d){if(y.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,m[m.length]=e,U(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){if(y.w3)return G(a)},embedSWF:function(c,d,e,f,g,h,i,j,k,l){var m={success:!1,id:d};y.w3&&!(y.wk&&y.wk<312)&&c&&d&&e&&f&&g?(U(d,!1),B(function(){e+="",f+="";var n={};if(k&&typeof k===b)for(var o in k)n[o]=k[o];n.data=c,n.width=e,n.height=f;var p={};if(j&&typeof j===b)for(var q in j)p[q]=j[q];if(i&&typeof i===b)for(var r in i)typeof p.flashvars!=a?p.flashvars+="&"+r+"="+i[r]:p.flashvars=r+"="+i[r];if(S(g)){var s=L(n,p,d);n.id==d&&U(d,!0),m.success=!0,m.ref=s}else{if(h&&H()){n.data=h,I(n,p,d,l);return}U(d,!0)}l&&l(m)})):l&&l(m)},switchOffAutoHideShow:function(){x=!1},ua:y,getFlashPlayerVersion:function(){return{major:y.pv[0],minor:y.pv[1],release:y.pv[2]}},hasFlashPlayerVersion:S,createSWF:function(a,b,c){return y.w3?L(a,b,c):undefined},showExpressInstall:function(a,b,c,d){y.w3&&H()&&I(a,b,c,d)},removeSWF:function(a){y.w3&&N(a)},createCSS:function(a,b,c,d){y.w3&&T(a,b,c,d)},addDomLoadEvent:B,addLoadEvent:C,getQueryParamValue:function(a){var b=i.location.search||i.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return V(b);var c=b.split("&");for(var d=0;d<c.length;d++)if(c[d].substring(0,c[d].indexOf("="))==a)return V(c[d].substring(c[d].indexOf("=")+1))}return""},expressInstallCallback:function(){if(u){var a=P(f);a&&p&&(a.parentNode.replaceChild(p,a),q&&(U(q,!0),y.ie&&y.win&&(p.style.display="block")),r&&r(s)),u=!1}}}}();jQuery&&function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:!1,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var c=location.pathname;c=c.split("/"),c.pop(),c=c.join("/")+"/";var d={};d.uploadifyID=settings.id,d.pagepath=c,settings.buttonImg&&(d.buttonImg=escape(settings.buttonImg)),settings.buttonText&&(d.buttonText=escape(settings.buttonText)),settings.rollover&&(d.rollover=!0),d.script=settings.script,d.folder=escape(settings.folder);if(settings.scriptData){var e="";for(var f in settings.scriptData)e+="&"+f+"="+settings.scriptData[f];d.scriptData=escape(e.substr(1))}d.width=settings.width,d.height=settings.height,d.wmode=settings.wmode,d.method=settings.method,d.queueSizeLimit=settings.queueSizeLimit,d.simUploadLimit=settings.simUploadLimit,settings.hideButton&&(d.hideButton=!0),settings.fileDesc&&(d.fileDesc=settings.fileDesc),settings.fileExt&&(d.fileExt=settings.fileExt),settings.multi&&(d.multi=!0),settings.auto&&(d.auto=!0),settings.sizeLimit&&(d.sizeLimit=settings.sizeLimit),settings.checkScript&&(d.checkScript=settings.checkScript),settings.fileDataName&&(d.fileDataName=settings.fileDataName),settings.queueID&&(d.queueID=settings.queueID),settings.onInit()!==!1&&(a(this).css("display","none"),a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>'),swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,d,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess}),settings.queueID==!1&&a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')),typeof settings.onOpen=="function"&&a(this).bind("uploadifyOpen",settings.onOpen),a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(b,c,d){if(b.data.action(b,c,d)!==!1){var e=Math.round(d.size/1024*100)*.01,f="KB";e>1e3&&(e=Math.round(e*.001*100)*.01,f="MB");var g=e.toString().split(".");g.length>1?e=g[0]+"."+g[1].substr(0,2):e=g[0],d.name.length>20?fileName=d.name.substr(0,20)+"...":fileName=d.name,queue="#"+a(this).attr("id")+"Queue",b.data.queueID&&(queue="#"+b.data.queueID),a(queue).append('<div id="'+a(this).attr("id")+c+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+c+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+e+f+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+c+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}}),typeof settings.onSelectOnce=="function"&&a(this).bind("uploadifySelectOnce",settings.onSelectOnce),a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(a,b){a.data.action(a,b)!==!1&&alert("The queue is full.  The max size is "+b+".")}),a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(b,d,e,f,g){var h=new Object;h=e,h.folder=c+f;if(g)for(var i in e)var j=i;a.post(d,h,function(c){for(var h in c)if(b.data.action(b,d,e,f,g)!==!1){var i=confirm("Do you want to replace the file "+c[h]+"?");i||document.getElementById(a(b.target).attr("id")+"Uploader").cancelFileUpload(h,!0,!0)}g?document.getElementById(a(b.target).attr("id")+"Uploader").startFileUpload(j,!0):document.getElementById(a(b.target).attr("id")+"Uploader").startFileUpload(null,!0)},"json")}),a(this).bind("uploadifyCancel",{action:settings.onCancel},function(b,c,d,e,f){if(b.data.action(b,c,d,e,f)!==!1){var g=f==!0?0:250;a("#"+a(this).attr("id")+c).fadeOut(g,function(){a(this).remove()})}}),typeof settings.onClearQueue=="function"&&a(this).bind("uploadifyClearQueue",settings.onClearQueue);var g=[];a(this).bind("uploadifyError",{action:settings.onError},function(b,c,d,e){if(b.data.action(b,c,d,e)!==!1){var f=[c,d,e];g.push(f),a("#"+a(this).attr("id")+c+" .percentage").text(" - "+e.type+" Error"),a("#"+a(this).attr("id")+c).addClass("uploadifyError")}}),a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(b,c,d,e){b.data.action(b,c,d,e)!==!1&&(a("#"+a(this).attr("id")+c+"ProgressBar").css("width",e.percentage+"%"),b.data.toDisplay=="percentage"&&(displayData=" - "+e.percentage+"%"),b.data.toDisplay=="speed"&&(displayData=" - "+e.speed+"KB/s"),b.data.toDisplay==null&&(displayData=" "),a("#"+a(this).attr("id")+c+" .percentage").text(displayData))}),a(this).bind("uploadifyComplete",{action:settings.onComplete},function(b,c,d,e,f){b.data.action(b,c,d,unescape(e),f)!==!1&&(a("#"+a(this).attr("id")+c+" .percentage").text(" - Completed"),a("#"+a(this).attr("id")+c).fadeOut(250,function(){a(this).remove()}))}),typeof settings.onAllComplete=="function"&&a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(a,b){a.data.action(a,b)!==!1&&(g=[])})})},uploadifySettings:function(b,c,d){var e=!1;a(this).each(function(){if(b=="scriptData"&&c!=null){if(d)var f=c;else var f=a.extend(settings.scriptData,c);var g="";for(var h in f)g+="&"+h+"="+escape(f[h]);c=g.substr(1)}e=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(b,c)});if(c==null){if(b=="scriptData"){var f=unescape(e).split("&"),g=new Object;for(var h=0;h<f.length;h++){var i=f[h].split("=");g[i[0]]=i[1]}e=g}return e}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,!1)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,!0,!1)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(!1)})}})}(jQuery);var PHP_IS_JSON_ENABLED="__della_operator_JsHttpRequest_enabled",hwndRequestSearch=null,hwndCfg={newWindowId:"RequestSearchWnd",header:{closeBtn:!0},positionX:null,positionY:245,height:null,bgDiv:{color:"#343434",opacity:20},cssStyleClass:"enterWnd",contentId:"RequestSearchWndContent",onClose:function(){blockRequestsSycle=!1},thisObjName:"hwndRequestSearch"},hwndW3=null,hwndCFObj=null,hwndWFCH=null
