function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  return foundObj;
}
function change_tab(target)
{
for	(a=0;a<document.all.length;a++){						
if ((document.all[a].id.substr(0,4)=='htab')||(document.all[a].id=='search_result')){
document.all[a].className='clsTabBlur';
}
}
document.all["htab"+target].className='clsTabSelected';
}
function std_go(url){
common_frame.location=url;		
if (document.all("show")) show.document.location="../inc/blank.asp"
}
function _show_hidden_buMenCengCi_new(obj){
try{
if (obj.src.indexOf("plus_b.gif")>=0){
obj.src=obj.src.replace(/plus_b.gif/i,"plus_a.gif")
}else{
obj.src=obj.src.replace(/plus_a.gif/i,"plus_b.gif")
}
t=obj.parentElement.nextSibling.style;
if (t.display=="none"){
t.display="block";
}else{
t.display="none"
}
}catch(e){
}		
}
function check(theform,func)
{
var e=theform.elements;
for (var i=0,lngLeng = e.length;i<lngLeng;i++)
{
if (e[i].disabled) continue;
if (e[i].leixing==null) continue;
if (e[i].chulibz=='R') continue
var strValue;
strValue=e[i].value.replace(/^\s+|\s+$/,"");
e[i].value=strValue;
if (strValue==""){
if (e[i].allowNull==null){
if (e[i].chulibz=='M'){
_goError(e[i],func,"该项目不能为空！")
return false
}
continue
}
if (e[i].allowNull=='Y'){
continue
}
if (e[i].chulibz=='M'){
_goError(e[i],func,"该项目不能为空！")
return false
}	
switch(e[i].leixing){
case "NVC":
case "VC":
case "C":						
continue
default:
_goError(e[i],func,"该项目不能为空！")
return false
}					
}
if (e[i].value.length>e[i].maxlength&&(e[i].tagName=='TEXTAREA')){
alert (e[i].parentElement.previousSibling.innerText+"长度过长应该小于"+e[i].maxlength);
e[i].focus();
return (false);
}		
switch(e[i].leixing)
{
case 'NVC':
break
case 'VC':
break
case 'I':

if (!isintstr(strValue)){
_goError(e[i],func)
return false
}
break
case 'IP':
{
var filter=/[0-5]{1,3}.[0-5]{1,3}.[0-5]{1,3}.[0-5]{1,3}/;
if (!filter.test(strValue))
{
_goError(e[i],func)
return false
}
}
break
case 'DA':
if (!isdatestr(strValue)){
_goError(e[i],func)
return false
}
if (!isValidSmallDate(strValue)){
_goError(e[i],func,"日期超出了SmallDate的范围（1900-1-1到 2079-6-6）")
return false
}
break
case 'LDA':
if (!isdatestr_lda(strValue)){
_goError(e[i],func)
return false

}
if (!isValidSmallDate(strValue)){
_goError(e[i],func,"日期超出了SmallDate的范围（1900-1-1到 2079-6-6）")
return false
}
break
case 'DE':
if (!isDecimal(e[i].value)){
_goError(e[i],func)
return false
}	
break
case 'R':
if (!isintstr(strValue)){
_goError(e[i],func)
return false
}
break
case 'M':
if (!isMoney(e[i].value)){
_goError(e[i],func)
return false
}	
break
case 'SJ':					
if (!(/^(([0-1][0-9])|([2][0-3])|[0-9]):(([0][0-9]|([1-5][0-9]|[0-9])))$/.test(strValue))){
_goError(e[i],func)
return false
}
case 'DASJ':	
if (!isDASJ(e[i].value)){
_goError(e[i].value,func)
return false
}
case 'LLDA':
if (!isLLDA(e[i].value)){
_goError(e[i],func)
return false
}	
break
case 'Y':
break
case 'YM':
break
}
}				
return true
}
function _goError(e,func,s){
if (s!=null) alert(e.parentElement.previousSibling.innerText+s)
else	alert(e.parentElement.previousSibling.innerText+"类型错误");

if (func!=null) {
func(e)
}
else{			
e.focus();			
}
}
function _selItem(item1,item2)
{
var option1 = document.all(item1).options
var option2 = document.all(item2).options
var arrText = new Array();
var arrValue = new Array();
var j;
j = 0;
for(var i=option1.length-1;i>=0;i--)
{
if (option1(i).selected)
{
arrText[j]=option1(i).text;
arrValue[j]=option1(i).value;
option1.remove(i);
j = j + 1;
}
}
for(i=arrText.length-1;i>=0;i--)
{
var oOption = document.createElement("OPTION");
option2.add(oOption);
oOption.innerText = arrText[i];
oOption.value = arrValue[i];		
}
}
function _rollup(sel_item)
{
var option = document.all(sel_item).options
var value
var text
if (document.all(sel_item).options.length == 0) return false
if (document.all(sel_item).selectedIndex == 0) return false
for (var i=0;i<option.length;i++)
{
if (option(i).selected)
{
value = option(i-1).value
text  = option(i-1).innerText
option(i-1).value = option(i).value
option(i-1).innerText = option(i).innerText
option(i).value = value
option(i).innerText = text
option(i-1).selected=true
option(i).selected=false
}
}
}
function _rolldown(sel_item)
{
var option = document.all(sel_item).options
var value
var text
if (document.all(sel_item).selectedIndex == option.length-1) return false
for (var i=option.length-1;i>=0;i--)
{
if (option(i).selected)
{
if (i==(option.length-1)) return false
value = option(i+1).value
text  = option(i+1).innerText
option(i+1).value = option(i).value
option(i+1).innerText = option(i).innerText
option(i).value = value
option(i).innerText = text
option(i+1).selected=true
option(i).selected=false
}
}
}
function _delete(thisform)
{
if (confirm("危险操作,您确信删除?"))
return true
else
return false
}
function getToday()
{
var d = new Date()
return d.getYear()+'/'+(d.getMonth()+1)+'/'+d.getDate()
}	
function getTotime()
{
var d = new Date()
var s= d.getYear()+'/';
s += formatInt((d.getMonth()+1))+'/';
s += formatInt(d.getDate())+' ';
s += formatInt(d.getHours())+':'
s += formatInt(d.getMinutes())+':'
s += formatInt(d.getSeconds())
return s
}
function formatInt(value)
{
if (value<10)
{
return '0'+value
}
else
{
return ''+value
}
}
function getDateFormat10(d)
{
if (d=="") return ''
var arrDa
arrDa = d.split("-")
var s
s = formatInt(arrDa[0])+'-'+formatInt(arrDa[1])+'-'+formatInt(arrDa[2])
return s
}	
function checkAllItemsISNull(thisform)	{
var e=theform.elements;
var flag = 0;
for (var i=0,lngLeng = e.length;i<lngLeng;i++)
{
if (e[i].type=="text")	{
alert(e[i].value);
if (e[i].value!="") 
flag = 1;				
}
}
if (flag == 0)	{
alert("error");
return false;
}
else
return true;	
}	
function changeHints(subject,spanid,strlen){
var l=strlength(subject.value)
if (l<=strlen) {
var templen = strlen-l
if (document.all!=null) document.all(spanid).innerHTML="<font color=blue>还可以输入"+templen+"字符</font>"
}
else{
if (document.all!=null) {
document.all(spanid).innerHTML="<font color=red>输入的字节数超出"+strlen+"字符</font>"
}
}
return true
}	
function strlength(str){
var l=str.length;
var n=l
for (var i=0;i<l;i++)
{
if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
}
return n
}
function  selectOther(obj)  
{  
for(var  i  =  0;i<obj.elements.length;i++)  
if(obj.elements[i].type  ==  "checkbox"  )  
{  
if(!obj.elements[i].checked)  
obj.elements[i].checked  =  true;  
else  
obj.elements[i].checked  =  false;  
}  
}
function left_menu(meval)
{
var left_n=eval(meval);
if (left_n.style.display=="none")
{ eval(meval+".style.display='';"); }
else
{ eval(meval+".style.display='none';"); }
}
function ShowAnswer(OBJ) {
if (OBJ == "1") {   
faq_1.style.display = "";
faq_2.style.display = "none";
faq_3.style.display = "none";
faq_4.style.display = "none";
}else if (OBJ == "2") {   
faq_1.style.display = "none";
faq_2.style.display = "";
faq_3.style.display = "none";
faq_4.style.display = "none";
}else if (OBJ == "3") {   
faq_1.style.display = "none";
faq_2.style.display = "none";
faq_3.style.display = "";
faq_4.style.display = "none";
}else {   
faq_1.style.display = "none";
faq_2.style.display = "none";
faq_3.style.display = "none";
faq_4.style.display = "";
}
}
