// JavaScript Document


//导航栏


function showNav2(n)
{
//	for(var i=1;i<=10;i++)
//	{
//		document.getElementById("nb"+i).className="unsel"
//		document.getElementById("ns"+i).style.display="none";
//	}
//	document.getElementById("nb"+n).className="sel"
//	document.getElementById("ns"+n).style.display="";
}

//导航栏

function showNav3(n)
{
	for(var i=1;i<=7;i++)
	{
		document.getElementById("ss"+i).className="nc1"
	}
	document.getElementById("ss"+n).className="nc2"
}



function Tab2(Xname,Cname,Lenght,j) 
//参数1(不含123的按钮ID),参数2(不含123的框架ID),数组总个数+1(因为循环时用了小于号),当前数组元素
{
	
	for(i=1;i<Lenght;i++)  //变换CSS
		{
			document.getElementById(Xname+i).className="n1"
		}
	document.getElementById(Xname+j).className="n2"
	for(i=1;i<Lenght;i++)  //隐现框架
		{
			document.getElementById(Cname+i).style.display="none"
		}
		document.getElementById(Cname+j).style.display="block"
}


//Xname按钮ID,Cname框架ID,总数,当前数
function Tab(Xname,Cname,Lenght,j) 
{
    //变换CSS
	for(i=0;i<=Lenght;i++){  
	    $("#" + Xname + i).removeClass("even");
	}
	$("#" + Xname + j).addClass("even");
	//隐显框架
	for(i=0;i<=Lenght;i++){  
	    $("#" + Cname + i).hide();
	}
	$("#" + Cname + j).show();
}


//搜索
function CheckSearch() 
{ 
	if (document.fromSearch.Keyword.value =="" || document.fromSearch.Keyword.value =="请输入你要搜索的关键词") 
	{ 
	alert("请输入你要搜索的关键词！"); 
	document.fromSearch.Keyword.focus (); 
	return false; 
	} 
}

function ChangeSearch(n,type) 
{ 
	for(var i=0;i<=5;i++)
	{
			document.getElementById("sea"+i).className="n1";
	}
	document.getElementById("sea"+n).className="n2";
	document.getElementById("Type").value=type;
}


//图片缩放
function DrawImage(ImgD,FitWidth,FitHeight){ 
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
if(image.width/image.height>= FitWidth/FitHeight){
if(image.width>FitWidth){
ImgD.width=FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}
else{
ImgD.width=image.width;
ImgD.height=image.height;
} 
} 
else{
if(image.height>FitHeight){
ImgD.height=FitHeight;
ImgD.width=(image.width*FitHeight)/image.height;
}
else{
ImgD.width=image.width;
ImgD.height=image.height;
} 
} 
}
} 




//注册VIP
function getVIP(){
alert('您目前还不是VIP会员，请申请成为VIP会员后再使用此功能！');
location.href='VIP.asp';
}
function getConstruction(){
alert('抱歉，此项目正在建设中，暂时未能使用！');
return false; 
}


