var x; var y; function position() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } x=0;; y=(myWidth /2) - (104/2);; } position(); var RoozGozaronlineuser={ controlHTML: '', controlattrs: {offsetx:y, offsety:x}, keepfixed:function(){ var $window=jQuery(window) var controlx=($window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx) var controly=($window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety) this.$control.css({left:controlx+'px', top:controly+'px'}) }, togglecontrol:function(){ var scrolltop=jQuery(window).scrollTop() if (!this.cssfixedsupport) this.keepfixed() }, init:function(){ jQuery(document).ready(function($){ var mainobj=RoozGozaronlineuser var iebrws=document.all mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body') mainobj.$control=$('
'+mainobj.controlHTML+'
') .css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, cursor:'pointer', zIndex:'99999'}) .attr({title:'Online User'}) .appendTo('body') if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') mainobj.$control.css({width:mainobj.$control.width()}) mainobj.togglecontrol() $(window).bind('scroll resize', function(e){ mainobj.togglecontrol() }) }) } } RoozGozaronlineuser.init()