function InitAjax()
{
　var ajax=false; 
　try { 
　　ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
　} catch (e) { 
　　try { 
　　　ajax = new ActiveXObject("Microsoft.XMLHTTP"); 
　　} catch (E) { 
　　　ajax = false; 
　　} 
　}
　if (!ajax && typeof XMLHttpRequest!='undefined') { 
　　ajax = new XMLHttpRequest(); 
　} 
　return ajax;
}

function joinfavorite(itemid)
{
  //实例化Ajax对象
　var ajax = InitAjax();
  var url = "http://www.aspot.com.cn/addfavorite.php?itemid="+itemid+"&timeStamp="+new Date().getTime();
　//使用Get方式进行请求
　ajax.open("GET", url, true); 
　//获取执行状态
　ajax.onreadystatechange = function() { 
　　//如果执行是状态正常，那么就把返回的内容赋值给上面指定的层
　　if (ajax.readyState == 4 && ajax.status == 200) {
		 alert(ajax.responseText);
　　} 
　}
　//发送空
　ajax.send(null); 
return false;
}

function setRate(value,itemid) {
	//实例化Ajax对象
　var ajax = InitAjax();
  var url = "http://www.aspot.com.cn/vote.php?value="+value+"&itemid="+itemid+"&timeStamp="+new Date().getTime();
　//使用Get方式进行请求
　ajax.open("GET", url, true); 
　//获取执行状态
　ajax.onreadystatechange = function() { 
　　//如果执行是状态正常，那么就把返回的内容赋值给上面指定的层
　　if (ajax.readyState == 4 && ajax.status == 200) {
		 alert(ajax.responseText);
	  if(ajax.responseText.indexOf('成功')!='-1'){
		 location.reload();
	  }
　　} 
　}
　//发送空
　ajax.send(null); 
return false;
}

function autosizeimg(o,p,r)
{
if (o.style.display == 'none')
	{
	o.style.display = ''
	}
if (o.offsetWidth>p.offsetWidth*r)
	{
	var w = p.offsetWidth*r
	var h = w*o.offsetHeight/o.offsetWidth
	o.style.width = w+'px'
	o.style.height = h+'px'
	}
}