﻿function pj(){
	var up=$("up");
	if(!up)return false;
	if(location.href.indexOf("c_js")>-1)return false;
	var id=parseInt(location.search.split("=")[1]);
	$("title").innerHTML+="<span id='pj_h'></span><span id='pj_c'></span><span id='pj_'></span>";
	$("pj_h").onclick=function(){pj_(0,id);}
	$("pj_c").onclick=function(){pj_(1,id);}
	$("pj_").onclick=function(){
		var pj_d=document.createElement("div");
		pj_d.id="pj_d";
		$("title").appendChild(pj_d);	
		pj_(2,id);}
	var pj_=function(a,b,c){
		var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHttp"):new XMLHttpRequest();	
		var url="pj_.asp?id="+b+"&x="+a+"&c="+c+"&d="+Math.random();
		xhr.open("GET",url,true);
		xhr.send(null);
		xhr.onreadystatechange=function(){if(xhr.readyState==4&&xhr.status==200){			
			if(a<2)alert(xhr.responseText);
			if(a==2||a==3){
				$("pj_d").innerHTML=xhr.responseText;
				$("pj_g").onclick=function(){$('title').removeChild($('pj_d'));}
				$("pj_ti").onclick=function(){pj_(3,id,encodeURIComponent($("pj_title").value));}}}}
		}}
onloadjs(pj);