﻿

function WorkaroundFFIssue()
{
    if (IS.moz)
    {
        var rightContent = document.getElementById("contentRight");
        if (rightContent)
        {
            rightContent.setAttribute("style", "display: none;");

            window.setTimeout(function()
            {
                rightContent.setAttribute("style", "display:'';");
            }, 25);
        }
    }
}

function GetIEVersion()
{
    var rv = -1;
    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;
}


function SetCookie(name, value, expires, path, domain, secure, dontEscapeValue)
{

    var today = new Date();
    today.setTime(today.getTime());

    if (expires)
    {
        expires = expires * 1000 * 60 * 60 * 24;
    }

    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = name + "=" + (dontEscapeValue ? value : escape(value)) +
    ((expires) ? ";expires=" + expires_date.toGMTString() : "") +
    ((path) ? ";path=" + path : "") +
    ((domain) ? ";domain=" + domain : "") +
    ((secure) ? ";secure" : "");
}


function GetCookie(check_name)
{
    var a_all_cookies = document.cookie.split(';');
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false;

    for (i = 0; i < a_all_cookies.length; i++)
    {

        a_temp_cookie = a_all_cookies[i].split('=');

        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');


        if (cookie_name == check_name)
        {
            b_cookie_found = true;

            if (a_temp_cookie.length > 1)
            {
                cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
            }
            return cookie_value;
            break;
        }
        a_temp_cookie = null;
        cookie_name = '';
    }
    if (!b_cookie_found)
    {
        return null;
    }
}

function CheckIE6()
{
    if (IS.ie && GetIEVersion() < 7)
    {
        if (GetCookie("warningacc") == false || GetCookie("warningacc") == null)
        {
            document.write('<div id="warningmsg-container"><div id="warningmsg" style="background-color: #B01212; color: #FEFEFE; padding: 3px 5px; text-align: left;font-size: 12px;background-image:url(/WebResources/Images/warning.png);background-position:5px 3px;background-repeat:no-repeat;"><p style="float:right;"><img src="/WebResources/Images/close_warning.png" onClick="CloseWarningMsg();" style="cursor:pointer;" alt="Stop remind me" title="Stop remind me" /></p><p style="padding-bottom: 3px; font-weight: bold; font-family: Tahoma; font-size: 13px;padding-left:18px;">You may want to upgrade your browser</p>');
            document.write('<p style="padding-left: 1px; padding-bottom: 7px; font-size: 11px;font-family:Tahoma;">You are currently browsing Intersoft Solutions website with an older version of Internet Explorer. For the best browsing experience, please click <a href="http://www.microsoft.com/windows/ie" target="_blank" style="text-decoration:underline;color:#FEFEFE;font-weight:bold;">here</a> to upgrade your browser to Internet Explorer 8.</p></div></div>');
        }
    }
}

function CloseWarningMsg()
{
    var warningmsg = document.getElementById("warningmsg");
    var parentwarning = document.getElementById("warningmsg-container");

    parentwarning.style.overflow = "hidden";
    parentwarning.style.position = "relative";
    warningmsg.style.position = "relative";

    SetCookie('warningacc', true, 30, "/", "", "");
    Animation.Do(warningmsg, "SlideUp", null, null, { "Style": "Easing", "Step": 5 });
}
