function printFrame(whichFrame)
{
	window.parent[whichFrame].focus();
	window.parent[whichFrame].print();
}
function isMobileNo(mobile)
{
	var mobileRegex = new RegExp("13[5-9]{1}[0-9]{8}");
	var res = mobile.match(mobileRegex);
	if(res != null)
		return true;
	else
		return false;
}
//----------------------- for table start -------------------------------
oldBackgroundColor="white";
oldColor="black";
selectedColor="#FFFFCC";
/**
鼠标经过一行时，将这行高亮显示。
*/
function mOvr(src) 
{
	if (!src.contains(event.fromElement))
	{ 
		oldBackgroundColor=src.style.backgroundColor
		if(oldBackgroundColor.length<1)
			oldBackgroundColor="white";
		oldColor=src.style.color;
		if(oldColor.length<1)
			oldColor="black";
		src.style.backgroundColor = "highlight";
		src.style.color = "white";
	}
}
/**
鼠标移开一行时，将这一行的背景色和字体色设置为原来状态
*/
function mOut(src)
{
	if (!src.contains(event.toElement)) 
	{
		with(src.style)
		{
			backgroundColor = oldBackgroundColor;
			color=oldColor;
		}
	}
}
/**
选中或取消选中所有的复选框
*/
function checkAll()
{
	var array=window.document.all("chk");
	if(document.all.checkAll.checked)
	{
		for(var i=0;i<array.length;i++)
		{
			if(array[i].value=="noneed")
				continue;
			array[i].checked=true;
			getTr(array[i]).style.backgroundColor = selectedColor;
		}
	}
	else
	{
		for(var i=0;i<array.length;i++)
		{
			if(array[i].value=="noneed")
				continue;
			array[i].checked=false;
			getTr(array[i]).style.backgroundColor = "white";
		}
	}
}
/**
根据选中状态，设定当前行的背景颜色
*/
function changeBgcolor(src)
{
	var tr=getTr(src);
	if(src.checked)
		oldBackgroundColor=selectedColor;
	else
		oldBackgroundColor="white";
}
/**
获取被选中的那一行
*/
function getTr(src)
{
	var temp=src;
	while(temp!=null && temp.tagName!="TR" && temp.tagName!="BODY")
	{
		temp=temp.parentElement;
	}
	return temp;
}
/**
查看被省略的内容
*/
function view(table,column,id,value)
{
	var s=unescape(value);
	var win=window.open();
	win.document.write("<xmp>"+s+"</xmp>");
}
/**
查看被省略的内容
*/
function viewContent(table,column,id,value)
{
	var s=unescape(value);
	var win=window.open();
	win.document.write("<xmp>"+s+"</xmp>");
}
//---------------------- for table end ----------------------------------

function mOvrText(src)
{
	with(src.style)
	{
		position="relative";
		left="1px";
		top="1px";
		cursor="hand";
	}
}
function mOutText(src)
{
	with(src.style)
	{
		position="relative";
		left="0px";
		top="0px";
	}
}
//处理双击查看详情
function view(obj)
{
	var keyFieldValue=getText(obj,1);
	form3.keyFieldValue.value=keyFieldValue;
	form3.action=form3.viewPage.value;
	form3.target="_blank";
	form3.submit();
}
function getText(source,childIndex)
{
	var temp = source;
	while ((temp != null) && (temp.tagName != "TR"))
	{
		temp = temp.parentElement;
	}
	var children = temp.children;
	var msg=children[childIndex].innerText;
	return msg;
}