//滚动
function marquee(i, direction)
{
var obj = document.getelementbyid("marquee" + i);
var obj1 = document.getelementbyid("marquee" + i + "_1");
var obj2 = document.getelementbyid("marquee" + i + "_2");
if (direction == "up")
{
if (obj2.offsettop - obj.scrolltop <= 0)
{
obj.scrolltop -= (obj1.offsetheight + 20);
}
else
{
var tmp = obj.scrolltop;
obj.scrolltop++;
if (obj.scrolltop == tmp)
{
obj.scrolltop = 1;
}
}
}
else
{
if (obj2.offsetwidth - obj.scrollleft <= 0)
{
obj.scrollleft -= obj1.offsetwidth;
}
else
{
obj.scrollleft++;
}
}
}
function marqueestart(i, direction)
{
var obj = document.getelementbyid("marquee" + i);
var obj1 = document.getelementbyid("marquee" + i + "_1");
var obj2 = document.getelementbyid("marquee" + i + "_2");
obj2.innerhtml = obj1.innerhtml;
var marqueevar = window.setinterval("marquee("+ i +", '"+ direction +"')", 20);
obj.onmouseover = function(){window.clearinterval(marqueevar);}
obj.onmouseout = function(){marqueevar = window.setinterval("marquee("+ i +", '"+ direction +"')", 20);}
}
//屏蔽鼠标右键
function disabledrightbutton()
{
document.oncontextmenu = function(e){return false;}
document.onselectstart = function(e){return false;}
if (navigator.useragent.indexof("firefox") > -1)
{
document.writeln("");
}
}
// 设为首页
function sethome(obj, vrl)
{
try
{
obj.style.behavior='url(#default#homepage)';
obj.sethomepage(vrl);
}
catch(e)
{
if(window.netscape)
{
try
{
netscape.security.privilegemanager.enableprivilege("universalxpconnect");
}
catch (e)
{
alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
return;
}
var prefs = components.classes['@mozilla.org/preferences-service;1'].getservice(components.interfaces.nsiprefbranch);
prefs.setcharpref('browser.startup.homepage', vrl);
}
}
}
// 加入收藏
function addfavorite(surl, stitle)
{
try
{
window.external.addfavorite(surl, stitle);
}
catch (e)
{
try
{
window.sidebar.addpanel(stitle, surl, "");
}
catch (e)
{
alert("您使用的浏览器不支持此功能,请使用ctrl+d进行添加");
}
}
}
function flashplay( pics, texts, links, flash_width, flash_height, text_height){
var swf_height = flash_height + text_height;
var banner = ''
document.write('');
}
// 内页左右等高
// $(document).ready(function(){
// var hright = $(".main").height();
// var hleft = $(".sidebar").height();
// if(hleft>hright){
// $(".sidebar").css("height",hleft);
// $(".main").css("height",hleft);
// }else{
// $(".sidebar").css("height",hright);
// $(".main").css("height",hright);
// }
// })
// 回到顶部
// $(window).scroll(function(){
// var scrollh = $(window).scrolltop();
// if(scrollh>300){
// $(".back-top").fadein();
// }else{
// $(".back-top").fadeout();
// }
// })
// 回到顶部效果
$(document).ready(function(){
$(".back-top").on('click',function(){
$('html,body').animate({'scrolltop':0},500);
});
})
// 在线qq
$(function(){
var m_woo_panel = $('#m-woo-panel');
$('#j-close').on('click',function(){
m_woo_panel.hide();
});
$('#j-console').on("click",function(){
if($(this).hasclass("m-console-active")){
$(this).removeclass("m-console-active");
m_woo_panel.animate({right:0});
}else{
$(this).addclass("m-console-active");
m_woo_panel.animate({right:-164});
};
});
});
// qq滚动特效
$(document).ready(function(){
$("#m-woo-panel").floatadv();
});
jquery.fn.floatadv = function(loaded) {
var obj = this;
body_height = parseint($(window).height());
block_height = parseint(obj.height());
top_position = parseint((body_height/2) - (block_height/2) +
$(window).scrolltop());
if (body_height