function public_js()
{
this.string_list=new Array();
this.img_list=new Array();
this.my_z_index=0;


//=========================================用于广告
this.advertisement_obj1;
this.advertisement_obj2;
this.advertisement_num;
this.js_name;

this.initEcAd=function(obj1,obj2,num) 
{
this.advertisement_obj1=obj1;
this.advertisement_obj2=obj2;
this.advertisement_num=num;
obj1.style.posTop = -200;
obj1.style.visibility = "visible";
obj2.style.posTop = -200;
obj2.style.visibility = "visible";
this.MoveLeftLayer();
this.MoveRightLayer();
}
this.MoveLeftLayer=function()
{
var x = 5;
var y = 100*this.advertisement_num;
var diff = (document.body.scrollTop + y - this.advertisement_obj1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
this.advertisement_obj1.style.posTop = parseInt(y);
this.advertisement_obj1.style.posLeft = x;
setTimeout("page.MoveLeftLayer();", 20);
}
this.MoveRightLayer=function()
{
var x = 5;
var y = 100*this.advertisement_num;
var diff = (document.body.scrollTop + y - this.advertisement_obj2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
this.advertisement_obj2.style.posTop = y;
this.advertisement_obj2.style.posRight = x;
setTimeout("page.MoveRightLayer();", 20);
}


//=========================================

this.set_iframe__height=function(obj)  
{
if(obj)
{
var win=obj;  
if (document.getElementById)  
{
   if (win && !window.opera)  
   {
    if (win.contentDocument && win.contentDocument.body.offsetHeight)  
     win.height = win.contentDocument.body.offsetHeight;  
    else if(win.Document && win.Document.body.scrollHeight)  
     win.height = win.Document.body.scrollHeight;  
   }  
}
}  
}


this.windows_piaofu=function()
{

}

this.ret=function(aa)
{
var a1=document.my_ret;
if(a1)
{
var a2=a1.ret4;
if(a2)
{
if(a2.value)
{
a1.submit();
}
else
{
alert((aa*1+1==1)?'请填写检索的关键词！！':'Please fill in the key word which retrieves!! ');
}
}
else
{
alert((aa*1+1==1)?'出错了，请再试试！！':'Has made a mistake, please again try!! ');
}
}
else
{
alert((aa*1+1==1)?'出错了，请再试试！！':'Has made a mistake, please again try!! ');
}
}
//=========================================
this.cut_options=function(obja)
{
if(obja)
{
for(i=1;i<obja.options.length;i++)
{
if(obja.options[i].selected==true)
{
obja.remove(i);
this.cut_options(obja);
break;
}
}
}
}
//=========================================
this.add_options=function(obja,objb)
{
if(obja && objb)
{
for(i=1;i<obja.options.length;i++)
{
if(obja.options[i].selected==true)
{
var b1=obja.options[i].value;
var b2=obja.options[i].text;
var my_status="ok";
if(b1 && b2)
{
for(m=1;m<objb.options.length;m++)
{
if(objb.options[m].value==b1)
{
my_status="error";
break;
}
}

if(my_status=="ok")
{
new_opt=document.createElement("option");
new_opt.value=b1;
new_opt.text=b2;
objb.add(new_opt);
}
}
obja.options[i].selected=false;
}
}
}
}
//=========================================
//=========================================
this.add_options_no_select=function(obja,objb)
{
if(obja && objb)
{
for(i=1;i<obja.options.length;i++)
{

var b1=obja.options[i].value;
var b2=obja.options[i].text;
var my_status="ok";
if(b1 && b2)
{
for(m=1;m<objb.options.length;m++)
{
if(objb.options[m].value==b1)
{
my_status="error";
break;
}
}

if(my_status=="ok")
{
new_opt=document.createElement("option");
new_opt.value=b1;
new_opt.text=b2;
objb.add(new_opt);
}
}

}
}
}
//=========================================
//=========================================
this.add_options2=function(obja,objb)
{
if(obja && objb)
{
for(i=1;i<obja.options.length;i++)
{
if(obja.options[i].selected==true)
{
var b1=obja.options[i].value;
var b2=obja.options[i].text;
var my_status="ok";
if(b2)
{
for(m=1;m<objb.options.length;m++)
{
if(objb.options[m].text==b2)
{
my_status="error";
break;
}
}

if(my_status=="ok")
{
new_opt=document.createElement("option");
new_opt.value=b1;
new_opt.text=b2;
objb.add(new_opt);
}
}
obja.options[i].selected=false;
}
}
}
}
//=========================================
this.load_options=function(obja,objb,my_user_list)
{
if(obja && objb)
{
var b1=obja.value;
objb.length=1;
if(b1)
{
for(i=0;i<my_user_list.length;i++)
{
var b2=my_user_list[i].split(",");
if(b2[0].match(b1))
{
new_opt=document.createElement("option");
new_opt.value=b2[0];
new_opt.text=b2[1];
objb.add(new_opt);
}
}
}
else
{
for(i=0;i<my_user_list.length;i++)
{
var b2=my_user_list[i].split(",");
new_opt=document.createElement("option");
new_opt.value=b2[0];
new_opt.text=b2[1];
objb.add(new_opt);
}
}
}
}
//=========================================
this.make_url=function(a1,a2,a3)
{
try
{
var b1=a1.split(",");
var c1=a2.split(",");
var d1=document.location.href.split("/");
var e1="";
var f1="http:/";
for(i=0;i<b1.length;i++)
{
my_status="error";	
for(m=3;m<d1.length;m+=2)
{
if(d1[m]==b1[i] && d1[m])
{
d1[m]="";
d1[m+1]="";
break;
}
}
if(my_status=="error" && c1[i]!="undefined" && c1[i])
{
e1=e1+"/"+b1[i]+"/"+c1[i];
}
}


for(i=2;i<d1.length;i++)
{
if(d1[i])
{
f1=f1+"/"+d1[i];
}
}
a4=f1+e1;
a3.action=a4;
a3.submit();
//=======================================
}
catch(e)
{
}
}


//=========================================
//=========================================
//对像位置,E是对像 返回:左边宽度,离上面的距离,对像的宽度,对像的高度
this.getIE=function(a1)
{
var b1=a1;
var t=b1.offsetTop;
var l=b1.offsetLeft;
var x1=b1.scrollWidth;
var x2=b1.scrollHeight;
while(b1=b1.offsetParent)
{
t+=b1.offsetTop;
l+=b1.offsetLeft;
}
var my_wz=new Array()
my_wz[0]=l;
my_wz[1]=t;
my_wz[2]=x1;
my_wz[3]=x2;
return my_wz;
}
//=========================================
this.parent_goto=function(a1)
{
window.close();
if(document.all)
{
dialogArguments.document.location=(a1?a1:dialogArguments.document.location);
}
else
{
window.opener.document.location=(a1?a1:window.opener.document.location);
}
}

this.set_z_index=function(a1,a2)
{
if(a1 && document.getElementById(a1))
{
a3=(a2 && a2>0)?a2:1;
this.my_z_index=this.my_z_index+a3;
document.getElementById(a1).style.zIndex=this.my_z_index;
}
}

this.close_parent_dia=function(a1)
{
if(document.all)
{
window.close();
dialogArguments.window.opener=null;
dialogArguments.window.close();
}
else
{
this.close_parent_win();  
}
}
this.close_parent_win=function()
{
window.close();
window.opener.close();  	
}

this.open_edit=function(a1,a2)
{
a4=arguments[1]?arguments[1]:780;
a5=arguments[2]?arguments[2]:600;
//a6=arguments[3]?2:1;
//var a3=((a6==1)?("窗口已打开了您是需要打开新窗口吗？\n\n如果打开新窗口那么现在的内容将不作保存！！"):("The window has opened you is needs to open the new window? \n\n ifwill open the new window that present the content not to make thepreservation! !"));
//if(this.edit)
{
//if(window.confirm(a3))
{
//this.edit.close();
window.open(a1,'','height='+a5+',width='+a4+',top=0,left=0,toolbar=no,menubar=no,scrollbars=auto, resizable=yes,location=no, status=no');
}
//else
{
//this.edit.focus();
}
}
//else
{
//this.edit=window.open (a1,'','height=600,width=780,top=0,left=0,toolbar=no,menubar=no,scrollbars=auto, resizable=yes,location=no, status=no') 
}
}
//=========================================
this.set_dialog_size=function(a1,a2,a3)
{
try
{
//改变窗口大小a1:id号  a3:加上多少；
var b1=(a2>0 && a2<3)?a2:1;
var b2=(b1==1)?'When adjustment window size has the mistake, after please renovate the page to try again! !':'调整窗口大小时发生错误，请刷新页面后再试试！！';
var b3=top.document.getElementById(a1).offsetHeight;
var b4=top.document.getElementById(a1).offsetWidth;
 if(top.document.all)
 {
if(top.window.dialogHeight)
{ 	
top.window.dialogHeight=(b3*1+a3*1)+"px";
top.window.dialogWidth=(b4*1+a3*1)+"px";
}
else
{
top.window.resizeTo(b4*1+a3*1,b3*1+a3*1);
}
}
else
	{
top.window.resizeTo(b4*1+a3*1,b3*1+a3*1);
	}
}
catch(e)
{
}
}
this.reset_win_size=function(a1,a2,a3,a4)
{
var b5=document.getElementById(a1);
if(b5)
{
var b1=(a2>0 && a2<3)?a2:1;
var b2=b1==1?'调整窗口大小时发生错误，请刷新页面后再试试！！':'When adjustment window size has the mistake, after please renovate the page to try again! !';
var b4=b5.offsetHeight;
var b3=b5.offsetWidth;
try
{
//改变窗口大小a1:id号  a3:高加上多少；
window.resizeTo(b3*1+a3*1,b4*1+a4*1);
}
catch(e)
{
}
}
}
//=========================================
this.img_w_h=function()
{
if(arguments.length>1 && arguments[0])
{
arguments[1]>=0?arguments[0].width=arguments[1]:"";
arguments[2]>=0?arguments[0].height=arguments[2]:"";
}
}
//=========================================
this.open_window=function(a1)
{
if(a1)
{
a2=arguments[1]?arguments[1]:780;
a3=arguments[2]?arguments[2]:600;
window.open (a1,'newwindow','height='+a3+',width='+a2+',top=0,left=0,toolbar=no,menubar=no,scrollbars=auto, resizable=auto,location=no, status=no');
}
}
//=========================================
this.open_dialog=function(a1)
{
try
{
if(a1)
{
var a2=arguments[1]?arguments[1]:500;
var a3=arguments[2]?arguments[2]:300;
if(document.all) //IE   
{
try
{
showModalDialog(a1,window,'dialogWidth='+a2+'px;dialogHeight='+a3+'px;help=no;status=no;');  	
}
catch(e)
{
window.open(a1 ,null,'width='+a2+',height='+a3+',menubar=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes'); 
}
}
  else
  	{
window.open(a1 ,null,'width='+a2+',height='+a3+',menubar=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes'); 
  	}
}
}
catch(e)
{
alert('error')
}
}
//=========================================
this.view_html=function(a1,a2)
{
if(document.getElementById(a1))
{
if(arguments[2] && arguments[2]>0)
{
a3=(a2.length>arguments[2]?a2.substr(0,arguments[2])+"……":a2)
}
else
{
a3=a2;
}
document.getElementById(a1).innerHTML=a3;
}
}
//=========================================
this.view_type=function(a1,a2)
{
if(a1 && document.getElementById(a1) && a2>0)
{

document.getElementById(a1).style.display=(a2==1?"none":"");
}
}
//=========================================
this.view_type2=function(a1,a2,a3,a4)
{
if(a1 && a2 && a3>0 && a3 && a3>0 && a4>0)
{
for(i=a2;i<=a3;i++)
{
if(document.getElementById(a1+i))
{
document.getElementById(a1+i).style.display=(a4==1?"none":"");
}
}
}
}
//=========================================
this.view_type3=function(a1)
{
if(a1 && document.getElementById(a1))
{
var a2=document.getElementById(a1).style.display;
document.getElementById(a1).style.display=(a2=="none"?"":"none");
}
}
//=========================================
this.change_img=function(a1,a2,a3)
{
if(a1>=0 && a2>0 && this.img_list[a1] && a3)
{
if(a2==1)
{
document.getElementById(a3)?document.getElementById(a3).src=this.img_list[a1].src:"";
if(arguments[3] && arguments[3]>=0)
{
document.getElementById(a3)?document.getElementById(a3).width=arguments[3]:"";
}
if(arguments[4] && arguments[4]>=0)
{
document.getElementById(a3)?document.getElementById(a3).height=arguments[4]:"";
}
}

if(a2==2)
{

if(arguments[3])
{
for(i=0;i<=arguments[3];i++)
{
document.getElementById(a3+i)?document.getElementById(a3+i).setAttribute("background", this.img_list[a1].src):"";	
}
}
else
{
document.getElementById(a3)?document.getElementById(a3).setAttribute("background", this.img_list[a1].src):"";	
}


}
}
}
this.change_bg_color=function(a1,a2,a3,a4)
{
for(i=0;i<a4;i++)
{
document.getElementById(a1+(i+1))?document.getElementById(a1+(i+1)).style.background="":"";
}
document.getElementById(a1+a3)?document.getElementById(a1+a3).style.background=a2:"";
}
//=========================================
this.load_img_to_list=function(a1,a2)
{
if(a1 && a2)
{
a3=a1.split(a2);
for(i=0;i<a3.length;i++)
{
this.img_list[i]=new Image;
this.img_list[i].src=a3[i];
}
}
}
//=========================================
this.load_string_to_list=function(a1,a2)
{
if(a1 && a2)
{
a3=a1.split(a2);
for(i=0;i<a3.length;i++)
{
this.string_list[i]=a3[i];
}
}
}
//=========================================
this.alert_list_num=function(a1)
{
if(a1>=0 && this.string_list[a1])
{
alert(this.string_list[a1])
}
}
//=========================================
this.png_img=function()
{
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
}
//=========================================
//a1:id号
//A2==1:中文a2==2英文
//a3:类型1:年月日 2:年月日时分 3:年月日时分秒
//a4类名
this.ymdhis=function(a1,a2,a3,a4)
{
if(a1 && a2 && a3 && a4)
{
var b1=document.getElementById(a1);
if(b1)
{
var aaaa=new Date();
var d1=aaaa.getYear();
var d2=aaaa.getMonth()*1+1;
var d3=aaaa.getDate();
var d4=aaaa.getHours();
var d5=aaaa.getMinutes();
var d6=aaaa.getSeconds();
if(a2=="1")
{
var c4=d1+"年"+d2+"月"+d3+"日";
}
else
{
var c4="Month :"+d2+" Date :"+d3+" Year :"+d1;
}
if(a3=="1")
{
c4=c4+" "+d4;
b1.innerHTML=c4;
setTimeout(a4+".ymdhis('"+a1+"','"+a2+"','"+a3+"','"+a4+"')",600000);
}
if(a3=="2")
{
c4=c4+" "+d4+":"+d5;
b1.innerHTML=c4;
setTimeout(a4+".ymdhis('"+a1+"','"+a2+"','"+a3+"','"+a4+"')",60000);
}
if(a3=="3")
{
c4=c4+" "+d4+":"+d5+"    "+d6;
b1.innerHTML=c4;
setTimeout(a4+".ymdhis('"+a1+"','"+a2+"','"+a3+"','"+a4+"')",1000);
}
}
}
}
//=========================================
}
