function showsub(cid){
	var chbox=document.getElementsByName(cid);
	var myL=chbox.length;
	for(i=0;i<myL;i++){
		chbox[i].style.display='';
	}
}

function shutsub(cid){
	var chbox=document.getElementsByName(cid);
	var myL=chbox.length;
	for(i=0;i<myL;i++){
		chbox[i].style.display='none';
	}
}

function checkAll(status)
{
	var chbox=document.getElementsByName("myid");
	var myL=chbox.length;
	for(i=0;i<myL;i++)	{chbox[i].checked=status;}
	
	if(status){theBg='bg3';}
	else{theBg=''}

	var trBG=document.getElementsByTagName("tr");
	for(i=0;i<trBG.length;i++)
	{	
		if(trBG[i].id.indexOf("tr")!=-1)
		{trBG[i].className=theBg;}
	}
}
function changeTRbg(_self,_obj)
{
	obj=document.getElementById(_obj);
	if(_self.checked){obj.className='bg3';}
	else{	obj.className='';}
}
function ow(url){
	window.open(url,'','width=530,height=500,resizable=0,scrollbars=yes,menubar=no,status=yes');
}

function owb(url){
	window.open(url,'','width=905,height=432,resizable=0,scrollbars=no,menubar=no,status=yes');
}

function insertswf(width, height, url){
	document.write("<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 width='" + width + "' height='" + height + "'>");
	document.write("<param name='movie' value='" + url + "'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='scale' value='noscale'>");
	document.write("<param name='wmode' value='transparent'>");
	document.write("<param name='allowScriptAccess' value='always'>");
	document.write("<param name='salign' value='t'>");
	document.write("<embed src='" + url + "' quality='high' allowScriptAccess='always' scale='noscale' salign='t' pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width='" + width + "' height='" + height + "'></embed>");
	document.write("</object>");
}


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;
        }
    }
} 


