function clin_js()
{
this.menu_list;
this.menu_name;
this.menu_status;

this.ceil_my_file=function(a1,a2,a3,a4,a5,a6,a7)
{
if(a1 && document.getElementById(a1) && a2 && document.getElementById(a2) && a3)
{
if(a4)
{
var b1=eval(a6+".get_some_file_text('"+a1+"','"+a3+"','"+a4+"','"+a5+"','"+a7+"')");
alert(b1)
b1=b1.split('</head>');
b2=b1[0]?b1[1]:b1[0];
alert(b2)
document.getElementById(a1).innerHTML=b2;
}
else
{
alert(a3);
alert();
document.getElementById(a1).innerHTML=a3;
}
}
}

this.get_some_file_text=function(a1,a2,a3,a4,a5)
{
//('file_<?php echo 文件的ID号; ?>','文字内容','多少个字')
if(a1 && a2 && a3 && document.getElementById(a1))
{
var b3=a4*a3;
var b4=(a4+1)*a3;
var b1=a2.substr(b3,b4);
b2=(a2.length>b3 && a2.length>b4)?(a5==1?"(Continued......)":"（待续……）"):"";
return b1+b2;
}
}

this.get_some_text=function(a1,a2,a3,a4)
{
//('file_<?php echo 文件的ID号; ?>','文字内容','多少个字')
if(a1 && a2 && a3 && document.getElementById(a1))
{
var b1=a2.substr(0,a3);
b2=a2.length>a3?(a4==1?"......":"……"):"";
document.getElementById(a1).innerHTML=b1+b2;
}
}

this.view_back=function(a1,a2,a3,a4)
{
if(document.getElementById(a1) && document.getElementById(a2))
{
var b1=document.getElementById(a1);
var b2=document.getElementById(a2);
if(b2.style.display=='none')
{
b2.style.display="";
b1.innerHTML=a4;
}
else
{
b2.style.display="none";
b1.innerHTML=a3;
}
}
}
this.resizeimage=function(obj, MaxW, MaxH)
{
	
 var imageObject = obj;
    var state = imageObject.readyState;
 if(state!='complete') 
 {
        setTimeout("resizeImage("+imageObject+","+MaxW+","+MaxH+")",50);
  return;
    }
    var oldImage = new Image();
    oldImage.src = imageObject.src;
    var dW = oldImage.width; 
    var dH = oldImage.height;
    
    if(dW>MaxW || dH>MaxH) 
    {
    	 MaxW=(MaxW && MaxW>0)?MaxW:0;
	     MaxH=(MaxH && MaxH>0)?MaxH:0;
        a=MaxW>0?(dW/MaxW):0; 
        b=MaxH>0?(dH/MaxH):0;
        if(b>a)
        {
        	a = b;
        }
        dW = dW/a;
        dH = dH/a;
         
    }

    if(dW > 0 && dH > 0) 
 {
        imageObject.width = dW;
  imageObject.height = dH;
 }

}

this.open_menu=function(a1,a2)
{
if(a1)
{
a2==1?document.location=a1:window.open(a1);
}
}
this.make_json=function(my_text)
{
if(my_text)
{
return eval(my_text);
}
}
this.view_menu=function(menu_type,now_menu,menu_list,menuname)
{
menuname=menuname?menuname:'smenu';
this.view_menu_a(now_menu,menu_list,menuname,menu_type);
this.menu_list=menu_list;
this.menu_name=menuname;
this.menu_status=0;
}
this.none_menu=function()
{
if(this.menu_list && this.menu_name && this.menu_status==1)
{
my_menulist=this.menu_list.split('^');
document.getElementById(this.menu_name+'0')?document.getElementById(this.menu_name+'0').style.display="none":"";
for(i=0;i<my_menulist.length;i++)
{
document.getElementById(this.menu_name+my_menulist[i])?document.getElementById(this.menu_name+my_menulist[i]).style.display="none":"";
}
}
}
this.out_none_menu=function()
{
this.menu_status=1;
setTimeout("page.none_menu()",300);
}
this.view_menu_a=function(now_menu,menu_list,menuname,menu_type)
{
//menulist=menu_list.split('^');
//document.getElementById(menuname+'0')?document.getElementById(menuname+'0').style.display="none":"";
//for(i=0;i<menulist.length;i++)
//{
//document.getElementById(menuname+menulist[i])?document.getElementById(menuname+menulist[i]).style.display="none":"";
//}
this.none_menu();

if(now_menu)
{
em1=now_menu.getAttribute("ema");
if(document.getElementById(em1))
{
document.getElementById(em1).style.display="";
this.set_this_xy(now_menu,document.getElementById(em1),menu_type);
}
}
this.can_view_menu(now_menu);

//this.set_this_xy(obj,document.getElementById(menu_html+menu_id),1);
}

this.can_view_menu=function(now_menu)
{
if(now_menu)
{
em2=now_menu.getAttribute("emb");
document.getElementById(em2)?document.getElementById(em2).style.display="":"";
em3=document.getElementById(em2)?document.getElementById(em2).getAttribute("em"):"";
document.getElementById(em3)?this.can_view_menu(document.getElementById(em3)):"";
}
}


this.getPosition=function(el) 
{
for (var lx=0,ly=0;el!=null;lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent); 
return {x:lx,y:ly} 
}
this.set_this_xy=function(a1,a2,a3)
{
if(a1 && a2 && a3)
{
if(a3==1)
{
a2.style.left=this.getPosition(a1).x;
a2.style.top=this.getPosition(a1).y+a1.offsetHeight;

}
else
{
a2.style.left=(this.getPosition(a1).x+a1.offsetWidth);
a2.style.top=this.getPosition(a1).y;
}
}
}



this.change_bg_text=function(a1,a2,a3,a4)
{
//a1:总共有几个
//a2:现在第几个
//a3:当前背景改为图片
//a4:其它背景改为图片
//alert(a1+"//"+a2+"//"+a3+"//"+a4)
try
{
if(a1 && a2 && a3>=0 && a4>=0)
{
for(i=1;i<(a1*1+1);i++)
{
//document.getElementById("bg"+i)?document.getElementById("bg"+i).background=a4:'';
//document.getElementById("table"+i)?document.getElementById("table"+i).style.display='none':'';
document.getElementById("bg"+i)?this.change_img(a3,2,"bg"+i):"";
document.getElementById("table"+i)?document.getElementById("table"+i).style.display='none':'';
}
document.getElementById("bg"+a2)?this.change_img(a4,2,"bg"+a2):"";
document.getElementById("table"+a2)?document.getElementById("table"+a2).style.display='':'';
}
}
catch(e)
{
}
}







this.enter_menu1=function(a1,a2,a3)
{
if(a2)
{
var b1=a2.split("^");
for(i=0;i<b1.length;i++)
{
document.getElementById(a3+b1[i])?document.getElementById(a3+b1[i]).style.display="none":"";
}
}
document.getElementById(a3+a1)?document.getElementById(a3+a1).style.display="":"";
}
//=========================================
this.key_post_find=function(form_name,key_name,time_name,type_name,menu_name,num_name,action_name)
{
if(window.event.keyCode==13)
{
this.post_find(form_name,key_name,time_name,type_name,menu_name,num_name,action_name);
}
}
this.post_find=function(form_name,key_name,time_name,type_name,menu_name,num_name,action_name)
{

}
//=========================================
this.goto_link_select=function(a1)
{
if(a1)
{
var b1=a1.options[a1.options.selectedIndex].getAttribute("value");
var b2=a1.options[a1.options.selectedIndex].getAttribute("em");
if(b1)
{
if(b2=="_self")
{
document.location.href=b1;
}
if(b2=="_blank")
{
window.open(b1);
}
}
a1.options[0].selected=true;
}
}


this.keyup_user_in=function(a1)
{
if(window.event.keyCode==13)
{
if(document.logoin && document.logoin.user_name && document.logoin.user_passwd)
{
this.user_in(a1);
}
else
{
eval('this.'+a1+'()');
}
}
}
this.user_in=function(a1)
{
var b1=(a1==2?'Import your consumer please!':'请输入您的用户名！');
var b2=(a1==2?'Import your consumer password please!':'请输入您的用户密码！');
var b3=(a1==2?'Seem as if problem contact with administrative person please a little bit! !':'好像有点问题吧，请与管理员联系！！');
try
{
var c1=document.logoin.user_name;
var c2=document.logoin.user_passwd;
if(c1.value)
{
if(c2.value)
{
document.logoin.submit();
}
else
{
alert(b2);
}
}
else
{
alert(b1);
}
}
catch(E)
{
alert(b3);
}
}



this.user_out=function(a1)
{
var a2=(a1==1?'您确定要退出本次登陆吗？':'Do you need to remove from capital landing time for sure?');
if(confirm(a2))
{
document.location="../../admin/outlogo/";
}
}
this.user_out2=function(a1,a2)
{
if(a2)
{
var a3=(a1?'您确定要退出本次登陆吗？':'Do you need to remove from capital landing time for sure?');
if(confirm(a3))
{
document.location=a2;
}
}
}
this.user_admin=function()
{
document.location="../../admin/";
}
this.user_add=function(a1)
{
if(a1)
{
 if(   document.all   ) //IE   
  {   
 showModalDialog(a1,window,'dialogWidth=500px;dialogHeight=320px;help=no;status=no;'); 
  }   
  else   
  {
  window.open(a1,null,'width=500,height=320,menubar=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes');   
  }
}
}
this.test_reg_user=function(a1,a2,a3,a4,a5,a6,a7,a8,a9)
{
//a1:用户名;a2:真实姓名;a3:密码;a4:验证密码;
var b1=a1.value;
var b2=a2.value;
var b3=a3.value;
var b4=a4.value;
if(this.test_username(b1))
{
if(b2 && b2!="undefined")
{
if(b3 && b3!="undefined")
{
if(b3==b4)
{
return 'ok';
}
else
{
return a8;
}
}
else
{
return a7;
}
}
else
{
return a9;
}
}
else
{
return a6;
}
}
this.test_username=function(b1)
{
//a1:用户名;a2:真实姓名;a3:密码;a4:验证密码;
var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]){5,19}$/; 
if(b1 && patrn.exec(b1))
{
return true;
}
}
this.tongji_sub=function(a1,a2,a3,a4,a5)   //表单名,统计的变量名,此统计的ID号,中英文,AJAX路径
{
var aa1=(a4?'Has not made the choice, is unable to submit! ! ':'没有作出选择，无法提交！！');
var aa2=(a4?'The correlation object, has not been unable to submit! ! ':'没有相关的对象，无法提交！！');
var aa3=(a4?'Submits when the information has the mistake, after please renovate the page to try again! !':'提交信息时发生错误，请刷新页面后再试试！！');
try
{
if(a1 && a2 && a3 && eval("document."+a1) && eval("document."+a1+"."+a2) && a5)
{
var end_var='';
b1=eval("document."+a1+"."+a2);
for(i=0;i<b1.length;i++)
{
if(b1[i].checked==true)
{
end_var=end_var?(end_var+","+(i+1)):(i+1);
}
}
if(end_var)
{
var c2="tongji_id="+a3+"&tongji_one="+end_var;
var c3=this.send_ajax_message("POST",a5,c2,a4);
//alert(end_var)
if(c3)
{
c4=c3.split('^');
c4[0]=='tongji'?alert(c4[1]):'';
eval("document."+a1+".reset()");
}
}
else
{
alert(aa1);	
}
}
else
{
alert(aa2);
}

}
catch(e)
{
alert(aa3);
}

}
this.tongji_view=function(a1,a2)
{
var b2=(a2==1?'Examined when this statistics has the mistake, after please renovate the page to try again! !':'查看此统计时发生错误，请刷新页面后再试试！！');
try
{
if(a1)
{
this.open_dialog(a1);
}
}
catch(e)
{
alert(b2+a1);
}
}
this.xmlHttp;
this.creatXMLHttpRequest=function(a1)
{
  try 
	  {
    this.xmlHttp = new XMLHttpRequest();
      } 
  catch (trymicrosoft) 
	  {
    try 
	  {
      this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      } 
	catch (othermicrosoft) 
	  {
      try 
	  {
      this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
       } 
	   catch (failed) 
	   {
       this.xmlHttp = false;
       }
       }
       }

  if (!this.xmlHttp)
       {
    alert(a1)
       }
	
}

