﻿

var legalDisclaimer = null;

function CheckForPopUpBlock()
{
	var popupCheck = window.open('','','width=1,height=1,scrollbars=no');
	
	if (!popupCheck)
		alert('WARNING: iCONECT NXT has detected that you have popup blocker software installed.\nIn order for iCONECT to function properly, you must disable the blocker software.');
	else
		popupCheck.close();
}

function checkForFrame()
{
	if (parent.location != location)
		parent.location.href = document.location.href;
}

function openLegalStatement()
{
	if (window.legalDisclaimer)
	{
		if (!legalDisclaimer.closed)
			window.legalDisclaimer.location.href = "LegalStatement.aspx";
		else
			legalDisclaimer = window.open("LegalStatement.aspx","legalDisclaimer","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=260");
	}
	else
		legalDisclaimer = window.open("LegalStatement.aspx","legalDisclaimer","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=260");
	legalDisclaimer.focus();
}

function checkBrowser()
{
    var bCookies = false;
    //var bJavascript = true;
    var bJava = false;
    //var chkJs = document.getElementById('chkJavascript');
    var chkCkies = document.getElementById('chkCookies');
    var chkJv = document.getElementById('chkJava');

    if (document.cookie) bCookies = true;
    if (navigator.javaEnabled()) bJava = true;                        		
    			
    /*if (bJavascript && chkJs !== null) {
        chkJs.checked = true;
        chkJs.style.color = 'green';
    }
    else
        chkJs.checked = false;*/

    if (chkCkies !== null && chkJv !== null) {
        if (bCookies) {
            chkCkies.checked = true;
            chkCkies.style.color = 'green';
        }
        else
            chkCkies.checked = false;
    	
        if (bJava)
        {
            chkJv.checked = true;
            chkJv.style.color = 'green';
        }
        else
            dchkJv.checked = false;
    }

    if (bCookies === true) {
        document.getElementById('loginControl').style.display = '';
    }
    if (bCookies !== true || bJava !== true) {
        document.getElementById('browserConfig').style.display = '';
    }
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
