﻿var blnMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1) ? true : false;			
var blnNS4 = (document.layers) ? true : false;
var blnNS6 = (!document.all && document.getElementById) ? true : false;
var blnIE4 = (document.all && !document.getElementById) ? true : false;
var blnIE5 = (document.all && document.getElementById) ? true : false;																
var blnIEScreenWidth = (document.all) ? true : false;	
var TempPasswordTextBox = '';
var PasswordTextBox = '';
//***************Other Browser detection features**********************************//
//Browser detection stuff - Used this way because cant use object detection as opera and IE have same compatible objects and cant be
//tested
var appVersion = navigator.userAgent.toLowerCase();
var is_opera = (appVersion.indexOf("opera") != -1 || appVersion.indexOf("opera") != -1);
var is_firefox = (appVersion.indexOf("firefox") != -1 || appVersion.indexOf("firefox") != -1);
var is_mozilla = (appVersion.indexOf("gecko") != -1 && appVersion.indexOf("firefox") == -1);
var is_safari = (appVersion.indexOf("safari") != -1);
var is_ie8 = (appVersion.indexOf("msie 8.0") != -1);
var is_ie7 = (appVersion.indexOf("msie 7.0") != -1);
var is_ie6 = (appVersion.indexOf("msie 6.0") != -1);

//Sets and returns the screen height for the given browser
function SetScreenWidth() {
	if(blnIEScreenWidth && !blnMac) { 
		return "document.body.clientWidth";
	} else {
		return "self.innerWidth";
	}
}	
		
//Gets the returned value from ftnObjSetScreenWidth() and eval() to return the screen width
function GetScreenWidth() {
	return eval(SetScreenWidth());
}

//Sets and returns the screen height for the given browser
function SetScreenHeight() {
	if(blnIEScreenWidth && !blnMac) { 
		return "document.body.clientHeight";
	} else {
		return "self.innerHeight";
	}
}	
		
//Gets the returned value from ftnObjSetScreenWidth() and eval() to return the screen width
function GetScreenHeight() {
	return eval(SetScreenHeight());
}

function GetScrollHeight(obj)
{
   return obj.scrollHeight;
}
//Shows and hide the password and email in the login box
function ShowText(obj) {

    if (obj.value == 'email address') {
        obj.value = '';
    }
}

function changeBox() {
    document.getElementById(TempPasswordTextBox).style.display='none';
    document.getElementById(PasswordTextBox).style.display='inline';
    document.getElementById(PasswordTextBox).value='';
    document.getElementById(PasswordTextBox).focus();  
}

//Shows and hide the forgot password overlay
function HideForgotPasswordOverlay() {
    document.getElementById('DisplayForgotPasswordOverlay').style.display = "none";
}

function ShowForgotPasswordOverlay() {
    document.getElementById('DisplayForgotPasswordOverlay').style.display = "inline";
    document.getElementById('<%=uxDisplayForgotPassword.ClientID%>').style.display = "inline"; 
    scroll(0, 0);
}
