﻿
var GO = function(elemId){
		if(document.getElementById){
			return document.getElementById(elemId);
		}else if(document.layers){
			document.layers[elemId];
		}else{
			return eval('document.all.' + elemId);
		}
	}
	//GO("wdivname_2").className='wdiv_n';
	
	
		function tongpr(obj)
	{
	//alert(obj.scrollLeft);
	  if(GO(obj))
	  {
	  
	   //alert(GO(obj))
	  if(GO(obj).scrollLeft>0)
	   GO(obj).scrollLeft=parseInt(GO(obj).scrollLeft)-125;
	  }
	}
	
	function tongnext(obj)
	{
	 if(GO(obj))
	  {
	  
	   GO(obj).scrollLeft=parseInt(GO(obj).scrollLeft)+125;
	  // alert(parseInt(obj.scrollLeft))
	  }
	}
	
	
	setTimeout('csh()',100);
	//window.onload=csh;
	function csh()
	{
		//alert("tempstr")
		if(GO("showclass"))
		{
			var tempstr=GO("showclass").value;
			
			titlechange(tempstr);


		}
		
	}
	
function madielist()
{
  if(GO("madieshow"))
  {
   if(GO("madieshow").style.display!='block')
   {
     GO("madieshow").style.top=document.documentElement.scrollTop+document.documentElement.offsetHeight/2-100;
      GO("madieshow").style.left=document.documentElement.offsetWidth/2-100;
      GO("madieshow").style.display='block';
   }
  }
  else
  {
    var oDiv=document.createElement("div"); 
     oDiv.setAttribute('id','madieshow');
     //oDiv.setAttribute('tsel','yes');
     document.body.appendChild(oDiv);  
      GO('madieshow').className="float";
     GO('madieshow').style.left=document.documentElement.offsetWidth/2-100;
     GO('madieshow').style.top=document.documentElement.scrollTop+document.documentElement.offsetHeight/2-100;
     GO('madieshow').style.zIndex="3";
     GO('madieshow').style.width="310";
     GO('madieshow').style.height="300";
     
     
     var tinner='<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff" >'
        tinner+='<tr><td height="20" align="right"><span style="cursor:pointer; color:Red; font-size:12px"  onclick="madieremove();">[关闭]</span></td></tr>'
        tinner+='<tr><td >'
        
        tinner += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
	tinner += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
	tinner += "width=\"310\" height=\"210\">";
	tinner += "<param name=\"movie\" value=\"/vide.swf\" />";
	tinner += "<param name=\"quality\" value=\"high\" />";
	tinner += "<param name=\"wmode\" value=\"transparent\" />";
	tinner += "<embed src=\"/vide.swf\"  quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
	tinner += "type=\"application/x-shockwave-flash\" width=\"310\" height=\"210\" ";
	tinner += "wmode=\"transparent\"></embed>";
	tinner += "</object>";
      
       // tinner+='getFlashObject("/vide.swf","310", "210","");'
        tinner+='</td></tr>'
        tinner+='</table>';
        GO('madieshow').innerHTML=tinner;
    
  }
}
	function madieremove()
	{
	 if(GO("madieshow"))
  {
	  var p;
        if(p =GO("madieshow").parentNode)   
        {   
         p.removeChild(GO("madieshow"));   
        }
        }   
	}
	function titlechange(tname,tnum)
	{
		for(var i=1;i<7;i++)
		{
		  if(!GO(tname+"_"+i))break;
		  if(tname+"_"+i=="b_4")
		  {
		    GO(tname+"_"+i+"_inner").style.display='none';
		  GO(tname+"_"+i+"_link").style.color='#000000';
		  GO(tname+"_"+i).style.background="url('img/05.jpg')";
		   GO(tname+"_"+i).style.backgroundRepeat="no-repeat";
		  }else
		  {
		  GO(tname+"_"+i+"_inner").style.display='none';
		  GO(tname+"_"+i+"_link").style.color='#000000';
		  GO(tname+"_"+i).style.background="url('img/03.jpg')";
		   GO(tname+"_"+i).style.backgroundRepeat="no-repeat";
		   }
		}
		if(GO(tname+"_"+tnum))
		{
		
			 GO(tname+"_"+tnum+"_inner").style.display='block';
			GO(tname+"_"+tnum+"_link").style.color='#ffffff';
			if(tname+"_"+tnum=="b_4")
			{
			GO(tname+"_"+tnum).style.background="url('img/05_01.jpg')";
			}
			else
			{
			 GO(tname+"_"+tnum).style.background="url('img/index1_36.jpg')";
			 }
			   GO(tname+"_"+tnum).style.backgroundRepeat="no-repeat";
			// .style.background="url('img/a.jpg')";
		}
	}
	
	
	
		function adchange(obj)
	{
		for(var i=1;i<3;i++)
		{
		  if(!GO("ad_"+i))break;
		 
		 // GO("ad_"+i+"_inner").style.display='none';
		  GO("ad_"+i).src='img/C'+i+'.jpg';
		  GO("ad_"+i+"_1").style.display='none';
		 
		  
		}
		if(GO("ad_"+obj))
		{
		
		 GO("ad_"+obj).src='img/D'+obj+'.jpg';
		  GO("ad_"+obj+"_1").style.display='block';
			 // GO("ad_"+obj+"_inner").style.display='none';
		}
		//alert(GO("ad_1").src)
	}
	
	
	
	function classchange(obj)
	{
	if(GO("pclassshow_"+obj))
		{
	if( GO("pclassshow_"+obj).style.display=='block')
	{
	 GO("pclassshow_"+obj).style.display='none';
		}
	else
	{
	 GO("pclassshow_"+obj).style.display='block';
	}
	}
	
	
	
//		for(var i=1;i<=3;i++)
//		{
//		  if(!GO("pclassshow_"+i))break;

//		  GO("pclassshow_"+i).style.display='none';
//		 
//		  
//		}
//		if(GO("pclassshow_"+obj))
//		{
//		
//		
//		  GO("pclassshow_"+obj).style.display='block';
//			 // GO("ad_"+obj+"_inner").style.display='none';
//		}
		//alert(GO("ad_1").src)
	}
	
	
	function c_show(obj)
	{
	if(GO(obj))
		{
	if( GO(obj).style.display=='')
	{
	 GO(obj).style.display='none';
		}
	else
	{
	 GO(obj).style.display='';
	}
	}
	}
	function adchange1(obj)
	{
	
	
	if(obj=='1')
	{
	   GO("ad_1").style.background="url('img/test02.jpg')";
	   GO("ad_1_1").style.display='block';
	   GO("ad_2").style.background="url('img/test.jpg')";
	   GO("ad_2_1").style.display='none';
	}
		else
		{
		  GO("ad_1").style.background="url('img/test0.jpg')";
	   GO("ad_1_1").style.display='none';
	   GO("ad_2").style.background="url('img/test1.jpg')";
	   GO("ad_2_1").style.display='block';
		}
		
		GO("ad_2").style.backgroundRepeat="no-repeat";
		//alert(GO("ad_1").src)
	}
	
	
	
	function helpshow(obj)
	{ //alert(obj);
		if(GO(obj))
		{
		 if(GO(obj).style.display=='none')
		 GO(obj).style.display='block';
		 else
		 GO(obj).style.display='none';
		}
	}

 function showing(imgid,twidth,theight)
    {
     var mypic = new Image();
     mypic.src = imgid.src;
     var mywidth = mypic.width;
     var myheight = mypic.height;
     if(mywidth>=myheight)
     {
       if (mywidth >= twidth)
      {    
       imgid.style.width = twidth;
       imgid.style.height = Math.floor(myheight/(mywidth/twidth));
      }
     }
     else
     {
       if (myheight >= theight)
        {    
         imgid.style.height = theight;
         imgid.style.width = Math.floor(mywidth/(myheight/theight));
        }
      }
    
    }
 
