"),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));
/* tooltip hover div */
! function(o){
/* marquee li */
o.fn.hasAttr=function(name){return this.attr(name) !==undefined;};
o.fn.tooltipOnmose=function(){
var that=$(this),t=(o(this),function(t){
t.css({
position: "fixed",
'z-index':9999
});
var i=t.height(),
n=t.width(),
e=o(window).height(),
s=o(window).width();
window.onmousemove=function(o){
var c=o.clientX,
u=o.clientY,
f=c + 20,
h=u + 20 - i;
0>s - (c + n)&&(f=c - 20 - n),0>e - (u + i)&&(h=u - 20 - i),t.css({
top: h + "px"
}),t.css({
left: f + "px"
})
}
});
$(this).parent().find("figure").hover(function(){
if($(window).width()>786){
t(that);
that.addClass("active");
}else{
that.removeClass("active");
}
},function(){
that.removeClass("active");
});
}
}(jQuery);
/* scroll ads */
(function($){
$(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);
});
}
/* 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();
});
});
}
/* fixed top scroll */
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){
window.location.href=$(this).attr("href");
}
return true;
});
$.each($(".navbar-default li>a"),function(){
var that=$(this);
var toggleHover=function(w,level){
if(w<786){
if(level==1){
that.removeClass("hvr-grow-shadow");
}else{
that.removeClass("hvr-grow-shadow");
}
}else{
if(level==1){
that.addClass("hvr-grow-shadow");
}else{
that.addClass("hvr-grow-shadow");
}
}
};
var check=0;
if(that.parent().parent().hasClass("level_1")){
check=1;
}
toggleHover($(window).width(),check);
$(window).resize(function(){
toggleHover($(this).width(),check);
});
});
$(".navbar-default li>a>.caret-icon,.navbar-default li>span>.caret-icon").click(function(){
if($(window).width()<786 ){
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;
});
}
/* hover mask img */
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 .disable 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 .disable 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());
});
}
}
$("div>table").length>0&&$.each($("div>table"),function(){
var b=$(this);
b.parent().addClass("table-responsive"),b.addClass("table")
});
});
}(jQuery));