//加入收藏
function addFavorites(){
if (document.all){
window.external.addFavorite('http://www.dlwwedu.com', '大连文武学校');
} 
else if (window.sidebar){
window.sidebar.addPanel('大连文武学校', 'http://www.dlwwedu.com', '');
}
} 
//设为主页
function setHomepage(){
if (document.all){
document.body.style.behavior = 'url(#default#homepage)';
document.body.setHomePage('http://www.dlwwedu.com');
} 
else if (window.sidebar){
if (window.netscape){
try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");} 
catch (e){alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");} 
} 
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
 prefs.setCharPref('browser.startup.homepage', 'http://www.dlwwedu.com');
} 
}
//调用示例：showFlv('flashid',600,300,'test.swf');
function showFlash(id, width, height, src){
var flashvars = false;
var param={wmode:"transparent"};
var attributes = {};
swfobject.embedSWF(src, id, width, height, "9.0.0", "" ,flashvars, param,attributes);
}
//调用示例：showHomeFlash('1.jpg|2.jpg|3.jpg','http://www.x.com|http://www.x.com|http://www.x.com','标题|标题|标题')
function showHomeFlash(pics,links,texts){
var flashvars = false;
var pic_width=360; //图片宽度
var pic_height=210; //图片高度
var button_pos=4; //按扭位置 1左 2右 3上 4下
var stop_time=4000; //图片停留时间(1000为1秒钟)
var show_text=1; //是否显示文字标签 1显示 0不显示
var txtcolor="000000"; //文字色
var bgcolor="b9d7fb"; //背景色
var swf_height=show_text==1?pic_height+20:pic_height;
var flashvar='pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time;
var param={wmode:"transparent",FlashVars:flashvar};
var attributes = {};
swfobject.embedSWF("/flash/focus.swf", "flashad", pic_width, swf_height, "9.0.0", "" ,flashvars, param,attributes);
}
//向左滚动(id,高,数量,速度,停留时间)
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);
        })
    }
}

function showFlv(id, width, height, src) {
    var flashvars = false;
    var param = { allowFullScreen: "true", wmode: "transparent" };
    var attributes = {};
    swfobject.embedSWF("/Flash/flvplayer.swf?vcastr_file=" + src, id, width, height, "9.0.0", "", flashvars, param, attributes);
}
