var _ISHOW_LOGIN_WEB_ROOT = 'passport.ispeak.cn';
document.domain='ispeak.cn';
function iShowLogin(callback,partnerId){
var callback = callback;
var partnerId = partnerId;
var maskId = '__ishow_login_mask_v1' ;
var frameId = '__ishow_login_frame_v1' ;
var reg_frameid = '__ishow_register_frame_v1' ;
var TPLId = '__ishow_login_TPL_v1' ;
this.showMain = function()
{
mask();
loginframe();
};
this.register = function()
{
mask();
registerframe();
};
this.CancelMain = function()
{
try{parent.document.body.removeChild(Get(maskId));}catch(e){}
try{parent.document.body.removeChild(Get(frameId));}catch(e){}
try{parent.document.body.removeChild(Get(reg_frameid));}catch(e){}
};
this.TPL = function(tplname)
{
TPL_frame(tplname);
}
this.Get=function(id)
{
return parent.document.getElementById(id);
};
var isIe6 = function ()
{
var isIE=!!window.ActiveXObject;
return isIE&&!window.XMLHttpRequest;
};
var mask = function()
{
if(Get(maskId)){return ;}
if(isIe6()){parent.document.body.style.margin='0';parent.document.body.style.height='100%';parent.document.getElementsByTagName('html')[0].style.height='100%'}
var maskdiv = parent.document.createElement('div');
maskdiv.id = maskId;
maskdiv.style.cssText = "position:fixed; top:0; left:0; z-index:999990; width:100%; height:100%; background:#000; filter:alpha(opacity=50); opacity:0.5;";
if(isIe6() || getIEversion()==7)
{
maskdiv.style.position='absolute';
var h = parent.document.body.scrollHeight;
if(window.screen.availHeight>h)h=window.screen.availHeight;
maskdiv.style.height=h+20+'px';
}
parent.document.body.appendChild(maskdiv);
};
var loginframe = function()
{
if(Get(frameId)){return ;}
if(Get(reg_frameid)){parent.document.body.removeChild(Get(reg_frameid));}
var framediv = parent.document.createElement('div');
framediv.id = frameId;
framediv.style.cssText = "position:fixed; z-index:999991; width:630px; height:306px;background:#fff;top:50%;left:50%;margin-top:-155px;margin-left:-315px;overflow:hidden";
framediv.innerHTML = '';
if(isIe6() || getIEversion()==7)
{
framediv.style.position='absolute';
}
parent.document.body.appendChild(framediv);
};
var registerframe = function()
{
if(Get(reg_frameid)){return ;}
if(Get(frameId)){parent.document.body.removeChild(Get(frameId));}
var framediv = parent.document.createElement('div');
framediv.id = reg_frameid;
framediv.style.cssText = "position:fixed; z-index:999991; width:630px; height:450px;background:#fff;top:50%;left:50%;margin-top:-225px;margin-left:-315px;overflow:hidden";
framediv.innerHTML = '';
if(isIe6() || getIEversion()==7)
{
framediv.style.position='absolute';
}
parent.document.body.appendChild(framediv);
};
var Get=this.Get;
}
function ishow_go_login(callback,partnerId)
{
var iLogin = new iShowLogin(callback,partnerId);
iLogin.showMain();
}
function ishow_cancel_login()
{
var iLogin = new iShowLogin();
iLogin.CancelMain();
}
function ishow_tpl_login(callback,tplname)
{
var iLogin = new iShowLogin(callback);
iLogin.TPL(tplname);
}
function isIE()
{
var s = navigator.userAgent;
if(s.indexOf("MSIE")>0)
{
return true;
}
return false;
}
function getIEversion()
{
if(isIE())
{
var version = navigator.appVersion;
var start = version.indexOf("MSIE");
var temp = version.slice(start+5, start+6);
return parseInt(temp);
}
return 1;
}
function ishow_tpl_register(callback,tplname)
{
var iLogin = new iShowLogin(callback,tplname);
iLogin.register();
}