// JavaScript Document


	var doing = false;		//是否正在执行 ajax请求
	
		jQuery(document).ready(function(){
										
correctPNG(jQuery("#single_logo")[0]);
										/*
										
										// 本注释内容可用
			jQuery("#login_form").corner("7px");



			listVoa(0.1, '所有随时记');
		//	fixOnePng(jQuery("#footer img")[0]);
correctPNG(jQuery("#single_logo")[0]);

*/


/*
			jQuery("#page_content").corner("7px");
			jQuery("#login_form").corner("7px");


	

			// for loginAtnote button
			jQuery("#loginAtnote a").click(function(){
				doLogin();
			});
			jQuery("#user_name").keydown(function(e){
				if(e.keyCode == 13){
						doLogin();
					}
			});
			jQuery("#user_pwd").keydown(function(e){
				if(e.keyCode == 13){
						doLogin();
					}
			});



			// for joinUs button
			jQuery("#joinUs").bind("mouseover", function(){
				changeCss( jQuery(this), "joinUs_");
			});
			jQuery("#joinUs").bind("mouseout", function(){
				changeCss( jQuery(this), "joinUs");
			});
correctPNG(jQuery("#single_logo")[0]);

//	correctPNG(jQuery("#footer img")[0]);
*/
		});	

		

function listVoa(tag_id, tag_name, page){
// alert(getScrollTop());

//return;
	var query = "dt=getVoaList&tag_id="+tag_id+"&tag_name="+tag_name+"&page="+page;

	if ( doing == true )
	{
		return;
	}
	boxDiv("body",'first', 300, 30, "boxRed", "clientTop", '载入中...', 'left', 'no_autoHide', 0);
	doing = true;
	
		jQuery.ajax({
			url: "my.one_ajax.php",
			type: "post",
			data: query,
			dataType: "html",
			timeout: 0,
			success: function(msg){
				//alert(msg);
				doing = false;
				jQuery("body .boxRed").hide();
				try
				{
					var objMe = msg.evalJSON(true);
				}catch(e){
					boxDiv("body",'first', 300, 150, "boxRed", "clientCenter", msg, 'left', 'autoHide', 3000);
					return;
					}
				//alert( objMe.msgStatus);
				if ( objMe.msgStatus == "error" )	// error
				{
					if ( objMe.msgCode == "101" )	//数据库错
					{
						boxDiv("body",'first', 300, 30, "boxRed", "clientCenter", objMe.msgStr, 'center', 'autoHide', 3000);
						//window.setTimeout(function(){window.location="atnoteClientList.php"}, 1000);
						return;
					}
			
					return;
					
				}
				else
				{
					jQuery("#voa_list_ul").empty();

					// tag_info
					if ( ( objMe.tag_id == 0 ) || ( objMe.tag_id == 0.1 ) )
					{
						jQuery("#tag_info").html("&#8250;&nbsp;所有随时记");
					}
					else
					{
						jQuery("#tag_info").html("&#8250;&nbsp;"+objMe.tag_name);
					}
					
					for (i = 0; i<objMe.nums; i++)
					{
						lineX = eval('objMe.voa_' + i );
						add_date = "("+lineX.add_date + ")";
						//alert(lineX.topic);
						jQuery("#voa_list_ul").append("<li id=\"voa_list_ul_li_"+i+"\">"+add_date+"<a href=\"showAtnote.php?id="+lineX.topic_id+"\" target=\"_blank\">"+lineX.topic+"</a></li>");
						if (lineX.pic != ""){
						jQuery("#voa_list_ul").append("<img src=\""+lineX.pic+"\" border=\"0\"  />");
						}
						
					}
					
					//all_pages, all_nums
					jQuery("#page_nav_all_pages").html(objMe.all_pages);
					jQuery("#page_nav_all_nums").html(objMe.all_nums);
					
					
					
					// show split pages nav		start
					click_fun_param = ""+objMe.tag_id+",'"+objMe.tag_name+"',";
					a_str = splitPages(objMe.page, objMe.all_pages, "listVoa", click_fun_param);
					
					jQuery("#page_nav_a").html(a_str);
					changeCss(jQuery("#nav_a_"+objMe.page), "currentPageStyle");
					// show split pages nav		end
					
					
/*
{"all_pages":"1","voa_0":{"user_id":"7666","user_name":"voa","user_nick_name":"voa","topic_id":"19633","topic":"test","topic_describe":"","content":"","pic":"","tags_id":"10"},"voa_1":{"user_id":"7666","user_name":"voa","user_nick_name":"voa","topic_id":"19634","topic":"test2","topic_describe":"","content":"","pic":"","tags_id":"10"}}
*/
				}
			},
			error: function(msg){
				doing = false;
				jQuery("body .boxRed").hide();
				boxDiv("body",'first', 300, 150, "boxRed", "clientCenter", "请再试一次...", 'left', 'autoHide', 3000);
			//alert(msg.responseText); 
			}
		});
		
}

