document.onreadystatechange=function(){
	if(document.readyState.toLowerCase()=="complete")
	{
		page_init();
	}
}

function info_list_menu_over(tO){
	var tds,i;
	
	switch(tO.innerText)
	{
		case "网上报名":
			set_cycle_image(23);break;
		case "准考证打印":
			set_cycle_image(24);break;
		case "证书发放":
			set_cycle_image(25);break;
		default:
			set_cycle_image(0);break;
	}
	
	
	tds=tO.parentElement.parentElement.getElementsByTagName("td");
	for(i=0;i<tds.length;i++)
	{
		if(tds[i].getAttribute("className")!="")
		{tds[i].setAttribute("className","common");}
	}
	tO.setAttribute("className","over");
	for(i=0;i<4;i++)
	{
		document.getElementById("list_table_"+i.toString()).style.display="none";
	}
	document.getElementById("list_table_"+tO.getAttribute("my_order")).style.display="block";
}
var container_object,left_position;
var step_length=1,step_wait=50;
var lO,rO;
var the_timer;
function scroll_image_list(){
	container_object=document.getElementById("default_link_image_table_container");
	lO=document.getElementById("default_link_image_table_left");
	rO=document.getElementById("default_link_image_table_right");
	rO.innerHTML=lO.innerHTML;
	left_position=0;
	do_scroll_cycle();
}
function do_scroll_cycle()
{
	var total_width,left_distance,step_width;
	total_width=parseInt(document.getElementById("default_link_image_table").offsetWidth);
	left_distance=parseInt(rO.offsetLeft);
	step_width=parseInt(rO.offsetWidth);
	if(total_width==0 || left_position+left_distance>=total_width)
		left_position+=step_length-step_width;
	else
		left_position+=step_length;

	container_object.scrollLeft=left_position;
	the_image_timer=setTimeout("do_scroll_cycle()",step_wait);
}
function scroll_image_list_stop(){
	clearTimeout(the_image_timer);
}
function scroll_image_list_start(){
	do_scroll_cycle();
}
function jump_page(a,b,p){
	var tm="?a={a}{b_part}&p={p}";
	
	tm=tm.replace(/{a}/g,a).replace(/{p}/g,p.toString());
	if(p.length<1)
		tm=tm.replace(/{b_part}/g,"");
	else
		tm=tm.replace(/{b_part}/g,"&b="+b);
	
	window.location.href=tm;
}
function jump_search_page(tP){
	var tm="?search_content={search_content}&p={p}";
	tm=tm.replace("{p}",tP);
	tm=tm.replace("{search_content}",tS);
	window.location.href=tm;
}
function float_ad(){
	var tO,tH,tW,sT,sL,mW,mH;
	if(document.getElementById("float_ad_div")==undefined)
	{
		tO=document.createElement(ad_container);
		document.getElementsByTagName("body")[0].appendChild(tO);
		tO.innerHTML=ad_content;
	}
	else
	{
		tO=document.getElementById("float_ad_div");
	}
	

	tH=document.getElementsByTagName("body")[0].offsetHeight;
	tW=document.getElementsByTagName("body")[0].offsetWidth;
	sL=document.getElementsByTagName("body")[0].scrollLeft;
	sT=document.getElementsByTagName("body")[0].scrollTop;
	mH=tO.offsetHeight;
	mW=tO.offsetWidth;
	
	ad_left=ad_left+ad_left_step;
	ad_top=ad_top+ad_top_step;

	if(ad_left+mW>tW || ad_left<0)
	{ad_left_step=-ad_left_step;}
	if(ad_top+mH>tH || ad_top<0)
	{ad_top_step=-ad_top_step;}
	
	if(ad_left+mW>tW)
	{ad_left=tW-mW;}
	if(ad_top+mH>tH)
	{ad_top=tH-mH;}

	tO.style.left=ad_left+sL;
	tO.style.top=ad_top+sT;
	
	ad_timer=setTimeout("float_ad()",ad_time_span);
}
function over_float_ad(){
	clearTimeout(ad_timer);
}
function check_search(fO){
	if(fO.search_content.value.length<1)
	{alert("请输入搜索的内容！");fO.search_content.focus();return false;}
	return true;
}

var lan_mu_timer=null;
function page_init(){
	if(!(/\/default\.aspx/g.test(location.href) || /\/$/g.test(location.href)))
		return;
	reset_area();
}
function reset_area(){
	var _x,_y,_w,_h;
	
	_x=133-document.body.scrollLeft;_y=172-document.body.scrollTop;_w=730,_h=230;
	document.body.onmouseover=function(){
		if(event.clientX>_x && event.clientX<_x+_w && event.clientY>_y && event.clientY<_y+_h)
		{
			if(lan_mu_timer!=null)
			{clearTimeout(lan_mu_timer);lan_mu_timer=null;}
		}
		else
		{
			if(lan_mu_order!=0)
			{
				//lan_mu_timer=setTimeout("set_cycle_image(0)",500);
				lan_mu_timer=setTimeout("document.getElementById(\"td_news_list_menu\").click();",500);
			}
		}
	};
}
window.onresize=function(){reset_area();}
window.onscroll=function(){reset_area();}
