function checkRequirements()
{
    if(is_ie5_5 && !is_ie5_5_SP2)
    {
        location.replace("/WEL/minRequirements.htm");
        return false;
    }
    
    if (is_ie5_5up && cookieEnabled)
	{
        var msxmlInstalled = false;
        //var pwFileInstalled = false;
        var vprInstalled = false;

        try
        {
	        var xXmlObj = new ActiveXObject("MSXML2.DOMDocument");
	        xXmlObj = null;
	        msxmlInstalled = true;
        }
        catch(e)
        {
	        msxmlInstalled = false;
        }

        //Determine if the PW FileTransfer Control needs to be loaded.
        //try
        //{
	    //    var xFileObj = new ActiveXObject("PWFILETRANSFER.PWFileTransferCtrl.1");
	    //    pwFileInstalled = true;
	    //    xFileObj = null;
        //}
        //catch(e)
        //{
	    //    pwFileInstalled = false;
        //}

        //Determine if the VPR Control needs to be loaded
		//if(pwFileInstalled && msxmlInstalled)
		if(msxmlInstalled)
		{
		    return true;
	    }
        else
        {
		    location.replace("/WEL/jsp/preinstall.jsp");
		    return false;
        }
    }
    else
    {
        location.replace("/WEL/minRequirements.htm");
        return false;
    }
}

function cookieEnabled()
{
		var tmpcookie = new Date();
		chkcookie = (tmpcookie.getTime() + '');
		document.cookie = "chkcookie=" + chkcookie + "; path=/";
		if (document.cookie.indexOf(chkcookie,0) < 0) 
		{
            return false;
  		}
		else
		{
  			return true;
		}
}


function CheckForControl(closeWindow, openWindow, controlName, cabLocation)
{
    try
    {
    
        switch (controlName)
        {
            case "PWFileTransfer":
                controlString="PWFILETRANSFER.PWFileTransferCtrl.1";
                break;
            
            case "Xfile":
                controlString = "SoftArtisans.AXFFile";
                break;
            
            case "MarkupManager":
                controlString = "RXHIGHX.RxhighxCtrl.1";
                break;
            
            default:
                controlString="PWFILETRANSFER.PWFileTransferCtrl.1";
        }
        
        //Hack means to see if the active-x control is installed If not the catch block will 
        //Handle redirecting to the ControlRequired Page)
         var xFileObj = new ActiveXObject(controlString);
         xFileObj = null;
        return true;
    }
    catch(e)
    {
        var baseURL = "LiteServlet?REQUEST_TYPE=";
        if(openWindow)
        {
            // If we are on Windows XP with SP2 we need to increase the screen dialog sizes by
            // 20px since the status bar is always visible now.
            var STATUS_BAR_ALLOWANCE = 0;
            if(window.clientInformation.userAgent.indexOf("Windows NT 5.1") > 0)
                var STATUS_BAR_ALLOWANCE = 20;
    
            windowHeight=225 + STATUS_BAR_ALLOWANCE

            controlWindow = window.open(baseURL + "ControlRequired&controlName=" + controlName + "&cabLocation=" + cabLocation, "controlWindow",
                  "directory=0,width=450,height=" + windowHeight + ",resizable=0, statusbar=1, hotkeys=0,menubar=0,scrollbars=0,status=1,toolbar=0");	
            controlWindow.focus();
        }
        if(closeWindow == true)
            window.close();
        else if(closeWindow == "cancelFirst")
        {
            form = document.getElementById("cancelForm");
   		    docToolbar = window.open("", "welDocToolbar");
			            		    
   	        form.target = docToolbar.currentChildFrame;
            form.submit();
            window.close();
        }
        return false;
    }		        		
}

