var infoid='985'; var moodzt = "0"; var http_request = false; var no = "0"; function makeRequest(url, functionName, httpType, sendData) { http_request = false; if (!httpType) httpType = "GET"; if (window.XMLHttpRequest) { // Non-IE... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/plain'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot send an XMLHTTP request'); return false; } var changefunc="http_request.onreadystatechange = "+functionName; eval (changefunc); //http_request.onreadystatechange = alertContents; http_request.open(httpType, url, true); http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); http_request.send(sendData); } function $() { var elements = new Array(); for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { offset += search.length end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function get_mood(mood_id) { //if(moodzt == "1") if (get_cookie('laoymood985')=='985') { alert("-_-|||,你不是表过态了嘛?!"); } else { url ="/xinqing.asp?action=mood&id="+infoid+"&typee="+mood_id+"&m=" + Math.random(); makeRequest(url,'return_review1','GET',''); //moodzt = "1"; document.cookie='laoymood'+infoid+'='+infoid+''; no="1"; alert("投票成功!"); } } function remood() { url ="/xinqing.asp?action=show&id="+infoid+"&m=" + Math.random(); makeRequest(url,'return_review1','GET',''); } function return_review1(ajax) { if (http_request.readyState == 4) { if (http_request.status == 200) { var str_error_num = http_request.responseText; if(str_error_num=="error") { alert("信息不存在!"); } else if(str_error_num==0) { alert("-_-|||,你不是表过态了嘛?!"); } else { moodinner(str_error_num); } } else { alert('Error'); } } } function moodinner(moodtext) { var imga = "images/pre_02.gif"; var imgb = "images/pre_01.gif"; var color1 = "#666"; var color2 = "#555"; var heightz = "80"; //图片100%时的高 var hmax = 0; var hmaxpx = 0; var heightarr = new Array(); var moodarr = moodtext.split(","); var moodzs = 0; for(k=0;k<2;k++) { moodarr[k] = parseInt(moodarr[k]); moodzs += moodarr[k]; } for(i=0;i<2;i++) { heightarr[i]= Math.round(moodarr[i]/moodzs*heightz); if(heightarr[i]<1) heightarr[i]=1; if(moodarr[i]>hmaxpx) { hmaxpx = moodarr[i]; } } for(j=0;j<2;j++) { if(moodarr[j]==hmaxpx && moodarr[j]!=0) { document.getElementById('moodinfo'+j).innerHTML = " "+moodarr[j]+""; } else { document.getElementById('moodinfo'+j).innerHTML = " "+moodarr[j]+""; } } if (no == "1") { document.getElementById('md1').innerHTML = moodarr[0]; document.getElementById('md2').innerHTML = moodarr[1]; } } document.writeln("
"); document.writeln("