$(function(){ if($(".nav ul li dl.wfull").length>0) { var yxwidth=$(".top").width(); var mlw=$(".top").offset().left-$(".nav ul li dl.wfull").parent("li").offset().left; $(".nav ul li dl.wfull").css("width",yxwidth-30+'px').css("left",mlw+'px'); } $tel=$("a.bar_tel"); $wapp=$("a.bar_whatsapp"); if( /android|webos|iphone|ipad|blackberry|iemobile|opera mini/i.test(navigator.useragent)) { $(".nav ul a.ceall").click(function(){return false}); $("body").css("padding-bottom","40px"); $(".ce_bar").addclass("ce_bar_bottom"); $("a.bar_share").live("click",function(){ $(this).next("div").addclass("s_div_b"); $(this).next("div").append("x"); $(this).next("div").show(); $(this).next("div").animate({"width": "86%"},300); $(".ce_bar ul li div.sharethis-inline-share-buttons").css("right","40px"); $("a.bar_share").next("div").find("span").click(function(){ $(".s_div_b").animate({"width": "0px"},300); settimeout(function(){$(".s_div_b").hide()}, 300); }) }) $wapp.attr("href","whatsapp://send/?phone="+$wapp.attr("vid")+""); $tel.attr("href","tel:"+$tel.attr("vid")+""); } else { $(".ce_bar ul li a.bar_share").click(function(){ var $shedi=$(".ce_bar ul li div.sharethis-inline-share-buttons"); if($shedi.css("right")=="-10000px") { $(".ce_bar ul li div.sharethis-inline-share-buttons").css("right","40px"); } else { $(".ce_bar ul li div.sharethis-inline-share-buttons").css("right","-10000px"); } }) $tel.click(function(){ if($(this).next("div").length>0) {$(this).next("div").fadetoggle(600); } }) } //$skype=$("a.bar_skype"); //$skype.click(function(){ //$skype.attr("href","skype:"+$skype.attr("vid")+"?chat"); //}); //$email=$("a.bar_email"); //$email.click(function(){ //$email.attr("href","mailto:"+$email.attr("vid").replace("!####","@")); //}); var $setxt=$("input.seartxt"); $("#searform").mouseenter(function(){ $setxt.show(); $setxt.animate({"width": "140px"},600); }); $("#searform").mouseleave(function(){ $setxt.animate({"width": "0px"},600);$setxt.hide(); }); $("input.searbtn").click(function(){ { if($setxt.val()!="") { $("#searform").submit(); } }; }); $(".nav ul li.big").mouseenter(function(){ $(this).children("dl").show(); $(this).addclass("down"); }); $(".nav ul li.big").mouseleave(function(){ $(this).children("dl").hide(); $(this).removeclass("down"); }); $(".navbtn").click(function(){ $(this).hide(); $(".closebtn").show();$(".menubigbg").animate({ "right": 0},300); $(".nav").animate({ "right": 0},300); $("body").css("position","fixed"); }); $(".nav ul li dd a.bigc").mouseenter(function(){ if($(this).next("dl").css("display")=='none') {$(this).next("dl").show();} }); $(".nav ul li dl dl").mouseenter(function(){ $(this).show(); }); $(".nav ul li dl dl").mouseleave(function(){ if(!$(this).parent("dd").parent("dl").hasclass("wfull")) { $(this).hide(); } }); $(".nav ul li dd a.bigc").mouseleave(function(){ if($(this).next("dl").css("display")=='block') {$(this).next("dl").hide();} }); $(".closebtn").click(function(){ $(this).hide(); $(".navbtn").show();$(".menubigbg").animate({ "right":"-100%"},300); $(".nav").animate({ "right": "-100%"},300); $("body").css("position","static"); }); $(".menubigbg").click(function(){ $(".closebtn").hide(); $(".navbtn").show();$(".menubigbg").animate({ "right":"-100%"},300); $(".nav").animate({ "right": "-100%"},300); $("body").css("position","static"); }); $("dl.lcpmenu a.bigc").click(function(){ $("dl.lcpmenu dl").slideup(); $(this).next("dl").toggle(); }); if($(".footer dl dt").css("float")=='none') {ck=0; $(".footer dl dt").click(function(){ ck=ck+1; $(this).parent("dl").find("dd").toggle(); if($(this).next("dd").css("display")=='none') { $(this).removeclass("sub"); } else {$(this).addclass("sub");}; }); } if($(".nav").css("position")=='fixed') { var menunavheight=$(window).height()-56; $(".nav").css("height",menunavheight+'px'); $(".nav").perfectscrollbar();} $(".dp").find("img").each(function() { var theimage = new image(); var sxwidth=$(this).width(); theimage.src = $(this).attr("src"); var imagewidth = theimage.width; var imageheight = theimage.height; if (theimage.complete) { $(this).height(sxwidth*imageheight/imagewidth); return; } theimage.onload = function () { $(this).height(sxwidth*imageheight/imagewidth); } }); var $body = $(document.body); var $bottomtools = $('.bottom_tools'); $(window).scroll(function () { var scrollheight = $(document).height(); var scrolltop = $(window).scrolltop(); var $footerheight = $('.page-footer').outerheight(true); var $windowheight = $(window).innerheight(); scrolltop > 200 ? $("#scrollup").fadein(200).css("display","block") : $("#scrollup").fadeout(200); $bottomtools.css("bottom", scrollheight - scrolltop - $footerheight > $windowheight ? 45 : $windowheight + scrolltop +$footerheight + 45 - scrollheight); }); $('#scrollup').click(function (e) { e.preventdefault(); $('html,body').animate({scrolltop:0}); }); }); $(window).resize(function(){ $(".dp").find("img").each(function() { var theimage = new image(); var xwidth=$(this).width(); theimage.src = $(this).attr("src"); var imagewidth = theimage.width; var imageheight = theimage.height; $(this).height(xwidth*imageheight/imagewidth); }); if($(".footer dl").css("float")=='left') {$(".footer dl dd").show();} else {$(".footer dl dt").removeclass("sub"); $(".footer dl dd").hide();} });