var agt = navigator.userAgent.toLowerCase();
//if (agt.indexOf('msie') == -1) alert('您使用的浏览器不是IE,鉴于饱蠹模块对IE支持比较好,所以推荐使用IE浏览.');

/*
// ##################################################
// for debug
// ##################################################
*/
if( 0)
	window.onerror = function( msg, url, line){
	/*
	var str = "脚本运行出错:\n";
	str += "\nURL : " + url;
	str += "\nErr : " + msg;
	str += "\nLine: " + line;
	alert(str);
	//*/
	window.status = line + " -> " + msg;
	return true;
}

/*
// ##################################################
// for is_ie
// ##################################################
*/
function is_ie(){
	if( navigator.appVersion.indexOf('MSIE') > 0) return true;
	return false
}

/*
// ##################################################
// for debug
// ##################################################
*/
function get_obj( o){
	return document.getElementById( o);
}

/*
// ##################################################
// for center
// ##################################################
*/
function center( o){
	o.style.left = (document.body.clientWidth - o.clientWidth) / 2;
	o.style.top = (document.body.clientHeight - o.clientHeight) / 2 + document.body.scrollTop;
}

/*
// ##################################################
// for hidden_all_input
// ##################################################
*/
function hidden_all_input( bool){
	var s = document.getElementsByTagName('SELECT');
	for(i = 0; i < s.length; i++){
		var name = s[i].tagName;
		if( name == 'SELECT'){
			if( bool) s[i].style.display = 'none';
			else s[i].style.display = '';
		}
	}
}

var close_window_msg = function(){
	var o = document.getElementById('window_msg');
	if( o.style.visibility == 'visible') show_msg( '', false);
}
/*
// ##################################################
// for show_msg
// ##################################################
*/
document.write( "<div style='position: absolute;top: 0;left: 0;background:#CCCCCC;filter:alpha(opacity=50);-moz-opacity:0.50;opacity: 0.5;z-index:5;' id='window_msg_'></div><span id=window_msg style='visibility:hidden'></span>");
//show_msg('正在加载...',false);
function msg_center(o){
	o.style.left = (document.body.clientWidth - o.clientWidth) / 2;
	o.style.top = (document.body.clientHeight - o.clientHeight) / 2 + document.body.scrollTop;
}
function show_msg( str, bool){
	var o = document.getElementById('window_msg');
	var oo = document.getElementById('window_msg_');
	//str += '<div style="text-align:center;margin: 10px 0px 0px 0px;padding:2px 0px 0px 0px;border-top:1px #999999 dotted"><button style="border:1px #7BA6E7 solid;background:white" onclick="close_window_msg()">关闭</button></div>';
	str = '<span style="text-align:center;width:20px;height:20px;margin:-13px 0px 0px -13px;background:#7BA6E7;color:white;cursor:pointer" onclick="close_window_msg()"><b>X</b></span>' + str;
	o.innerHTML = str;
	msg_center(o);
	oo.style.width=document.body.scrollWidth;
	oo.style.height=document.body.scrollHeight;
	hidden_all_input( bool);
	if( bool){
		oo.style.visibility = 'visible';
		o.style.visibility = 'visible';
	}
	else{
		oo.style.visibility = 'hidden';
		o.style.visibility = 'hidden';
	}
}

function user_man( html){
	var o = document.getElementById('window_msg');
	var oo = document.getElementById('window_msg_');
	o.innerHTML = html;
	msg_center(o);
	oo.style.width=document.body.scrollWidth;
	oo.style.height=document.body.scrollHeight;
	hidden_all_input( true);
	oo.style.visibility = 'visible';
	o.style.visibility = 'visible';
}

/*
// ##################################################
// get url's ext
// get_ext( [String], [String|Number]);
// eg: alert( get_ext( "http://www.test.com/test.html?A=aa&B=bb", "A"));
// ##################################################
*/
get_ext = function( href, ext_name){
	if( href == null) return null;

	addr = href.indexOf("?");
	if( addr > 1) ext = href.substring( href.indexOf("?")+1, href.length);
	else ext = "";

	if( ext_name == null) return ext;

	ext_array = ext.split( "&");
	for( i=0;i<ext_array.length;i++){
		ext_item_array = ext_array[i].split( "=");
		if( ext_name.constructor == String)
			if( ext_name == ext_item_array[0])
				return ext_item_array[1];
		if( ext_name.constructor == Number)
			if( ext_name == i)
				return ext_item_array[1];
	}
	return null;
}

