/* 
     ------------------------------------------------
     PVII Equal CSS Columns scripts
     Copyright (c) 2005 Project Seven Development
     www.projectseven.com
     Version: 1.5.0
		 使2个以上Div等高
		 onload="P7_equalCols('Left','Right')"
     ------------------------------------------------
    */
    function P7_colH(){ 
     var i,oh,hh,h=0,dA=document.p7eqc,an=document.p7eqa;
     if(dA&&dA.length){
     for(i=0;i<dA.length;i++){
     dA[i].style.height='auto';
     }
    for(i=0;i<dA.length;i++){
         oh=dA[i].offsetHeight;h=(oh>h)?oh:h;
    }
    for(i=0;i<dA.length;i++){
     if(an){
         dA[i].style.height=h+'px';
     }else{
         P7_eqA(dA[i].id,dA[i].offsetHeight,h);
     }
    }
    if(an){
         for(i=0;i<dA.length;i++){
         hh=dA[i].offsetHeight;
    if(hh>h){
             dA[i].style.height=(h-(hh-h))+'px';
    }
     }
    }else{
     document.p7eqa=1;
    }
     document.p7eqth=document.body.offsetHeight;
     document.p7eqtw=document.body.offsetWidth;
     }
    }
    function P7_eqT(){ //v1.5 by PVII-www.projectseven.com
     if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){
     P7_colH();
     }
    }
    function P7_equalCols(){ //v1.5 by PVII-www.projectseven.com
     if(document.getElementById){
     document.p7eqc=new Array;
     for(i=0;i<arguments.length;i++){
         document.p7eqc[i]=document.getElementById(arguments[i]);
     }
    setInterval("P7_eqT()",10);
     }
    }
    function P7_eqA(el,h,ht){ //v1.5 by PVII-www.projectseven.com
     var sp=10,inc=10,nh=h,g=document.getElementById(el),oh=g.offsetHeight,ch=parseInt(g.style.height);
     ch=(ch)?ch:h;var ad=oh-ch,adT=ht-ad;nh+=inc;nh=(nh>adT)?adT:nh;g.style.height=nh+'px';
     oh=g.offsetHeight;if(oh>ht){nh=(ht-(oh-ht));g.style.height=nh+'px';}
     if(nh<adT){
     setTimeout("P7_eqA('"+el+"',"+nh+","+ht+")",sp);
     }
    }

/*获取控件*/
function  _(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//显示大图
function ShowBigImg(url)
{
	try
	{
			_('BigImg').innerHTML='<img src='+url+' width="420" height="260" />';
	}
	catch(e){}
}

//显示或隐藏
function Show(id) {
	 var x=_(id);
	if (x.style.display == 'none') x.style.display = '';
	else if (x.style.display == '') x.style.display = 'none';
}
//图像大小自适应
function ImgAuto(i,MaxW,MaxH){var o=new Image();o.src=i.src;var w=o.width;var h=o.height;var t;if (w>MaxW){t=MaxW;}else{t=w;}if ((h*t/w)>MaxH){i.height=MaxH;i.width=MaxH/h*w;}else{i.width=t;i.height=t/w*h;}}

//左边导航
function ShowLeft(id,n)
{
	for(i=1;i<=n;i++)
	{
		_("SMenu"+i).style.display="none";
		_("TMenu"+i).className="Menu";
	}
	_("SMenu"+id).style.display="";
	_("TMenu"+id).className="MenuOn";
}

