var logoutCalled = false;
var childWindow,isChildWindow = true;
function openLoginWindow(wname){
//var urlToOpen = "hdiits.htm?viewName=login&theme=defaulttheme";
var urlToOpen = "login.jsp";
var mwname = 'IFMS';
if( wname ){
mwname = wname;
}else{
var dt = new Date();
mwname = mwname + dt.getMilliseconds();
}
var prop = 'width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0,resizable=no,menubar=no,scrollbars=yes,toolbar=no,location=no,status=no';
childWindow= window.open(urlToOpen, mwname, prop);
child.moveTo( 0, 0 );
child.resizeTo(screen.availWidth, screen.availHeight);
child.focus();
}
window.onbeforeunload = function childClose()
{
childWindow.close();
}
var intervalID = window.setInterval(checkWindow, 500);
function checkWindow()
{
if (childWindow && childWindow.closed)
{
window.clearInterval(intervalID);
var host = window.location.host;
window.location.href = "http://" + host +"/IFMS/j_spring_security_logout";
/* if (logoutCalled==false)
{
alert("Always make proper logout");
} */
}
}
function parent_disable() {
if (childWindow && !childWindow.closed)
childWindow.focus();
}
function logoutClick() {
logoutCalled= true;
var host = window.location.host;
window.location.href = "http://" + host +"/IFMS/j_spring_security_logout";
if(logoutCalled==true)
{
window.close();
}
}
function ajaxfunctionForLogout (ctx){
var url = ctx + '/ifms.htm';
var pars = 'actionFlag=closeApplicationOnLogout';
var myAjax = new Ajax.Request(url,{
method: 'get',
parameters: pars
});
}
// Move From hdiits/web/web-inf/jsp/core/login.jsp.
function pause(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
function init()
{
document.forms[0].j_username.focus();
}
/*
function startLogin()
{
if(document.forms[0].btnSubmit.disabled==false)
{
if (document.forms[0].j_username.value=="")
{
alert("Please Enter User Name.");
document.forms[0].j_username.focus();
return false;
}
if (document.forms[0].j_password.value=="")
{
alert("Please Enter Password.");
document.forms[0].j_password.focus();
return false;
}
document.forms[0].btnSubmit.disabled = true ;
showProgressbar_login('Signing in...
Please wait...');
window.setTimeout('document.forms[0].submit();',500);
}
}
*/
function checkEnter()
{
var key;
if(window.event)
key = window.event.keyCode;
else
key = e.which;
if (key==13) {
startLogin();
}
}
function getX() {
var maxX;
maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) + (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
return maxX;
}
function Browser() {
var ua, s, i;
var maxX,maxY;
this.isIE = false; // Internet Explorer
this.isNS = false; // Netscape
this.version = null;
ua = navigator.userAgent;
s = "MSIE";
if ((i = ua.indexOf(s)) >= 0)
{
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
var maxHeight;
var d = 0.9616;
if (this.version==7)
{
maxX=getX();
var x=Math.round(maxX/1.65);
if (maxX==780)
{
x=maxX/1.3;
}
maxHeight = (screen.availHeight)*d;
var top = (maxHeight - 564)/2;
document.write("");
document.write("");
return;
}
else if(this.version==6)
{
maxHeight = screen.availHeight * d;
var top = (maxHeight - 564)/2;
document.write("");
document.write("");
return;
}
//document.write("