var site = "backyardministries";
var title = "Backyard Ministries";
var start = "July 26th, 2002";
var extra = "";
var cgi_location = "http://www.innategraphix.com/cgi-bin/";
var php_location = "http://www.innategraphix.com/";
var mylevel = 5;
function incCookie(cookieName) {
		today = new Date();
		if(mylevel > 1){
			if(mylevel > 2){
				if(mylevel > 3){
					if(mylevel > 4){
						expdate = new Date(); expdate.setMonth(12); expdate.setDate(1);
						expdate.setHours(0); expdate.setMinutes(0); expdate.setSeconds(0);
						var expires = "; expires=" + expdate.toGMTString();
						document.cookie=cookieName+"_year="+expdate+expires;
					}
					expdate = new Date(); expdate.setMonth(expdate.getMonth() + 1); expdate.setDate(1);
					expdate.setHours(0); expdate.setMinutes(0); expdate.setSeconds(0);  
					var expires = "; expires=" + expdate.toGMTString();
					document.cookie=cookieName+"_month="+expdate+expires;
				}
				expdate = new Date(); expdate.setDate(expdate.getDate() + 7);
				expdate.setHours(0); expdate.setMinutes(0); expdate.setSeconds(0);  
				var expires = "; expires=" + expdate.toGMTString();
				document.cookie=cookieName+"_week="+expdate+expires;
			}
			expdate = new Date(); expdate.setDate(expdate.getDate() + 1);
			expdate.setHours(0); expdate.setMinutes(0); expdate.setSeconds(0);  
			var expires = "; expires=" + expdate.toGMTString();
			document.cookie=cookieName+"_day="+expdate+expires;
		}
}

function readCookie (cookieName) {
	/* Check if we have any cookies at all... */
	if(document.cookie) {
		/* Check if we have the favorites cookie... */
		index = document.cookie.indexOf(cookieName)
		if (index != -1) {
			/* Find the start */
			cookieStart = (document.cookie.indexOf("=", index) + 1)
			/* Find the end */
			cookieStop = document.cookie.indexOf(";", index)
			if (cookieStop == -1) { cookieStop = document.cookie.length }
			/* with the start and the end... now you've got the whole thing */
			return document.cookie.substring(cookieStart, cookieStop)
		}
	}
	return null;
}

function nocount() { 
 	var expdate = new Date(); 
	expdate.setTime(expdate.getTime() + (365 * 24 * 60 * 60 * 1000));  // Expires in 1 year
	var expires = "; expires=" + expdate.toGMTString();
	document.cookie=site+"_dont=1"+expires;
	location.reload();
}
function docount() {
	var expdate = new Date(); 
	expdate.setTime(expdate.getTime() - 1);  // Expired
	var expires = "; expires=" + expdate.toGMTString();
	document.cookie=site+"_dont="+expires;
	location.reload();
}

// --Screen
    var myscreen = 1;
    if (screen.width >= 640) {myscreen++}
	if (screen.width >= 800) {myscreen++}
	if (screen.width >= 1024) {myscreen++}
	if (screen.width >= 1280) {myscreen++}
	if (screen.width == 1600) {myscreen++}
	if (screen.width > 1600 && screen.width < 2400) {myscreen = 7}
	if (screen.width == 2400) {myscreen = 8}

// --Browser
	var mybrowser = 1;
	var is_major = parseInt(navigator.appVersion);
    var agt=navigator.userAgent.toLowerCase();
	if ((agt.indexOf("hotjava") != -1) || (agt.indexOf("opera") != -1)) {mybrowser = 2}
	if ((agt.indexOf("webtv") != -1) || (agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)) {mybrowser = 3}
	if (agt.indexOf("aol") != -1) {mybrowser = 4}
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("aol") == -1));
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf("aol") == -1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    if (is_ie) 
		if (is_major >= 4) {
			if ((agt.indexOf("msie 6.")!=-1) || (is_major > 4)) {
				mybrowser = 7;
			} else {
				mybrowser = 6;
			}
		} else {
			mybrowser = 5;
		}
	if (is_nav)
		if (is_major >= 4) {
			if (is_major >= 5) {
				mybrowser = 7;
			} else {
				mybrowser = 6;
			}
		} else {
			mybrowser = 5;
		}
		