/*
// ##################################################
// get url's filename
// urlgetfilename( [String]);
// eg: alert( urlgetfilename( "http://www.test.com/test.html?a=b"));
// return test.html
// ##################################################
*/
url_get_filename = function( url){
	url_array = url.split( "/");
	if( url_array.length > 1){
		filename = url_array[url_array.length-1];
		addr = filename.indexOf("?");
		if( addr > 1) filename = filename.substring( 0, addr);
		return filename;
	}
	else
		return null;
}

document.write( "<script id=script_for_defer defer></script>");

		function mOvrBgColor(o,color){ if (!o.contains(event.fromElement)){o.style.background = color}}
		function mOutBgColor(o,color){ if (!o.contains(event.toElement)){o.style.background = color}}
		function ltoolsOvr(o,color){ if (!o.contains(event.fromElement)){o.style.background = color;/* o.backgroundImage = "url(../images/l_tools_back.gif)"; o.backgroundPosition = "right"}; o.style.backgroundRepeat = "no-repeat"*/}}
		function ltoolsOut(o,color){ if (!o.contains(event.toElement)){o.style.background = color; }}
		function rtoolsOvr(o){ if (!o.contains(event.fromElement)){o.style.background = '#CAD9DD' ;/* o.backgroundImage = "url(../images/l_tools_back.gif)"; o.backgroundPosition = "right"}; o.style.backgroundRepeat = "no-repeat"*/}}
		function rtoolsOut(o){ if (!o.contains(event.toElement)){o.style.background = '#FFFFFF'; }}
		function web2Ovr(o){ if (!o.contains(event.fromElement)){o.className = 'web2ovr' ;}}
		function web2Out(o){ if (!o.contains(event.toElement)){o.className = 'web2out'; }}


function array_get_x( a, n){ a = a.split('|'); return a[n];}

// 查找此数组中是否有此数
function have_this_num( ar, n){ for( a in ar){ if( ar[a] == n) return true; } return false;}

var isBeginMove = false;	/* 是否开始移动 */
var sourceObj = null;		/* 源对象 */
var destionObj = null;		/* 目标对象 */
var bigObj = null;			/* 目标框架 */
/* 鼠标Down */
function div_m_down( obj){
	if( obj == null) return false;
	/* if( event.y > 20) return false; */
	sourceObj = obj;
	destionObj = null;
	obj.setCapture();
	obj.style.zIndex = 1;
	obj.mDownX = event.clientX;
	obj.mDownY = event.clientY;
	isBeginMove = true;
}
/* 鼠标Move */
function div_m_move( obj){
	if( !isBeginMove) return false;
	obj.style.cursor = 'move';
	obj.style.left = event.clientX-obj.mDownX;
	obj.style.top = event.clientY-obj.mDownY;
	obj.style.filter = 'Alpha(Opacity=25, FinishOpacity=25, Style=1)';
}
/* 鼠标Up */
function div_m_up( obj){
	if( !isBeginMove) return false;
	obj.style.cursor = '';
	obj.releaseCapture();
	obj.style.zIndex = 0;
	obj.style.left = 0;
	obj.style.top = 0;
	isBeginMove = false;
	window.setTimeout("insert()",1);
	obj.style.filter = '';
}
/* 鼠标Over */
function div_m_over( obj){
	if( obj == sourceObj) return false;
	destionObj = obj;
}
/* 鼠标移到框架上时 */
function div_m_bigover( obj){
	bigObj = obj;
}
/* 将源对象插入目标对象前或插入目标框架里 */
function insert(){
	if( sourceObj != null && destionObj != null) destionObj.insertAdjacentElement("beforeBegin",sourceObj);
	else if( sourceObj != null && bigObj != null) bigObj.insertAdjacentElement("beforeEnd",sourceObj);
	sourceObj = null;
	destionObj = null;
	bigObj = null;
}


/*
// ##################################################
// getNode
// getNode( xml_obj);
// ##################################################
*/
function getNode( o){
	if( o.hasChildNodes()) return o.firstChild.data;
	else return '';
}

/*
// ##################################################
// div to table
// div_to_table( arr, col, table_class);
// ##################################################
*/
function div_to_table( arr, col, table_class){
	if( col == '' || col == 0 || arr.length == 0) return '';
	if( !table_class) table_class = 'px12';
	var r = '<table class="'+table_class+'"><tr>';
	for( var i=0; i<arr.length; i++){
		if( i%col == 0) r += '</tr><tr>';
		r += '<td valign=bottom>'+arr[i]+'</td>';
	}
	r += '</tr></table>';
	return r;
 }