var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-18505310-4"]);_gaq.push(["_trackPageview"]);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)})();(function(b){b.tiny=b.tiny||{};b.tiny.ajaxRequest={options:{validate:function(){return true},success:function(){},error:function(){},sendAll:true,waiting:true,processing:true,container:null,ids:[]}};b.fn.isEmpty=function(){return b(this).val()==null||jQuery.trim(b(this).val())==""};b.fn.ajaxRequest=function(h,g,e){var j=b(this);var f=b.extend({},b.tiny.ajaxRequest.options,e);var i;if(f.container==null&&f.processing){i=b(".processing",h);if(i.attr("class")==null){i=b("<div class='processing'/>");i.appendTo(b(h))}}j.bind(g,function(){if(!f.waiting||!j.attr("ajaxRequest")){if(f.container==null&&f.processing){i.empty();b("<img class='loading_img' src='/images/loading.gif'/>").appendTo(i);i.show("fast",function(){j.doAjax(i,h,g,f)})}else{if(f.container!=null){b(f.container).empty()}j.doAjax(i,h,g,f)}}})};b.fn.doAjax=function(g,m,e,h){var j=b(this);d(j,h.waiting);if(h.validate()){var p=b(m).attr("apply");var n="type=ajax";n+=getParam("apply",p);n+=getParam("target",j.attr("id"));n+=getParam("event",e);n+=getParam("token",tokenKey);if(h.sendAll){b("[ajax=true]",m).each(function(){var i=c(b(this));if(i.length>0){n+=getParam(encodeURIComponent(b(this).attr("id")),i)}})}else{if(h.ids!=null){for(var l=0;l<h.ids.length;l++){var f=h.ids[l];var k=c(b("#"+f));if(k.length>0){n+=getParam(encodeURIComponent(f),k)}}}}b.ajax({type:"POST",url:"/actionServlet",data:n,success:function(i){h.success(i);a(j,h.waiting);if(h.container==null&&h.processing){g.html(i)}else{if(h.container!=null){b(h.container).html(i)}else{b("body").append(i)}}},error:function(i){h.error(i);a(j,h.waiting);if(i.status=="404"){i=getLabel("pagenotfound")}else{i=getLabel("serviceunavailable")}if(h.container==null&&h.processing){g.html(i)}else{if(h.container!=null){b(h.container).html(i)}else{alert(i)}}}})}else{a(j,h.waiting);if(h.container==null&&h.processing){g.empty()}}};function d(e,f){if(f){e.attr("ajaxRequest","true")}}function a(e,f){if(f){e.attr("ajaxRequest",null)}}function c(f){var e=jQuery.trim(f.val());e=e.replace(/\s{2,}/," ");f.val(e);if(f.attr("search")){return f.searchVal()}return jQuery.trim(f.val())}})(jQuery);$(function(){loadingImg(".loading");$("body").browserClass();d();a();c();$("#btnSearch").ajaxRequest("#fastSearchForm","click");$("#btnLogout").ajaxRequest("#btnLogout","click");$("#txtCenterSearch").ok(b);$("#btnCenterSearch").click(b);$("#btnTopLogin").click(function(){var e=document.location.pathname.toLowerCase().indexOf(encodeURI("/index/dang nhap"));if(e<0){window.location="/index/dang nhap?url="+encodeURIComponent(window.location)}});$("#slCenterSearch").change(function(){window.location="/index/doanh nghiep/c/"+$(this).val()});function b(){var e=$("#txtCenterSearch").searchVal();if(e==""||e==null){$("#txtCenterSearch").focus()}else{window.location=window.location.pathname+"?key="+e}}function a(){try{$(".search").searchInput("none")}catch(e){}}function d(){try{$.datepicker.setDefaults($.datepicker.regional.vi);$(".date").datepicker({changeMonth:true,changeYear:true});$(".date").datepicker("option","dateFormat","dd/mm/yy");$(".mask").setMask()}catch(e){}}function c(){$(".a_content img").each(function(){if($(this).width()>578){$(this).width(578)}})}});
