')
var atr = $(Name + ' div.changeDiv a');
var sum = atr.length;
for (i = 1; i <= sum; i++) {
var title = atr.eq(i - 1).attr("title");
var href = atr.eq(i - 1).attr("href");
$(Name + ' .change').append('
' + i + '');
$(Name + ' .title').append('
' + title + '');
}
$(Name + ' .change i').eq(0).addClass('cur');
}
$(Name + ' div.changeDiv a').sGallery({//对象指向层,层内包含图片及标题
titleObj: Name + ' div.title a',
thumbObj: Name + ' .change i',
thumbNowClass: Class
});
$(Name + " .title-bg").width(Width);
}
//缩略图
jQuery.fn.LoadImage = function (scaling, width, height, loadpic) {
if (loadpic == null) loadpic = "../images/msg_img/loading.gif";
return this.each(function () {
var t = $(this);
var src = $(this).attr("src")
var img = new Image();
img.src = src;
//自动缩放图片
var autoScaling = function () {
if (scaling) {
if (img.width > 0 && img.height > 0) {
if (img.width / img.height >= width / height) {
if (img.width > width) {
t.width(width);
t.height((img.height * width) / img.width);
} else {
t.width(img.width);
t.height(img.height);
}
}
else {
if (img.height > height) {
t.height(height);
t.width((img.width * height) / img.height);
} else {
t.width(img.width);
t.height(img.height);
}
}
}
}
}
//处理ff下会自动读取缓存图片
if (img.complete) {
autoScaling();
return;
}
$(this).attr("src", "");
var loading = $("

");
t.hide();
t.after(loading);
$(img).load(function () {
autoScaling();
loading.remove();
t.attr("src", this.src);
t.show();
//$('.photo_prev a,.photo_next a').height($('#big-pic img').height());
});
});
}
//向上滚动代码
function startmarquee(elementID, h, n, speed, delay) {
var t = null;
var box = '#' + elementID;
$(box).hover(function () {
clearInterval(t);
}, function () {
t = setInterval(start, delay);
}).trigger('mouseout');
function start() {
$(box).children('ul:first').animate({ marginTop: '-=' + h }, speed, function () {
$(this).css({ marginTop: '0' }).find('li').slice(0, n).appendTo(this);
})
}
}
//TAB切换
function SwapTab(name, title, content, Sub, cur) {
$(name + ' ' + title).mouseover(function () {
$(this).addClass(cur).siblings().removeClass(cur);
$(content + " > " + Sub).eq($(name + ' ' + title).index(this)).show().siblings().hide();
});
}