function checkMail(e,d,b){if(b){text=$(b).innerHTML;text=text.replace(d,"");$(b).innerHTML=text}var a=false;var c=/^[a-zA-Z]+(([\'\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$/;object=$(e);email=object.value;if(email.search(c)==-1){a=true}if(b){if(navigator.appName=="Microsoft Internet Explorer"){$(b).className="hide"}else{$(b).setAttribute("class","hide")}}if(a){if(d){if(b){$(b).innerHTML=$(b).innerHTML+" "+d;if(navigator.appName=="Microsoft Internet Explorer"){$(b).className="notify notify_red"}else{$(b).setAttribute("class","notify notify_red")}}else{alert(d)}}return false}return true}function checkUrl(e,d,b){if(b){text=$(b).innerHTML;text=text.replace(d,"");$(b).innerHTML=text}var a=false;var c="^http://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&?/.=]+$";object=$(e);url=object.value;if(url.search(c)==-1){a=true}if(a){if(d){if(b){$(b).innerHTML=$(b).innerHTML+" "+d}else{alert(d)}}if(!b){}return false}return true}function checkUrl2(e,d,b){if(b){text=$(b).innerHTML;text=text.replace(d,"");$(b).innerHTML=text}var a=false;var c="^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&?/.=]+$";object=$(e);url=object.value;if(url.search(c)==-1){a=true}if(a){if(d){if(b){$(b).innerHTML=$(b).innerHTML+" "+d}else{alert(d)}}if(!b){}return false}return true}function checkPhone(e,c,b,d){if(b){text=$(b).innerHTML;text=text.replace(c,"");$(b).innerHTML=text}var a=false;object=$(e);number=object.value;if(!d){if(number.length!=0&&number.search("^[ 0-9.+/-]{8,}$")==-1){a=true}}else{if(number.search("^[ 0-9.+/-]{8,}$")==-1){a=true}}if(a){if(c){if(b){$(b).innerHTML=$(b).innerHTML+" "+c}else{alert(c)}}if(!b){}return false}return true}function checkZIP(b,a){wrong=false;object=$(b);zip=object.value;if(false){wrong=true}if(wrong){alert(a);if(!noticeItemId){object.focus();object.select()}return false}return true}function checkMinLength(g,b,d,a,c){if(a){text=$(a).innerHTML;text=text.replace(d,"");$(a).innerHTML=text}wrong=false;try{object=$(g);text=object.value;len=text.length;if(c&&!len){return true}if(a){if(navigator.appName=="Microsoft Internet Explorer"){$(a).className="hide"}else{$(a).setAttribute("class","hide")}}if(len<b){if(a){$(a).innerHTML=$(a).innerHTML+" "+d;if(navigator.appName=="Microsoft Internet Explorer"){$(a).className="notify notify_red"}else{$(a).setAttribute("class","notify notify_red")}}else{if(d){alert(d)}}return false}return true}catch(f){if(d.length){alert("hyba")}return false}}function checkValue(b,d,c,a){if(a){text=$(a).innerHTML;text=text.replace(c,"");$(a).innerHTML=text}wrong=false;try{text=b.value;if(a){if(navigator.appName=="Microsoft Internet Explorer"){$(a).className="hide"}else{$(a).setAttribute("class","hide")}}if(text==d){if(c){if(a){$(a).innerHTML=$(a).innerHTML+" "+c;if(navigator.appName=="Microsoft Internet Explorer"){$(a).className="notify notify_red"}else{$(a).setAttribute("class","notify notify_red")}}else{alert(c)}}return false}return true}catch(f){if(c.length){alert("hyba")}return false}}function equal(c,b,d,a){if(a){text=$(a).innerHTML;text=text.replace(d,"");$(a).innerHTML=text;if(navigator.appName=="Microsoft Internet Explorer"){$(a).className="hide"}else{$(a).setAttribute("class","hide")}}if(c==b){return true}else{if(d){if(a){$(a).innerHTML=$(a).innerHTML+" "+d;if(navigator.appName=="Microsoft Internet Explorer"){$(a).className="notify notify_red"}else{$(a).setAttribute("class","notify notify_red")}}else{alert(d)}}return false}}function checkInvalidChars(d,b,a){if(a){text=$(a).innerHTML;text=text.replace(b,"");$(a).innerHTML=text}try{object=$(d);if(!object.value.length){return true}regexp="^[a-zA-Z0-9_-]+$";if(object.value.search(regexp)==-1){if(b){if(a){$(a).innerHTML=$(a).innerHTML+" "+b}else{alert(b)}}return false}else{return true}}catch(c){if(b){alert(b)}return false}}function checkSpaces(d,b,a){if(a){text=$(a).innerHTML;text=text.replace(b,"");$(a).innerHTML=text}try{object=$(d);if(object.value.indexOf(" ")!=-1){if(b){if(a){$(a).innerHTML=$(a).innerHTML+" "+b}else{alert(b)}}return false}else{return true}}catch(c){if(b){alert(b)}return false}}function checkAnySelectOption(h,d,a){if(a){var g=$(a);text=g.innerHTML;text=text.replace(d,"");g.innerHTML=text}try{var c=false;if(h.tagName=="DIV"){c=(multiselect_getSelected(h).length>0)}else{for(var b=0;b<h.length;b++){if(h.options[b].selected){c=true}}}if(!c){if(d){if(a){var g=$(a);g.innerHTML=$(a).innerHTML+" "+d;if(g.style.display=="none"){g.style.display=""}}else{alert(d)}}}return c}catch(f){if(d){alert(d)}return false}}function checkRadioSelected(a){var c=document.getElementsByName(a);for(var b=0;b<c.length;b++){if(c[b].checked){return true}}return false}function checkSurgeonsRegisterForm(){var b=$("register_form");var a=true;a=a*checkValue($("register_country2"),"NULL",false,false);a=a*checkMinLength("register_name2",3,false,false);a=a*checkMail("register_email2",false,false);if(a){$("register_submit2").disabled=""}else{$("register_submit2").disabled="disabled"}}function checkAgreement(a){if(!$(a).checked){$(a+"_notice").style.display="block"}else{$(a+"_notice").style.display=""}return $(a).checked}var defaultValues=new Array();function setDefaultValues(a){defaultValues=a}function checkRegisterForm(b){var c=true;var a=(navigator.appName=="Microsoft Internet Explorer");if(!checkValue($("register_country"),"NULL",false,false)){c=false;$("country-nike").style.display="none";if(b){if(a){$("register_country_notice").className="notify notify_red"}else{$("register_country_notice").setAttribute("class","notify notify_red")}}}else{$("country-nike").style.display="inline"}if(!checkMinLength("register_name",3,false,false)||$("register_name").value==defaultValues.register_name){c=false;$("name-nike").style.display="none";if(b){if(a){$("register_name_notice").className="notify notify_red"}else{$("register_name_notice").setAttribute("class","notify notify_red")}}}else{$("name-nike").style.display="inline"}if(!checkMinLength("register_password",6,false,false)||$("register_password").value==defaultValues.register_password){c=false;$("pass1-nike").style.display="none";if(b){if(a){$("register_password_notice").className="notify notify_red"}else{$("register_password_notice").setAttribute("class","notify notify_red")}}}else{$("pass1-nike").style.display="inline"}if(!checkMail("register_email",false,false)||$("register_email").value==defaultValues.register_email){c=false;$("email-nike").style.display="none";if(b){if(a){$("register_email_notice").className="notify notify_red"}else{$("register_email_notice").setAttribute("class","notify notify_red")}}}else{$("email-nike").style.display="inline"}if(!equal($("register_password").value,$("register_password_confirm").value,false,false)||$("register_password_confirm").value==defaultValues.register_password_confirm){c=false;$("pass2-nike").style.display="none";if(b){if(a){$("register_password_confirm_notice").className="notify notify_red"}else{$("register_password_confirm_notice").setAttribute("class","notify notify_red")}}}else{if(checkMinLength("register_password_confirm",6,false,false)&&$("register_password_confirm").value!=defaultValues.register_password_confirm){$("pass2-nike").style.display="inline"}}return(c)?true:false}function checkProfileForm(){var a=true;a=a*checkMinLength("profile_name",3,false,false);a=a*checkMail("profile_email",false,false);if($("profile_password").value.length){a=a*checkMinLength("profile_password",6,false,false);a=a*equal($("profile_password").value,$("profile_password_confirm").value,false,false)}a=a*$("profile_agree").checked;if(!a){$("profile_submit").disabled="disabled"}else{$("profile_submit").disabled=""}}function changeNamesChecking(c,e,b,g,a){var h=$(e);var f;for(var d=0;d<h.length;d++){if(h.options[d].value==b){f=h.options[d]}}if(c.value.length){f.selected="selected"}else{f.selected=""}}function checkProfileBEForm(l,o,n,k,p,f,d){var a=true;var c="warnings";a=a*checkMinLength("password",6,o,c,d);a=a*checkInvalidChars("password",n,c);if(l==1||l==3||l==6){var b=$("fullnames");var h=false;if(c){text=$(c).innerHTML;text=text.replace(k,"");$(c).innerHTML=text}for(var g=0;g<b.length;g++){if(b.options[g].selected){h=true}}if(!h){$(c).innerHTML=$(c).innerHTML+" "+k}a=a*h}if(l==2||l==4||l==5){var b=$("companies");var h=false;if(c){text=$(c).innerHTML;text=text.replace(p,"");$(c).innerHTML=text}for(var g=0;g<b.length;g++){if(b.options[g].selected){h=true}}if(!h){$(c).innerHTML=$(c).innerHTML+" "+p}a=a*h}var m=$("spokenlangs");if(m){a=a*checkAnySelectOption(m,f,c)}if(!a){try{$("save_data").disabled=true}catch(j){}try{$("save_data2").disabled=true}catch(j){}try{$("save_data_saleslead").disabled=true}catch(j){}try{$("save_data_saleslead2").disabled=true}catch(j){}try{$(c).style.display="block"}catch(j){}}else{try{$("save_data").disabled=false}catch(j){}try{$("save_data2").disabled=false}catch(j){}try{$("save_data_saleslead").disabled=false}catch(j){}try{$("save_data_saleslead2").disabled=false}catch(j){}try{$(c).style.display="none"}catch(j){}}}function checkAddressForm(b,a){valid=true;try{if(a){text=$(a).innerHTML;text=text.replace(b,"");$(a).innerHTML=text}country=$("country").value;if(country=="NULL"){valid=false}type2=$("type2");type3=$("type3");city=$("city").value;street=$("street").value;if((type2.checked||type3.checked)&&(city=="NULL"||street=="")){valid=false}}catch(c){valid=false;b=c}if(!valid){if(b){if(a){$(a).innerHTML=$(a).innerHTML+" "+b}else{alert(b)}}$("save_address").disabled="disabled"}else{$("save_address").disabled=""}}function checkContactForm(g,f,b,d,c,j,e){var a=true;var h="";if(!checkMail("cf_email"+e,false,0)){h=h+g+" ";a=false}if(!checkPhone("cf_phone"+e,false,false,true)){h=h+f+" ";a=false}if(!checkMinLength("cf_name"+e,1,false,false,false)){h=h+b+" ";a=false}if(!checkMinLength("cf_comment"+e,1,false,false,false)){h=h+d+" ";a=false}for(i=0;i<j.length;i++){if(j[i].length>0&&$("cf_comment"+e).value.indexOf(j[i])!=-1){h=h+c+" ";a=false;i=j.length}}if(!a){window.alert(h);return false}else{return true}}function checkDiscussionForm(){var a=true;var j=null;var d=$("accept_conditions");if(d&&!d.checked){a=false;j=d}var c=$("id_country");if(c&&c.nodeName=="SELECT"){var k=0;for(var e=0;e<c.length;e++){if(c.options[e].selected){k=c.options[e].value;break}}if(k<=0){a=false;j=c}}var h=$("id_region");if(h&&h.nodeName=="SELECT"&&c==null){var k=0;for(var e=0;e<h.length;e++){if(h.options[e].selected){k=h.options[e].value;break}}if(k<=0){a=false;j=h}}var b=$("for_doctors_1");if(b&&!checkRadioSelected("for_doctors")){a=false;j=b}var l=$("message");if(!(l.value&&l.value!=l.getAttribute("data-placeholder"))){a=false;j=l}var g=$("subject");if(!(g.value&&g.value!=g.getAttribute("data-placeholder"))){a=false;j=g}var f=$("email");if(f&&!checkMail("email")){a=false;j=f}if(!a){notice("notices",j.getAttribute("data-notice"));j.focus()}return a}function checkReviewForm(){var b=true;var a=null;var c=$("text");if(!(c.value&&c.value!=c.getAttribute("data-placeholder"))){b=false;a=c}if(!b){notice("notices",a.getAttribute("data-notice"));a.focus()}return b}function notice(a,c){$(a).innerHTML="";var b=document.createElement("div");b.innerHTML="<div class='rounded notify notify_red' id='status_message'><span class='sprite ico-error fl'>&nbsp;</span><a class='fr' href='' onclick=\"this.parentNode.style.display='none';return false;\"><img src='/pictures/notify_red_close.jpg' alt=''/></a>"+c+"</div>";$(a).appendChild(b);return b}function checkMailingForm(){var a=true;if(!checkMinLength("from_date",1,false,false,false)){a=false}if(!checkMinLength("to_date",1,false,false,false)){a=false}if(!checkMinLength("limitXB",1,false,false,false)){a=false}if(!checkMinLength("limitXP",1,false,false,false)){a=false}if(!checkMinLength("limitYP",1,false,false,false)){a=false}if(!checkMinLength("limitZP",1,false,false,false)){a=false}if(!checkMinLength("limitNP",1,false,false,false)){a=false}if(!checkAnySelectOption($("branches"),false,false)){a=false}if(!a){window.alert("Všechna pole jsou povinná, vyplňte je!");return false}else{return true}}function checkPriceSetting(c){var b=true;var a="";additional=$(c+"selected_products");for(i=0;i<additional.length;i++){partners=$(c+"selected_partners"+additional.options[i].value);if(!partners.length){b=false;a="Doplňkový produkt musí mít určeno, komu náleží! "}}if($("nextprogram").value!=0&&$("nextproduct").value==0){b=false;a+="Když vyberete cenový program, musíte vybrat také produkt! "}if(!b){window.alert(a);return false}else{return true}}function checkAdtextForm(){if(!$("title").value.length){alert("Vyplňte titulek!");return false}if(!$("valid_from").value.length){alert("Vyplňte od kdy je adtext validní!");return false}if(!$("valid_to").value.length){alert("Vyplňte do kdy je adtext validní!");return false}if(!checkAnySelectOption($("mailing_types"),false,false)){alert("Jelikož jste ve filtru 'Typ mailu' nevybrali nic, adtext by se nikomu nezaslal, prosím vyberte ve filtru 'Typ mailu' požadované hodnoty!");return false}if(!checkAnySelectOption($("user_types"),false,false)){alert("Jelikož jste ve filtru 'Typ subjektu' nevybrali nic, adtext by se nikomu nezaslal, prosím vyberte ve filtru 'Typ subjektu' požadované hodnoty!");return false}if(!checkAnySelectOption($("branches"),false,false)){alert("Jelikož jste ve filtru 'Obory' nevybrali nic, adtext by se nikomu nezaslal, prosím vyberte ve filtru 'Obory' požadované hodnoty!");return false}if(!checkAnySelectOption($("presentations"),false,false)){alert("Jelikož jste ve filtru 'Aktuální nastavení prezentace subjektu' nevybrali nic, adtext by se nikomu nezaslal, prosím vyberte ve filtru 'Aktuální nastavení prezentace subjektu' požadované hodnoty!");return false}if(!checkAnySelectOption($("countries"),false,false)){alert("Jelikož jste ve filtru 'Stát subjektu' nevybrali nic, adtext by se nikomu nezaslal, prosím vyberte ve filtru 'Stát subjektu' požadované hodnoty!");return false}if(!checkAnySelectOption($("trial_types"),false,false)){alert("Jelikož jste ve filtru 'Trialy' nevybrali nic, adtext by se nikomu nezaslal, prosím vyberte ve filtru 'Trialy' požadované hodnoty!");return false}return true}function checkContestForm(c){var a=true;var h=null;var g=getElementsByClassName2("answer","input",c);for(var f in g){if(g[f].value.length==0){h=g[f];a=false;break}}var j=$("fullname");if(a&&j.value.length==0){a=false;h=j}var d=$("street");if(a&&d.value.length==0){a=false;h=d}var e=$("city");if(a&&e.value.length==0){a=false;h=e}var b=$("zip");if(a&&b.value.length==0){a=false;h=b}if(a&&!checkMail("email",false,false)){a=false;h=$("email")}if(a&&!checkPhone("phone",false,false,false)){a=false;h=$("phone")}if(!a){notice("notices",h.getAttribute("data-notice"));h.focus()}return a}function fe_checklength(a,c,b){text=a.value;mericObj=document.getElementById(b);if(text.length>c){a.value=text.substring(0,c)}if(mericObj){mericObj.value=c-a.value.length}};
