$(document).ready(function(){
$("slideshow").each(function(){
console.log("a");
var elm=$(this);
if(elm.is("[enabled]")) return;
elm.attr("enabled",true);
var nav=elm.children("nav").length ? elm.children("nav").length : $("");
elm.children().each(function(){
var lbl=$(this).attr("label") || $(this).attr("title") || false;
if(!lbl) lbl=($(this).find("label,h2,h3").length ? $(this).find("label,h2,h3").first().html() : "?");
var tab=$(this);
$(""+lbl+"").appendTo(nav).click(function(){
clearTimeout(window.cyclefntimer);
$(this).addClass("selected").siblings().removeClass("selected");
tab.addClass("active").siblings().not(nav).not(".nav").removeClass("active");
tab.attr("status","active").siblings().not(nav).not(".nav").attr("status","inactive");
window.cyclefntimer=setTimeout(cyclefn,15000);
});
});
nav.appendTo(elm);
nav.children().first().click();
var nextfn=function(){
var nxt=nav.find(".selected").next();
if(!nxt.length) nxt=nav.children().first();
nxt.click();
}
var prevfn=function(){
var prv=nav.find(".selected").prev();
if(!prv.length) prv=nav.children().last();
prv.click();
}
var cyclefn=function(){
nextfn();
//window.cyclefntimer=setTimeout(cyclefn,10000);
}
$("").appendTo(elm).click(nextfn);
$("").appendTo(elm).click(prevfn);
clearTimeout(window.cyclefntimer);
window.cyclefntimer=setTimeout(cyclefn,15000);
});
if(navigator.share){ } else { $("#shareMob").remove(); }
console.log("welcome");
});
function shareFB(){ window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(window.location.href)+"&t="+encodeURIComponent(document.title),"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600"); }
function shareWA(){ window.location.href="https://api.whatsapp.com/send?text="+encodeURIComponent("*" + document.title + "*:\n" + $("meta[name=description]").attr("content") + "\n"+ window.location.href); }
function shareMobile(){
if (navigator.share) {
navigator.share({ title: document.title, url:window.location.href,text:$("meta[name=description]").attr("content")}).catch(console.error);
}
}