// --OS
	var myos = 1;
    if ((agt.indexOf("bsd")!=-1) || (agt.indexOf("un")!=-1) || (agt.indexOf("ux")!=-1) || 
		(agt.indexOf("ix")!=-1) || (agt.indexOf("sco")!=-1)) {myos = 2}
	var is_mac = (agt.indexOf("mac")!=-1);
	if (is_mac) {myos = 3}
	if (is_mac && ((agt.indexOf("ppc")!=-1) || (agt.indexOf("powerpc")!=-1))) {myos = 4}
	if ((agt.indexOf("win9")!=-1) || (agt.indexOf("windows 9")!=-1) || 
		(agt.indexOf("win 9")!=-1)) {myos = 5}
	if ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1)) {myos = 6}
	if (agt.indexOf("windows nt 5.1")!=-1) {myos = 7}

// --Color
    var mycolor = 1
	if (screen.colorDepth >= 4) {mycolor++}
	if (screen.colorDepth >= 8) {mycolor++}
	if (screen.colorDepth >= 16) {mycolor++}
	if (screen.colorDepth >= 24) {mycolor++}
	if (screen.colorDepth == 32) {mycolor++}
	if (screen.colorDepth > 32 && screen.colorDepth < 64) {mycolor = 7}
	if (screen.colorDepth == 64) {mycolor = 8}
// --Plugins
	var myplugin = 0;
	var pluginlist = "";
	var is_win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
	var is_ns  = (navigator.appName.indexOf("Netscape") != -1);

	function detectIE(ClassID,name) { 
		result = false; 	
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('result = IsObject(CreateObject("' + ClassID + '"))\n');
		document.write('</SCR' + 'IPT\> \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;
	}
	
	if (is_ie && is_win) {
		pluginlist = detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("PDF.PdfCtrl.5","Acrobat Reader");
	}
	if (is_ns || !is_win) {
		nse = ""; 
		for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/pdf","Acrobat Reader");
	}
	pluginlist = pluginlist.toLowerCase();
	if (pluginlist.indexOf("quicktime") != -1) {myplugin = myplugin + 1}
	if (pluginlist.indexOf("real") != -1) {myplugin = myplugin + 2}
	if (pluginlist.indexOf("acrobat") != -1) {myplugin = myplugin + 4}

//--Flash
	var myflash=1;
	var flash2Installed = false;
	var flash3Installed = false;
	var flash4Installed = false;
	var flash5Installed = false;
	var flash6Installed = false;
	var flash7Installed = false;
	var flash8Installed = false;
// </sc ript>    
// <SCR IPT LANGUAGE="JavaScript1.1" type="text/javascript">
<!--
// write vbscript detection if we're not on mac.
if (is_ie && is_win){ // don't write vbscript tags on anything but ie win
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}
// -->
// </SCR IPT>
// <SCR IPT LANGUAGE="JavaScript" type="text/javascript">
function detectFlash(){
	if (navigator.plugins){								// does navigator.plugins exist?
		if (navigator.plugins["Shockwave Flash 2.0"] 	// yes>> then is Flash 2 
		|| navigator.plugins["Shockwave Flash"]){		// or flash 3+ installed?

			// set convenient references to flash 2 and the plugin description
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			// a flash plugin-description looks like this: Shockwave Flash 4.0 r5
			// so we can get the major version by grabbing the character before the period
			// note that we don't bother with minor version detection. do that in your movie with $version
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

			// we know the version, now set appropriate version flags
			flash2Installed = flashVersion == 2;		
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion == 8;
		}
	}
	
	// loop through all versions we're checking, and set actualVersion to highest detected version
	for (var i = 2; i <= 8; i++) {	
		if (eval("flash" + i + "Installed") == true) {myflash = i}
	}
	if(navigator.userAgent.indexOf("WebTV") != -1) {myflash = 3}	
	return myflash;
}

detectFlash();
