//////////////////////// //Rating //////////////////////// function rating_mOver(obj,ind) { var i; var objID = obj.id.substring(0, obj.id.length - 1); for(i = 1 ; i <= ind ; i++) document.getElementById(objID + i).src = "http://blog.nineon.com/images/rating_3.gif"; for(i = ind + 1 ; i <= 5 ; i++) document.getElementById(objID + i).src = "http://blog.nineon.com/images/rating_1.gif"; } function rating_mOut(obj, ind, rating) { var i; var objID = obj.id.substring(0, obj.id.length - 1); for(i = 1 ; i <= rating ; i++) document.getElementById(objID + i).src = "http://blog.nineon.com/images/rating_2.gif"; for(i = rating + 1 ; i <= 5 ; i++) document.getElementById(objID + i).src = "http://blog.nineon.com/images/rating_1.gif"; } function rating_mClick(obj,ind,clientID,postID,infoID,rating,ratingBy) { var xmlHttp = null; xmlHttp = GetXMLHTTPObject(); xmlHttp.open("GET","http://blog.nineon.com//rating.axd?PostID=" + postID + "&Rating=" + ind,true); xmlHttp.send(null); var objInfo = document.getElementById(infoID); var rat = (parseFloat(rating + ind) / parseFloat(ratingBy + 1)); rat = rat.toString(); if(rat.indexOf(".") > -1) { if((rat.length - (rat.indexOf(".") + 1)) > 2) { rat = rat.substring(0,rat.indexOf(".") + 3); } else if((rat.length - (rat.indexOf(".") + 1)) == 1) { rat = rat + "0"; } } else { rat = rat + ".00"; } objInfo.innerText = rat.toString() + " by " + parseFloat(ratingBy + 1); var ii ; for(ii = 1 ; ii <= parseInt(rat) ; ii++) { document.getElementById(clientID + "_ri" + ii).src = "http://blog.nineon.com/images/rating_2.gif"; } for(ii = 1 ; ii <= 5 ; ii++) { document.getElementById(clientID + "_ri" + ii).onclick = new function(){}; document.getElementById(clientID + "_ri" + ii).onmouseover = new function(){}; document.getElementById(clientID + "_ri" + ii).onmouseout = new function(){}; } document.getElementById(clientID + "_ratingTD").style.cursor = "normal"; for(ii = parseInt(rat) + 1 ; ii <= 5 ; ii++) { document.getElementById(clientID + "_ri" + ii).src = "http://blog.nineon.com/images/rating_1.gif"; } } function rating_firstLoad(clientID, rating) { var i ; for(i = 1 ; i <= rating ; i++) { document.getElementById(clientID + "_ri" + i).src = "http://blog.nineon.com/images/rating_2.gif"; } } function rating_Disable(clientID,infoID) { var i ; for(i = 1 ; i <= 5 ; i++) { document.getElementById(clientID + "_ri" + i).onclick = new function(){}; document.getElementById(clientID + "_ri" + i).onmouseover = new function(){}; document.getElementById(clientID + "_ri" + i).onmouseout = new function(){}; } document.getElementById(clientID + "_ratingTD").style.cursor = "normal"; document.getElementById(infoID).className = "lightText"; } //////////////////////// //Common //////////////////////// function GetXMLHTTPObject() { var xmlHTTPObject = null; try{ xmlHTTPObject = new XMLHttpRequest(); } catch (e){ try{ xmlHTTPObject = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ try{ xmlHTTPObject = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("Your browser does not support AJAX!"); } } } return xmlHTTPObject; }