"),n=$("
"),s=$(""),r=$(""),l=$(""),d=$(""),o=$("");d.html(":"),o.html(":");var u={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],showSec:!0,showDate:!0},u=$.extend({},u,e);if(u.showDate){var h=new Date;h.setDate(h.getDate()),t.html(u.dayNames[h.getDay()]+","+h.getDate()+"/"+u.monthNames[h.getMonth()]+"/"+h.getFullYear())}u.showSec&&setInterval(function(){var e=(new Date).getSeconds();l.html((10>e?"0":"")+e)},1e3),setInterval(function(){var e=(new Date).getMinutes();r.html((10>e?"0":"")+e)},1e3),setInterval(function(){var e=(new Date).getHours();s.html((10>e?"0":"")+e)},1e3),u.showDate&&a.append(t),n.append(s),n.append(d),n.append(r),u.showSec&&(n.append(o),n.append(l)),a.append(n)};}(jQuery));
!function(i){i.fn.tooltipOnmose=function(){var n=$(this),t=(i(this),function(n){n.css({position:"fixed","z-index":9999});var t=n.height(),o=n.width(),e=i(window).height(),s=i(window).width();window.onmousemove=function(i){var c=i.clientX,d=i.clientY,a=c+20,f=d+20-t;0>s-(c+o)&&(a=c-20-o),0>e-(d+t)&&(f=d-20-t),n.css({top:f+"px"}),n.css({left:a+"px"})}});$(this).parent().find("figure").hover(function(){$(window).width()>786?(t(n),n.addClass("active")):n.removeClass("active")},function(){n.removeClass("active")})}}(jQuery);
!function(t){if(!t.fn.style){var e=function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},r=!!CSSStyleDeclaration.prototype.getPropertyValue;r||(CSSStyleDeclaration.prototype.getPropertyValue=function(t){return this.getAttribute(t)},CSSStyleDeclaration.prototype.setProperty=function(t,r,n){this.setAttribute(t,r);var n="undefined"!=typeof n?n:"";if(""!=n){var i=new RegExp(e(t)+"\\s*:\\s*"+e(r)+"(\\s*;)?","gmi");this.cssText=this.cssText.replace(i,t+":"+r+" !"+n+";")}},CSSStyleDeclaration.prototype.removeProperty=function(t){return this.removeAttribute(t)},CSSStyleDeclaration.prototype.getPropertyPriority=function(t){var r=new RegExp(e(t)+"\\s*:\\s*[^\\s]*\\s*!important(\\s*;)?","gmi");return r.test(this.cssText)?"important":""}),t.fn.style=function(t,e,r){var n=this.get(0);if("undefined"==typeof n)return this;var i=this.get(0).style;return"undefined"!=typeof t?"undefined"!=typeof e?(r="undefined"!=typeof r?r:"",i.setProperty(t,e,r),this):i.getPropertyValue(t):i}}}(jQuery);
(function($){
$.fn.hasAttr=function(name){return this.attr(name) !==undefined;};
$(document).ready(function(){
var menu=0,slider=0,margin=0,widthmain=$("#container").width();
if($("#header .more-inside-menu").length>0){
menu=parseInt($("#header .more-inside-menu").offset().top + $("#header .more-inside-menu").height() );
}
if($("#header .slider-header").length>0){
slider=parseInt($("#header .slider-header").offset().top + $("#header .slider-header").height() );
}
if($(".ads-banner-scroll").length>0){
$.each($(".ads-banner-scroll"),function(){
var that=$(this),width=$(this).width();
var resizeWidth=function(){
var widthBanner=($(window).width() - $("#container").width() - 30 )/2;
that.width(widthBanner);
};
if(that.hasClass("align-right")){
that.css({"right":"5px",'text-align':'left'});
}else{
that.css({"left":"5px",'text-align':'right'});
}
if($(this).hasClass("scroll-menu")&&menu !=0){
margin=menu;
}
if($(this).hasClass("scroll-slider")&&slider !=0){
margin=slider;
}
var scrollBanner=function(t){
if(t0&&$(".nav-div-fixed").length>0){
var divNav=$(".nav-div-fixed"),nav=$(".nav-fixed");
var navFixedTop=function(top){
if(divNav.offset().top + 400 ){
$.each($('[data-toggle="tooltip"]'),function(){
$(this).tooltip();
});
}
var valiratorNumber=function(e){
if ($.inArray(e.keyCode,[46,8,9,27,13,110,190]) !==-1||
(e.keyCode==65&&e.ctrlKey===true)||
(e.keyCode==67&&e.ctrlKey===true)||
(e.keyCode==88&&e.ctrlKey===true)||
(e.keyCode>=35&&e.keyCode<=39)){
return;
}
if ((e.shiftKey||(e.keyCode<48||e.keyCode>57))&&(e.keyCode<96||e.keyCode>105)){
e.preventDefault();
}
};
if($("input.number").length>0){
$("input.number").keyup(function(e){
if($(this).val()==0||$(this).val()<0){
$(this).val("1");
}
});
$("input.number").keydown(function(e){
valiratorNumber(e);
});
}
if($("input.is-number").length>0){
$("input.is-number").keyup(function(e){
if($(this).val()<0||$(this).val()==""){
$(this).val(0);
}
if($(this).hasAttr("max-value")){
if(parseInt($(this).attr("max-value"))<$(this).val()&&parseInt($(this).attr("max-value"))>0){
$(this).val($(this).attr("max-value"));
}
}
});
$("input.is-number").keydown(function(e){
valiratorNumber(e);
});
}
/* cart order control */
if($(".cart-orders").length>0){
$.each($(".cart-orders"),function(){
var that=$(this);
control=that.children("h2"),
content=that.children(".content-main");
control.click(function(){
content.toggle();
});
});
}
if($("#header .fixed-top").length>0){
$.each($("#header .fixed-top"),function(){
var that=$(this),he=$("#header"),gw=$(window).width();
var active=function(gwf){
var h=that.height();
if(gwf>=768 ){
he.css({'padding-top':h + "px"});
}else{
he.css({'padding-top':"0px"});
}
};
active(gw);
$(window).resize(function(){
var wrs=$(this).width();
active(wrs);
});
});
}
/* tooltip image */
if($(".tooltip-hover").length>0){
$.each($(".tooltip-hover"),function(){
$(this).tooltipOnmose();
});
}
if($(".navbar-default li ").length>0){
$(".navbar-default li").click(function(){
return false;
});
$(".navbar-default li>a").click(function(){
if($(this).attr("href").length>0){
if( $(this).hasAttr("target")&&$(this).attr("target")=="_blank"){
window.open($(this).attr("href"),'_blank');
return false;
}else{
window.location.href=$(this).attr("href");
}
}
return true;
});
$(".navbar-default li>a>.caret-icon,.navbar-default li>span>.caret-icon").click(function(){
if($(window).width()<992 ){
if($(this).parent().parent().hasClass("open")){
$(this).parent().parent().removeClass("open");
}else{
$(this).parent().parent().addClass("open");
}
}else{
$(this).parent().parent().removeClass("open");
}
return false;
});
}
if($(".image-hover-zoom").length>0){
$.each($(".image-hover-zoom"),function(){
var that=$(this),
block=that.find(".layout_latest");
$.each(block,function(){
var thatblock=$(this);
thatblock.hover(function(){
block.addClass("inactive");
$(this).removeClass("inactive");
},function(){
block.removeClass("inactive");
});
});
});
}
if($("#top-link-block").length>0){
$(window).scroll(function(){
var t=parseInt($(window).scrollTop());
if(t>100){
$("#top-link-block").css("opacity",1);
}else{
$("#top-link-block").css("opacity",0);
}
});
}
if($(".popup-detail-mask").length>0){
$("body").addClass("popup-detail");
if($(".menu-brebrum").length>0){
$(".menu-brebrum").css({"opacity":"0.1"});
}
if($(".popup-detail-mask p.back ").length>0){
$(".popup-detail-mask p.back ").addClass("top-block-popup");
}
}
if($(".menu-left-category .icon-tree").length>0){
$(".menu-left-category .icon-tree").click(function(){
$(this).toggleClass("active");
$(this).parent().children("ul").toggle();
});
$(".menu-left-category li").hover(function(){
if($(window).width()>786){
var par=$(this);
if(par.children("ul").length>0){
par.children(".icon-tree").addClass("active");
par.children("ul").show();
}
}
},function(){
if($(window).width()>786){
var par=$(this);
if(par.children("ul").length>0){
par.children(".icon-tree").removeClass("active");
par.children("ul").hide();
}
}
});
var callbackActiveTree=function(node){
if(node.parent("li").length>0){
node.parent("li").children(".icon-tree").toggleClass("active");
node.parent("li").children("ul").toggle();
callbackActiveTree(node.parent().parent());
}
};
if($(".menu-left-category a.active").length>0){
$.each($(".menu-left-category a.active"),function(){
if($(this).parent().hasClass("submenu")){
$(this).parent().children(".icon-tree").toggleClass("active");
$(this).parent().children("ul").toggle();
}
callbackActiveTree($(this).parent().parent());
});
}
}
if($(".logo img").length>0&&$(".navbar-default").length>0){
var nav_logo=function(){
var lg=$(".logo img"),wlg=$(".logo img").width(),wnav=$(".navbar-default .navbar-toggle").width();
if(wlg + wnav + 40>$(window).width()&&$(window).width()<768){
if(!lg.hasClass("titleClass")){
lg.addClass("titleClass");
}
}else{
lg.removeClass("titleClass");
}
};
nav_logo();
$(window).resize(function(){
nav_logo();
});
}
if($(".thong-ke-truy-cap").length>0){
$.each($(".thong-ke-truy-cap"),function(){
var var_online=$(this).find("#VisitorsOnlineCount"),
var_hittotal=$(this).find("#TotalVisitCount");
var replace_addZero=function(value){
value=value.replace(",","");
lengthZero=6;
if(lengthZero>value.length){
var lengthMore=lengthZero - value.length;
for (var i=0;i0){
$.each($("#header .block-top-fixed"),function(){
var headerBody=$("#header"),that=$(this);
var widthResize=function(){
var ww=$(window).width(),hm=that.height();
if(ww>786){
headerBody.css({"padding-top":hm +"px"});
that.addClass("fixed-top");
}else{
headerBody.css({"padding-top":"0px"});
that.removeClass("fixed-top");
}
};
widthResize();
$(window).resize(function(){
widthResize();
});
});
}
if($(".neo-top").length>0&&$(".neo-start").length>0){
$.each($(".neo-start"),function(){
var static=$(this),dHead=$(".neo-top");
var hasMenu=false;
var hasDesktop=false;
if($(window).width()>992){
hasDesktop=true;
}
var fixedMenu=function(){
if(static.find(".navbar-default").length>0){
$.each(static.find(".navbar-default"),function(){
if($(this).children(".navbar-header").length>0){
var that=$(this);
var checkClickButton=function(){
var hmenu=that.children(".navbar-header").height();
var max_height=($(window).height() - ($(window).height() * 20 / 100 ) - hmenu - 10);
if( that.children(".navbar-collapse.in").length>0&&that.children(".navbar-collapse.in").height()>max_height ){
hasMenu=true;
}
if(hasMenu==true){
that.children(".navbar-collapse").style('max-height',max_height +'px');
that.children(".navbar-collapse").style('overflow-y','scroll','important');
}else{
that.children(".navbar-collapse").style('max-height','inherit');
that.children(".navbar-collapse").style('overflow-y','none','important');
}
};
that.children(".navbar-header").children("button").click(function(){
checkClickButton();
});
that.find(".caret-icon").click(function(){
checkClickButton();
});
}
});
}
}
var changeFix=function(){
var hHead=dHead.height() + dHead.offset().top,scrollW=parseInt($(window).scrollTop());
if( hHead992){
hasMenu=false;
hasDesktop=true;
}else{
hasDesktop=false;
}
changeFix();
});
$(window).scroll(function(){
changeFix();
});
changeFix();
});
}
if($("div>table").length>0){
$.each($("div>table"),function(){
var that=$(this);
that.parent().addClass("table-responsive");
that.addClass("table");
});
}
if($(".cart-button").length>0){
$(".cart-button>span").click(function(){
if($(this).children(".content").length>0){
$(this).children(".content").addClass("active");
}
});
$(".cart-button").hover(function(){
if($(this).children(".content").length>0){
$(this).children(".content").addClass("active");
}
},function(){
if($(this).children(".content").length>0){
$(this).children(".content").removeClass("active");
}
});
}
});
}(jQuery));