﻿// JScript 文件

//设为首页
function setSave(obj)
{SetHome2(obj,window.location);}

function SetHome2(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',双击即可。");}
        }
    }
 }
//加入收藏
function setFavorite()
{AddFavorite(window.location,document.title)}

function AddFavorite(sURL,sTitle)
{
    try{window.external.addFavorite(sURL,sTitle);}
    catch(e)
    {
        try{window.sidebar.addPanel(sTitle,sURL,"");}
        catch(e)
        {alert("加入收藏失败，请使用Ctrl+D进行添加");}
    }
}

// JScript 文件

//图片按比例缩放 
function changeImg(ImgD,iwidth,iheight){     
     var image=new Image(); 
     image.src=ImgD.src; 
    if(image.width>0 && image.height>0){     
    if(image.width/image.height>= iwidth/iheight){ 
        if(image.width>iwidth){   
         ImgD.width=iwidth; 
         ImgD.height=(image.height*iwidth)/image.width; 
         }else{ 
         ImgD.width=image.width;   
         ImgD.height=image.height; 
         } 
         ImgD.alt=image.width+"×"+image.height; 
         } 
    else{ 
        if(image.height>iheight){   
         ImgD.height=iheight; 
         ImgD.width=(image.width*iheight)/image.height;         
         }else{ 
         ImgD.width=image.width;   
         ImgD.height=image.height; 
         } 
         ImgD.alt=image.width+"×"+image.height; 
         } 
     } 
} 


function addFlash(flashURL,flashWIDTH,flashHEIGHT) 
{    
    
    document.writeln('<OBJECT  WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>');   
    document.writeln('<PARAM NAME=movie VALUE="'+flashURL+'">');   
    document.writeln('<PARAM NAME=wmode VALUE=transparent>');   
    document.writeln('<PARAM NAME=loop VALUE=true>');   
    document.writeln('<PARAM NAME=quality VALUE=high>');   
    document.writeln('<EMBED src="'+flashURL+'" loop=true wmode=opaque quality=high swLiveC WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');   
    document.writeln('</OBJECT>'); 
} 



function pshow(tid)
{   
 
    $(".L_item[t*='"+tid+"']").toggle();
       
     
}
