<!--#include file="../../p_inc/Include_func.asp"-->
<!--#include file="../inc/public.asp"-->
<!--#include file="../inc/openconn.asp"-->
<%
bf=Request("bf")
IF bf="" Then
	sTitle="新闻页"
End IF
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=sTitle%>生成</title>
</head>

<body>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #E4EDF9;
}
body,td,th,p {
	font-size: 12px;
}
-->
</style>
<%IF G_JING_TAI_Print_Time="" Then G_JING_TAI_Print_Time=500%>
<script>
 var sett;
 var i=1;
function scrollWindow(){sett=setTimeout('Printout('+iii+')',<%=G_JING_TAI_Print_Time%>);}
function scrollWindow2(){
if (i%2==1){
	document.getElementById('qingtian_id').innerHTML="<font color=red>（已暂停，双击后继续！）</font>"+document.getElementById('qingtian_id').innerHTML
	clearTimeout(sett)	
}
else
	scrollWindow();
	i++;
}
//document.ondblclick=scrollWindow2;
function Instr(t1,t2,t3){
	document.getElementById('qingtian_id').innerHTML="<br><b>已生成/要生成的新闻页面条数:<font color=#FF0000>"+t1+"</font>/<font color=#FF0000><b>"+t2+"</b></font>个 √ id："+t3+"<br>"
	window.setInterval("Instr_jiange()",2000)
}
function Instr_jiange(){
	document.getElementById('qingtian_id').innerHTML=document.getElementById('qingtian_id').innerHTML+"------休息一下---------"
}

function scrollWindow4(){this.scroll(0, 6500000);sett=setTimeout('scrollWindow4()',1);}
scrollWindow4();
function scrollWindow5(){clearTimeout(sett)}

function setCookie(name, value) {
    var expdate = new Date();
    var argv = setCookie.arguments;//获得数组
    var argc = setCookie.arguments.length;//获得数组的长度
    var expires = (argc > 2) ? argv[2] : 1;//可伸长变量
    var path = (argc > 3) ? argv[3] : "/";
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    if(expires!=null){
        expdate.setTime(expdate.getTime() + ( expires*24*60*60*1000 )); //把传过来得变量变成天数
	}
    document.cookie = name + "=" + escape (value)
    +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
    +((path == null) ? "" : ("; path=" + path))
    +((domain == null) ? "" : ("; domain=" + domain))
    +((secure == true) ? "; secure" : "");
}
function getCookie(name,name1){
	var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	if(arr != null) return unescape(arr[2]); 
	return name1;
}
</script>
<%
'bf=a 就生成播放页
'bf="" 就生成新闻页


G_JING_TAI_News_detail_Flag="1"

IF G_moshi="" Then
	response.Write "<b>动态模式无需生成！</b>"
	IF request("qt_a1")="a" Then
	Else
		response.Write "<meta http-equiv=""Refresh"" content=""1;URL=../qingtiandy_News/index.asp"">"
	End IF
	response.End()	
End IF

sTitle="新闻页"



id=request("selAnnounce")
IF id="00000000" Then
	id=SessionToTxt("selAnnounce","","00")
Else
	if trim(id)="" then
		response.write "没有选择记录！"
		response.end
	Else
		id=replace(id," ","")
	end if
End IF
if trim(id)="" then
	response.write "没有记录！"
	response.end
Else
	id=replace(id," ","")
end if
id=replace(id," ","")
id=Trim(id)
%>
<p id="qingtian_id"></p>
<p id="qingtian_id2"></p>
<p></p>
<script>
var id2
id2="<%=id%>"
id2_arr=id2.split(",")


var xmlHttp
function qingtiandy_cxhr()
{
	try{
		xmlHttp=new XMLHttpRequest();
		}
	catch(e){
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}	
}

function qingtiandy_$(id){
	return document.getElementById(id);	
}


	
var iii=0
var pii=0
function Printout(ii){
	iii=ii
	var timenow = new Date().getTime();
	if(iii<id2_arr.length){
		qingtiandy_cxhr();	
		var url="Ajax_makedetailNews.asp";
		document.getElementById('qingtian_id').innerHTML="<br>"+"<b>(<span onclick=Printout("+iii+") style='cursor:pointer; text-decoration:underline'>刷新</span>)已生成/要生成的<%=sTitle%>面:<font color=#FF0000>"+(iii+1)+"</font>/<font color=#FF0000><b>"+id2_arr.length+"</b></font>个 当前ID:"+id2_arr[iii]+"<b> 等待.."
		var t_post="id="+id2_arr[iii]+"&f2=<%=G_JING_TAI_News_detail_Flag%>&bf=<%=bf%>&timenow="+timenow
		xmlHttp.open("post",url,true);
		xmlHttp.onreadystatechange=qingtiandy_ok
		xmlHttp.setRequestHeader("Content-Length",t_post.length);
		xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
		xmlHttp.send(t_post);
	}
	else{
		//document.getElementById('qingtian_id2').innerHTML="<p><b>生成完毕！</b>"
		<%
		IF request("back")<>"" Then
			response.write "window.location.href='"&request("back")&"'"
		ElseIF 	request("back2")<>"" Then
			response.Write "document.getElementById('qingtian_id2').innerHTML='<b>生成完毕！</b>'"
			
		Else	
			response.write "window.location.href='"&request.ServerVariables("HTTP_REFERER")&"'"
		End IF
		%>		
	}
}
function qingtiandy_ok(){
	if(xmlHttp.readyState==4)
	{	
		if (xmlHttp.status==200)
		{
			var temp_x=xmlHttp.responseText;
			if (temp_x!=""){
				//document.getElementById('qingtian_id').innerHTML="<br>"+"<b>(<span onclick=Printout("+(iii+1)+") style='cursor:pointer; text-decoration:underline'>刷新</span>)已生成/要生成的新闻页面:<font color=#FF0000>"+(iii+1)+"</font>/<font color=#FF0000><b>"+id2_arr.length+"</b></font>个 √ "+temp_x+"<br>"
				document.getElementById('qingtian_id').innerHTML="<br>"+"<b>(<span onclick=Printout("+(iii+1)+") style='cursor:pointer; text-decoration:underline'>刷新</span>)已生成/要生成的<%=sTitle%>:<font color=#FF0000>"+(iii+1)+"</font>/<font color=#FF0000><b>"+id2_arr.length+"</b></font>个 当前生成ID:"+id2_arr[iii]+"<b> "	
				document.getElementById('qingtian_id').innerHTML+="<b>√ "+temp_x+"</b><br>"
				setCookie("p_page_n1",(parseInt(iii)+1))
				sett=window.setTimeout("Printout("+(iii+1)+")",<%=G_JING_TAI_Print_Time%>);		
			}
		}
	}	
}
function p2(){
	Printout(parseInt(getCookie("p_page_n1",0)))
}
Printout(0)
//window.setInterval("p2()",1000*60*3)
</script>