function getRandomId(a){var b="rand_"+Math.floor(Math.random()*(Math.random()*5)*2.7)+"_"+Math.floor(Math.random()*5)+"_"+a;if(document.getElementById(b)){return b+"_"+Math.floor(Math.random()*(Math.random()*5)*2.7)+"_"+Math.floor(Math.random()*5)}else{return b}return"rand_x_y"}function newDropDownPos(e){if(e.parent().offset()){var a=e.parent().offset().top;var d=e.height();var b=jQuery(window).height();var c=jQuery(window).scrollTop();if(a>=c&&((b+c)>(a+d))){e.css("position","absolute");e.css("top","0");e.removeClass("show_up")}else{e.css("position","absolute");e.css("top","-"+d+"px");e.addClass("show_up")}}}function checkDropDowns(a){for(i in DROP_OBJS.objects){var b=DROP_OBJS.objects[i].obj;if(i!=a&&b.is(":visible")){b.slideUp("fast",function(){b.removeClass("isDown")})}}}jQuery(window).resize(function(){for(i in DROP_OBJS.objects){var a=DROP_OBJS.objects[i].obj;newDropDownPos(a)}});jQuery(window).scroll(function(){for(i in DROP_OBJS.objects){var a=DROP_OBJS.objects[i].obj;newDropDownPos(a)}});var DROP_OBJS={errors:{1:"Nu exista",2:""},showError:function(b,a){alert(b+" : "+a)},getError:function(a){var b=DROP_OBJS.errors;return b[a]},objects:{},createObject:function(a){try{if(!document.getElementById(a)){throw DROP_OBJS.getError(1)}}catch(b){DROP_OBJS.showError(a,b)}if(DROP_OBJS.objects[a]){DROP_OBJS.objects[a].unbind();DROP_OBJS.objects[a].clear()}DROP_OBJS.objects[a]={ID:a,getID:function(){return this.ID},obj:jQuery("#"+a),getObj:function(){return this.obj},firstSpanObject:"",getFirstSpanObject:function(){return this.firstSpanObject},value:"",getValue:function(){return this.value},selectedItemObject:"",getSelectedItemObject:function(){return this.selectedItemObject},searchObject:((jQuery("#"+a)&&jQuery("#"+a).siblings(".rand_hidden_text").length)?jQuery("#"+a).siblings(".rand_hidden_text"):""),getSearchObject:function(){return this.searchObject},realInputObject:"",getRealInputObject:function(){return this.realInputObject},idPrefix:"",getIdPrefix:function(){return this.idPrefix},scrollSpeed:"100",getScrollSpeed:function(){return this.scrollSpeed},defaultSelectedItemId:"",getDefaultSelectedItemId:function(){return this.defaultSelectedItemId},selectObjects:"",getSelectObjects:function(){return this.selectObjects},selectOptions:"",getSelectOptions:function(){return this.selectOptions},hash:"",generateHash:function(){var c=document.getElementById(this.obj.attr("id")).getElementsByTagName("li");return c[c.length-1].innerHTML+this.ID+(c[1]?c[1]:c[0]).innerHTML+"_"+c.length+"_"+document.getElementById(this.obj.attr("id")).className},getHash:function(){return this.hash},selectItem:function(){var c=this.realInputObject.val();this.selectedItemObject=this.obj.children(".li_hover").first();this.firstSpanObject.html("<i>"+this.selectedItemObject.html()+"</i>");this.obj.removeClass("isDown");this.realInputObject.val(this.selectedItemObject.attr("id").replace(new RegExp(this.idPrefix,"g"),""));this.searchObject.val("");if((this.idPrefix+c)!=this.selectedItemObject.attr("id")){this.onChange(this.selectedItemObject.attr("id"))}this.slideUp()},onChange:function(c){},slideUp:function(){if(this.slideType=="normal"){this.obj.slideUp("100").removeClass("isDown")}if(this.slideType=="none"){this.obj.hide().removeClass("isDown")}},slideDown:function(){newDropDownPos(this.obj);if(this.slideType=="normal"){this.searchObject.focus();this.obj.slideDown().addClass("isDown")}if(this.slideType=="none"){this.searchObject.focus();this.searchObject.focus();this.obj.show().addClass("isDown")}},clear:function(){this.searchObject.unbind();this.searchObject.remove();this.obj.unbind();this.firstSpanObject.unbind();delete DROP_OBJS.objects[this.ID]},unbind:function(){this.firstSpanObject.unbind();this.searchObject.unbind();this.obj.children().unbind();this.obj.unbind()},checkLiHover:function(){return(this.obj.children(".li_hover").length)?true:false},drop:function(){this.slideDown();if(this.selectedItemObject.length){this.obj.scrollTo(this.selectedItemObject,parseInt(this.scrollSpeed),{margin:true,offset:-100})}checkDropDowns(this.ID);this.slideUps=false},close:function(){this.slideUp();this.obj.children("li").removeClass("li_hover");this.selectedItemObject.addClass("li_hover")},scroll:function(c){this.obj.children("li").removeClass("li_hover");jQuery("#"+c).addClass("li_hover");this.selectedItemObject=jQuery("#"+c);if(this.selectedItemObject.length){this.obj.scrollTo(this.selectedItemObject,parseInt(this.scrollSpeed),{margin:true,offset:-100})}},waitUntilReset:"800",startTime:"",slideUps:false,init:function(){if(this.defaultSelectedItemId){if(jQuery("#"+this.defaultSelectedItemId).length){this.obj.children().remove(".li_hover");jQuery("#"+this.defaultSelectedItemId).addClass("li_hover");this.getFirstSpanObject().html(this.obj.children("#"+this.defaultSelectedItemId).html())}}if(!this.searchObject){var c=getRandomId(this.id);this.obj.parent().prepend('<input class="rand_hidden_text" autocomplete = "false" name="'+c+'" id="'+c+'" type="text" style="color:white;width:1px;height:1px;resize:none;border:none;background:none;z-index: -1"></input>');this.searchObject=jQuery("#"+c)}this.hash=this.generateHash();newDropDownPos(this.obj)}}},getObject:function(a){return DROP_OBJS.objects[a]},closeAll:function(){jQuery(".isDown").hide().removeClass("isDown")},goTo:function(a,e,c,b){if(DROP_OBJS.objects[a]){var d=DROP_OBJS.objects[a].selectedItemObject;if(!DROP_OBJS.objects[a].obj.children("#"+e).length){e=DROP_OBJS.objects[a].idPrefix}DROP_OBJS.objects[a].obj.children("li").removeClass("li_hover");DROP_OBJS.objects[a].obj.children("#"+e).addClass("li_hover");DROP_OBJS.objects[a].selectedItemObject=DROP_OBJS.objects[a].obj.children("#"+e).first();(c)?DROP_OBJS.objects[a].firstSpanObject.html(jQuery("#"+c).html()):DROP_OBJS.objects[a].firstSpanObject.html(DROP_OBJS.objects[a].selectedItemObject.html());if(d.attr("id")!=DROP_OBJS.objects[a].selectedItemObject.attr("id")&&b==true){DROP_OBJS.objects[a].onChange(DROP_OBJS.objects[a].selectedItemObject.attr("id"))}}},clearAllForms:true,clearAll:function(){DROP_OBJS.clearAllNow(true)},clearEverything:function(){DROP_OBJS.clearAllNow(false)},clearAllNow:function(a){for(i in this.objects){if(!this.objects[i].doNotClearOnSubmit||!a){jQuery("#"+this.objects[i].searchObject.attr("id")).unbind();jQuery("#"+this.objects[i].searchObject.attr("id")).remove();jQuery("#"+this.objects[i].obj.attr("id")).unbind();jQuery("#"+this.objects[i].firstSpanObject.attr("id")).unbind()}}}};(function(b){var a=function(c){try{if(c){if(!DROP_OBJS.objects[c]){throw DROP_OBJS.getError(1)}else{return DROP_OBJS.getObject(c)}}}catch(d){return false}};b.fn.dropdown=function(c){var j={slideUps:false,first_span_id:"fake_selector",real_input_id:"city_id",id_prefix:"option_",onChange:function(k){},scroll_speed:100,wait_until_reset:500,defaultId:"",refreshItem:true,slideType:"normal",doNotClearOnSubmit:false};function e(l){var k=new Object();b.each(l,function(m,n){k[n.id]=n.innerHTML.toLowerCase()});return k}function h(k){var l={};b.each(b(k),function(m,n){l[n.id]=n});return l}function f(p,q,o){var n={};var l=0;for(i in p){if(i!==c.id_prefix){var m=p[i].replace(/\.|,| |\/|\|/gi,"");if(m.indexOf(q)==0&&m){n[l++]=o[i]}}}return n}function g(l){var k=0;for(i in l){k++}return k}function d(m){var p="qwertyuiopasdfghjklzxcvbnm";var l="QWERTYUIOPASDFGHJKLZXCVBNM";var k=0;var o=26;while(k<=o){if(p.charCodeAt(k)==m){return p.charAt(k)}k++}k=0;while(k<=o){if(l.charCodeAt(k)==m){return l.charAt(k)}k++}}var c=b.extend(j,c);this.each(function(){var m=b(this);var k=this.id;if(!m.length){return false}if(!a(k)||(a(k)&&(a(k).hash!=a(k).generateHash()||a(k).refreshItem==true))){if(a(k)&&(a(k).hash&&a(k).hash!=a(k).generateHash()&&c.refreshItem==false)){a(k).selectOptions=e(a(k).obj.children("li"));a(k).selectObjects=h(a(k).obj.children("li"));var l=a(k);l.obj.children("li").click(function(){l.obj.children("li").removeClass("li_hover");b(this).addClass("li_hover");l.selectItem()})}else{DROP_OBJS.createObject(k);a(k).id=k;a(k).obj=b(this);b(this).addClass("dropdownhash");a(k).realInputObject=b("#"+c.real_input_id);a(k).idPrefix=c.id_prefix;a(k).firstSpanObject=b("#"+c.first_span_id);a(k).onChange=c.onChange;a(k).selectedItemObject=a(k).obj.children("li.li_hover").length>0?a(k).obj.children("li.li_hover").first():(!a(k).defaultSelectedItemId)?b("#"+a(k).idPrefix):b("#"+a(k).defaultSelectedItemId);a(k).defaultSelectedItemId=c.defaultId;a(k).waitUntilReset=c.wait_until_reset;a(k).selectOptions=e(a(k).obj.children("li"));a(k).selectObjects=h(a(k).obj.children("li"));a(k).refreshItem=c.refreshItem;a(k).slideType=c.slideType;a(k).doNotClearOnSubmit=c.doNotClearOnSubmit;a(k).init();var l=a(k);l.searchObject.keyup(function(p){var o=(p.which)?p.which:p.keyCode;if((o>=97&&o<=122)||(o>=65&&o<=90)||(o==46)||(o==38)||(o==40)||(o==13)||(o==27)){if(o!=13){if(!l.obj.hasClass("isDown")){l.drop()}}if((o!=38)&&(o!=40)&&(o!=13)&&(o!=27)){var t=l.searchObject.val().toLowerCase();var r=(t)?f(l.selectOptions,t,l.selectObjects):l.selectObjects;if(r[0]){l.scroll(r[0].id)}else{l.scroll(l.selectedItemObject.attr("id"))}}else{if(o==13&&l.obj.is(":visible")){if(l.checkLiHover()){l.selectItem()}}if(o==27){l.close()}if(o==40){if(!l.checkLiHover()){l.obj.children("li").first().addClass("li_hover")}else{var s=l.obj.children("li.li_hover").first();if(s.next().length>0){var n=s.next();s.removeClass("li_hover");n.addClass("li_hover");l.scroll(n.attr("id"))}}}if(o==38){if(!l.checkLiHover()){l.obj.children("li").first().addClass("li_hover")}else{var s=l.obj.children("li.li_hover").first();if(s.prev().length>0){var q=s.prev();s.removeClass("li_hover");q.addClass("li_hover");l.scroll(q.attr("id"))}}}}}return false});l.searchObject.keypress(function(o){var n=(o.which)?o.which:o.keyCode;if((n>=97&&n<=122)||(n>=65&&n<=90)||(n==46)||(n==38)||(n==40)||(n==13)||(n==27)||(n==9)){if(n==13){return false}if(l.startTime){var p=l.startTime;startSecs=new Date();l.startTime=startSecs.getTime();if(parseInt(l.startTime-p)>=l.waitUntilReset){l.searchObject.val("")}}else{startSecs=new Date();l.startTime=startSecs.getTime()}return true}return false});l.obj.children("li").click(function(){if(b(this).hasClass("ignoreThis")){return false}l.obj.children("li").removeClass("li_hover");b(this).addClass("li_hover");l.selectItem()});l.searchObject.focusin(function(){l.firstSpanObject.parent().addClass("focusin")});l.searchObject.focusout(function(){l.firstSpanObject.parent().removeClass("focusin")});l.firstSpanObject.click(function(){if(!l.obj.hasClass("isDown")){l.drop();newDropDownPos(l.obj)}else{l.close()}});b("body *").hover(function(){if(this.id==l.obj.attr("id")||this.id==l.firstSpanObject.attr("id")||b(this).parent().attr("id")==l.obj.attr("id")||b(this).parent().attr("id")==l.firstSpanObject.attr("id")){l.slideUps=false}},function(){l.slideUps=true});b("form").submit(function(){if(DROP_OBJS.clearAllForms){DROP_OBJS.clearAll()}});b("body").click(function(){if(l.slideUps){l.close()}})}}})}})(jQuery);var tabSelected=0;jQuery(document).ready(function(){function q(G,F){if(jQuery("#"+G).length){if(F&&clearValue(jQuery("#"+G).val())==clearValue(F)){return false}return((clearValue(jQuery("#"+G).val())!="")?true:false)}return true}function l(J,G,H,I){if(jQuery(".edit_common_item_text").length>0){var K={};var F=jQuery("#"+G).val();var L=J.parent().prev();var N=J.siblings().first();var M=J.parent().siblings(".edit_common_item_text");if(M.length>1){K=t(J.parent().parent())}else{K.text=F}K.action_type=H;M.hide();M.siblings(".ajax_loader").show();N.parent().hide();M.parent().find(".package_error").remove();jQuery.ajax({url:I,type:"POST",data:K,success:function(O){if(O.indexOf("PACKAGE_#_ERROR:")<0){L.html(O);if(M.length==1){M.val(O)}L.show();M.hide();M.siblings(".ajax_loader").hide();N.addClass("edit_icon");N.removeClass("minus_icon");N.next().hide();N.parent().show()}else{var P=O.replace(/PACKAGE_#_ERROR:/g,"");M.show();M.val(L.html());M.prev().hide();N.parent().show();if(!M.parent().find(".package_error").length){M.parent().prepend('<p class="package_error">'+P+"</p>")}}}})}return false}function g(H,G){var F=H;for(var I in G){F[I]=G[I]}return F}function t(H){var G=H.find("input");var F={};G.each(function(){switch(jQuery(this).attr("type")){case"radio":if(jQuery(this).is(":checked")){F[this.name]=jQuery(this).val()}break;case"checkbox":if(jQuery(this).is(":checked")){F[this.name]=jQuery(this).val()}break;default:F[this.name]=jQuery(this).val()}});return F}function s(){if(jQuery(".edit_common_item").length){var F=baseURL;if(jQuery("#module").val()=="teachers"){F+="/index.php?module=teachers&action=ajaxEditTeacherCommonFields"}if(jQuery("#module").val()=="doctors"){F+="/index.php?module=doctors&action=ajaxEditDoctorCommonFields"}if(jQuery("#module").val()=="architects"){F+="/index.php?module=architects&action=ajaxEditArchitectCommonFields"}if(jQuery("#module").val()=="translators"){F+="/index.php?module=translators&action=ajaxEditTranslatorCommonFields";jQuery(".save_phone_item").click(function(){return l(jQuery(this),"pro_phone","5",F)});jQuery(".save_contact_item").click(function(){return l(jQuery(this),"pro_email","4",F)});jQuery(".save_interpreting_item").click(function(){return l(jQuery(this),"pro_interpreting","6",F)})}if(jQuery("#module").val()=="lawyers"){F+="/index.php?module=lawyers&action=ajaxEditLawyerCommonFields";jQuery(".save_phone_item").click(function(){return l(jQuery(this),"pro_phone","5",F)});jQuery(".save_contact_item").click(function(){return l(jQuery(this),"pro_contact","4",F)})}if(jQuery("#module").val()=="notaries"){F+="/index.php?module=notaries&action=ajaxEditNotaryCommonFields";jQuery(".save_phone_item").click(function(){return l(jQuery(this),"pro_phone","4",F)});jQuery(".save_site_item").click(function(){return l(jQuery(this),"pro_site","5",F)});jQuery(".save_email_item").click(function(){return l(jQuery(this),"pro_email","6",F)});jQuery(".save_address_item").click(function(){return l(jQuery(this),"pro_address","7",F)})}if(jQuery("#module").val()=="accountants"){F+="/index.php?module=accountants&action=ajaxEditAccountantCommonFields";jQuery(".save_phone_item").click(function(){return l(jQuery(this),"pro_phone","5",F)});jQuery(".save_mobile_item").click(function(){return l(jQuery(this),"pro_mobile","6",F)});jQuery(".save_email_item").click(function(){return l(jQuery(this),"pro_email","7",F)});jQuery(".save_expert_item").click(function(){return l(jQuery(this),"pro_expert","8",F)})}jQuery(".edit_common_item").click(function(){if(jQuery(".edit_common_item_text").length>0){var H=jQuery(this).parent().siblings(".edit_common_item_text");var G=jQuery(this).parent().prev();jQuery(this).parent().parent().find(".package_error").remove();if(!H.is(":visible")){G.hide();H.show();jQuery(this).addClass("minus_icon");jQuery(this).removeClass("edit_icon");jQuery(this).siblings().first().show()}else{G.show();H.hide();jQuery(this).addClass("edit_icon");jQuery(this).removeClass("minus_icon");jQuery(this).siblings().first().hide()}}return false});jQuery(".save_edu_item").click(function(){return l(jQuery(this),"pro_edu","2",F)});jQuery(".save_exp_item").click(function(){return l(jQuery(this),"pro_exp","1",F)});jQuery(".save_award_item").click(function(){return l(jQuery(this),"pro_award","3",F)})}}s();if(jQuery("#module").val()=="lawyers"){for(var d=1;d<=3;d++){E(d)}}if(jQuery("#module").val()=="teachers"){for(var d=1;d<=2;d++){E(d)}}if(jQuery("#module").val()=="doctors"){for(var d=1;d<=3;d++){E(d)}}if(jQuery("#module").val()=="notaries"){for(var d=1;d<=2;d++){E(d)}}if(jQuery("#module").val()=="architects"){for(var d=1;d<=3;d++){E(d)}}if(jQuery("#module").val()=="translators"){for(var d=1;d<=2;d++){E(d)}}if(jQuery("#module").val()=="accountants"){for(var d=1;d<=1;d++){E(d)}}function E(M){if(jQuery("#module").val()=="architects"){if(M==1){var H=baseURL+"/index.php?module=architects&action=ajaxEditArchitectModality"}if(M==2){var H=baseURL+"/index.php?module=architects&action=ajaxEditArchitectFirm"}if(M==3){var H=baseURL+"/index.php?module=architects&action=ajaxEditArchitectSignature"}}if(jQuery("#module").val()=="translators"){if(M==1){var H=baseURL+"/index.php?module=translators&action=ajaxEditTranslatorLanguage"}if(M==2){var H=baseURL+"/index.php?module=translators&action=ajaxEditTranslatorFirm"}}if(jQuery("#module").val()=="lawyers"){if(M==1){var H=baseURL+"/index.php?module=lawyers&action=ajaxEditLawyerDomain"}if(M==2){var H=baseURL+"/index.php?module=lawyers&action=ajaxEditLawyerFirm"}if(M==3){var H=baseURL+"/index.php?module=lawyers&action=ajaxEditLawyerModality"}}if(jQuery("#module").val()=="teachers"){if(M==1){var H=baseURL+"/index.php?module=teachers&action=ajaxEditTeacherInstitution"}if(M==2){var H=baseURL+"/index.php?module=teachers&action=ajaxEditTeacherSubject"}}if(jQuery("#module").val()=="doctors"){if(M==1){var H=baseURL+"/index.php?module=doctors&action=ajaxEditDoctorInstitution"}if(M==2){var H=baseURL+"/index.php?module=doctors&action=ajaxEditDoctorSpecialty"}if(M==3){var H=baseURL+"/index.php?module=doctors&action=ajaxEditDoctorCertification"}}if(jQuery("#module").val()=="notaries"){if(M==1){var H=baseURL+"/index.php?module=notaries&action=ajaxEditNotaryOffice"}if(M==2){var H=baseURL+"/index.php?module=notaries&action=ajaxEditNotaryLanguage"}}if(jQuery("#module").val()=="accountants"){if(M==1){var H=baseURL+"/index.php?module=accountants&action=ajaxEditAccountantFirm"}}var J=jQuery("#pro_field_"+M);var I=J.children().last().find(".add_pro_row").first();var G=J.children().last().children(".cancel_add_pro_row").first();var N=J.children().children(".pro_field_actions").children(".save_pro_row");var K=J.children().children(".pro_field_actions").children(".edit_pro_row");var L=J.children().children(".pro_field_actions").children(".delete_pro_row");function F(P,R,Q,O,S){if(O){O.siblings(".pro_field_add_select").find("a.new_item_in_list").first().click(function(){jQuery(this).parent().parent().parent().parent().parent().siblings(".pro_hidden_input").val("");var T=jQuery(this).parent().parent().parent().parent().parent().siblings(".pro_hidden_input");T.show();T.focus();jQuery(this).parent().parent().parent().parent().parent().hide();return false});O.click(function(){var U=jQuery(this).siblings(".pro_field_add_select").first();var V=jQuery(this).siblings(".pro_hidden_input");var X=V.val();var aa=t(jQuery(this).siblings(".aditionl_fields").first());var Z=jQuery(this).parent();var Y=jQuery(this).attr("href");if(jQuery(this).hasClass("ready_to_add")){if(!clearValue(V.val())){if(V.is(":visible")){V.val("")}return false}var T=jQuery(this);T.siblings(".circle_loader").first().show();U.children().hide();var W={new_item:X,action_type:3};if((V.is(":visible"))){W.is_new=1}if(aa){g(W,aa)}T.siblings(".pro_hidden_input").hide();T.siblings(".aditionl_fields").hide();if(Z.children(".package_error").length){Z.children(".package_error").remove()}jQuery.ajax({url:H,type:"POST",data:W,success:function(ag){if(ag){ag=ag.split("#######");var ai=parseInt(ag[0]);var ah=ag[1];if(!ai){if(!Z.children(".package_error").length){Z.prepend('<p class="package_error">'+ag+"</p>")}T.siblings(".circle_loader").first().hide();U.children().show();return false}else{Z.before(ah);var af=getIndexfromId(T.parent().parent().attr("id"));var ae=jQuery(Y+ai);var ab=ae.children(".pro_field_actions").children(".save_pro_row").first();var ad=ae.children(".pro_field_actions").children(".edit_pro_row").first();var ac=ae.children(".pro_field_actions").children(".delete_pro_row").first();F(ab,ad,ac)}}T.siblings(".circle_loader").first().hide();T.siblings(".inp_hold").first().show();U.hide();U.children().show();T.removeClass("ready_to_add");T.removeClass("save_icon");T.addClass("plus_icon");T.siblings(".cancel_add_pro_row").hide();T.siblings(".aditionl_fields").hide()}})}if(!jQuery(this).hasClass("input_only_edit")){if(!U.is(":visible")&&!U.siblings(".pro_hidden_input").is(":visible")){U.show();jQuery(this).addClass("ready_to_add");jQuery(this).removeClass("plus_icon");jQuery(this).addClass("save_icon");jQuery(this).siblings(".cancel_add_pro_row").show();jQuery(this).siblings(".aditionl_fields").show()}}else{if(!jQuery(this).hasClass("ready_to_add")){U.siblings(".pro_hidden_input").show();jQuery(this).addClass("ready_to_add");jQuery(this).removeClass("plus_icon");jQuery(this).addClass("save_icon");jQuery(this).siblings(".cancel_add_pro_row").show();jQuery(this).siblings(".aditionl_fields").show()}}return false});S.click(function(){var U=jQuery(this).siblings(".pro_field_add_select").first();jQuery(this).parent().find(".package_error").remove();if(U.is(":visible")){U.hide()}jQuery(this).siblings(".add_pro_row").removeClass("ready_to_add");jQuery(this).siblings(".add_pro_row").removeClass("save_icon");var T=getIndexfromId(jQuery(this).parent().parent().attr("id"));if(jQuery("#module").val()=="notaries"&&T==1){jQuery(this).siblings(".add_pro_row").addClass("edit_icon")}else{jQuery(this).siblings(".add_pro_row").addClass("plus_icon")}jQuery(this).hide();jQuery(this).siblings(".pro_hidden_input").first().css("display","none");jQuery(this).parent().find(".aditionl_fields").hide();return false})}R.parent().find("a.new_item_in_list").click(function(){jQuery(this).parent().parent().parent().parent().parent().siblings(".aditionl_fields").show();var T=jQuery(this).parent().parent().parent().parent().parent().siblings(".pro_hidden_input");T.show();T.focus();jQuery(this).parent().parent().parent().parent().parent().hide();return false});Q.click(function(){if(!jQuery(this).attr("target")){var U=getIndexfromId(jQuery(this).parent().parent().attr("id"));var T=jQuery(this).parent().parent();if(jQuery(this).hasClass("notAll")&&T.parent().find(".active_now").length==1){return false}if(jQuery(this).hasClass("notFirst")&&!T.prev().length){return false}if(U){T.children().hide();T.append('<div class="circle_loader ajax_loader"></div>');jQuery.ajax({url:H,type:"POST",data:{old_item:U,action_type:2},success:function(V){if(!V){T.remove()}else{if(V.indexOf("#######")<0){if(!T.children(".package_error").length){T.prepend('<p class="package_error">'+V+"</p>")}}T.children().show();T.find(".pro_field_static").hide();T.children(".circle_loader").remove()}}})}}return false});P.click(function(){var Y=jQuery(this).parent().siblings(".txt_inp").first().val();if(!Y){Y=jQuery(this).parent().siblings("input:hidden").first().val()}var V=getIndexfromId(jQuery(this).parent().parent().attr("id"));var U=jQuery(this).parent().siblings(".pro_hidden_input").first();var T=jQuery(this).parent().parent();var aa=t(jQuery(this).parent().siblings(".aditionl_fields").first());var W=t(jQuery(this).parent().siblings(".more_to_edit").first());var Z=jQuery(this).attr("href");if(clearValue(Y)&&(V!=Y||jQuery.isEmptyObject(W)==false)){if(jQuery(this).siblings(".edit_pro_row").first().hasClass("input_only_edit")){if(clearValue(jQuery(this).parent().siblings(".pro_field_static").first().html())==clearValue(Y)&&!W){return false}}var X={new_item:Y,old_item:V,action_type:1};if((U.is(":visible"))){X.is_new=1}if(aa){X=g(X,aa)}if(W){X=g(X,W)}T.html('<div class="circle_loader ajax_loader"></div>');jQuery.ajax({url:H,type:"POST",data:X,success:function(af){if(af){af=af.split("#######");var ah=parseInt(af[0]);var ag=af[1];T.after(ag);T.remove();var ae=jQuery(Z+ah);var ab=ae.children(".pro_field_actions").children(".save_pro_row").first();var ad=ae.children(".pro_field_actions").children(".edit_pro_row").first();var ac=ae.children(".pro_field_actions").children(".delete_pro_row").first();F(ab,ad,ac)}}})}return false});R.click(function(){var T=jQuery(this).parent().first();var U=T.prev();var W=T.siblings(".inp_hold").first();var V=jQuery(this).parent().siblings(".pro_hidden_input").first();V.hide();T.parent().find(".package_error").remove();if(U.is(":visible")){U.hide();if(!jQuery(this).hasClass("input_only_edit")){W.show()}else{V.show();V.val(jQuery(this).parent().siblings(".pro_field_static").html())}if(jQuery(this).siblings(".delete_pro_row").hasClass("notFirst")&&!T.parent().prev().length){jQuery(this).siblings(".delete_pro_row").remove()}jQuery(this).removeClass("edit_icon");jQuery(this).attr("title","renunta");jQuery(this).addClass("minus_icon");jQuery(this).siblings().show();jQuery(this).parent().siblings(".more_to_edit").first().show();jQuery(this).parent().siblings(".less_to_edit").first().hide()}else{U.show();W.hide();jQuery(this).addClass("edit_icon");jQuery(this).attr("title","editeaza");jQuery(this).removeClass("minus_icon");jQuery(this).siblings().hide();jQuery(this).parent().siblings(".aditionl_fields").first().hide();jQuery(this).parent().siblings(".more_to_edit").first().hide();jQuery(this).parent().siblings(".less_to_edit").first().show()}return false})}F(N,K,L,I,G)}if(jQuery(".add_pro").length){var x=baseURL+"/index.php?module=main&action=";function p(){var F=parseInt(jQuery("#p_city").val());var G=(jQuery("#add_teacher_form").length)?parseInt(jQuery("#p_type").val()):"2";if(F&&G){r("#dd_p_institution");jQuery.ajax({url:x+((jQuery("#add_teacher_form").length)?"ajaxGetInstitutions":"ajaxGetMedicalInstitutions")+"&options=1&city_id="+(F)+"&type_id="+(G),success:function(H){jQuery("#p_institution").val("");jQuery("#dd_p_institution").html(H);jQuery("#add_pro_institution_ul").dropdown({first_span_id:"add_pro_institution",real_input_id:"p_institution",id_prefix:"add_pro_institution_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(I){}})}})}}function v(){var F=parseInt(jQuery("#p_county").val());D();if(F){r("#dd_p_city");jQuery.ajax({url:x+"ajaxGetCities&options=1&county_id="+(F),success:function(G){jQuery("#p_city").val("");jQuery("#dd_p_city").html(G);jQuery("#add_pro_city_ul").dropdown({first_span_id:"add_pro_city",real_input_id:"p_city",id_prefix:"add_pro_city_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(H){p()}})}})}}jQuery("#add_pro_county_ul").dropdown({first_span_id:"add_pro_county",real_input_id:"p_county",id_prefix:"add_pro_county_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){v()}});jQuery("#add_pro_domain_ul").dropdown({first_span_id:"add_pro_domain",real_input_id:"p_domain",id_prefix:"add_pro_domain_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){}});jQuery("#add_pro_specialty_ul").dropdown({first_span_id:"add_pro_specialty",real_input_id:"p_specialty",id_prefix:"add_pro_specialty_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){}});jQuery("#add_pro_type_ul").dropdown({first_span_id:"add_pro_type",real_input_id:"p_type",id_prefix:"add_pro_type_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){p()}});jQuery("#add_pro_subject_ul").dropdown({first_span_id:"add_pro_subject",real_input_id:"p_subject",id_prefix:"add_pro_subject_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){}});jQuery("#add_pro_modality_ul").dropdown({first_span_id:"add_pro_modality",real_input_id:"p_modality",id_prefix:"add_pro_modality_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){}});jQuery("#add_pro_language_ul").dropdown({first_span_id:"add_pro_language",real_input_id:"p_language",id_prefix:"add_pro_language_li_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){jQuery("#add_pro_language_2").parent().parent().parent().show().prev().show()}});jQuery(".remove_lang_field").click(function(){jQuery(this).parent().parent().parent().hide();jQuery(this).parent().parent().parent().prev().hide();return false});jQuery("#add_pro_language_ul_3").dropdown({first_span_id:"add_pro_language_3",real_input_id:"p_language_3",id_prefix:"add_pro_language_li_3_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){}});jQuery("#add_pro_language_ul_2").dropdown({first_span_id:"add_pro_language_2",real_input_id:"p_language_2",id_prefix:"add_pro_language_li_2_",slideType:"none",doNotClearOnSubmit:true,onChange:function(F){if(F!="add_pro_language_li_2_0"){jQuery("#add_pro_language_3").parent().parent().parent().show().prev().show()}}});function D(){if(jQuery("#p_institution").length){if(jQuery("#add_teacher_form").length){jQuery("#p_institution").val("");jQuery("#add_pro_institution").html("<i>Alege o localitate si un tip de scoala</i>")}if(jQuery("#add_doctor_form").length){jQuery("#p_institution").val("");jQuery("#add_pro_institution").html("<i>Alege o localitate</i>")}}}if(jQuery("form.add_pro_form").length){DROP_OBJS.clearAllForms=false}jQuery("form.add_pro_form").submit(function(){var F=jQuery("#add_pro_err");F.hide();F.html("");if(!q("last_name")){F.html(F.html()+"Numele este obligatoriu<br/>")}if(!q("p_domain")){F.html(F.html()+"Domeniul este obligatoriu<br/>")}if(!q("first_name")){F.html(F.html()+"Prenumele este obligatoriu<br/>")}if(!q("p_county")){F.html(F.html()+"Judetul este obligatoriu<br/>")}if(!q("p_city")){F.html(F.html()+"Orasul este obligatoriu<br/>")}if(!q("p_type")){F.html(F.html()+"Tipul de scoala este obligatoriu<br/>")}if(!q("p_institution")){F.html(F.html()+"Institutia este obligatorie<br/>")}if(!q("p_subject")){F.html(F.html()+"Materia este obligatorie<br/>")}if(!q("p_language")){F.html(F.html()+"Limba este obligatorie<br/>")}if(clearValue(F.html())){F.html("<p>Campurile cu * sunt obligatorii</p>");F.show();return false}else{DROP_OBJS.clearEverything();return true}});if(jQuery("#p_type").length){function j(){var G=parseInt(jQuery(this).val());var F=parseInt(jQuery("#p_city").val());if(F&&G){jQuery("#p_institution_loader").show();jQuery("#p_institution").hide();jQuery.ajax({url:x+"ajaxGetInstitutions&options=1&city_id="+(F)+"&type_id="+(G),success:function(H){if(H.indexOf("option")>0){H="<option value=''>Alege</option>"+H}else{H="<option value=''>Nici o institutie</option>"+H}jQuery("#p_institution").html(H);jQuery("#p_institution_loader").hide();jQuery("#p_institution").show()}})}}}}if(jQuery("form.assoc_pro").length>0){jQuery("form.assoc_pro").submit(function(){var F=jQuery("#assoc_pro_err");F.hide();F.html("");if(!q("phone","telefon")){F.html(F.html()+"Telefonul este obligatoriu<br/>")}if(!checkPhone(jQuery("#phone").val())){F.html(F.html()+"Numarul de telefonul nu este valid<br/>")}if(clearValue(F.html())){F.show();return false}else{return true}})}function A(){if(jQuery("#module").length>0){if(jQuery("#module").val()=="doctors"){jQuery("#fake_select").dropdown({first_span_id:"fake_selector",real_input_id:"f_specialty_id",id_prefix:"option_",onChange:function(F){DROP_OBJS.goTo("advance_specialty_select","advance_specialty_"+F.replace(/option_/gi,""),F)}});jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});jQuery("#advance_specialty_select").dropdown({first_span_id:"advance_specialty_selector",real_input_id:"f_specialty_id",id_prefix:"advance_specialty_",onChange:function(F){DROP_OBJS.goTo("fake_select","option_"+F.replace(/advance_specialty_/gi,""),F)}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="lawyers"){jQuery("#fake_select").dropdown({first_span_id:"fake_selector",real_input_id:"domain_id",id_prefix:"option_",onChange:function(F){DROP_OBJS.goTo("advance_domain_select","advance_domain_"+F.replace(/option_/gi,""),F)}});jQuery("#advance_domain_select").dropdown({first_span_id:"advance_domain_selector",real_input_id:"domain_id",id_prefix:"advance_domain_",onChange:function(F){DROP_OBJS.goTo("fake_select","option_"+F.replace(/advance_domain_/gi,""),F)}});jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="notaries"){jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="teachers"){jQuery("#fake_select").dropdown({first_span_id:"fake_selector",real_input_id:"subject_id",id_prefix:"option_",onChange:function(F){DROP_OBJS.goTo("advance_subject_select","advance_subject_"+F.replace(/option_/gi,""),F)}});jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});jQuery("#advance_subject_select").dropdown({first_span_id:"advance_subject_selector",real_input_id:"subject_id",id_prefix:"advance_subject_",onChange:function(F){DROP_OBJS.goTo("fake_select","option_"+F.replace(/advance_subject_/gi,""),F)}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="architects"){jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="translators"){jQuery("#fake_select").dropdown({first_span_id:"fake_selector",real_input_id:"language_id",id_prefix:"option_",onChange:function(F){DROP_OBJS.goTo("advance_language_select","advance_language_"+F.replace(/option_/gi,""),F)}});jQuery("#advance_language_select").dropdown({first_span_id:"advance_language_selector",real_input_id:"language_id",id_prefix:"advance_language_",onChange:function(F){DROP_OBJS.goTo("fake_select","option_"+F.replace(/advance_language_/gi,""),F)}});jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="accountants"){jQuery("#fake_city_select").dropdown({first_span_id:"fake_city_selector",real_input_id:"city_id",id_prefix:"city_",onChange:function(F){jQuery("#county_id").val("");k("city_id","county_id")}});if(jQuery(".find_your_pro").length>0){f()}}if(jQuery("#module").val()=="facebook"){jQuery("#fake_select_profs").dropdown({first_span_id:"fake_selector_profs",real_input_id:"typeProf",id_prefix:"option_",doNotClearOnSubmit:true})}}}A();function c(){for(var F=1;F<=4;F++){if(jQuery("#form_request_field_"+F).length>0){jQuery("#form_request_field_"+F).submit(function(){var H=getIndexfromId(jQuery(this).attr("id"));var G=jQuery("#err_request_field_"+H);G.hide();G.html("");if(jQuery("#comment_request_field_"+H).hasClass("cl_recomandare")){if(!q("comment_request_field_"+H,(jQuery("#comment_request_field_"+H).hasClass("cl_recomandare"))?"text recomandare":"text cerere")){G.html(G.html()+((jQuery("#comment_request_field_"+H).hasClass("cl_recomandare"))?"Textul recomandarii este obligatoriu<br/>":"Textul cererii este obligatoriu<br/>"))}}if(!q("with_request_field_"+H,"0")){G.html(G.html()+"Substituentul este obligatoriu<br/>")}if(clearValue(G.html())){G.show();return false}else{return true}});jQuery("#pro_btn_request_field_"+F).click(function(){var G=getIndexfromId(jQuery(this).attr("id"));jQuery("#err_request_field_"+G).hide();jQuery("#comment_request_field_"+G).val((jQuery("#comment_request_field_"+G).hasClass("cl_recomandare"))?"text recomandare":"text cerere");jQuery("#overlay_request_field_"+G).fadeTo(320,1);jQuery("#box_request_field_"+G).css("display","block");jQuery("#box_request_field_"+G).animate({top:"92px",opacity:1},320)});jQuery("#close_request_field_"+F).click(function(){var G=getIndexfromId(jQuery(this).attr("id"));jQuery("#overlay_request_field_"+G).fadeTo(0,0);jQuery("#overlay_request_field_"+G).css("display","none");jQuery("#box_request_field_"+G).animate({top:"0",opacity:0},0);jQuery("#box_request_field_"+G).css("display","none")})}}}c();jQuery("#upload_photo_btn").click(function(){jQuery("#overlay_upload_photo").fadeTo(320,1);jQuery("#box_upload_photo").css("display","block");jQuery("#box_upload_photo").animate({top:"92px",opacity:1},320)});jQuery("#upload_photo_close").click(function(){jQuery("#overlay_upload_photo").fadeTo(0,0);jQuery("#overlay_upload_photo").css("display","none");jQuery("#box_upload_photo").animate({top:"0",opacity:0},0);jQuery("#box_upload_photo").css("display","none")});jQuery("#login_btn").click(function(){jQuery("#overlay").fadeTo(300,1);jQuery("#login_box").css("display","block");jQuery("#login_box").animate({top:"42px",opacity:1},300)});jQuery("#login_close").click(function(){jQuery("#overlay").fadeTo(0,0);jQuery("#overlay").css("display","none");jQuery("#login_box").animate({top:"0",opacity:0},0);jQuery("#login_box").css("display","none")});jQuery(".assoc_btn").click(function(){jQuery("#assoc_pro_err").hide();jQuery("#phone").val("telefon");jQuery("#overlay_assoc").fadeTo(320,1);jQuery("#assoc_box").css("display","block");jQuery("#assoc_box").animate({top:"92px",opacity:1},320);var F=parseInt(jQuery(this).attr("id").replace(/assoc_id_/g,""));jQuery("#pro_id").val(F)});jQuery("#assoc_close").click(function(){jQuery("#overlay_assoc").fadeTo(0,0);jQuery("#overlay_assoc").css("display","none");jQuery("#assoc_box").animate({top:"0",opacity:0},0);jQuery("#assoc_box").css("display","none")});jQuery("#reg_btn").click(function(){jQuery("#overlay").fadeTo(300,1);jQuery("#reg_box").css("display","block");jQuery("#reg_box").animate({top:"42px",opacity:1},300)});jQuery("#reg_close").click(function(){jQuery("#overlay").fadeTo(0,0);jQuery("#overlay").css("display","none");jQuery("#reg_box").animate({top:"0",opacity:0},0);jQuery("#reg_box").css("display","none")});jQuery("#go_to_login").click(function(){jQuery("#reg_box").animate({top:"0",opacity:0},300);jQuery("#reg_box").css("display","none");jQuery("#login_box").css("display","block");jQuery("#login_box").animate({top:"42px",opacity:1},300)});jQuery("#go_to_register").click(function(){jQuery("#login_box").animate({top:"0",opacity:0},300);jQuery("#login_box").css("display","none");jQuery("#reg_box").css("display","block");jQuery("#reg_box").animate({top:"42px",opacity:1},300)});jQuery("#open_site_recommendation").click(function(){if(document.getElementById("security_image")){document.getElementById("security_image").src=motherBaseURL+"scripts/image_v1.php?rcode="+Math.floor(Math.random()*10001)}jQuery("#overlay_site_recommendation").fadeTo(300,1);jQuery("#overlay_site_recommendation").animate({opacity:1},300);jQuery("#box_site_recommendation").css("display","block");jQuery("#box_site_recommendation").animate({top:"42px",opacity:1},300)});jQuery("#close_site_recommendation").click(function(){jQuery("#overlay_site_recommendation").fadeTo(0,0);jQuery("#overlay_site_recommendation").css("display","none");jQuery("#box_site_recommendation").animate({top:"0",opacity:0},0);jQuery("#box_site_recommendation").css("display","none")});if(jQuery("#user_rated_doctors").length>0){function n(){if(jQuery("a.pag_btn").length>0){jQuery("a.pag_btn").click(function(){o(jQuery(this).attr("href"),"#"+jQuery(this).parent().parent().parent().parent().attr("id"));return false});jQuery("a.btn").click(function(){o(jQuery(this).attr("href"),"#"+jQuery(this).parent().parent().parent().attr("id"));return false})}}function o(G,F){r(F,true);jQuery.ajax({url:G,success:function(H){jQuery(F).html(H);n()}})}r("#user_rated_doctors",true);r("#user_rated_lawyers",true);r("#user_rated_notaries",true);r("#user_rated_teachers",true);r("#user_rated_architects",true);r("#user_rated_translators",true);r("#user_rated_accountants",true);var m=baseURL+"/index.php"+document.location.search;o(m+"&ajax=getDoctors","#user_rated_doctors");o(m+"&ajax=getLawyers","#user_rated_lawyers");o(m+"&ajax=getNotaries","#user_rated_notaries");o(m+"&ajax=getTeachers","#user_rated_teachers");o(m+"&ajax=getArchitects","#user_rated_architects");o(m+"&ajax=getTranslators","#user_rated_translators");o(m+"&ajax=getAccountants","#user_rated_accountants");jQuery(".tab_link").click(function(){jQuery(".tab_link").removeClass("bbb");jQuery(".tab_content").hide();jQuery("#"+jQuery(this).attr("id").replace(/tab_/g,"")).show();jQuery(this).addClass("bbb");return false});if(window.location.hash){var b=window.location.hash.substring(1);jQuery(".tab_link").removeClass("bbb");jQuery(".tab_content").hide();jQuery("#user_rated_"+b).show();jQuery("#tab_user_rated_"+b).addClass("bbb")}}function h(H,L,F,K,I){var J="what="+H+"&filter_value="+L;var G=baseURL+"/index.php?action=fetchForSelect&targetID="+F+"&subsequentReset="+K;if(I>0){J+="&selectedValue="+I}new Ajax.Request(G,{method:"GET",parameters:J,onSuccess:responseFetchOptions})}function w(G,F){jQuery.ajax({url:G,success:function(H){H=H.split("######");jQuery(F).html(H[0]);A();if(this.url.indexOf("ajaxTeachersSelect")>=0){jQuery("#fake_select").append('<li id="option_get_rest"  style="background:#FFF">Mai mult</li>');jQuery("#option_get_rest").click(function(){r("#option_get_rest");C()})}}})}function B(G,F){if(!jQuery("#"+F).hasClass("goAjaxF")){jQuery("#"+F).addClass("goAjax");jQuery("#main_search_contaier").html('<div id="fake" class="med_bg"><div class="loader index_loader"></div></div>');w(baseURL+"index.php?module=main&action="+G,"#main_search_contaier")}return false}if(jQuery(".main_search").length>0){jQuery("#menu_lawyers").click(function(){B("ajaxLawyersSelect",this.id)});jQuery("#menu_doctors").click(function(){B("ajaxDoctorsSelect",this.id)});jQuery("#menu_notaries").click(function(){B("ajaxNotariesSelect",this.id)});jQuery("#menu_architects").click(function(){B("ajaxArchitectsSelect",this.id)});jQuery("#last").click(function(){B("ajaxTranslatorsSelect",this.id)});jQuery("#first").click(function(){B("ajaxTeachersSelect",this.id)});jQuery("#menu_accountants").click(function(){B("ajaxAccountantsSelect",this.id)});var y='<li><h2><a title="vezi tot" href="%h%index.php?module=%s%&action=listing">vezi tot</a></h2></li>';jQuery(".list_medici").append(y.replace(/%h%/,baseURL).replace(/%s%/,"doctors"));jQuery(".list_avocati").append(y.replace(/%h%/,baseURL).replace(/%s%/,"lawyers"));jQuery(".list_profesori").append(y.replace(/%h%/,baseURL).replace(/%s%/,"teachers"));jQuery(".list_notari").append(y.replace(/%h%/,baseURL).replace(/%s%/,"notaries"));jQuery(".list_arhitecti").append(y.replace(/%h%/,baseURL).replace(/%s%/,"architects"));jQuery(".list_traducatori").append(y.replace(/%h%/,baseURL).replace(/%s%/,"translators"));B("ajaxTeachersSelect","first");function C(){DROP_OBJS.getObject("fake_select").slideUps=false;jQuery.ajax({url:baseURL+"index.php?module=main&action=ajaxTeachersSelect&getRest=1",success:function(F){jQuery("#fake_select").children("li").last().remove();jQuery("#fake_select").html(jQuery("#fake_select").html()+F);jQuery("#fake_select").dropdown({first_span_id:"fake_selector",real_input_id:"subject_id",id_prefix:"option_",refreshItem:false});DROP_OBJS.getObject("fake_select").getSearchObject().focusin();DROP_OBJS.getObject("fake_select").getSearchObject().focus()}});return false}jQuery(".main_search").find("a").click(function(){jQuery(this).siblings().removeClass("left_tab_round_index");jQuery(this).next("span").addClass("left_tab_round_index")});jQuery(".main_search").find("a").hover(function(){if(!jQuery(this).hasClass("selected")){jQuery(this).next("span").addClass("left_tab_round_index")}},function(){if(!jQuery(this).hasClass("selected")){jQuery(this).next("span").removeClass("left_tab_round_index")}});if(tabSelected){jQuery("#"+tabSelected).trigger("click")}}if(jQuery("#fake").length){if(!jQuery(this).hasClass("donotclean")){jQuery("#fake").submit(function(){if(!jQuery(".wide_search2").length&&!jQuery(".right_search2").length){if(jQuery("#type_id").length){jQuery("#type_id").remove()}if(jQuery("#institution_id").length){jQuery("#institution_id").remove()}if(jQuery("#county_id").length){jQuery("#county_id").remove()}}jQuery.each(jQuery("#search_box input"),function(F,G){if(G.id){var H=jQuery("#"+G.id);if((G.id=="name"||G.id=="surname")&&!H.val()){H.after('<div class="txt_inp" style="width:'+H.width()+"px;height:"+H.height()+'px"></div>')}if(!H.val()){H.remove()}}})})}}function f(){if(jQuery(".wide_search2").length<=0&&jQuery(".right_search2").length<=0){jQuery("#to_hide").hide();jQuery("#to_replace").show();if(jQuery("#advance_county_selector").length<=0){k("city_id","county_id")}if(jQuery(".wide_search").length){jQuery(".wide_search").removeClass("wide_search").addClass("wide_search2");jQuery("#advanced_search_bottom").show()}if(jQuery(".right_search").length){jQuery(".right_search").removeClass("right_search").addClass("right_search2");jQuery("#advanced_short_search_bottom").show()}jQuery(".advanced_search_line").show();jQuery(".show_advanced_search").slideDown("fast")}else{jQuery(".show_advanced_search").slideUp("fast",function(){jQuery(".advanced_search_line").hide();if(jQuery(".wide_search2").length){jQuery(".wide_search2").removeClass("wide_search2").addClass("wide_search");jQuery("#advanced_search_bottom").hide()}if(jQuery(".right_search2").length){jQuery(".right_search2").removeClass("right_search2").addClass("right_search");jQuery("#advanced_short_search_bottom").hide()}jQuery("#to_replace").hide();jQuery("#to_hide").show();DROP_OBJS.closeAll();jQuery("#fake ul").hide()})}}function k(G,I){r("#advance_search_counties");var F=jQuery("#"+G).val();var H=jQuery("#"+I).val();jQuery.ajax({async:true,url:baseURL+"index.php?module=main&action=ajaxGetCounties"+(F?"&city_id="+parseInt(F):"")+(H?"&county_id="+parseInt(H):""),success:function(J){jQuery("#advance_search_counties").html(J);if(jQuery("#advance_county_select").children("li.li_hover").length>0){jQuery("#"+I).val(jQuery("#advance_county_select").children("li.li_hover").attr("id").replace(/advance_county_/gi,""))}jQuery("#advance_county_select").dropdown({first_span_id:"advance_county_selector",real_input_id:"county_id",id_prefix:"advance_county_",onChange:function(K){if(jQuery("#city_id").length){jQuery("#city_id").val("")}if(jQuery("#institution_id").length){jQuery("#institution_id").val("")}z(K.replace(/advance_county_/gi,""),"city_id",true)}});z(jQuery("#"+I).val(),G,false)}})}function e(){if(jQuery("#advance_search_types").length>0){if(jQuery("#advance_type_selector").length<=0){r("#advance_search_types");var G=jQuery("#type_id").val();var F=jQuery("#city_id").val();jQuery.ajax({async:true,url:baseURL+"index.php?module=main&action=ajaxGetInstTypes"+(G?"&type_id="+parseInt(G):""),success:function(H){jQuery("#advance_search_types").html(H);jQuery("#advance_type_select").dropdown({first_span_id:"advance_type_selector",real_input_id:"type_id",id_prefix:"advance_type_",onChange:function(I){if(jQuery("#city_id").val()){if(I!="advance_type_"){jQuery("#institution_id").val("")}a()}}});if(F&&G){a()}}})}}}function a(){if(jQuery("#advance_search_institutions").length>0){var G=jQuery("#city_id").val();var H=jQuery("#type_id").val();var F=jQuery("#institution_id").val();if(!G&&!jQuery("#advance_institution_select").length&&jQuery("#advance_institution_selector").length){if(jQuery("#circle_loader").length){removeLoader("search_box");A()}return false}r("#advance_search_institutions");jQuery.ajax({async:true,url:baseURL+"index.php?module=main&action=ajaxGetInstitutions"+(G?"&city_id="+parseInt(G):"")+(H?"&type_id="+parseInt(H):"")+(F?"&institution_id="+parseInt(F):""),success:function(I){jQuery("#advance_search_institutions").html(I);jQuery("#advance_institution_select").dropdown({first_span_id:"advance_institution_selector",real_input_id:"institution_id",id_prefix:"advance_institution_"});if(jQuery("#circle_loader").length){removeLoader("search_box");A()}}})}}function z(I,G,H){r("#advance_search_cities");var F=jQuery("#"+G).val();jQuery.ajax({async:true,url:baseURL+"index.php?module=main&action=ajaxGetCities"+((jQuery(".find_your_pro").length>0)?"&seach_pro=1":"")+"&county_id="+I+(F?"&city_id="+parseInt(F):""),success:function(J){jQuery("#advance_search_cities").html(J);if(jQuery("#institution_id").length){e();if((!jQuery("#type_id").val()||H)||(jQuery("#type_id").val()&&!jQuery("#city_id").val())){a()}}jQuery("#advance_city_select").dropdown({first_span_id:"advance_city_selector",real_input_id:"city_id",id_prefix:"advance_city_",onChange:function(K){if(jQuery("#institution_id").length){jQuery("#institution_id").val("");a()}DROP_OBJS.goTo("fake_city_select","city_"+jQuery("#"+K).attr("id").replace(/advance_city_/gi,""),K,false)}});if(jQuery("#module").val()!="teachers"&&jQuery("#circle_loader").length){removeLoader("search_box");A()}}})}function r(G,F){jQuery(G).html('<div class="circle_loader ajax_loader"></div>');if(F){jQuery(G).html('<div class="circle_loader_big ajax_loader"></div>')}}jQuery("#a_advanced_search").click(function(){(jQuery(this).hasClass("simple_search"))?jQuery(this).removeClass("simple_search"):jQuery(this).addClass("simple_search");f();return false});jQuery("#modifier_btn").click(function(){jQuery("form").submit()});if(jQuery(".star2").length>0){jQuery("ul.big_rank li a").hover(function(){jQuery(this).parent().siblings("li").first().addClass("all_gray")},function(){jQuery(this).parent().siblings("li").first().removeClass("all_gray")});jQuery("ul.big_rank li a").click(function(){var F=jQuery("span.starexp_"+jQuery(this).attr("title")).first().html();jQuery(this).parent().parent().siblings("div.caption_live_rating").first().html(F);if(jQuery(this).attr("title")>=3){jQuery(this).parent().siblings("li").first().addClass("all_green")}else{jQuery(this).parent().siblings("li").first().removeClass("all_green")}})}if(jQuery(".recommends").length>=0){var u=parseInt(jQuery(".lefter").last().height());jQuery.each(jQuery(".righter"),function(F,G){var H=jQuery(".righter").eq(F);if(H.height()<u){H.css({height:(u-10)+"px",position:"relative"});H.children("span").last().addClass("recommend_span_bottom")}})}if(jQuery("#form_compare").length>0){document.getElementById("form_compare").setAttribute("action",baseURL+"index.php")}});function responseRecommendEntity(a){removeLoader("recommend_div");try{var b=a.responseText.evalJSON();if(!b.error){document.getElementById("recommend_div").style.display="none";document.getElementById("recommend_div").value="rec_email";document.getElementById("recommend_div").value="securitycode"}alert(b.message)}catch(c){throw new Error(c)}return false}function putBanner(){if(document.getElementById("banner728x90_no")&&document.getElementById("banner728x90")){var b=document.getElementById("banner728x90_no");var a=document.getElementById("banner728x90");b.style.display="";a.appendChild(b)}if(document.getElementById("banner300x250_no")&&document.getElementById("banner300x250")){var b=document.getElementById("banner300x250_no");var a=document.getElementById("banner300x250");b.style.display="";a.appendChild(b)}}function showLogin(){jQuery("#overlay").fadeTo(300,1);jQuery("#login_box").css("display","block");jQuery("#login_box").animate({top:"42px",opacity:1},300)}function showSeo(b){var a=arrModules.length;var c=0;if(!b){b="medici"}for(;c<a;c++){$("fc_"+arrModules[c]).style.display="none"}$("fc_"+b).style.display="block"}function responseFetchOptions(b){try{var d=b.responseText.evalJSON();if(d.message!="ok"){alert("Nope!")}else{var a=$("combo_cascade_"+d.targetID);a.length=1;for(var c=0;c<d.options_number;c++){if(d.selectedValue==d.options[c]["value"]){try{a.add(new Option(d.options[c]["name"],d.options[c]["value"],true),null)}catch(f){a.add(new Option(d.options[c]["name"],d.options[c]["value"],true))}}else{try{a.add(new Option(d.options[c]["name"],d.options[c]["value"]),null)}catch(f){a.add(new Option(d.options[c]["name"],d.options[c]["value"]))}}}if(d.subsequentReset){for(var c=0;c<d.subsequentReset;c++){var a=$("combo_cascade_"+(parseInt(d.targetID)+c+1));a.length=1}}if(d.possibleAnswers>=0){$("possibleAnswers").innerHTML="<b>Rezultate: </b>"+d.possibleAnswers}}}catch(f){throw new Error(f)}return false}function showLoader(g,c,f){var e=document.getElementById(g);var b=e.getAttribute("class");var d=e.innerHTML;var a=(c==1)?'<div id="circle_loader" class="circle_loader" style="position:absolute;top:45%;left:45%"></div>':'<div id="circle_loader" style="width:100%;height:0;position:relative;z-index:1000"><div class="loader" style="position:absolute;top:'+f+'px;left:40%"></div></div>';e.setAttribute("class",b+" visibility_none");e.innerHTML=a+d}function removeLoader(c){var b=document.getElementById(c);var a=b.getAttribute("class");b.setAttribute("class",a.replace(/visibility_none/gi,""));b.removeChild(document.getElementById("circle_loader"))}function changeOrder(c,b){var d=document.getElementById("f_orderBy").value;var a=document.getElementById("f_order").value;document.getElementById("f_orderBy").value=c;if(b=="ASC"){document.getElementById("f_order").value="ASC"}else{document.getElementById("f_order").value="DESC"}DROP_OBJS.clearAll();document.getElementById("fake").submit()}function recommendEntity(f,c,b,a,e){var g="email="+f+"&entity_type="+c+"&entity_id="+b+"&captcha="+e+"&entity_name="+a;var d=baseURL+"/index.php?module=AmvcUser&action=recommendPage";showLoader("recommend_div",1,0);new Ajax.Request(d,{method:"POST",parameters:g,onSuccess:responseRecommendEntity})}function compare_add(d,c){jQuery("#compsel_"+d).attr("checked",c);var a=jQuery("#module").val();var b=baseURL+"index.php?module="+a+"&action=compadd&id=";jQuery.post(b+d+"&really="+(c?1:0),function(e){if(!e){jQuery("#compare_header").hide()}else{jQuery("#compare_list").html(e);jQuery("#compare_header").show()}})}function compare_close(){jQuery("#compare_header").hide();return;var a=jQuery("#module").val();var b=baseURL+"index.php?module="+a+"&action=compclose";jQuery.post(b,function(c){if(c.replace(/\n/g,"")=="OK"){jQuery("#compare_header").hide();jQuery("input:checkbox.compsel").attr("checked",false)}})}function showHideElementByClassName(b,d){if(!d){d="none"}var a=document.getElementsByClassName(b);for(var c=0;c<a.length;c++){a[c].style.display=d}}function centerPhotoWindow(b){$("fadeBg").style.top="0px";$("fadeBg").style.left="0px";document.body.appendChild($(b));var d=0;var a=0;if(typeof window.innerHeight!="undefined"){d=window.innerHeight;a=window.innerWidth}else{d=document.documentElement.offsetHeight;a=document.documentElement.offsetWidth}var c=0;if(typeof window.pageXOffset!="undefined"){c=window.pageYOffset}else{c=document.body.parentNode.scrollTop}if($(b).getHeight()>0){$(b).style.top=Math.round(document.body.offsetTop+((d-$(b).getHeight()))/2+c)+"px"}else{$(b).style.top=Math.round(document.body.offsetTop+d/2-200+c)+"px"}if($(b).getWidth()>0){$(b).style.left=Math.round(document.body.offsetLeft+((a-$(b).getWidth()))/2)+"px"}else{$(b).style.left=Math.round(document.body.offsetLeft+a/2)+"px"}}function fadeScreen(){if($("fadeBg")==null){var a=document.createElement("div");a.setAttribute("id","fadeBg");var b=0;if(typeof window.innerHeight!="undefined"){b=window.innerHeight}else{b=document.documentElement.offsetHeight}a.style.height=b+"px";addEvent(a,"click",clearPhotoAlbum,false);document.body.appendChild(a)}}function clearPhotoAlbum(){showHideElementByClassName("photoAlbumContainer");$("fadeBg").parentNode.removeChild($("fadeBg"))}function addEvent(e,d,b,a){if(e.addEventListener){e.addEventListener(d,b,a);return true}else{if(e.attachEvent){var c=e.attachEvent("on"+d,b);return c}else{e["on"+d]=b}}}function tryShowPhoto(d,a){fadeScreen();showHideElementByClassName("photoAlbumContainer");if($("container_"+d).innerHTML==""){var c="id="+d+"&album_id="+a;var b=baseURL+"/index.php?action=fetchPhoto";new Ajax.Updater("container_"+d,b,{method:"GET",parameters:c,evalScripts:true,onSuccess:function(){$("photo_"+d).style.display="block"},insertion:Insertion.Bottom})}else{$("photo_"+d).style.display="block";centerPhotoWindow("photo_"+d)}}function setAvatar(c,e,b){var d="id="+e+"&photoId="+b;var a=baseURL+"/index.php?module="+c+"&action=setAvatar&ajx=1";new Ajax.Request(a,{method:"GET",parameters:d,onSuccess:responseSetAvatar})}function responseSetAvatar(a){try{var b=a.responseText.evalJSON();alert(b.message)}catch(c){throw new Error(c)}return false}function verifyFacebookAddRating(){var a=document.getElementById("fake").elements;var c=false;for(var b=0;b<a.length;b++){if(a[b].value==""&&a[b].className!="rand_hidden_text"&&a[b].name!="search"){var c=true}}if(c){alert("Toate campurile trebuie completate/alese");return false}return true}function checkPhone(b){var a=/^[0-9\-\.\+]{6,13}$/;b=clearValue(b);if(b.match(a)){return true}else{return false}}function clearValue(a){return a.replace(/ /g,"")}function getIndexfromId(c){var b=c;var a=b.split("_");return a[a.length-1]?a[a.length-1]:""}function goToLink(b,a){if(a){window.location=motherBaseURL+"index.php?"+b}else{window.location=baseURL+"index.php?"+b}}function addSiteRecommendation(c){var a=baseURL+"/index.php?module=AmvcUser&action=addSiteRecommendation";var b=Form.serialize(c);new Ajax.Request(a,{method:"POST",parameters:b,onSuccess:responseAddSiteRecommendation})}function responseAddSiteRecommendation(a){try{var c=a.responseText.evalJSON();if(c.errors){$("err_site_recommendation").innerHTML="<ul>";for(var b=0;b<c.noerrors;b++){$("err_site_recommendation").innerHTML+="<li>"+c.errors[b]+"</li>"}$("err_site_recommendation").innerHTML+="</ul>";jQuery("#err_site_recommendation").css("display","block")}else{jQuery("#err_site_recommendation").css("display","none");jQuery("#overlay_site_recommendation").fadeTo(0,0);jQuery("#overlay_site_recommendation").css("display","none");jQuery("#box_site_recommendation").animate({top:"0",opacity:0},0);jQuery("#box_site_recommendation").css("display","none")}}catch(d){throw new Error(d)}return false};
