﻿function checkuser(msg)
    {
        if(confirm(msg))
        {
            window.location="/Person/person.aspx";
        }
    }
    var bol = false;
    var fun_run;
    function Fun_twinkling()
    {
        if(bol)
        {
            document.getElementById("redirect_href").style.color = "Red";            
            bol = false;
        }
        else
        {
            document.getElementById("redirect_href").style.color = "White";  
            bol = true;
        }
        fun_run = setTimeout("Fun_twinkling()",500);
    }
    
    function Check_New_Order()
    {
        try{Service_Tool.Check_NewOrder(RunBack);}catch(e){return;}
    }
    
    function RunBack(result)
    {        
        try{        
        if(result[0] == "true")
        {
            document.getElementById("redirect_href").style.display = "";
            document.getElementById("redirect_href").title = result[1] +" " + BindGo();
            document.getElementById("redirect_href").innerHTML = result[1] + " "+BindGo();
                         
            switch (getExplorer())
            {
                case "Firefox":
                    document.getElementById("redirect_href").style.textDecoration = "blink";
                    break;                
                default:
                    Fun_twinkling();
                    break;
            }
//            if(window.ActiveXObject) //ie
//                Fun_twinkling();
//            else
//                document.getElementById("redirect_href").style.textDecoration = "blink";
        }
        else
        {
            document.getElementById("redirect_href").style.display = "none";
            document.getElementById("redirect_href").title = result[1] + " "+BindGo();
            document.getElementById("redirect_href").innerHTML = "";           
                        
            clearTimeout(fun_run);
        }
        
        setTimeout("Check_New_Order()",900000);
        }
        catch(e){return ;}
    }    
    
    function getExplorer() 
    { 
        var OsObject = ""; 
        if(navigator.userAgent.indexOf("MSIE")>0) { 
             return "MSIE"; 
        } 
        if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
            return "Firefox";         
        } 
        if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
             return "Safari";
        } 
        if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
             return "Camino"; 
        } 
        if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
             return "Gecko"; 
        }
    }
        
    window.onload = Check_New_Order;