(function(a){a.address=(function(){var c=function(i,p){a(this).trigger(a.extend(a.Event(i),(function(){var ag={value:this.value(),path:this.path(),pathNames:this.pathNames(),parameterNames:this.parameterNames(),parameters:{},queryString:this.queryString(),isBackForward:p};for(var af=0,ae=ag.parameterNames.length;af<ae;af++){ag.parameters[ag.parameterNames[af]]=this.parameter(ag.parameterNames[af])}return ag}).call(this)))};var U=function(){c.call(a.address,"init")};var n=function(i){c.call(a.address,"change",!!i)};var O=function(){var i=T.href.indexOf("#");return i!=-1?ac(o(T.href.substr(i+1))):""};var g=function(){try{top.document;return top}catch(i){return window}};var E=function(p,i){if(B.strict){p=i?(p.substr(0,1)!="/"?"/"+p:p):(p==""?"/":p)}return p};var q=function(i,p){return(h&&T.protocol=="file:")?(p?P.replace(/\?/,"%3F"):P.replace(/%253F/,"?")):i};var ad=function(ag){for(var ae=0,p=ag.childNodes.length,af;ae<p;ae++){if(ag.childNodes[ae].src){k=String(ag.childNodes[ae].src)}if(af=ad(ag.childNodes[ae])){return af}}};var W=function(){if(!s){var p=O();var i=!(P==p);if(t&&r<523){if(D!=X.length){D=X.length;if(typeof z[D-1]!=F){P=z[D-1]}S(true)}}else{if(h&&i){if(r<7){T.reload()}else{G.value(p,true)}}else{if(i){P=p;S(true)}}}}};var S=function(i){n(i);m(v,10)};var v=function(){var p=(T.pathname+(/\/$/.test(T.pathname)?"":"/")+C.value()).replace(/\/\//,"/").replace(/^\/$/,"");var i=window[B.tracker];if(typeof i==f){i(p)}else{if(typeof pageTracker!=F&&typeof pageTracker._trackPageview==f){pageTracker._trackPageview(p)}else{if(typeof urchinTracker==f){urchinTracker(p)}}}};var e=function(){var i=w.contentWindow.document;i.open();i.write("<html><head><title>"+aa.title+"</title><script>var "+x+' = "'+O()+'";<\/script></head></html>');i.close()};var M=function(){if(!R){R=true;a("a").attr("xref",function(){return a(this).attr("href")});if(h&&r<8){aa.body.innerHTML='<iframe id="'+x+'" src="javascript:false;" width="0" height="0"></iframe>'+aa.body.innerHTML;w=aa.getElementById(x);m(function(){a(w).bind("load",function(){var i=w.contentWindow;var p=i.location.href;P=(typeof i[x]!=F?i[x]:"");if(P!=O()){S();T.hash=q(P,true)}});if(typeof w.contentWindow[x]==F){e()}},50)}else{if(t){if(r<418){a(aa.body).append('<form id="'+x+'" style="position:absolute;top:-9999px;" method="get"></form>');I=aa.getElementById(x)}if(typeof T[x]==F){T[x]={}}if(typeof T[x][T.pathname]!=F){z=T[x][T.pathname].split(",")}}}m(function(){U();n();v()},1);if(h&&r>=8){aa.body.onhashchange=W}else{u(W,50)}a("a").attr("href",function(){return a(this).attr("xref")}).removeAttr("xref");a("a[rel*=address:]").address()}};var C={baseURL:function(){var i=T.href;if(i.indexOf("#")!=-1){i=i.substr(0,i.indexOf("#"))}if(i.substr(i.length-1)=="/"){i=i.substr(0,i.length-1)}return i},strict:function(){return B.strict},history:function(){return B.history},tracker:function(){return B.tracker},title:function(){return aa.title},value:function(){if(!Z){return null}return o(E(q(P,false),false))},path:function(){var i=this.value();return(i.indexOf("?")!=-1)?i.split("?")[0]:i},pathNames:function(){var p=this.path();var i=p.split("/");if(p.substr(0,1)=="/"||p.length==0){i.splice(0,1)}if(p.substr(p.length-1,1)=="/"){i.splice(i.length-1,1)}return i},queryString:function(){var p=this.value();var i=p.indexOf("?");return(i!=-1&&i<p.length)?p.substr(i+1):""},parameter:function(aj){var ag=this.value();var ae=ag.indexOf("?");if(ae!=-1){ag=ag.substr(ae+1);var ai=ag.split("&");var ah,af=ai.length;while(af--){ah=ai[af].split("=");if(ah[0]==aj){return ah[1]}}}},parameterNames:function(){var af=this.value();var p=af.indexOf("?");var ag=[];if(p!=-1){af=af.substr(p+1);if(af!=""&&af.indexOf("=")!=-1){var ah=af.split("&");var ae=0;while(ae<ah.length){ag.push(ah[ae].split("=")[0]);ae++}}}return ag}};var G={strict:function(i){B.strict=i},history:function(i){B.history=i},tracker:function(i){B.tracker=i},title:function(i){m(function(){H=aa.title=i;if(J&&w&&w.contentWindow&&w.contentWindow.document){w.contentWindow.document.title=i;J=false}if(!L&&Y){T.replace(T.href.indexOf("#")!=-1?T.href:T.href+"#")}L=false},50)},value:function(ae,af){ae=ac(o(E(ae,true)));if(ae=="/"){ae=""}if(P==ae){return}L=true;P=ae;s=true;S(af);z[X.length]=P;if(t){if(B.history){T[x][T.pathname]=z.toString();D=X.length+1;if(r<418){if(T.search==""){I.action="#"+P;I.submit()}}else{if(r<523||P==""){var i=aa.createEvent("MouseEvents");i.initEvent("click",true,true);var p=aa.createElement("a");p.href="#"+P;p.dispatchEvent(i)}else{T.hash="#"+P}}}else{T.replace("#"+P)}}else{if(P!=O()){if(B.history){T.hash="#"+q(P,true)}else{T.replace("#"+P)}}}if((h&&r<8)&&B.history){m(e,50)}if(t){m(function(){s=false},1)}else{s=false}}};var x="jQueryAddress",f="function",F="undefined",A=a.browser,r=parseFloat(a.browser.version),Y=A.mozilla,h=A.msie,K=A.opera,t=A.safari,Z=false,N=g(),aa=N.document,X=N.history,T=N.location,u=setInterval,m=setTimeout,o=decodeURI,ac=encodeURI,ab=navigator.userAgent,w,I,k,H=aa.title,D=X.length,s=false,R=false,L=true,J=true,z=[],y={},P=O(),j={},B={history:true,strict:true};if(h){r=parseFloat(ab.substr(ab.indexOf("MSIE")+4))}Z=(Y&&r>=1)||(h&&r>=6)||(K&&r>=9.5)||(t&&r>=312);if(Z){for(var V=1;V<D;V++){z.push("")}z.push(O());if(h&&T.hash!=O()){T.hash="#"+q(O(),true)}if(K){history.navigationMode="compatible"}ad(document);var b=k.indexOf("?");if(k&&b>-1){var l,d=k.substr(b+1).split("&");for(var V=0,Q;Q=d[V];V++){l=Q.split("=");if(/^(history|strict)$/.test(l[0])){B[l[0]]=(isNaN(l[1])?/^(true|yes)$/i.test(l[1]):(parseInt(l[1])!=0))}if(/^tracker$/.test(l[0])){B[l[0]]=l[1]}}}a(M)}else{if((!Z&&T.href.indexOf("#")!=-1)||(t&&r<418&&T.href.indexOf("#")!=-1&&T.search!="")){aa.open();aa.write('<html><head><meta http-equiv="refresh" content="0;url='+T.href.substr(0,T.href.indexOf("#"))+'" /></head></html>');aa.close()}else{v()}}a.each(("init,change").split(","),function(ae,p){j[p]=function(af,i){a(a.address).bind(p,i||af,i&&af);return this}});a.each(("baseURL,strict,history,tracker,title,value").split(","),function(ae,p){j[p]=function(i){if(typeof i!="undefined"){if(Z){G[p](i)}return a.address}else{return C[p]()}}});a.each(("path,pathNames,queryString,parameter,parameterNames").split(","),function(ae,p){j[p]=function(i){return C[p](i)}});return j})();a.fn.address=function(b){a(this).click(function(){var c=b?b.call(this):/address:/.test(a(this).attr("rel"))?a(this).attr("rel").split("address:")[1].split(" ")[0]:a(this).attr("href").replace(/^#/,"");a.address.value(c);return false})}}(jQuery));(function(){function b(){window.domain_static=document.domain.indexOf("localhost")!=-1?"http://static.jokker.localhost/":"http://static.jokker.ee/";window.loadList=this.loadList;window.bindListItems=this.bindListItems;window.getListAsString=this.getListAsString;window.getCheckboxesAsString=this.getCheckboxesAsString;window.loadItem=this.loadItem;jQuery(document).ready(this.ready)}puu.extend(b,{error:function(c,f,e){var d='<p class="error">'+(f?f:"Tehniline viga, palun proovi uuesti.")+"</p>";jQuery("#"+c+" .error").remove();if(e){jQuery("#"+c).before(d);return}jQuery("#"+c).prepend(d)},hideLeft:function(){jQuery("#content-container").removeClass("widel");return false},showLeft:function(){jQuery("#content-container").addClass("widel");return false},bindCVComments:function(c){jQuery("#cv-comment-add").bind("submit",function(d){d.preventDefault();jQuery("#cv-comment-add .ok, #cv-comment-add .error").remove();jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=cvlist&name="+jQuery("#cv-nimi-f").val()+"&comment="+jQuery("#cv-comment-f").val()+"&rating="+jQuery("#cv-hinnang-f").val()+"&id="+jQuery("#cv-list tr.list").attr("id").split("-")[1]+"&job_id="+c,success:function(e){if(e=="OK"){jQuery("#cv-comment-add").append('<p class="ok">Salvestatud.</p>');return}b.error("#cv-comment-add table",e,true)},error:function(){b.error("#cv-comment-add table","Tehniline viga, palun proovi uuesti.",true)}})});jQuery("#cv-send").bind("submit",function(d){d.preventDefault();jQuery("#cv-send .ok, #cv-send .error").remove();jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=cvsend&title="+encodeURIComponent(jQuery("#cv-pealkiri-f").val())+"&content="+encodeURIComponent(jQuery("#cv-sisu-f").val())+"&id="+jQuery("#cv-list tr.list").attr("id").split("-")[1]+"&job_id="+c,success:function(e){if(e=="OK"){jQuery("#cv-send").append('<p class="ok">Saadetud.</p>');return}b.error("#cv-send table",e,true)},error:function(){b.error("#cv-send table","Tehniline viga, palun proovi uuesti.",true)}})});jQuery("#cv-insert-a, #cv-insert-b").bind("click",function(g){g.preventDefault();if(jQuery("#cv-sisu-f").val()&&!confirm("Sisestan põhja? Olemasolev sisu kustutatakse.")){return}if(jQuery(this).attr("id")=="cv-insert-a"){var h="";h+=jInfo.name+"\n";h+=jInfo.address+"\n";h+=jInfo.telephone+"\n";h+="\n";h+="\n";h+="Lugupeetud "+jQuery("#personal-info h2").text()+"\n";h+="\n";h+="Täname Teid kandideerimast "+jInfo.name+' poolt korraldatud "'+jInfo.jobName+'" konkursil. Kahjuks peame tõdema, et seekord osutus valituks teine kandidaat.\n';h+="\n";h+="Täname Teid "+jInfo.name+"-le osutatud tähelepanu eest ja soovime Teile edu edaspidiseks.\n";h+="\n";h+="Lugupidamisega\n";h+=jInfo.name;jQuery("#cv-sisu-f").val(h)}else{var f=new Date();var h="";h+="Kutse tööintervjuule\n";h+="\n";h+=(f.getDate()<10?"0"+f.getDate():f.getDate())+"."+(f.getMonth()<9?"0"+(f.getMonth()+1):f.getMonth()+1)+"."+f.getFullYear()+"\n";h+=jInfo.name+"\n";h+=jInfo.address+"\n";h+=jInfo.telephone+"\n";h+="\n";h+="\n";h+="Lugupeetud "+jQuery("#personal-info h2").text()+"\n";h+="\n";h+='Täname Teid kandideerimast "'+jInfo.jobName+'" konkursil.\n';h+="\n";h+="Palume Teil tulla tööintervjuule /päev/./kuu/ kell /kell/ aadressil /aadress/.\n";h+="\n";h+="Palun teavitage intervjuule saabumisel vastuvõttu. Juhul kas pakutud aeg ei ole Teile sobilik kontakteeruga pr/hr. /nimi/ telefoninumbril /telefoninumber/ /kuupäev/.\n";h+="\n";h+="Peatse kohtumiseni.\n";h+="\n";h+="Lugupidamisega\n";h+=jInfo.name;jQuery("#cv-sisu-f").val(h)}})},setActiveHelper:function(f){b.clearHelpers();
if(jQuery("#login-form").length){return}jQuery("#helper-"+f+", #helper-"+f+" li").removeClass("hidden");jQuery("#helper-"+f+" a").unbind("click").bind("click",function(h){jQuery.scrollTo(jQuery(this).attr("href"),300);h.preventDefault()}).each(function(h){if(!jQuery(jQuery(this).attr("href")).length){jQuery(this).parents("li").eq(0).addClass("hidden")}});var g=jQuery("#prefs").length?jQuery("#prefs").offset().top+225:jQuery("#categories").offset().top+jQuery("#categories").innerHeight();var c=jQuery("tr.list").length?jQuery("tr.list").offset().top:0;var e=g>c?g:c;var d=function(h){var i=e-jQuery(document).scrollTop();jQuery("#helper-"+f).css({top:(i>0?i:0)+"px"})};d();jQuery(window).bind("scroll",d)},clearHelpers:function(){jQuery(window).unbind("scroll");jQuery('#left ul[id^="helper-"]').addClass("hidden")},kandideeri:function(){jQuery(".kaaskiri > a").bind("click",function(c){c.preventDefault();jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=kaaskiri&act=delete&id="+jQuery(this).parents("p").eq(0).children("input").eq(0).attr("value")});jQuery(this).parents("p").eq(0).fadeOut()})},loadList:function(c){jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=list&"+(c?c:""),success:function(e){jQuery("#content > *:not(#search-simple, #search-cv, #search-service, #tags)").remove();b.clearHelpers();if(jQuery("#tags").length){jQuery("#tags").before(e)}else{jQuery("#content").append(e)}},error:function(){b.error("#job-list","Tehniline viga, palun proovi uuesti.",true)}})},bindListItems:function(g,f,e,c){if(jQuery.browser.msie&&jQuery.browser.version<8&&!c){jQuery(document).ready(function(){b.bindListItems(g,f,e,true)});return}jQuery("#pageselect a").bind("click",function(i){if(jQuery(document).scrollTop()>jQuery("#content").offset().top){jQuery.scrollTo("#content",300,{offset:{top:-30}})}var h={job:"Tööpakkumised",service:"Teenusepakkujad",cvs:"Tööotsijad",cvv:"Valikulaud"};if(f=="cvs"&&jQuery("#s-sort").length){f="cvv"}jQuery.address.value("/"+h[f]+"/"+jQuery(this).attr("href").split("/").reverse()[0]+"/"+(g?"?"+g:""));return false});var d="";jQuery("#"+(f=="cvs"?"cv":f)+"-list th a").bind("click",function(i){var h=jQuery(this).is(".asc");var j=jQuery(this).is(".desc");jQuery("#"+(f=="cvs"?"cv":f)+"-list th a").removeClass("asc").removeClass("desc");if((!h&&!j)||h){jQuery(this).addClass("desc")}else{jQuery(this).addClass("asc")}d=jQuery(this).parents("th").eq(0).attr("class").split("-")[1]+"-"+jQuery(this).attr("class");loadList(g+"&sort="+d);i.preventDefault()});jQuery("#"+(f=="cvs"?"cv":f)+"-list td:nth-child(2) a").bind("click",function(k){var j=this;var l=jQuery(this).attr("href").replace(/http(s)?:\/\/(.*?)\//,"/").split("/")[2];var i=jQuery(this).parents("tr").eq(0);var h=f=="cvs"?"cv":f;if(i.is(".active")){i.removeClass("active");jQuery('tr[id^="'+h+'-"]').remove();b.clearHelpers();return false}if(f=="job"){jQuery.address.value("/Tööpakkumine/"+l+"/")}else{if(f=="cvs"){jQuery.address.value("/CVd/"+l+"/"+(e?e+"/":""))}else{if(f=="service"){jQuery.address.value("/Teenusepakkuja/"+l+"/")}}}return false})},loadItem:function(d,e,c){jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=item&type="+(d?d:0)+"&id="+(e?e:0)+(c?"&pid="+c:""),success:function(f){jQuery("#right").empty();jQuery("#right").append(f)},error:function(){b.error("#right","Tehniline viga, palun proovi uuesti.")}})},getListAsString:function(f,c){var d=[];var e=0;jQuery("#"+f+" option").each(function(){if((!c&&!jQuery(this).attr("disabled"))||(c&&jQuery(this).attr("selected"))){d[e]=jQuery(this).attr("value");e++}});return d.join(",")},getCheckboxesAsString:function(e){var c=[];for(var d=0;d<e.length;d++){if(jQuery("#"+e[d]).is(":checked")){c[c.length]=jQuery("#"+e[d]).val()}}return c.join(",")},savedContent:null,hasSavedContent:function(){return !!this.savedContent},saveContent:function(){this.savedContent=jQuery("#content").html()},restoreSavedContent:function(){jQuery("#content").html(this.savedContent);this.savedContent=null},bindFacebook:function(){jQuery(".facebook-link").bind("click",function(c){c.preventDefault();jQuery("head").append('<script src="http://static.ak.connect.facebook.com/connect.php/en_US" type="text/javascript"><\/script>');var d=function(){if(!window.FB){window.setTimeout(d,100);return}FB.init("cc710df31eba730f804af842d843a7ca","/Facebook/facebook_xd.html");var e="http://jokker.ee/Tööpakkumine/"+jQuery("#job-description").attr("class").split("-")[1]+"/";var f={name:"Tööpakkumine: "+jQuery("#jobname").text()+" ("+jQuery("#job-by").text()+")",href:e,description:jQuery("#job-description").text(),media:[{type:"image",src:"http://static.jokker.ee/img/logo_ee.png",href:e}]};FB.ensureInit(function(){FB.Connect.streamPublish("",f,[{text:"Jokker.ee",href:"http://jokker.ee/"}])})};d()})},ready:function(){jQuery("#hm-profile-hide").bind("click",b.hideLeft);jQuery("#hm-profile-show").bind("click",b.showLeft);jQuery("#tutvustus-m li").bind("click",function(d){d.preventDefault();jQuery("#tutvustus-m li, #tutvustus ul:not(#tutvustus-m)").removeClass("active");jQuery(this).addClass("active");jQuery("#tutvustus-"+(jQuery("#tutvustus-m li").index(this)+1)).addClass("active")});jQuery("#prefs .hop a").bind("click",function(d){d.preventDefault();jQuery("#content-container").addClass("widel");jQuery.scrollTo(jQuery(this).attr("href"),400)});if(jQuery("#tags").length){jQuery("#tags a").bind("click",function(f){f.preventDefault();var d=decodeURIComponent(jQuery(this).attr("href").split("/").reverse()[1]);jQuery("#otsi-f").val(d);jQuery.address.value("/Tööpakkumised/?otsi="+encodeURIComponent(d));jQuery.scrollTo("#content",500,{offset:{top:-70}})})}var c=true;jQuery.address.change(function(i){if(!i.pathNames[0]&&c){c=false;return}c=false;var h=i.pathNames.length?i.pathNames[0].toLowerCase():"";if(!h){if(b.hasSavedContent()){b.restoreSavedContent();b.clearHelpers();return}jQuery('tr[id^="job-"], tr[id^="cv-"], tr[id^="service-"]').remove();jQuery("#job-list tr, #cv-list tr, #service-list tr").removeClass("active");b.clearHelpers();return}else{if(h=="cvd"||h=="tööpakkumine"||h=="teenusepakkuja"){var g;var f;var j=parseInt(i.pathNames[1]);if(h=="cvd"){g="cv";f=i.pathNames[2]}else{if(h=="tööpakkumine"){g="job"}else{if(h=="teenusepakkuja"){g="service"}}}jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=item&type="+(g?g:0)+"&id="+j+(f?"&pid="+f:""),success:function(e){if(jQuery("#"+g+"item-"+j).length){jQuery('tr[id^="'+g+'-"]').remove();jQuery("#"+g+"-list tr.active").removeClass("active");jQuery("#"+g+"item-"+j).addClass("active").after('<tr id="'+g+"-"+j+'" class="list"><td colspan="9">'+e+"</td></tr>");if(jQuery(document).scrollTop()>jQuery("#"+g+"-"+j).offset().top||(jQuery("#"+g+"-"+j).offset().top>jQuery(window).height()+jQuery(document).scrollTop())){jQuery.scrollTo("#"+g+"item-"+j,0)}return}b.saveContent();jQuery("#content").html(e)},error:function(){b.error("#"+g+"-list","Tehniline viga, palun proovi uuesti.",true)}})}else{if(h=="teenusepakkujad"||h=="tööpakkumised"||h=="tööotsijad"||h=="valikulaud"){var d={"tööpakkumised":"job",teenusepakkujad:"service","tööotsijad":"cvs",valikulaud:"cvs"};b.saveContent();loadList("type="+d[h]+"&page="+(i.pathNames[1]?parseInt(i.pathNames[1]):1)+(i.queryString?"&"+(jQuery.browser.msie?encodeURI(i.queryString):i.queryString):""))}else{if(h=="kategooriad"){loadList("type=job&path="+i.path)}}}}})}});var a={jobSimple:function(){var c=function(f){if(typeof f=="object"){f.preventDefault()}jQuery.address.value("/Tööpakkumised/?otsi="+encodeURIComponent(jQuery("#otsi-f").val()))};var d=function(){jQuery("#search-simple").bind("submit",c);if(simpleSearch){var e;jQuery("#otsi-f").bind("keyup",function(){if(e){window.clearTimeout(e)}e=window.setTimeout(c,300)})}};if(jQuery.browser.msie&&jQuery.browser.version<8){jQuery(document).ready(d)}else{d()}},job:function(){if(jQuery.browser.msie){jQuery(document).ready(function(){a._job()});return}a._job()},_job:function(){jQuery("#asukoht-s-f, #ametinimetused-s-f").multiSelect();jQuery("#aeg-s-f").daterangepicker({presetRanges:[{text:"Täna",dateStart:"today",dateEnd:"today"},{text:"Homme",dateStart:"tomorrow",dateEnd:"tomorrow"},{text:"Järgmised 30 päeva",dateStart:"Today",dateEnd:"Today+30"}],presets:{dateRange:"Kuupäevade vahemik",specificDate:"Kindel kuupäev",allDatesBefore:"Kõik päevad enne",allDatesAfter:"Kõik päevad pärast"},rangeStartTitle:"Alguskuupäev",rangeEndTitle:"Lõpukuupäev",nextLinkText:"Järgmine",prevLinkText:"Eelmine",doneButtonText:"Valmis",earliestDate:Date.parse("Today"),latestDate:Date.parse("Today+14"),rangeSplitter:"-",dateFormat:"yy-mm-dd",closeOnSelect:true,arrows:false,onOpen:function(c){$.datepicker.setDefaults($.datepicker.regional.et)}});jQuery("#search-job").bind("submit",function(c){var d=["ametinimetused="+getListAsString("ametinimetused-s-f"),"asukoht="+getListAsString("asukoht-s-f"),"otsi="+encodeURIComponent(jQuery("#otsi-s-f").val()),"vabad="+(jQuery("#vabad-s-f").attr("checked")?1:0),"koht="+(jQuery("#koht-s-f").val()?jQuery("#koht-s-f").val().join(","):""),"aeg="+encodeURIComponent(jQuery("#aeg-s-f").val()),"jtype="+getListAsString("type-s-f",1),"aegunud="+(jQuery("#aktiivsed-s-f").attr("checked")?0:1),];jQuery.address.value("/Tööpakkumised/?"+d.join("&"));c.preventDefault()})},cv:function(c){jQuery('#s-menu a[href="#s-filters"], #s-menu a[href="#s-sort"]').bind("click",function(f){jQuery("#s-filters, #s-sort").addClass("hidden");jQuery(jQuery(this).attr("href")).removeClass("hidden");jQuery("#s-menu li").removeClass("active");jQuery(this).parents("li").eq(0).addClass("active");f.preventDefault()});jQuery("#haridus-s h3, #amet-s h3").bind("click",function(f){jQuery("#haridustase-s-f, #koolid-s-f, #ametinimetused-s-f, #asukoht-s-f").multiSelect({searchEnabled:false});if(jQuery(this).parents("div").eq(0).is(".closed")){jQuery(this).parents("div").eq(0).removeClass("closed");return false}jQuery(this).parents("div").eq(0).addClass("closed");return false});jQuery("#search-cv").bind("submit",function(f){var g=["type=cvs","vanus="+(jQuery("#vanus-s-f").val()?jQuery("#vanus-s-f").val():0)+"-"+(jQuery("#vanus2-s-f").val()?jQuery("#vanus2-s-f").val():0),"juhiload="+getCheckboxesAsString(["juhiload-s-a-f","juhiload-s-b-f","juhiload-s-c-f","juhiload-s-d-f","juhiload-s-e-f"]),"sugu="+getCheckboxesAsString(["sugu-s-mees-f","sugu-s-naine-f"]),"kommentaarid="+(jQuery("#kommentaarid-s-f").is(":checked")?1:0),"soovitused="+(jQuery("#soovitused-s-f").is(":checked")?1:0),"pilt="+(jQuery("#pilt-s-f").is(":checked")?1:0),"auto="+(jQuery("#auto-s-f").is(":checked")?1:0),"reiting="+jQuery("#reiting-s-f").val(),"hinnang="+(jQuery("#hinnang-s-f").val()?jQuery("#hinnang-s-f").val():0),"kogemus="+jQuery("#kogemus-s-f").val()];
if(jQuery("#haridustase-s-f").is(".multiselect")){g[g.length]="asukoht="+getListAsString(c?"asukoht2-s-f":"asukoht-s-f");g[g.length]="ametinimetused="+getListAsString(c?"ametinimetused2-s-f":"ametinimetused-s-f");g[g.length]="haridustase="+getListAsString("haridustase-s-f");g[g.length]="koolid="+getListAsString("koolid-s-f",1)}if(c){jQuery('#s-sort label span[id^="sort-"]').each(function(){g[g.length]=jQuery(this).attr("id").split("-")[1]+"_t="+jQuery(this).text()});jQuery('#s-sort span[id^="sort-vanus-"], #s-sort span[id^="sort-kogemus-"]').each(function(){var h=jQuery(this).attr("id").split("-");g[g.length]=h[1]+"_v["+jQuery("#"+h[1]+"-"+h[2]).text()+"]="+jQuery(this).text()});jQuery('#s-sort span[id^="sort-juhiload-"], #s-sort span[id^="sort-sugu-"]').each(function(){var h=jQuery(this).attr("id").split("-");g[g.length]=h[1]+"_v["+h[2]+"]="+jQuery(this).text()});jQuery("#s-koolid table span").each(function(){var h=jQuery(this).parents('td[id^="s-"]').attr("id").split("-")[1];g[g.length]=h+"_v["+jQuery(this).parents("tr").eq(0).children("td:first-child").text()+"]="+jQuery(this).text()});jQuery("#s-keeled table span").each(function(){var h=jQuery(this).parents('td[id^="s-"]').attr("id").split("-")[1];g[g.length]=h+"_v["+jQuery(this).parents("tr").eq(0).children("td:first-child").text()+"]="+jQuery(this).text()});jQuery("#s-haridustase table span, #s-ametinimetused table span, #s-asukohad table span").each(function(){var h=jQuery(this).parents('td[id^="s-"]').attr("id").split("-")[1];g[g.length]=h+"_v["+jQuery(this).parents("tr").eq(0).attr("id").split("-")[1]+"]="+jQuery(this).text()});g.push("job_id="+jQuery("#s-search").attr("class").split("-")[1])}loadList(g.join("&"));f.preventDefault()});var d=function(h){var g=/^([0-9]+)$/;var f=/^\-([0-9]+)$/;if(!g.test(jQuery(h).text())&&!f.test(jQuery(h).text())){jQuery(h).text(0)}jQuery(h).text(parseInt(jQuery(h).text()));a.updatePercent()};var e=function(h){var g=/^([0-9]+)\-([0-9]+)$/;var f=/^([0-9]+)$/;if(!g.test(jQuery(h).text())&&!f.test(jQuery(h).text())){jQuery(h).text(0)}};jQuery('#s-sort span[id^="sort-"], #s-haridustase span, #s-koolid span, #s-keeled span, #s-asukohad span, #s-ametinimetused span').editable({callback:d});jQuery('#s-sort span[id^="vanus-"], #s-sort span[id^="kogemus-"]').editable({callback:e});jQuery("#s-kogemus-add, #s-vanus-add").bind("click",function(h){var g=jQuery(this).attr("id").split("-")[1];var f=jQuery("#s-"+g+" span").length/2;jQuery(this).parents("td").eq(0).find("table").append('<tr><td><span id="'+g+"-"+f+'">0-99</span>a</td><td class="right"><span id="sort-'+g+"-"+f+'">0</span>p</td></tr>');jQuery("#s-sort #sort-"+g+"-"+f).editable({callback:d});jQuery("#s-sort #"+g+"-"+f).editable({callback:e});return false});jQuery("#valikulaud-f").bind("change",function(){window.location.href="/Valikulaud/"+jQuery("#s-search").attr("class").split("-")[1]+"/"+jQuery(this).val()+"/"});jQuery("#save-link").bind("click",function(f){var g=prompt("Sisesta nimi valikulauale...",jQuery('#valikulaud-f option[selected="selected"]').text());if(g==null){return}jQuery("#search-cv .error #search-cv .ok").remove();jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=cvv&name="+encodeURI(g)+"&"+getParams().join("&"),success:function(h){jQuery("#search-cv").prepend('<p class="ok">Valikulaud on salvestatud.</p>')},error:function(){b.error("#search-cv","Tehniline viga, palun proovi uuesti.")}});f.preventDefault()});jQuery("#delete-link").bind("click",function(f){jQuery("#search-cv .error #search-cv .ok").remove();jQuery.ajax({timeout:7000,type:"GET",url:"/ajax.php?p=cvv&act=delete&id="+jQuery("#valikulaud-f").val(),success:function(g){jQuery('#valikulaud-f option[selected="selected"]').remove();jQuery("#search-cv").prepend('<p class="ok">Valikulaud on kustutatud.</p>')},error:function(){b.error("#search-cv","Tehniline viga, palun proovi uuesti.")}})})},updatePercent:function(){var c=0;jQuery('#s-sort label span[id^="sort-"]').each(function(){c+=parseInt(jQuery(this).text())});if(c==0){return}jQuery('#s-sort span[id^="perc-"]').each(function(){jQuery(this).text(Math.round((parseInt(jQuery("#sort-"+jQuery(this).attr("id").split("-")[1]).text())/c)*100))})},service:function(){jQuery("#asukoht-s-f, #ametinimetused-s-f").multiSelect();jQuery("#search-service").bind("submit",function(c){var d=["type=service","otsi="+encodeURIComponent(jQuery("#otsi-s-f").val()),"asukoht="+getListAsString("asukoht-s-f"),"ametinimetused="+getListAsString("ametinimetused-s-f")];if((!jQuery("#type-s-1-f").is(":checked")||!jQuery("#type-s-2-f").is(":checked"))&&(jQuery("#type-s-1-f").is(":checked")||jQuery("#type-s-2-f").is(":checked"))){d[d.length]="stype="+(jQuery("#type-s-1-f").is(":checked")?1:2)}loadList(d.join("&"));c.preventDefault()})}};var b=new b();window.jokker=b;window.jokkerSearch=a})();