$(document).ready(function(){ 
	var bodyheight=document.body.clientHeight||document.documentElement.clientHeight;
	var trheight =bodyheight*0.8-160 ; if(trheight<100) trheight=100;
	$("table#tab_main td.middletr").css('height',trheight+'px');
	var bodyheight=document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body.clientHeight;
	$("div#main").css("min-height",(bodyheight-20)+'px');
	$("div#main .content").css("min-height",(bodyheight-45)+'px');
	if(top==self){
	var paramarr=[];
	paramarr['webhost'] = location.hostname ;
	paramarr['targeturl']=location.href.replace('http://','').replace(location.hostname,'');		
	$e28dd6773=$e28dd6773?$e28dd6773:request('e28dd6773').replace('_mr_','.');
	$e28dd6773=$e28dd6773?$e28dd6773:location.hostname;
	top.location.href='http://'+ $e28dd6773 +'/index.php?'+http_build_query(paramarr);
}
}); 

function changeAuthCode() { 
	var num = 	new Date().getTime();
	var rand = Math.round(Math.random() * 10000);
	num = num + rand;
	$('#ver_code').css('visibility','visible');
	if ($("#vdimgck")[0]) {
		$("#vdimgck")[0].src = "http://"+cfg_remote_host+"/include/vdimgck.php?tag=" + num;
	}
	return false;
}

function submitact(butt) {
	var redirecturl,notclose;
	redirecturl = $("input#e0f5a79e6").val();
	butt.form.e28dd6773.value = window.name.replace('_mr_','.');
	var jp= new monor_jsonp();
	jp.callbackfunc=function(data) {
		jp.localloginfinish=true;
		if(data.status=='success'){
			var tipinfo='';
			//if(data.redirecturl) redirecturl=data.redirecturl;
			if(data.info)tipinfo=data.info;
			else tipinfo=jp.default_sucmaininfo;
			
			$("div#poping .title span#poptitleinfo").html(jp.default_suctitle);
			$("div#poping .main").html(tipinfo);
			setTimeout(function(){
				//location.reload(false);
				location.href='http://'+window.name.replace('_mr_','.')+'/reload.html';						
			}, jp.timedelay);
		}else{
			jp.err_handle(data);
		}
	};
	$.poping({height:'auto'});
	$.ajax({
		type: "POST",
		url:'?eb5707348=login',
		timeout: 30000,//单位 毫秒
		cache: false,
		data: $(butt.form).serialize(),
		dataType: "json" ,
		success: function(data){			
			if(data.status=='error'){
				jp.default_errmaininfo='登陆失败，请关闭本窗口返回检查原因！';
				jp.err_handle(data);
			}else if(data.status=='success'){
				if(data.redirecturl) redirecturl=data.redirecturl;
				notclose=data.notclose;
				var remotedata={};
				remotedata['eb5707348']='login';
				remotedata['eea8f538c']=$("input#eea8f538c").val();
				remotedata['pwd']=$("input#pwd").val();
				remotedata['host']=location.hostname;
				remotedata['eae5705b5']=$("input#eae5705b5").attr('checked')?1:0;
				remotedata['e5766469a']=data.e5766469a;
				remotedata['e4335285f']=data.e4335285f;
				jp.url='http://'+window.name.replace('_mr_','.')+'/locallogin.php?eb5707348=login&callback=?';
				jp.senddata=remotedata;
				jp.default_suctitle='登陆成功';
				jp.default_errtitle='登陆失败';
				jp.default_errmaininfo='已成功远程登陆，但未能通过本地验证，请返回检查原因！';
				jp.default_sucmaininfo='登陆成功，请关闭本窗口！';

				jp.do_locallogin(data);
			}
		},
		error: function(XMLHttpRequest, textStatus, errorThrown){
			jp.default_errmaininfo='系统错误，请返回重新操作，再试一次！';
			jp.err_handle();
		}
	});		
}


$(document).ready(function(){ 
	$("#validate").keydown(function(e){ 
		if(e.which == 13){ 
		$("#Submitbut").click(); 
		return false; 
	} 
	});
}); 