var xmlHttp_info;

function showinfo(url){
    if(window.ActiveXObject){
        xmlHttp_info= new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if(window.XMLHttpRequest){
        xmlHttp_info= new XMLHttpRequest();
    }
	xmlHttp_info.open("get",url,true);
	xmlHttp_info.onreadystatechange=getinfo;
	xmlHttp_info.send(null);
}

function getinfo() {
	if (xmlHttp_info.readyState == 4) {
		if (xmlHttp_info.status == 200) {
			//alert(xmlHttp_info.responseText);
			document.getElementById('info').style.display='block';
			document.getElementById("info").innerHTML=xmlHttp_info.responseText;
		} else {
			alert('Error!');
		}
	}
}



var xmlHttp_photo_all;
var xmlHttp_photo_list;
var xmlHttp_photo_detail;
function showphoto_all(url){
	createXMLHttpRequest_photo_all();
	xmlHttp_photo_all.open("get",url,true);
	xmlHttp_photo_all.onreadystatechange=changealbum;
	xmlHttp_photo_all.send(null);
}
function showphoto_list(url){
	createXMLHttpRequest_photo_list();
	xmlHttp_photo_list.open("get",url,true);
	xmlHttp_photo_list.onreadystatechange=changephoto;
	xmlHttp_photo_list.send(null);
}
function showphoto_detail(url){
	createXMLHttpRequest_photo_detail();
	xmlHttp_photo_detail.open("get",url,true);
	xmlHttp_photo_detail.onreadystatechange=showphoto;
	xmlHttp_photo_detail.send(null);
}
function createXMLHttpRequest_photo_all()
   {
	if(window.ActiveXObject)
	   {
		xmlHttp_photo_all= new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if(window.XMLHttpRequest)
	   {
		xmlHttp_photo_all= new XMLHttpRequest();
	}
}
function createXMLHttpRequest_photo_list()
   {
	if(window.ActiveXObject)
	   {
		xmlHttp_photo_list= new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if(window.XMLHttpRequest)
	   {
		xmlHttp_photo_list= new XMLHttpRequest();
	}
}
function createXMLHttpRequest_photo_detail()
   {
	if(window.ActiveXObject)
	   {
		xmlHttp_photo_detail= new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if(window.XMLHttpRequest)
	   {
		xmlHttp_photo_detail= new XMLHttpRequest();
	}
}
function changealbum() {
	if (xmlHttp_photo_all.readyState == 4) {
		if (xmlHttp_photo_all.status == 200) {
			//alert("changealbum");
			//alert(xmlHttp_photo_all.responseText);
			document.getElementById("photo_all").innerHTML=xmlHttp_photo_all.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}
function changephoto() {
	if (xmlHttp_photo_list.readyState == 4) {
		if (xmlHttp_photo_list.status == 200) {
			//alert("changephoto");
			//alert(xmlHttp_photo_list.responseText);
			document.getElementById("photo_list").innerHTML=xmlHttp_photo_list.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}
function showphoto() {
	if (xmlHttp_photo_detail.readyState == 4) {
		if (xmlHttp_photo_detail.status == 200) {
			//alert("showphoto");
			//alert(xmlHttp_photo_detail.responseText);
			document.getElementById("photo_detail").innerHTML=xmlHttp_photo_detail.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}

 function ReImgSize(){
  for (i=0;i<document.images.length;i++)
   {
   if (document.getElementsByTagName("img")){
	width=document.images[i].width;
	height=document.images[i].height;
	if (width>540)
	 {
       document.images[i].width="540";
       document.images[i].height=540*height/width;
       document.images[i].outerHTML='<a href="'+document.images[i].src+'" target="_blank" title="在新窗口打开图片">'+document.images[i].outerHTML+'</a>'
  	 }
   }
  else{
	if (document.images[i].width>600) {
	  document.images[i].title="在新窗口打开图片";
	  document.images[i].style.cursor="pointer";
	  document.images[i].onclick=function(e){window.open(this.src)}
	}
  }
  }
 }
 
 function divplay(){
	document.getElementById("tool_menu").style.display = "block";
}

function divplay1(){
	document.getElementById("tool_menu").style.display = "none";
}