this.send_ajax_message=function(type,url,db_array,a1)   
{
//type:post,get;URL:地址；db_array:需要提交的数据    A1：可中文还是英文；	
var b1=(a1*1==2)?'The procedure appears fatally is wrong, you are unable normally touse!':'程序出现致命错误，您无法正常使用！';
var c1=(a1*1==2)?'Is processing...':'正在处理...';
var c2=(a1*1==2)?'Completes':'完成';
var c3=(a1*1==2)?'The procedure has the mistake, please relates with the system manager!':'程序发生错误，请与系统管理员联系！';
var c4="";
                this.creatXMLHttpRequest(b1);
                this.xmlHttp.open(type,url,false);
                myxmlHttp=this.xmlHttp;

                this.xmlHttp.onreadystatechange =function()
				{
				if(myxmlHttp.readyState == 1) {         
                        window.status = c1;
                }
                if(myxmlHttp.readyState == 4) {
                        if(myxmlHttp.status == 200) {
                        window.status=c2;
						try
						{
                        c4=myxmlHttp.responseText;
						}
						catch (e)
						{
						alert(c3);
						c4="";
						}
                        }
                }
        }
        
				this.xmlHttp.setRequestHeader("Content-length", db_array.length);
				this.xmlHttp.setRequestHeader('content-type','application/x-www-form-urlencoded');
        this.xmlHttp.send(db_array);
return c4;
}
}
