﻿document.domain="361ad.com";
function Ajax_LoginShow(evt,url,Fm_width,Fm_height)
{
  evt = evt ? evt : window.event;
  
  var DIV = document.getElementById('Ajax_LoginDiv');
  var LoginBg = document.getElementById('LoginBg');
  
  var Frame = document.getElementById('Ajax_LoginFrame');

  var userX = document.body.clientWidth/2-Fm_width/2;
  var userY = 120;
  
  var width = document.body.clientWidth;
  var height = document.body.clientWidth;
    
  if (window.navigator.userAgent.indexOf("Firefox")>=1)
  {
    LoginBg.style.width = width.toString()+ "px";
    LoginBg.style.height = height.toString() + "px";
  }
  else
  {
     LoginBg.style.width = width.toString();
     LoginBg.style.height = height.toString();
  }
  
  DIV.style.left =userX + 'px';
  DIV.style.top =userY + 'px';
//  DIV.onfocus();
  Frame.style.width = Fm_width+ 'px';;
  Frame.style.height = Fm_height+ 'px';;
  Frame.src = url;
  DIV.style.display = '';
  LoginBg.style.display = '';
}
function LoginBg_Hidden()
{
  var DIV = document.getElementById('LoginBg');
  DIV.style.display = 'none';
}
function findDimensions()
{
    var DIV = document.getElementById('Ajax_LoginDiv');
  var LoginBg = document.getElementById('LoginBg');
  
  var Frame = document.getElementById('Ajax_LoginFrame');

  var userX = document.body.clientWidth/2-170;
  var userY = 250;
  
  var width = document.body.clientWidth;
  var height = document.body.clientWidth;
    
  if (window.navigator.userAgent.indexOf("Firefox")>=1)
  {
    LoginBg.style.width = width.toString()+ "px";
    LoginBg.style.height = height.toString() + "px";
  }
  else
  {
     LoginBg.style.width = width.toString();
     LoginBg.style.height = height.toString();
  }
  
  DIV.style.left =userX + 'px';
  DIV.style.top =userY + 'px';
}
window.onresize=findDimensions;
function __firefox(){
HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);
window.constructor.prototype.__defineGetter__("event", __window_event);
Event.prototype.__defineGetter__("srcElement", __event_srcElement);
}
function __element_style(){
return this.style;
}
function __window_event(){
return __window_event_constructor();
}
function __event_srcElement(){
return this.target;
}
function __window_event_constructor(){
if(document.all){
return window.event;
}
var _caller = __window_event_constructor.caller;
while(_caller!=null){
var _argument = _caller.arguments[0];
if(_argument){
var _temp = _argument.constructor;
if(_temp.toString().indexOf("Event")!=-1){
return _argument;
}
}
_caller = _caller.caller;
}
return null;
}
if(window.addEventListener){
__firefox();
} 