this.index-1;
this.active(index);
var ss = this;
this.timer = setTimeout(function(){
ss.run();
}, 8000);
} else {
this.activeByStep(index);
}
};
this.run = function() {
var index = this.index + 1 < this.length ? this.index + 1 : 0;
this.active(index);
var ss = this;
this.timer = setTimeout(function(){
ss.run();
}, this.timestep);
};
this.runRoll = function() {
for(var i = 0; i < this.slidenum; i++) {
if(this.slideshows[i] && typeof this.slideshows[i].style != 'undefined') this.slideshows[i].style.display = "block";
for(var j=0,L=this.slideother.length; j<L; j++) {
this.slideother[j].childNodes[i].style.display = "block";
}
}
this.index = this.slidenum - 1;
};
var imgs = this.slideshows.length ? this.slideshows[0].parentNode.getElementsByTagName('img') : [];
for(i=0, L=imgs.length; i<L; i++) {
this.imgs.push(imgs[i]);
this.imgLoad.push(new Image());
this.imgLoad[i].src = this.imgs[i].src;
this.imgLoad[i].onerror = function (){obj.imgLoaded ++;};
}
this.getSize = function () {
if(this.imgs.length == 0) return false;
var img = this.imgs[0];
this.imgWidth = img.width ? parseInt(img.width) : 0;
this.imgHeight = img.height ? parseInt(img.height) : 0;
var ele = img.parentNode;
while ((!this.imgWidth || !this.imgHeight) && !hasClass(ele,'slideshow') && ele != document.body) {
this.imgWidth = ele.style.width ? parseInt(ele.style.width) : 0;
this.imgHeight = ele.style.height ? parseInt(ele.style.height) : 0;
ele = ele.parentNode;
}
return true;
};
this.getSize();
this.checkLoad = function () {
var obj = this;
for(i = 0;i < this.imgs.length;i++) {
if(this.imgLoad[i].complete && !this.imgLoad[i].status) {
this.imgLoaded++;
this.imgLoad[i].status = 1;
}
}
var percentEle = $(this.id+'_percent');
if(this.imgLoaded < this.imgs.length) {
if (!percentEle) {
var dom = document.createElement('div');
dom.id = this.id+"_percent";
dom.style.width = this.imgWidth ? this.imgWidth+'px' : '150px';
dom.style.height = this.imgHeight ? this.imgHeight+'px' : '150px';
dom.style.lineHeight = this.imgHeight ? this.imgHeight+'px' : '150px';
dom.style.backgroundColor = '#ccc';
dom.style.textAlign = 'center';
dom.style.top = '0';
dom.style.left = '0';
dom.style.marginLeft = 'auto';
dom.style.marginRight = 'auto';
this.slideshows[0].parentNode.appendChild(dom);
percentEle = dom;
}
el.parentNode.style.position = 'relative';
percentEle.innerHTML = (parseInt(this.imgLoaded / this.imgs.length * 100)) + '%';
setTimeout(function () {obj.checkLoad();}, 100)
} else {
if (percentEle) percentEle.parentNode.removeChild(percentEle);
this.container.style.display = 'block';
if(this.slidebar) this.slidebar.style.display = '';
this.index = this.length - 1 < 0 ? 0 : this.length - 1;
if(this.slideshows.length > 0) {
if(!this.slidenum || !this.slidestep) {
this.run();
} else {
this.runRoll();
}
}
}
};
this.checkLoad();
}
function slidexactive(step) {
var e = getEvent();
var aim = e.target || e.srcElement;
var parent = aim.parentNode;
var xactivei = null, slideboxid = null,currentslideele = null;
currentslideele = hasClass(parent, 'slidebar') ? aim : null;
while(parent && parent != document.body) {
if(!currentslideele && hasClass(parent.parentNode, 'slidebar')) {
currentslideele = parent;
}
if(hasClass(parent, 'slidebox')) {
slideboxid = parent.id;
break;
}
parent = parent.parentNode;
}
if(step && !currentslideele) {
while(aim != document.body) {
if(hasClass(aim, 'slidebarup') || hasClass(aim, 'slidebardown')) {
currentslideele = aim;
break;
}
aim = aim.parentNode;
}
}
var slidebar = $C('slidebar', parent);
var children = slidebar.length == 0 ? [] : slidebar[0].childNodes;
if(currentslideele && (hasClass(currentslideele, 'slidebarup') || hasClass(currentslideele, 'slidebardown'))) {
xactivei = step;
} else {
for(var j=0,i=0,L=children.length;i<L;i++){
if(currentslideele && children[i] == currentslideele) {
xactivei = j;
break;
}
if(!hasClass(children[i], 'slidebarup') && !hasClass(children[i], 'slidebardown')) j++;
}
}
if(slideboxid != null && xactivei != null) slideshow.entities[slideboxid].xactive(xactivei);
}
function showPreview(val, id) {
var showObj = $(id);
if(showObj) {
showObj.innerHTML = val.replace(/\n/ig, "<bupdateseccoder />");
}
}
function toggle_collapse(objname, noimg, complex, lang) {
var obj = $(objname);
if(obj) {
obj.style.display = obj.style.display == '' ? 'none' : '';
var collapsed = getcookie('collapse');
collapsed = updatestring(collapsed, objname, !obj.style.display);
setcookie('collapse', collapsed, (collapsed ? 2592000 : -2592000));
}
if(!noimg) {
var img = $(objname + '_img');
if(img.tagName != 'IMG') {
if(img.className.indexOf('_yes') == -1) {
img.className = img.className.replace(/_no/, '_yes');
if(lang) {
img.innerHTML = lang[0];
}
} else {
img.className = img.className.replace(/_yes/, '_no');
if(lang) {
img.innerHTML = lang[1];
}
}
} else {
img.src = img.src.indexOf('_yes.gif') == -1 ? img.src.replace(/_no\.gif/, '_yes\.gif') : img.src.replace(/_yes\.gif/, '_no\.gif');
}
img.blur();
}
if(complex) {
var objc = $(objname + '_c');
if(objc) {
objc.className = objc.className == 'umh' ? 'umh umn' : 'umh';
}
}
}
function updatestring(str1, str2, clear) {
str2 = '_' + str2 + '_';
return clear ? str1.replace(str2, '') : (str1.indexOf(str2) == -1 ? str1 + str2 : str1);
}
function getClipboardData() {
window.document.clipboardswf.SetVariable('str', CLIPBOARDSWFDATA);
}
function setCopy(text, msg){
if(BROWSER.ie) {
clipboardData.setData('Text', text);
if(msg) {
showPrompt(null, null, '<span>' + msg + '</span>', 1500);
}
} else {
var msg = '<div class="c"><div style="width: 200px; text-align: center; text-decoration:underline;">点此复制到剪贴板</div>' +
AC_FL_RunContent('id', 'clipboardswf', 'name', 'clipboardswf', 'devicefont', 'false', 'width', '200', 'height', '40', 'src', STATICURL + 'image/common/clipboard.swf', 'menu', 'false', 'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent', 'style' , 'margin-top:-20px') + '</div>';
showDialog(msg, 'info');
text = text.replace(/[\xA0]/g, ' ');
CLIPBOARDSWFDATA = text;
}
}
function copycode(obj) {
setCopy(BROWSER.ie ? obj.innerText.replace(/\r\n\r\n/g, '\r\n') : obj.textContent, '代码已复制到剪贴板');
}
function showdistrict(container, elems, totallevel, changelevel) {
var getdid = function(elem) {
var op = elem.options[elem.selectedIndex];
return op['did'] || op.getAttribute('did') || '0';
};
var pid = changelevel >= 1 && elems[0] && $(elems[0]) ? getdid($(elems[0])) : 0;
var cid = c
296d534116cbbef9ce7c9576655b87ae |