﻿//定义一个bool值，用于标记是否显示部分文档中图片幻灯的说明文字是否显示
var Show_ppt_Title=false;

/*
function show_fullname(FullName)
{
//alert(event.pageX);
    var x,y,scrollx,scrolly;
    
    if(window.event)
    {
        x=event.x;
        y=event.y;
        scrollx=document.documentElement.scrollLeft;
        scrolly=document.documentElement.scrollTop;
    }
    else 
    {
        var FFevent = show_fullname.caller.arguments[0];
        x=FFevent.pageX;
        y=FFevent.pageY;
        scrollx=0;
        scrolly=0;

    }
    
    document.getElementById("Div_FullName").innerHTML=FullName;
    document.getElementById("Div_FullName").style.top=y-30+scrolly+"px";
    document.getElementById("Div_FullName").style.left=x-200+scrollx+"px";
    document.getElementById("Div_FullName").style.display="block";
}

function hidden_fullname()
{
    document.getElementById("Div_FullName").style.display="none";
}
*/

//bbs登录后清空用户信息
function ClearBbsForm()
{
    document.getElementById("bbsForm").reset();
    return true;
}
    
//右下角浮动图层定位
function ShowFloatImg()
{
    FloatDivPosition();
    document.getElementById("advice").style.display="block";
}

//调整浮动层的位置
function FloatDivPosition()
{
    var WinWidth=document.documentElement.clientWidth;
    var WinHeight=document.documentElement.clientHeight;
    var ImgWidth=165;
    var ImgHeight=104;
    
    var ImgLeft,ImgTop;
    
    if(navigator.userAgent.indexOf("MSIE")>0)
    {
        ImgLeft=WinWidth-ImgWidth+document.documentElement.scrollLeft;
        ImgTop=WinHeight-ImgHeight+document.documentElement.scrollTop;
    }
    else
    {
        ImgLeft=WinWidth-ImgWidth+document.body.scrollLeft;
        ImgTop=WinHeight-ImgHeight+document.body.scrollTop;
    }  
    
    
    document.getElementById("advice").style.left=ImgLeft+"px";
    document.getElementById("advice").style.top=ImgTop+"px";
 }   
 
 function CloseFloatImg()
 {
    document.getElementById("advice").style.display="none";
 }


//标签切换
function TipChange(TipId,DivId,Group,TipNum,LinkId,LinkUrl)
{
    for(i=1;i<=TipNum;i++)
    {
        document.getElementById("Div"+Group+"_"+i).style.display="none";
        document.getElementById("Tip"+Group+"_"+i).innerHTML="<img src='/08images/Tip"+Group+"_"+i+"TipNoS.gif' alt='' style='border:none; width:115px; height:26px;' />";
    }
    document.getElementById(DivId).style.display="block";
    document.getElementById(TipId).innerHTML="<img src='/08images/"+TipId+"TipS.gif' alt='' style='border:none; width:115px; height:26px;' />";
    document.getElementById(LinkId).href=LinkUrl;
    
    if(Group=="2")
    {
        if(TipId=="Tip2_2")
        {
            document.getElementById("Tip2_more").style.visibility="hidden";
            document.getElementById(LinkId).style.visibility="hidden";
        }
        else
            document.getElementById("Tip2_more").style.visibility="visible";
    }
}

//火狐、IE兼容的添加收藏夹脚本（google浏览器不支持）
function bookmark(title, url) {
  if (document.all)
    window.external.AddFavorite(url, title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
}

//火狐、IE兼容的设为主页脚本（google浏览器不支持）
function setHomepage()
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage('http://www.chinariceinfo.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.carzymusic.com');
 }
}

function ShowDirectorMail()
{
    if(navigator.userAgent.indexOf("MSIE 6.0")>0)
        window.showModalDialog("/08images/DirectorMail.jpg",window,"dialogWidth:410px; dialogHeight:350px;");
    else
        window.showModalDialog("/08images/DirectorMail.jpg",window,"dialogWidth:404px; dialogHeight:304px;");
    
}


//window.onload=ShowFloatImg;
//window.onscroll=FloatDivPosition;
//window.onresize=FloatDivPosition;