

function Show_select_all(){ //显示隐藏页面中的下拉框
var T_select=document.getElementsByTagName("select")
 for(t_select_int=0;t_select_int<T_select.length;t_select_int++){
 T_select[t_select_int].style.display="";
 }
}

function Hide_select_all(){ //隐藏页面中的下拉框
var T_select=document.getElementsByTagName("select")
 for(t_select_int=0;t_select_int<T_select.length;t_select_int++){
 T_select[t_select_int].style.display="none";
 }
}

function HideShow_select(){  //显示隐藏页面中的下拉框
var T_select=document.getElementsByTagName("select")
 for(t_select_int=0;t_select_int<T_select.length;t_select_int++){
 T_select[t_select_int].style.display=T_select[t_select_int].style.display?"":"none";
 }
}


		//下面消息框---------------------------------------------------------------------------
function m_close(){
document.getElementById("m_background").style.width='0px';
document.getElementById("m_background").style.height='0px';
document.getElementById("m_background").style.display='none';
document.getElementById("m_main").style.display='none';
Show_select_all();
}

function m_show(m_enter_eval,m_title_str,m_notice_str,m_exam_str){
Hide_select_all();
var m_button_num=1;
var m_content_str="1";
var m_enter_false="";
message_show(m_button_num,m_title_str,m_notice_str,m_exam_str,m_content_str,m_enter_eval,m_enter_false);
document.getElementById("txtUserName").focus();
}

function message_show(m_button_num,m_title_str,m_notice_str,m_exam_str,m_content_str,m_enter_eval,m_enter_false){
m_show_content(m_button_num,m_title_str,m_notice_str,m_exam_str,m_content_str,m_enter_eval,m_enter_false);
document.getElementById("m_background").style.display='';
document.getElementById("m_background").style.width='100%';
if(document.documentElement.scrollTop){

 if(document.documentElement.scrollHeight>document.documentElement.clientHeight){
 document.getElementById("m_background").style.height=document.documentElement.scrollHeight+'px';
 }else{
 document.getElementById("m_background").style.height=document.documentElement.clientHeight+'px';
 }
}else{
 if(document.body.scrollHeight>document.body.clientHeight){
  document.getElementById("m_background").style.height=document.body.scrollHeight+'px';
 }else{
 document.getElementById("m_background").style.height=document.body.clientHeight+'px';
 }
}
document.getElementById("m_main").style.display='';
 if (document.getElementById("me_button_1")){
 document.getElementById("me_button_1").focus();
 }
}

function message_bg_onclick(){
try{
 if (document.getElementById("me_button_1")){
 document.getElementById("me_button_1").focus();
 }
}catch(err){
return false;
}
}

function m_show_onresize(){    //暂无用
if(J_BI("message_div").innerHTML!=""){
  if(J_BI("m_main")){
      if(J_BI("m_main").style.display==''){
	     var m_width,m_height;
         if(document.documentElement.scrollTop){
           m_width=(((document.documentElement.clientWidth)/2)-200);
           m_height=(document.documentElement.scrollTop+(document.documentElement.clientHeight)/3);
         }else{
           m_width=(((document.body.clientWidth)/2)-200);
           m_height=(document.body.scrollTop+(document.body.clientHeight)/3);
         }
		 J_BI("m_main").style.top=""+m_height+"px";
		 J_BI("m_main").style.left=""+m_width+"px";
	  }
  }
  if(J_BI("m_background")){
     if(J_BI("m_background").style.display==''){
	   if(document.documentElement.scrollTop){
          J_BI("m_background").style.height=document.documentElement.scrollHeight+'px';
       }else{
          J_BI("m_background").style.height=document.body.scrollHeight+'px';
       }
	 }
  }
}
}

