﻿// JavaScript Document
//切换TAG IndexTag('BatHot',1,2)
var BarName='BatHot';
var TagContent='_Content';
var TagSum=0;
function IndexTag(BarName,CurrTag,TagSum)
{
    
    var images = document.getElementById("theImages").getElementsByTagName('IMG');
var ah = document.getElementById("theImages").getElementsByTagName('a');

  
		for(var no=0;no<images.length;no++){
		images[no].className="block";
		

		
		 if (CurrTag=="2" && no>7)//合作媒体
		 {
		 images[no].className="hide";
		 
		 }
			else if (CurrTag=="2" && no<8)
			{
			images[no].src="gdimages/image1"+(no+1)+".jpg";
			//ah[no].href="amertlynews/mthz.aspx";
			ah[no].href="amertlynews/partner.aspx";
			}
			
		else if (CurrTag=="1" && no>7 )//合作企业
		{
	     images[no].className="hide";
		}
		else if ( CurrTag=="1" && no<8 )
		{
		  images[no].src="gdimages/image4"+(no+1)+".jpg";
			ah[no].href="http://www.drance.com.cn";
			if(no==1) ah[no].href="http://www.nanyuaninn.com";
			if(no==2) ah[no].href="http://www.splendot.net";
			if(no==3) ah[no].href="http://www.998.com";
			if(no==4) ah[no].href="http://www.bjglif.com/new2.asp";
			if(no==5) ah[no].href="http://www.ees.com.cn";
			if(no==6) ah[no].href="http://www.hilon.com.cn";
                        if(no==7) ah[no].href="http://www.chinacgr.com";
			
		}
		
		
			else if ( CurrTag=="4" && no>3 )//爱心合作
			{
			images[no].className="hide";
			}
			else if ( CurrTag=="4" && no<4 )
			{
			images[no].src="gdimages/image3"+(no+1)+".jpg";
			//ah[no].href="amertlynews/axhz.aspx";	
			ah[no].href="amertlynews/partner.aspx";	
//if(no==5) ah[no].href="http://www.nyinn.cn";
//if(no==4) ah[no].href="http://www.bjglif.com/new2.asp";
			}
			
			
			
			else if ( CurrTag=="3" && no>11 )//公益合作
			{
			images[no].className="hide";
			}
			else if ( CurrTag=="3" && no<12 )
			{
			images[no].src="gdimages/image2"+(no+1)+".jpg";
			//ah[no].href="amertlynews/gyhz.aspx";
			ah[no].href="amertlynews/partner.aspx";
			}
		
		
		for(i=1; i <= TagSum; i++)
	   {
		if(i==CurrTag){
			//标题部分
			document.getElementById(BarName+i).className='ok';
			//内容部分
			document.getElementById(BarName+i+TagContent).style.display='block';
		}else{
			//标题部分
			document.getElementById(BarName+i).className='';
			//内容部分
			//document.getElementById(BarName+i+TagContent).style.display='none';

		}	
		}
		}
    
}


//function IndexTag(BarName,CurrTag,TagSum)
//{
//	//var TagTo=BarName+TagSum+TagContent;
//	//document.getElementById(TagTo).filters.Apply();
//	for(i=1; i <= TagSum; i++)
//	{
//		if(i==CurrTag){
//			//标题部分
//			document.getElementById(BarName+i).className='ok';
//			//内容部分
//			document.getElementById(BarName+i+TagContent).style.display='block';
//		}else{
//			//标题部分
//			document.getElementById(BarName+i).className='';
//			//内容部分
//			document.getElementById(BarName+i+TagContent).style.display='none';

//		}
//	}
//	//document.getElementById(TagTo).filters.play(); 	
//		
//}


function IndexTag2(BarName,CurrTag,TagSum)
{
	//var TagTo=BarName+TagSum+TagContent;
	//document.getElementById(TagTo).filters.Apply();
	for(i=1; i <= TagSum; i++)
	{
		if(i==CurrTag){
			//标题部分
			document.getElementById(BarName+i).className='ok';
			//内容部分
			document.getElementById(BarName+i+TagContent).style.display='block';
			document.getElementById(BarName+i+TagContent+2).style.display='block';
		}else{
			//标题部分
			document.getElementById(BarName+i).className='';
			//内容部分
			document.getElementById(BarName+i+TagContent).style.display='none';
			document.getElementById(BarName+i+TagContent+2).style.display='none';

		}
	}
	//document.getElementById(TagTo).filters.play(); 	
		
}
