﻿// JScript File

//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer


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("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") ; }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") ;
}

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) 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);


// Code and all web content for Bartram Enterprises:Property is copyright G.Bartram (c) 2008

function OutputBanner()
{
	if (pluginlist.indexOf("Flash") != -1)
    {
		var outputString = '<script type="text/javascript">';
		outputString += 'AC_FL_RunContent( "codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0","width","780","height","329","src","3480","quality","high","pluginspage","http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash","movie","3480" ); //end AC code';
		outputString += '</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="780" height="329">';
		outputString += '<param name="movie" value="3480.swf">';
		outputString += '<param name="quality" value="high">';
		outputString += '<embed src="3480.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="780" height="329"></embed>';
		outputString += '</object></noscript>';
    }
    else
    {
        var outputString = '<img src="images/banner.jpg" alt="" />';
    }
    document.write(outputString);
}


// Show the hand as we're over a link or menu
// Params:  htmlElement - object to show hand (if none, uses srcElement)
// Returns: none
function MouseHover(theEvent)
{
	var evt = (window.event) ? window.event : theEvent;	
	if (IE)
	{
		var htmlElement = evt.srcElement;
	}
	else
	{
		var htmlElement = evt.target;
	}
	if (htmlElement.className != 'menutextselected')
	{
		htmlElement.style.cursor = 'pointer';
		htmlElement.style.color = '#009933';
	}
}

function MouseOut(theEvent)
{
	var evt = (window.event) ? window.event : theEvent;	
	if (IE)
	{
		var htmlElement = evt.srcElement;
	}
	else
	{
		var htmlElement = evt.target;
	}

	htmlElement.style.cursor='default';
	
	if (htmlElement.className != 'menutextselected')
	{
		htmlElement.style.color = '#dddddd';
	}
}

function LoadApp(path)
{
    if (document.getElementById('choice').checked == true)
    {
        setCookie('choice', path, 999);
    }
    else
    {
        delCookie('choice');
    }

    window.location=path;
}


function checkCookieExists(NameofCookie)
{
    if (document.cookie.length > 0)
    {
        return document.cookie.indexOf(NameofCookie+"=");
    }
}

function getCookie(NameOfCookie)
{

    if (document.cookie.length > 0) 
    { 
        begin = document.cookie.indexOf(NameOfCookie+"="); 
        if (begin != -1) // Note: != means "is not equal to"
        { 

            begin += NameOfCookie.length+1; 
            end = document.cookie.indexOf(";", begin);
            if (end == -1) end = document.cookie.length;
            {
                return unescape(document.cookie.substring(begin, end)); 
            } 
        }
    }
    return null; 

} 

function setCookie(NameOfCookie, value, expiredays) 
{

    var ExpireDate = new Date ();
    ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

    document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

 
function delCookie (NameOfCookie) 
{

    if (getCookie(NameOfCookie)) 
    {
        document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
 
 

