(function($){
$(document).ready(function(){
if(window.plg_system_topofthepage_options.topalways) {
$('body,html').animate({scrollTop: 0},
window.plg_system_topofthepage_options.smoothscroll.duration,
window.plg_system_topofthepage_options.smoothscroll.transition
);
}
$(document.body).append(''+(window.plg_system_topofthepage_options.buttontext?window.plg_system_topofthepage_options.buttontext:'')+'');
// position it
styles = window.plg_system_topofthepage_options.styles;
styles.opacity = 0;
styles.display = 'block';
if(styles.left == 'center') {
var page = $(window).width()/2;
var buttonsize = $("#gototop").width()/2;
styles.left = (page-buttonsize)+'px';
}
if(window.plg_system_topofthepage_options.zIndex) {
// NodeList.prototype.map = function(fn) { var a=[]; for ( var i=0; i window.plg_system_topofthepage_options.scrollspy) {
if($('#gototop').css('opacity') == 0) {
$('#gototop').animate(show,parseInt(window.plg_system_topofthepage_options.displaydur),'linear');
}
} else {
$('#gototop').animate(hide,parseInt(window.plg_system_topofthepage_options.displaydur),'linear');
}
});
// scroll body to 0px on click
$('#gototop').click(function (e) {
button = this;
$('body,html').animate({
scrollTop: 0
},
window.plg_system_topofthepage_options.smoothscroll.duration,
window.plg_system_topofthepage_options.smoothscroll.transition,
function(){
$('#gototop').animate(hide,parseInt(window.plg_system_topofthepage_options.displaydur),'linear');
}
);
e.preventDefault();
return false;
});
});
})
})(jQuery)
function highZ(parent, limit){
limit = limit || Infinity;
parent = parent || document.body;
var who, temp, max= 1, A= [], i= 0;
var children = parent.childNodes, length = children.length;
while(i max && temp <= limit) max = temp;
}
return max;
}
function deepCss(who, css) {
var sty, val, dv= document.defaultView || window;
if (who.nodeType == 1) {
sty = css.replace(/\-([a-z])/g, function(a, b){
return b.toUpperCase();
});
val = who.style[sty];
if (!val) {
if(who.currentStyle) val= who.currentStyle[sty];
else if (dv.getComputedStyle) {
val= dv.getComputedStyle(who,"").getPropertyValue(css);
}
}
}
return val || "";
}