(function () {
var hidIsSearchShow = window.document.getElementById('hidIsSearchShow');
if(hidIsSearchShow && hidIsSearchShow.value == '1') {
return;
}
var location = window.location,
document = window.document,
docElem = document.documentElement,
body = window.body || window.document.getElementsByTagName('body')[0],
DD = function (selector, context) {
if (typeof selector === 'string') {
if (selector.charAt(0) === '<'
&& selector.charAt(selector.length - 1) === '>'
&& selector.length >= 3) {
this[0] = document.createElement(selector.replace(regTag, ''))
this.length = 1
}else{
this[0] = document.getElementById(selector)
this.length = this[0] ? 1 : 0;
}
} else {
if (!selector.length) {
this[0] = selector
this.length = 1
}else{
if(selector && selector.parent == selector){
this[0] = selector
this.length = 1
}else{
for(var i = 0; i < selector.length; i++){
this[i] = selector[i]
}
this.length = selector.length
}
}
}
},
regTag = /<|>/g;
//fix ie
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (obj, start) {
for (var i = (start || 0) ; i < this.length; i++) {
if (this[i] === obj) return i;
}
return -1;
}
}
DD.fn = DD.prototype = {
constructor: DD,
init: function (selector, context) {
return this;
},
bind: function (type, handler) {
return this.each(function () {
if (this.addEventListener)
this.addEventListener(type, handler, false);
else if (this.attachEvent)
this.attachEvent('on' + type, handler);
else
this['on' + type] = handler;
})
},
append: function (html) {
if (html)
this.innerHTML = '';
return this;
},
attr: function (name, val){
if(typeof name === 'string'){
if(!val) return this[0].getAttribute(name);
else {
this.each(function(){
if(!this.hasAttribute)
name = name.toLowerCase() === 'class' ? 'className' : name;
this.setAttribute(name, val);
})
}
}else{
this.each(function () {
for (p in name) {
if(!this.hasAttribute)
val = p.toLowerCase() === 'class' ? 'className' : p;
this.setAttribute(val, name[p]);
}
})
}
return this
},
css: function (name, val) {
if (typeof name === 'string') {
if (!val) {
if(window.getComputedStyle){
return window.getComputedStyle(this[0], null).getPropertyValue(name);
}
return this[0].style[name];
}
else {
this.each(function () {
if (this && (name in this.style ) && val) {
try {
this.style[name] = val ;
} catch(e) {}
}
});
}
}
else {
this.each(function () {
for (p in name) {
this.style[p] = name[p];
}
})
}
return this
},
hasClass: function (klass) {
if (this[0] && this[0].className) {
var l = this[0].className.split(' ');
return l.indexOf(klass) > -1;
}
return false;
},
is: function (tag) {
if(typeof tag === 'string' && tag.charAt(0) === ':'){
switch(tag){
case ':show':
return this.css('display') != 'none';
}
}else{
if (this[0] && this[0].nodeName)
return this[0].nodeName.toLowerCase() === tag.toLowerCase();
if(this[0] && tag === 'window')
return this[0].parent == this[0] ;
}
return false;
},
each: function (handle) {
for (var i = 0; i < this.length; i++) {
handle.call(this[i], i);
}
return this;
},
html: function (str) {
return this.each(function () {
this.innerHTML = str;
});
},
hide: function () {
return this.each(function () {
DD.css(this, 'display', 'none');
});
},
show: function(){
return this.each(function () {
DD.css(this, 'display', 'block');
});
},
toggle: function(){
return this.each(function(){
var _this = new DD(this);
_this.is(':show') ? _this.hide() : _this.show();
});
},
child: function(selector){
var child = [];
this.each(function(){
for(var i = 0; i < this.children.length; i++){
if((new DD(this.children[i])).is(selector))
child.push(this.children[i]);
}
});
return new DD(child)
},
parent: function(){
return new DD(this[0].parentElement);
},
width: function(){
if(this.is('window')){
if(this[0].innerWidth)
return this[0].innerWidth;
if(docElem.offsetWidth)
return docElem.offsetWidth;
if(body.offsetWidth)
return body.offsetWidth;
return 0;
}
return this[0].clientWidth || this[0].offsetWidth || this[0].scrollWidth;
},
height: function(){
if(this.is('window')){
if(this[0].innerHeight)
return this[0].innerHeight;
if(docElem.offsetHeight)
return docElem.offsetHeight;
if(body.offsetHeight)
return body.offfsetHeight;
return 0;
}
var total = 0;
this.each(function(){
total += this.clientHeight || this.offsetHeight || this.scrollHeight;
});
return total;
},
first: function(){
return new DD(this[0]);
},
last: function(){
return new DD(this[this.length-1]);
}
}
DD.include = function (attr) {
for (p in attr)
DD.fn[p] = attr[p];
};
DD.extend = function (attr) {
for (p in attr)
DD[p] = attr[p];
};
DD.extend({
css: function (elem, name, val) {
elem.style[name] = val;
},
loadStyles: function (url) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = url;
var head = document.getElementsByTagName('head')[0];
head.appendChild(link);
},
loadStylesString: function (css) {
var style = document.createElement('style');
style.type = 'text/css';
try {
style.appendChild(document.createTextNode(css));
} catch (ex) {
style.styleSheet.cssText = css;
}
var head = document.getElementsByTagName('head')[0];
head.appendChild(style);
},
stopPropagation: function (e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = false;
},
toJson: function (str) {
try {
return window.JSON && window.JSON.parse ? JSON.parse(str) : eval('(' + str + ')');
} catch (e) {
return '';
}
},
clone: function(obj){
if (obj == null || typeof obj != 'object') return obj;
if (obj instanceof Array) {
var copy = [];
copy = obj.slice(0);
return copy;
}
if (obj instanceof Object) {
var copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr))
copy[attr] = obj[attr];
}
return copy;
}
},
support: {
fixed: function(){
var a = new DD('
').css({
'position': 'fixed',
'left': '10px',
'display': 'none'
});
body.appendChild(a[0]);
var _s = a[0].offsetLeft >= 0;
body.removeChild(a[0]);
return _s;
},
ajax: function(){
var result = false;
var _t;
if(window.XMLHttpRequest){
_t = new window.XMLHttpRequest();
if('withCredentials' in _t){
result = true;
_t = null;
}
}else if(window.XDomainRequest){
result = true ;
}
return result;
}
},
ready: function(handler){
},
cookie: function(name, value, h){
if(name && !value && !h){
var cookieValue = "";
var search = name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end));
}
}
return cookieValue;
}
var expire = "";
if (h) {
expire = new Date((new Date()).getTime() + h * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire + ";path=/";
},
ajax: function(options){
var xhr = null ;
if(window.XMLHttpRequest){
xhr = new XMLHttpRequest();
}
if(xhr && 'withCredentials' in xhr) {
}else if (window.XDomainRequest){
xhr = new XDomainRequest();
}else{
xhr = null;
}
if(xhr){
xhr.open('GET', options.url, true);
xhr.onload = function(){
options.callback(xhr.responseText);
}
xhr.send();
}else{
}
},
reload: function(data){
var result = DD.toJson(data);
if(typeof result === 'object' && _ul.hasClass('webdd-dduser')){
opts.userList = result;
_ul.first().html(helper.getDDUser(true));
}
}
})
var opts = {
chatList: DD.toJson('[]'),
groupList: DD.toJson('[{"name":""}]'),
userList: DD.toJson('[{"IsEnable":"True","OnLineState":"4","UserId":"123345","FloatPositionId":"2","StylePath":"Images/StyleImages/FloatImage/FloatImage/","IsAutoInviteEnable":"True","AutoInviteMessage":"鎮ㄥソ锛屾湁浠€涔堝彲浠ュ府鍒版偍鐨勫悧锛?,"WebName":"閲嶅簡娆у痉浠〃鏈夐檺鍏徃","NickName":"绠$悊鍛?,"InviteUserId":"0","InviteMessage":"","VisitorOnlineState":"1"}]'),
cssHref: '',
position: 2,
ln: 'zh-cn' || 'zh-cn',
isCn : 'zh-cn' == 'zh-cn',
isUseGroup: 'False' == 'True',
type: {
qq: '0',
msn: '0',
taobao: '0',
alibaba: '0',
skype: '0',
phone: ''
},
autoInvite: 'True' == 'True',
address: '娌冲寳鐪佷繚瀹氬競',
message: '鎮ㄥソ锛屾湁浠€涔堝彲浠ュ府鍒版偍鐨勫悧锛?,
callback: '',
webName: '閲嶅簡娆у痉浠〃鏈夐檺鍏徃',
imgPath: 'http://s02.yizimg.com/Images/StyleImages/FloatImage/FloatImage/',
qrPath : 'http://qrcode.yi-z.cn/',
qrUrl: '',
ddStyle: '13',
direction: function(){
if([3,6].indexOf(opts.position) > -1) {
return 'top'
}else if([5,8].indexOf(opts.position) > -1){
return 'bottom'
}else{
return 'middle'
}
},
lang: (function(){
if('zh-cn' == 'zh-cn'){
return {
otherGroup: '鍏朵粬鍒嗙粍',
onlineService: '鍦ㄧ嚎瀹㈡湇',
webdd: '鏄撳睍鍙綋',
btnAccept: '鎺ュ彈瀵硅瘽',
btnCancel: '鏆備笉瀵硅瘽',
sendMessage: '鐐瑰嚮缁欐垜鍙戞秷鎭?,
dear: '浜茬埍鐨?,
user: '鐢ㄦ埛',
welcome: '娆㈣繋鎮ㄧ殑鍏変复',
invite: '閭€璇锋偍鍦ㄧ嚎娲借皥',
help: '鎮ㄥソ锛屾湁浠€涔堣兘澶熷府鍔╁埌鎮ㄧ殑鍚楋紵',
qr: '鐢ㄦ墜鏈鸿闂?,
qrDetail: '鎵嬫満鎵弿璧扮潃鐬?,
gotop: '鍥炲埌椤堕儴'
}
}else{
return {
otherGroup: 'Other Group',
onlineService: 'Online Service',
webdd: 'YiZhan DingDang',
btnAccept: 'Accept',
btnCancel: 'Cancel',
sendMessage: 'Click to send me a message',
dear: 'Dear ',
user: ' user',
welcome: 'welcome',
invite: 'invite you to discuss online',
help: 'Hello! What can I do for you?',
qr: 'Mobile Visit',
qrDetail: 'Visit website by Mobile',
gotop: 'Go to top'
}
}
})()
}
var helper = {
scroll: {
getPosition: function(over) {
var result = over - helper.scroll.start.pageY + helper.scroll.start.top;
if (result <= 0) {
return {
top: 0,
persent: 0
};
} else if (result + helper.scroll.scrollHeight > helper.scroll.conHeight) {
return {
top: helper.scroll.scrollMax,
persent: 100
}
}
return {
top: result,
persent: result / helper.scroll.scrollMax
}
}
},
getGroup: function(obj, index){
var chat = helper.getChatByGroup(obj.name),
h = [];
h.push('
');
//h.push('');
h.push('');
h.push(obj.name || opts.lang.otherGroup);
h.push('
');
//h.push('
');
h.push('');
for(var i = 0; i < chat.length; i++){
//if(chat[i].linkman)
h.push('- ' + helper.getChatType(chat[i]) + '
');
}
h.push('
');
return h.join('');
},
getChatByGroup: function(group){
var h = []
for(var i = 0; i < opts.chatList.length; i++){
if(opts.chatList[i].groupname == group && opts.chatList[i].isenable != '0')
h.push(opts.chatList[i]);
}
return h
},
checkHasChat: function(group) {
for(var i = 0; i < opts.chatList.length; i++){
if(opts.chatList[i].groupname == group && opts.chatList[i].isenable != '0')
return true;
}
return false;
},
getChatType: function(obj){
var result = []
switch (parseInt(obj.type, 10)){
case 1:
if(opts.type.qq == '2') {
result.push('');
result.push('');
result.push('$m$');
}else{
result.push('');
result.push('');
}
break
case 2:
result.push('');
if(opts.type.msn == '2'){
result.push('');
result.push('$m$');
}else{
result.push('');
}
result.push('');
break
case 3:
result.push('');
if(opts.type.taobao == '2'){
result.push('');
result.push('$m$');
}else{
result.push('');
}
result.push('');
break
case 4:
result.push('');
if(opts.type.alibaba == '2'){
result.push('');
result.push('$m$');
}else{
result.push('');
}
result.push('');
break
case 5:
result.push('');
if(opts.type.skype == '2'){
result.push('');
result.push('$m$');
}else{
result.push('');
}
result.push('');
break
case 6:
result.push('');
result.push('');
result.push('$v$');
result.push('');
break
}
result = result.join('')
.replace(/\$v\$/g, obj.value)
.replace(/\$m\$/g, obj.linkman)
.replace(/\$i\$/g, opts.imgPath)
.replace(/\$t\$/g, obj.type);
return result;
},
getPosition: function(pos){
var css = {}
switch(pos){
case 3:
css.left = '10px';
css.top = '20px';
break
case 1:
case 4:
css.left = '10px';
css.top = '100px';
break
case 5:
css.left = '10px';
css.bottom = '20px';
break
case 6:
css.right = '10px';
css.top = '20px';
break
case 2:
case 7:
css.right = '10px';
css.top = '100px';
break
case 8:
css.right = '10px';
css.bottom = '20px';
break
}
return css
},
win: {
height: (new DD(window)).height(),
width: (new DD(window)).width(),
reload: function(){
var _w = new DD(window);
helper.win.height = _w.height();
helper.win.width = _w.width();
}
},
initScroll: function(){
var uHeight = _ul.height() - 24;
var dHeight = webddMain.height();
if (uHeight > dHeight) {
//ie6 bug
webddScroll.show();
DD.css(webddScroll[0], 'height', (function(){
var persent = dHeight / uHeight ;
return (persent * dHeight) + 'px';
})());
DD.css(webddScroll[0], 'top', (function(){
wScroll = webddMain[0].scrollTop;
if(wScroll <= 0)
return '0px';
var max = uHeight - dHeight;
var h = wScroll / max;
var smax = webddMain.height() - webddScroll.height();
return (smax * h) + 'px';
})());
} else {
DD.css(webddScroll[0], 'height', '0');
DD.css(webddScroll[0], 'top', '0');
//ie6 bug
webddScroll.hide();
}
},
window: function(url, name){
window.open( url , '_blank','toolbar=no,location=no,memubar=no,scrollbars=no');
},
chatroom: function(userId){
var url = 'http://www.superstat.cn/WebddChatroom.aspx?webid=75101&vguid=6b0d28f0-7507-ded7-69c5-bf447a726365';
url += '&userid=' + userId;
url += '&url=' + document.location.href;
//helper.window(url, 'chatRoom');
return url;
},
messageBoard: function(userId){
var url = 'http://www.superstat.cn/WebddMessageBoard.aspx?webid=75101&vguid=6b0d28f0-7507-ded7-69c5-bf447a726365';
url += '&userid=' + userId;
url += '&ln=' + opts.ln;
url += '&hu='+ window.location;
//helper.window(url, 'messageBoard');
return url;
},
showDialog: function(){
dialog.html(helper.getDialog()).show();
},
getDDUser: function(isreload){
var _html = []
for(var i = 0; i < opts.userList.length; i++){
if(opts.userList[i].IsEnable == 'True'){
_isShowWebdd = true;
_html.push('- ');
_html.push('');
_html.push('');
_html.push((opts.userList[i].NickName.replace(/(^\s*)|(\s*$)/g, "") || '鏄撳睍鍙綋') + '');
_html.push('
');
if(opts.userList[i].OnLineState <=2){
if(isreload === true && opts.userList[i].InviteUserId == opts.userList[i].UserId){
opts.inviteUser = opts.userList[i] ;
if(DD.cookie('webdd-dialog-invite') != 'false' && opts.userList[i].VisitorOnlineState != 2)
helper.showDialog();
}
if(!opts.inviteUser && opts.autoInvite){
opts.inviteUser = opts.userList[i];
}
}
}
}
return _html.join('');
},
getDialog: function(){
var _html = [];
_html.push(''+ opts.lang.dear + opts.address + opts.lang.user + ', ' + opts.lang.welcome + '
');
_html.push(''+ opts.lang.webdd+'');
_html.push('' + opts.webName + ' - ' + opts.inviteUser.NickName + ' ' + opts.lang.invite + '锛?br />');
_html.push( (opts.inviteUser.InviteMessage || opts.lang.help ) +'
');
_html.push(''+opts.lang.btnAccept+'');
_html.push(''+opts.lang.btnCancel+'');
return _html.join('');
}
}
DD.loadStyles(opts.cssHref || 'http://www.superstat.cn/Styles/webdd.css?20140522');
DD.loadStyles('http://www.superstat.cn/Styles/webdd' + opts.ddStyle + '.css?20140522');
//DD.loadStyles(opts.cssHref || 'http://www.superstat.cn/Styles/webdd13.css?' + Math.random());
//鐢熸垚webdd鍐呭
var container = new DD('');
container.attr('id', 'webdd-container');
container.attr('class', 'webdd-custom');
helper.finalPos = helper.getPosition(opts.position);
container.css(helper.finalPos);
var _html = [],
_isShowWebdd = false;
/*鍙綋婕傛诞鏍?/
_html.push('
');
_html.push('
');
_html.push('
'+ opts.lang.onlineService+'');
_html.push('
');
_html.push('
');
if(opts.qrUrl){
_html.push('
');
_html.push('
');
_html.push('');
_html.push(opts.lang.qr);
_html.push('
');
_html.push('
');
_html.push('
');
_html.push('
' + opts.lang.qrDetail + '');
_html.push('
');
_html.push('
');
_html.push('
');
}
container.html(_html.join(''));
var isIe6 = !DD.support.fixed()
if (isIe6) {
container.css('position', 'absolute');
}
if(helper.win.width < 960 || !_isShowWebdd){
container.hide();
}
body.appendChild(container[0]);
//灞呬腑
if([1,2,4,7].indexOf(opts.position) > -1){
var _t = (helper.win.height - container.height() + 48) / 2;
helper.finalPos.top = (_t < 0 ? 20 : _t);
if (isIe6) {
helper.finalPos.top += 468 / 2 + (window.scrollY || docElem.scrollTop || body.scrollTop);
}
container.css('top', helper.finalPos.top + 'px');
}
container.bind('click', function(e){
if(!e) e = window.event;
var _this = new DD(e.target || e.srcElement);
//灞曞紑鑱旂郴浜?
if(_this.is('div') && _this.hasClass('webdd-group')){
var icon = (new DD(_this[0])).child('i');
if(icon.hasClass('icon-up') || icon.hasClass('icon-down')){
var ul = new DD(_this[0].nextSibling);
ul.toggle();
icon.attr('class', icon.hasClass('icon-up') ? 'icon-down' : 'icon-up');
helper.initScroll();
}
}
//鍏抽棴婕傛诞鍙綋
if(_this.hasClass('js-close')){
container.hide();
}
//婊氬姩鍒伴《閮?
if(_this.hasClass('icon-gotop')){
window.scrollTo(0, 0);
}
})
/*鍙綋瀵硅瘽妗?/
var dialog = new DD('
');
dialog.attr('id', 'webdd-dialog');
if (isIe6) {
dialog.css('position', 'absolute');
}
if(opts.inviteUser){
dialog.html(helper.getDialog());
}
body.appendChild(dialog[0]);
if(DD.cookie('webdd-dialog') == 'hide' || !opts.inviteUser || helper.win.width < 960){
dialog.hide();
DD.cookie('webdd-dialog', 'hide');
}
dialog.bind('click', function(e){
if(!e) e = window.event;
var _this = new DD(e.target || e.srcElement);
if(_this.is('a')){
if(_this.hasClass('btn-dialog-confirm')){
_this.attr('href', helper.chatroom(_this.attr('data-key')));
_this.attr('target', '_blank');
}else{
dialog.hide();
if(DD.cookie('webdd-dialog-invite') != 'false' && DD.cookie('webdd-dialog') == 'hide')
DD.cookie('webdd-dialog-invite', 'false');
DD.cookie('webdd-dialog', 'hide');
}
}
})
var _window = new DD(window);
var scrollTop = 0;
var gotop = new DD('webdd-gotop');
var webddQr = new DD('webdd-qr');
var setGotop = function(){
scrollTop = window.scrollY || docElem.scrollTop || body.scrollTop;
if(scrollTop > helper.win.height / 2)
gotop.show();
else
gotop.hide();
};
setGotop();
var webddMain = new DD('webdd-main'),
webddScroll = (new DD('webdd-scroll')).child('div'),
_ul = (new DD(webddMain[0])).child('ul'),
wScroll = 0,
_IE6ScrollHeight = 40 + 360 + webddQr.height() + 48 + parseInt(helper.finalPos.top || 0) + parseInt(helper.finalPos.bottom || 0);
if(dialog) {
var _ie6d = (function(){
return (helper.win.height - dialog.width()) / 2;
})()
}
var _ie6max = (new DD(body)).height() - helper.win.height;
_window.bind('scroll', function(e){
setGotop();
if(isIe6 && scrollTop < _ie6max){
var _ie6p = 20;
if(opts.direction() != 'top'){
helper.win.reload();
_ie6p = (helper.win.height - _IE6ScrollHeight) / (opts.direction() == 'bottom' ? 1 : 2 ) ;
}
if (_ie6p < 20) {
_ie6p = 20;
}
container.css('top', (scrollTop + _ie6p) + 'px');
if(dialog) {
dialog.css('top', (scrollTop + _ie6d) + 'px');
}
}
});
/*婊氬姩鏉$浉鍏?/
container[0].onselectstart = function(){
return false;
};
webddScroll.bind('mousedown', function(e) {
e = e || window.event;
//helper.scroll.start = container[0].offsetTop + gotop.height() + 32;
helper.scroll.inScroll = true;
helper.scroll.start = {
pageY: e.pageY || e.clientY + document.documentElement.scrollTop,
top: parseFloat(webddScroll.css('top'))
};
helper.scroll.scrollMax = webddMain.height() - webddScroll.height();
helper.scroll.conHeight = webddMain.height();
helper.scroll.conMax = _ul.height() - webddMain.height();
helper.scroll.scrollHeight = webddScroll.height();
});
var _document = new DD(document);
_document.bind('mousemove', function(e) {
if (helper.scroll.inScroll) {
e = e || window.event;
var pos = helper.scroll.getPosition(e.pageY || e.clientY + document.documentElement.scrollTop);
DD.css(webddScroll[0], 'top', pos.top + 'px');
webddMain[0].scrollTop = helper.scroll.conMax * pos.persent;
}
});
_document.bind('mouseup', function(){
helper.scroll.inScroll = false;
});
webddMain.bind('scroll', function(e){
if(!e) e = window.event;
wScroll = (e.target || e.srcElement).scrollTop;
if(e.preventDefault)
e.preventDefault();
else
e.returnValue = false
webddScroll.css('top', (function(){
if(wScroll <= 0)
return '0px';
var max = _ul.height() - webddMain.height();
var h = wScroll / max;
var smax = webddMain.height() - webddScroll.height();
return (smax * h) + 'px';
})())
});
webddMain.bind('mousewheel', function(e){
e = e || window.event;
webddMain[0].scrollTop += e.wheelDelta > 0 ? -60 : 60
if (e.preventDefault) {
e.preventDefault();
} else{
e.cancelBubble = true;
}
e.returnValue = false;
return false;
});
/*婊氬姩鏉$浉鍏?/
webddMain.bind('click', function(e){
if(!e) e = window.event
var _this = new DD(e.target || e.srcElement)
if(_this.hasClass('webdd-dd')){
if(_this.hasClass('webdd-online')){
_this.attr('href', helper.chatroom(_this.attr('data-key')))
}else{
_this.attr('href', helper.messageBoard(_this.attr('data-key')))
}
_this.attr('target', '_blank')
}
})
var refresh = function(){
helper.win.reload()
if(helper.win.width < 960 && !_isShowWebdd){
container.hide();
}
if(dialog){
dialog.css({
top: (function(){
var result = ((helper.win.height - dialog.height()) / 3)
if(isIe6)
result += (window.scrollY || docElem.scrollTop || body.scrollTop)
return result + 'px'
})(),
left: ((helper.win.width - (dialog.width() > 480 ? 480 : dialog.width())) / 2) + 'px'
});
}
}
var _scrollCount = 0;
var loaded = function(){
var shieldScript = window.document.getElementById('ShowShield');
var bodyChildren = body.children;
if((shieldScript != null && shieldScript.src.indexOf('type=3') > -1) || (bodyChildren && bodyChildren[0].className == 'FFFShield') || helper.win.width < 960 || !_isShowWebdd){
container.hide();
}
refresh();
var refreshScroll = function(){
if(_scrollCount < 5){
setTimeout(function(){
helper.initScroll();
refreshScroll();
var maxHeight = _window.height() - (gotop.height() || 40) - webddQr.height() - 48 -
parseInt(helper.finalPos.top || 0) - parseInt(helper.finalPos.bottom || 0);
webddMain.css('maxHeight', maxHeight + 'px');
_scrollCount++;
}, 100);
}
}
refreshScroll();
var reloadOddUser = function(){
setTimeout(function(){
helper.initScroll();
if(DD.support.ajax()){
DD.ajax({
url: 'http://www.superstat.cn/WebddCrossDomain.aspx?webid=75101&VisitorGuid=6b0d28f0-7507-ded7-69c5-bf447a726365&v=' + Math.random(),
callback:function(data){
DD.reload(data);
reloadOddUser();
refresh();
}
})
}else {
var scriptUrl = 'http://www.superstat.cn/WebddCrossDomain.aspx?webid=75101&VisitorGuid=6b0d28f0-7507-ded7-69c5-bf447a726365&Type=script&v=' + Math.random();
var _script = document.createElement('script');
_script.src = scriptUrl;
_script.type = 'text/javascript';
body.appendChild(_script);
reloadOddUser();
refresh();
}
}, 60000)
};
reloadOddUser();
if(opts.callback && typeof window[opts.callback] === 'function'){
window[opts.callback].call(container, DD);
}
}
if(document.readyState == 'complete') {
loaded();
}else{
_window.bind('load', function(){
loaded();
})
}
window.DD = DD;
})(window);