function m_show_content(m_button_num,m_title_str,m_notice_str,m_exam_str,m_content_str,m_enter_eval,m_enter_false){
var m_main_width=280; //框的宽度
var m_main_title_width=250 //标题宽度
var m_main_content_width=150 //文本框宽度

var m_title_str=m_title_str;
var m_content_str=m_content_str;
var m_enter_eval=m_enter_eval; //执行事件
var m_enter_false=m_enter_false; //执行事件

var m_width,m_height;
//if(document.documentElement.clientHeight>document.body.clientHeight){
if(document.documentElement){	
m_width=(((document.documentElement.clientWidth)/2)-200);
m_height=(document.documentElement.scrollTop+(document.documentElement.clientHeight)/3);

}else{
m_width=(((document.body.clientWidth)/2)-200);
m_height=(document.body.scrollTop+(document.body.clientHeight)/3);
}
var m_bg_top='0px';
var m_bg_left='0px';

var m_show_content_str='<div id="m_background" oncontextmenu="return false" onselectstart="return false;" onclick="message_bg_onclick();" style="Z-INDEX: 1000;top:'+m_bg_top+';left:'+m_bg_left+';position:absolute;display:none;overflow:hidden;text-align:center;" class="m_div_bg"> </div><div id="m_main" class="J_div_yd" style="position:absolute; width:400px; top:150px; left:50px; Z-INDEX: 1001;display:none;left:'+m_width+'px;top:'+m_height+'px;width:'+m_main_width+'px;position:absolute;background:#fff; border:1px solid #4e86c4;" oncontextmenu="return false">'+
						'<div style="height:30px; background:#9bc2ed;">'+
						'<h4 style="width:'+m_main_title_width+'px; padding:10px 0 0 5px; font-size:12px; color:#fff; overflow:hidden; text-overflow:ellipsis;white-space:nowrap; float:left;" title="'+m_title_str+'" onselectstart="return false;" onmouseout="m_drag=0" onmouseover="m_drag=1;">'+m_title_str+'</h4>'+
						'<div style="width:14px; height:14px; margin:8px 5px 0 0; float:right;" class="m_close" title="关闭登录框" onClick="m_close();"></div>'+
						'</div>' +
						'<div style="margin:6px 6px 0 6px; padding:5px; border:1px solid #fadc80; background:#fff9e3; color:#743e04; line-height:18px;display:block;" id="m_message">'+ m_notice_str +'<br /><span style="color:#888;">'+ m_exam_str +'</span>'+
						'</div>' +
						'<div style="margin:10px 6px 0 6px; line-height:18px;text-align:center;">'+
						'	<span  style="font-weight:500;">用户名</span><input style="width:'+m_main_content_width+'px;margin-left:5px;" id="txtUserName" type="text" onKeyDown="if(window.event.keyCode==13) document.getElementById(\'txtPassword\').focus();"></input>'+
						'</div>'+
						'<div style="margin:0 6px 10 6px; padding-top:10px; line-height:18px;text-align:center;">'+
						'	<span style="font-weight:500;">密&nbsp;&nbsp;码</span><input style="width:'+m_main_content_width+'px;margin-left:5px;" id="txtPassword" type="password" onKeyDown="if(window.event.keyCode==13) {document.getElementById(\'me_button_1\').focus();document.getElementById(\'me_button_1\').click();}" ></input>'+
						'</div>'+
						'<div style="height:30px; margin-top:6px; background:#e0ecf9; border-top:1px solid #c9d7e5; text-align:center;"><input type="button" class="m_input" onclick="'+m_enter_eval+';if(!isLogin) return false;m_close();" id="me_button_1" value=" 登录 " /><input type="button" class="m_input" onclick="window.location=\'http://www.ektom.com/reginfo.aspx?url=\'+window.location.href;" value=" 注册 " /></div>'+
						'</div>';


document.getElementById("message_div").innerHTML=m_show_content_str;
if(m_notice_str=="" && m_exam_str=="")
	document.getElementById("m_message").style.display = "none";
m_show_content_str="";

}

m_drag = 0;
m_move = 0;
t_m_array=new Array("m_main");
function t_c_array(t_m_iid){t_m_array[0]=t_m_iid;}

function J_gs(d,a){
    if (d.currentStyle){ 
      var curVal=d.currentStyle[a]
    }else{ 
      var curVal=document.defaultView.getComputedStyle(d, null)[a]
    } 
    return curVal;
  }
var t_om_object;
function m_init() {

t_om_object=null;
window.document.onmousemove = m_mouseMove;
window.document.onmousedown = m_mouseDown;
window.document.onmouseup   = m_mouseUp;
//window.document.ondragstart = m_mouseStop;
}

function m_getD(f_t_om_object){
t_om_object=f_t_om_object;
if(t_om_object.className!="J_div_yd"|"undefined"){
//alert(t_om_object.id);
t_om_object = (typeof t_om_object.parentNode != "undefined")?t_om_object.parentNode:t_om_object.parentElement;
m_getD(t_om_object);
}else{
return t_om_object;
}

}

function m_mouseDown(e){
e=window.event?window.event:e;
var temp_e = (typeof e.target != "undefined")?e.target:e.srcElement;
if (m_drag) {

//t_om_object=m_getD(temp_e);
m_getD(temp_e)
 if(t_om_object.className=="J_div_yd"){
clickleft = e.clientX - parseInt(J_gs(t_om_object,"left"))|0;
clicktop = e.clientY - parseInt(J_gs(t_om_object,"top"))|0;
t_om_object.style.zIndex += 1;
m_move = 1;
 }
}
}
function m_mouseStop() {
e=window.event?window.event:e;
var temp_e = (typeof e.target != "undefined")?e.target:e.srcElement;
e.returnValue = false;}

function m_mouseMove(e) {
e=window.event?window.event:e;
var temp_e = (typeof e.target != "undefined")?e.target:e.srcElement;
if (m_move) {

//alert(e.clientX+","+clickleft);
t_om_object.style.left = (e.clientX - clickleft) +"px";
t_om_object.style.top = (e.clientY - clicktop) +"px";

}

}
function m_mouseUp()   {
	m_move = 0;
}


function m_show_message(msg){
	obj = document.getElementById('m_message');
	obj.innerHTML = msg;
	obj.style.display = 'block';
}
//document.write("<div class='J_div_yd' style='position:absolute;' oncontextmenu='return false' onselectstart='return false;'><div id='m_2_2_1' onmouseout='m_drag=0' onmouseover='m_drag=1;' >adsfasdfasdfasdf</div></div>");
