function Msg(msg)
{
	alert(msg);
}
function search_dis(ob){  
 if (ob.style.display=="none"){
    ob.style.display="";
	window.location.href='#down';
 }else
    {ob.style.display="none";}
}
function SelectAll(){

	var flag = document.form1.allbox.checked ;
	for (var i=0;i<document.all.tags("input").length;i++){
		var e = document.form1.elements[i];
		if (document.form1.elements[i].type.toLowerCase()=='checkbox'){
			e.checked = flag ;
		}
	}
}
function SelectAll2(){
var flag = document.form1.allbox.checked ;
//alert(flag + "ok");
for (var i=0;i<document.form1.tags("input").length;i++){
	var e = document.form1.elements[i];
	if (e.type.toLowerCase()=="checkbox"){
		var name = e.id.toLowerCase() ;
		//alert(name + " - " + name.indexOf("checkbox1"));
		if (name.indexOf("chksel")>-1){
			e.checked = flag ;
		}
	}
  } 
}

var sbarbg = "" ;
function overcolor(st,bg) { 
	var bg2 = "#f9e9e9" ;
	if (bg != null)	{
		bg2 = bg ;
	}
	sbarbg = st.style.backgroundColor ;
	st.style.backgroundColor = bg2; 
}

function outcolor(st) { 
	st.style.backgroundColor = sbarbg; 
}

var irow = 0 ;
function selectArow(sObject)
{
	//Msg(document.all.jobtable.rows.length);
	for(var i=0;i<document.all.jobtable.rows.length;i++){
		color = document.all.jobtable.rows(i).bgColor ;
		document.all.jobtable.rows(i).bgColor=0xffffff;
		if ((i+1)%2==1)
		{
			document.all.jobtable.rows(i).bgColor=0xeeeeee;
		}
	}
	sObject.bgColor=0xDAE1F3;
}

function checknull(val){
	if (val == null || val == "") {
	   return true ;
	}
	return false;
}
function setStyleFocus(tipid)
{
	//Err("setStyleFocus ok")
	try {
		document.getElementById(tipid).className = "focus";
	} catch(e) {}
}
function setTdblur(tipid)
{
	try {
		var obj =_(tipid) ;
		var thisTd = obj.parentNode;
		thisTd.className = "rtTip";
	} catch(e) {}
}

function setTdFocus(tipid)
{
	try {
		var obj =_(tipid) ;
		var thisTd = obj.parentNode;
		thisTd.className = "tiptd";
	} catch(e) {}
}

function setval(obj,iMsg) {
	if (typeof obj == "string") {
		obj = _(obj);
	}
	obj.innerHTML = iMsg
}
function _(id) {
	return document.getElementById(id);
}
String.prototype.trim = function(){
	return this.replace(/(^[\s]*)|([\s]*$)/g, "");
}
function btcontroll(flag) {
	_("btsubmit").disabled = flag;
	_("btreset").disabled = flag;
}

function btndisplay(btnname,flag) {
	_(btnname).disabled = flag;
}
//ÏÔÊ¾ÌáÊ¾
function showTip(obj,isShow){
	var thisTr = obj.parentNode.parentNode
	//Msg(thisTr.tagName);
	var thisTd = obj.parentNode.parentNode.getElementsByTagName("td")[2]
	//Msg(thisTd.tagName);
	var thisTip = thisTd.getElementsByTagName("div")[0]
	//Msg(thisTip.tagName);
	if(isShow==1){
		thisTd.className="tiptd"
		thisTip.style.display="block"
	}else{
		//if(thisTr.className!="atn"){thisTip.style.display="none"}
	}
}
//ÏÔÊ¾´íÎó
function ShowAtn(obj,status){
	if (typeof obj == "string") {
		obj = _(obj);
	}
	var thisTd = obj.parentNode
	var thisTr = obj.parentNode.parentNode
	
	if(status==1){
		thisTd.className="tiptdc"
		obj.style.display="block"
		//obj.innerHTML = iMsg
		thisTr.className="atn"
	}else{
		thisTd.className="rtTip"
		thisTr.className=" "
		//obj.innerHTML = iMsg
		//obj.style.display="none"
	}
}
function ShowAtn2(obj,iMsg,status){
	if (typeof obj == "string") {
		obj = _(obj);
	}
	var thisTd = obj.parentNode
	var thisTr = obj.parentNode.parentNode
	
	if(status==1){
		thisTd.className="tiptdc"
		obj.style.display="block"
		obj.innerHTML = iMsg
		thisTr.className="atn"
	}else{
		thisTd.className="rtTip"
		thisTr.className=" "
		obj.innerHTML = iMsg
		//obj.style.display="none"
	}
}
/////
function chkint(str)
{
	var r= str.match(/^\s*[-\+]?\d+\s*$/) ;
	if(r==null){
		return false;
	}else{
		return true;
	}
}
