var agt=navigator.userAgent.toLowerCase();
var ie = (agt.indexOf("msie") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));

var query_string = "";

function detectIE(ClassID,name)
{
	result = false;
	document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n');
	if (result)
	{	if (name=='SVG Viewer')
		{
			document.loginform.SVG_VIEWER.value=ClassID; 
			document.loginform.SVG_RENDERER.value='SVG.PlugIn';
		}
		return name+',';
	}
	else 
		return '';
}

function getIEVersionNumber()
{
    var ua = navigator.userAgent;
    var MSIEOffset = ua.indexOf("MSIE ");
    if(MSIEOffset == -1)
    {
        return 0;
    }
    else
    {
        return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
    }
}

if (ie && win) 
{
    pluginlist = detectIE("PDF.PdfCtrl.4", "Acrobat 4.0");
    pluginlist += detectIE("PDF.PdfCtrl.5", "Acrobat 5.0/6.0");
    pluginlist += detectIE("PDF.PdfCtrl.6", "Acrobat 6.0.2");
    pluginlist += detectIE("acroPDF.PDF", "Acrobat 7.0");
    pluginlist += detectIE("Adobe.SVGCtl","SVG Viewer");
    pluginlist += detectIE("RenesisX.RenesisCtrl","SVG Viewer");
    pluginlist += detectIE("examotion.Renesis","SVG Viewer");
}
if (pluginlist.indexOf("SVG Viewer")==-1)
{
	query_string = "svg=N&";
}
if (pluginlist.indexOf("Acrobat")==-1)
{
	query_string = query_string + "pdf=N";
}
if(query_string!="")
{
	var str = '/plugin.jsp?'+query_string;
	window.open(str);
}

