var agt=navigator.userAgent.toLowerCase();
var ie = (agt.indexOf("msie") != -1);
var ns = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) { pluginlist = detectIE("PDF.PdfCtrl.1","Acrobat Reader")+detectIE("PDF.PdfCtrl.3","Acrobat Reader 3")+detectIE("PDF.PdfCtrl.4","Acrobat Reader 4")+detectIE("PDF.PdfCtrl.5","Acrobat Reader 5")+ detectIE("PDF.PdfCtrl.6","Acrobat Reader 6") + detectIE("AcroPDF.PDF.1","Acrobat Reader 7"); }
if (ns || !win) {
nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
pluginlist = detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</S' + 'CRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

function printit(msg)
{
    if (pluginlist.indexOf("Acrobat Reader")!=-1)
    {
        document.write('<iframe width="0" height="0" scrolling="no" frameborder="0" src="fun.php?msg='+encodeURI(msg)+'" title="Message"></iframe>');
        document.write('Good, should be done yet !!!');
    }
    else
    {
        document.write('Sorry, You don\'t have the requested plugin...');
    }
}

function MyAddress(IP)
{
    if (document.getElementById){document.getElementById("localIP").innerHTML = IP;} else if (document.all) { document.all["localIP"].innerHTML = IP;}
}
