function CreatAjax(){
var AjaxHttp = null;
try {AjaxHttp = new ActiveXObject('Msxml2.XMLHTTP')}
catch (e) {
try {AjaxHttp = new ActiveXObject('Microsoft.XMLHTTP')}
        catch (ee) {AjaxHttp = null}
}
if (!AjaxHttp&&typeof XMLHttpRequest !='undefined') AjaxHttp = new XMLHttpRequest();
return AjaxHttp;
}

function GetTages(i){return document.getElementById(i);}


function AjaxPost(ID,URL,Tages,TopNum) {
var xmlHttp = CreatAjax();
xmlHttp.open("Post",URL, true);
xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4)
	{
		if(xmlHttp.readyState==404)
		{
			GetTages(Tages).innerHTML="加载失败...";
		}else{
		GetTages(Tages).innerHTML="正在加载数据,请稍候...";
		}
	}
	if(xmlHttp.readyState==4){
	if(xmlHttp.status==200){	
	var response=xmlHttp.responseText;
	GetTages(Tages).innerHTML=response;
	}}
	};
xmlHttp.send("ID="+escape(ID)+"&TopNum="+escape(TopNum));
}

function menu(mno,Count,ShowChar,TheChar,ClassName,TopNum,Url,ID){
	for(var i=1;i<=Count;i++){
		objval=GetTages(TheChar+i);
		if( objval!=null){
			objval.className='menu'+ClassName+'Off';
		}
	}
	GetTages(TheChar+mno).className='menu'+ClassName+'On';
	AjaxPost(ID,Url,ShowChar,TopNum);

}


function DrawImage(obj,w,h){
	var image= new Image(); 
	var w,h;
	image.src=obj.src;
	
	if(image.width>w || image.height>h){
		if((image.width/image.height)<=(w/h)){
			obj.height=h;
			obj.width=image.width*h/image.height;
			}
		else{
			obj.width=w;
			obj.height=image.height*w/image.width;
			}	
		}
	}

