204 lines
5.3 KiB
JavaScript
204 lines
5.3 KiB
JavaScript
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
$(function(){
|
|||
|
|
$(".so ul li").click(function(){
|
|||
|
|
$(".so ul li").removeClass("hover");
|
|||
|
|
$(this).addClass("hover");
|
|||
|
|
rel = $(this).attr("rel").split("|");
|
|||
|
|
$("#searchType").val(rel[0]);
|
|||
|
|
$("#rootID").val(rel[1]);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var pageurl = location.href.toLowerCase().replace("http://www.3h3.com/","").split("/");
|
|||
|
|
|
|||
|
|
var LINK = {"danji" : "2" ,"jieji" : "3" ,"moniqi" : "3" ,"patch" : "4" ,"info" : "5" ,"gl" : "6" ,"meitu" : "7" ,"video" : "8"};
|
|||
|
|
var autos = true;
|
|||
|
|
if(LINK[pageurl[0]])
|
|||
|
|
{
|
|||
|
|
$("#v"+LINK[pageurl[0]]+" a").addClass("hover");
|
|||
|
|
$("#t_m_"+LINK[pageurl[0]]+"").show();
|
|||
|
|
autos = false;
|
|||
|
|
}
|
|||
|
|
if(pageurl[1] && pageurl[1].indexOf("_") > 0)
|
|||
|
|
{
|
|||
|
|
var U = pageurl[1].split("_");
|
|||
|
|
if(U.length == 3)
|
|||
|
|
{
|
|||
|
|
$("#t_m_"+LINK[pageurl[0]]+" a").each(function(){
|
|||
|
|
if($(this).attr("href").indexOf("_"+U[1]+"_") > 0)
|
|||
|
|
{
|
|||
|
|
$(this).addClass("hover");
|
|||
|
|
autos = false;
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(autos)
|
|||
|
|
{
|
|||
|
|
$("#v1 a").addClass("hover");
|
|||
|
|
$("#t_m_2").show();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function autoSearch()
|
|||
|
|
{
|
|||
|
|
var autooptions;
|
|||
|
|
|
|||
|
|
autooptions = {
|
|||
|
|
serviceUrl:'/ajax.asp',
|
|||
|
|
minChars:1,
|
|||
|
|
delimiter: /(,|;)\s*/, // regex or character
|
|||
|
|
maxHeight:400,
|
|||
|
|
// width:300,
|
|||
|
|
zIndex: 9999,
|
|||
|
|
deferRequestBy: 0, //miliseconds
|
|||
|
|
params: {action:'15' }, //aditional parameters
|
|||
|
|
//default is false, set to true to disable caching
|
|||
|
|
// callback function:
|
|||
|
|
onSelect: function(value, data){
|
|||
|
|
|
|||
|
|
window.location=data;
|
|||
|
|
},
|
|||
|
|
// local autosugest options:
|
|||
|
|
//lookup: ['January', 'February', 'March', 'April', 'May'] //local lookup values
|
|||
|
|
noCache: true
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
if($('#keyword').length>0)
|
|||
|
|
{
|
|||
|
|
var a1 = $('#keyword').autocomplete(autooptions);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var http_request = true;
|
|||
|
|
function send_request(url,Temp,ref , tb)
|
|||
|
|
{
|
|||
|
|
http_request = false;
|
|||
|
|
|
|||
|
|
if(window.XMLHttpRequest) {
|
|||
|
|
http_request = new XMLHttpRequest();
|
|||
|
|
if (http_request.overrideMimeType) {
|
|||
|
|
http_request.overrideMimeType('text/xml');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (window.ActiveXObject) { // IE<49><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
try {
|
|||
|
|
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
|||
|
|
} catch (e) {
|
|||
|
|
try {
|
|||
|
|
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
|||
|
|
} catch (e) {}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (!http_request) {
|
|||
|
|
window.alert("<22><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>XMLHttpRequest<73><74><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>.");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
http_request.onreadystatechange = ref;
|
|||
|
|
|
|||
|
|
http_request.open("Post", url, tb);
|
|||
|
|
http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
|
|||
|
|
http_request.send(Temp);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var isVote=false;
|
|||
|
|
|
|||
|
|
function sEval(softid,num,din,cai,Tpye)
|
|||
|
|
{
|
|||
|
|
if(isVote)
|
|||
|
|
{
|
|||
|
|
alert('<27><><EFBFBD>Ѿ<EFBFBD>Ͷ<EFBFBD><CDB6>Ʊ<EFBFBD><C6B1>,<2C>벻Ҫ<EBB2BB>ظ<EFBFBD>ͶƱ,<2C><>л<EFBFBD><D0BB><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>!!')
|
|||
|
|
return
|
|||
|
|
}
|
|||
|
|
var Temp="Action=0&softid="+ escape(softid) + "&num=" +escape(num)+"&type="+ Tpye; //<2F><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
var RequestFunction=function() { //<2F><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if (http_request.readyState == 4) { // <20>ж϶<D0B6><CFB6><EFBFBD>״̬
|
|||
|
|
if (http_request.status == 200) { // <20><>Ϣ<EFBFBD>Ѿ<EFBFBD><D1BE>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>أ<EFBFBD><D8A3><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
|
ReadMark(softid,din,cai,Tpye);
|
|||
|
|
alert('ͶƱ<CDB6>ɹ<EFBFBD>!!');
|
|||
|
|
} else { //ҳ<>治<EFBFBD><E6B2BB><EFBFBD><EFBFBD>
|
|||
|
|
// alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3>");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
send_request("../ajax.asp",Temp,RequestFunction,false);
|
|||
|
|
isVote = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function ReadMark(softid,din,cai,Tpye)
|
|||
|
|
{
|
|||
|
|
var Temp="Action=1&softid="+ escape(softid)+"&type="+ Tpye; //<2F><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
var RequestFunction=function() {
|
|||
|
|
if (http_request.readyState == 4) {
|
|||
|
|
if (http_request.status == 200) {
|
|||
|
|
var TempText=http_request.responseText;
|
|||
|
|
document.getElementById("pding").getElementsByTagName("span")[0].innerHTML = TempText.split("|")[0];
|
|||
|
|
document.getElementById("pcai").getElementsByTagName("span")[0].innerHTML = TempText.split("|")[1];
|
|||
|
|
document.getElementById("rankstar").innerHTML = '<img src="/template/3h3/images/star/'+(TempText.split("|")[2])+'.gif" /><b>'+(TempText.split("|")[3])+'</b>';
|
|||
|
|
} else {
|
|||
|
|
// alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD>쳣");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
send_request("../ajax.asp",Temp,RequestFunction,false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function ngsEval(id,goodid,badid,verid,type)
|
|||
|
|
{
|
|||
|
|
var objgood = $(goodid);
|
|||
|
|
var objbad = $(badid);
|
|||
|
|
|
|||
|
|
//objgood.css({cursor:"pointer"});
|
|||
|
|
ngSendEval(id,goodid,badid,verid,0,type);
|
|||
|
|
objgood.click(function (){ ngSendEval(id,goodid,badid,verid,1,type) ; isVote=true; });
|
|||
|
|
objbad.click(function (){ ngSendEval(id,goodid,badid,verid,2,type); isVote=true; });
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function ngSendEval(id,goodid,badid,verid,num,type)
|
|||
|
|
{
|
|||
|
|
if(isVote && num>0)
|
|||
|
|
{
|
|||
|
|
alert('<27><><EFBFBD>Ѿ<EFBFBD>Ͷ<EFBFBD><CDB6>Ʊ<EFBFBD><C6B1>,<2C>벻Ҫ<EBB2BB>ظ<EFBFBD>ͶƱ,<2C><>л<EFBFBD><D0BB><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>!!')
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var url="action=3&id="+id+"&num="+num+"&type="+type;
|
|||
|
|
$.ajax({
|
|||
|
|
type: "POST",
|
|||
|
|
url: "/ajax.asp",
|
|||
|
|
data: url,
|
|||
|
|
success: function(msg){
|
|||
|
|
ListEval(goodid,badid,verid,msg);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function ListEval(goodid,badid,verid,msg){
|
|||
|
|
var objgoodb = $(goodid + " strong");
|
|||
|
|
var objbadb = $(badid + " strong");
|
|||
|
|
var dataObj=eval("("+msg+")");
|
|||
|
|
objgoodb.eq(0).html(dataObj.Num[0] );
|
|||
|
|
objbadb.eq(0).html(dataObj.Num[1] );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function ViewCmsHits(tobj,id)
|
|||
|
|
{
|
|||
|
|
var obj= document.getElementById(tobj);
|
|||
|
|
var Url="Action=4&id="+ id;
|
|||
|
|
|
|||
|
|
var ref=function()
|
|||
|
|
{
|
|||
|
|
if (http_request.readyState == 4) {
|
|||
|
|
if (http_request.status == 200) {
|
|||
|
|
var requestText=http_request.responseText;
|
|||
|
|
obj.innerHTML = requestText;
|
|||
|
|
} else {
|
|||
|
|
// alert("д<><D0B4><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD>");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
send_request("../ajax.asp",Url,ref,true);
|
|||
|
|
}
|