function doZoom(size){ 
document.getElementById('zoom').style.fontSize=size+'px'
} 

function showcode(o){
 //重载验证码
  var timenow = new Date().getTime();
 o.src="/ValidateCode.aspx?d="+timenow;
}

function showcoded(o,tlength,tfontSize){
 //重载验证码
  var timenow = new Date().getTime();
 o.src="/login/VerifyCode.aspx?d="+timenow+"&tlength="+tlength+"&tfontSize="+tfontSize;
}


function CheckAll(form) 
{
   for (var i=0;i<form.elements.length;i++)
        {
	  var e = form.elements[i];
	  if (e.name != 'chkall')       e.checked = form.chkall.checked; 
	}
}

function CheckIsNull(obj,msg)
{
	if(obj.value=="")
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}

function changeTable(id)
{
    for (var i=1;i<5;i++)
    {
        if (document.getElementById("tab"+i))
        {
            document.getElementById("tab"+i).background="/images/pd_bg_1.jpg";
            document.getElementById("tdd"+i).className="t10";
        }
    }
    document.getElementById("tab"+id).background="/images/pd_bg_2.jpg";
    document.getElementById("tdd"+id).className="t8";
}

function changeTableT(id)
{
    for (var i=1;i<4;i++)
    {
        if (document.getElementById("tabb"+i))
        {
            document.getElementById("tabb"+i).background="/images/show_pic_0-1.jpg";
            document.getElementById("tabbd"+i).style.display="none";
        }
    }
    document.getElementById("tabb"+id).background="/images/show_pic_0-2.jpg";
    document.getElementById("tabbd"+id).style.display="block";
}

function Chanagetop(obj)
{
    document.getElementById(obj).style.display="block";
}
function Chanagetopout(obj)
{
    document.getElementById(obj).style.display="none";
}

function changeTDPic(id,count,pic)
{
    for (var i=1;i<count+1;i++)
    {
        document.getElementById("tdd"+i).className="product_smallimg";
    }
    document.getElementById("tdd"+id).className="product_smallimg01";
    document.getElementById("Image1").src=pic;
}

function changezx(id)
{
    if (id==0)
    {
        document.getElementById("top_ttr1").style.display="block";
        document.getElementById("top_ttr2").style.display="none";
        document.getElementById("top_ttd1").background="../images/djf.jpg";
        document.getElementById("top_ttd2").background="../images/djf1.jpg";
    }
    else
    {
        document.getElementById("top_ttr1").style.display="none";
        document.getElementById("top_ttr2").style.display="block";
        document.getElementById("top_ttd2").background="../images/djf.jpg";
        document.getElementById("top_ttd1").background="../images/djf1.jpg";
    }
}
//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
//参数(图片,允许的宽度,允许的高度)
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
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;
}
}
} 
//调用：<img src="图片" onload="javascriptrawImage(this,100,100)">
function OpenWin(url,width,height){
	var rtn = showModalDialog(url,'',"dialogHeight:"+height+";dialogWidth:"+width+";scroll:yes;help:no;status:no;")
	if(typeof(rtn) != "undefined"){
		window.location = rtn;
	}
}
function item_popup(url,width,height) { 
		var imgwin = window.open(url,'','scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width='+width+',height='+height+''); 
		imgwin.focus(); 
} 

function addCookie(){ 
    try    
    {
        window.external.addFavorite('http://www.njquxian.com', 'njquxian.com');    
    }    
    catch (e)    
    {
        window.sidebar.addPanel('njquxian.com', 'http://www.njquxian.com', "");    
    }    
}   
  
function setHomepage(){
    if (document.all){   
        document.body.style.behavior = 'url(#default#homepage)';   
        document.body.setHomePage('www.njquxian.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', 'www.njquxian.com');   
    }   
}    
