﻿// JScript 文件
function selectTag(id){
var tag = document.getElementById("Menutable").getElementsByTagName("li");
var taglength = tag.length;
document.getElementById("Menu"+id).className="Current";
}
  function gosearch(){
	           var searchType=document.getElementById("CateId").value;
			   var searchtxt=document.getElementById("KeyWord").value;
                    if(searchtxt==""||searchtxt=="请输入关键字"){
                       alert("请输入关键字");
                   }
                   else{
                       var Tempurl = '/search.aspx?Type=1&KeyWord=';
        switch (searchType) {
        case '1':
           Tempurl ='/search.aspx?Type=1&KeyWord=';
            break;
        case '2':
           Tempurl ='/searchVideo.aspx?Type=2&KeyWord=';
            break;
        case '3':
             Tempurl='searchBbs.aspx?Type=3&KeyWord=';
            break;
           }
                        location.href=Tempurl+searchtxt;
                    }
                }

	function OpenOrClose(BarObj){
					if(BarObj.style.display=="none"){
						BarObj.style.display="";
					}else{
						BarObj.style.display="none";
					}
				}

//重设图片高宽,调用方式onload="DrawImage(this,300,400)"
function DrawImage(ImgD,maxWidth, maxHeight)
{
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0)
{
   if(image.width>=maxWidth)
     { 
         ImgD.width=maxWidth;
         image.height=(image.height*maxWidth)/image.width;
      }
      else
      {
          ImgD.width=image.width;
         if(image.height>maxHeight)
           {
             alert(image.height)
             alert("ddd");
              ImgD.height=(maxHeight*image.width)/maxWidth;
           }
        }
  }
   delete image;   
}

var step =30;
var tempint=212;
var tempint2=0;
function rollnext(){
	if(document.getElementById("proccc").scrollLeft<830){
		tempint2=208;
		while(tempint2>0){
		document.getElementById("proccc").scrollLeft = document.getElementById("proccc").scrollLeft+5;
		tempint2=tempint2-5;
	}
}
}
function rollprev(){
	
	if(document.getElementById("proccc").scrollLeft>0){
		tempint=212;
		while(tempint>0){
		document.getElementById("proccc").scrollLeft = document.getElementById("proccc").scrollLeft-5;
		tempint=tempint-5;
	}	
	}
}
