//############################## IE FOR MAC DETECTOR (DISABLES MENU) ##############################//
var isMac = false;
if(navigator.userAgent.indexOf('Mac') != -1){
	isMac = true;
}
		
	
//############################## COPYRIGHT DATE ##############################//

var newDate = new Date();
var daYear = newDate.getFullYear();
var daDate = ""+daYear+"";


//############################## IMAGE ROLLOVERS ##############################//

function HoverImage(img){
	var oldSrc = new String(img.src);
	var newSrc = oldSrc.substring(0, oldSrc.length - 6);
	newSrc += "_1.gif";
	img.src = newSrc;
}
	
function unHoverImage(img){
	var oldSrc = new String(img.src);
	var newSrc = oldSrc.substring(0, oldSrc.length - 6);
	newSrc += "_0.gif";
	img.src = newSrc;
}

function rO(nm,st){
	document.images[nm].src = "/webtemplate_images/nav_index_" + nm + "_" + st + ".gif";
	document.images['mainPic'].src = "/webtemplate_images/img_" + nm + "_index.jpg";

	if(st == 1){
		doContent('pgmTitle',nm+'Title');
		document.getElementById('pgmText').innerHTML = "";
		document.getElementById('pgmLink').innerHTML = "";
		setTimeout('doContent(\'pgmText\',\''+nm+'Text\')',500);
		setTimeout('doContent(\'pgmLink\',\''+nm+'Link\')',1000);
		clearTimeout(rotateIt);
	}
	if(st == 0){
		//rO(imgList[last],1);
		rotateIt = setTimeout('doRand()',i);
	}
}

function doContent(w,n){
	document.getElementById(w).innerHTML = document.getElementById(n).innerHTML;
//end doContent
}

//############################## FLASH DETECTOR ##############################//

var detectableWithVB = false;
var pluginFound = false;

function goURL(daURL){
    window.location = daURL;
}
function redirectCheck(pluginFound, redirectURL, redirectIfFound) {
    if(redirectURL && ((pluginFound && redirectIfFound) || (!pluginFound && !redirectIfFound))){
		goURL(redirectURL);
		return pluginFound;
    }else{
		return pluginFound;
    }	
}
function canDetectPlugins(){
    if(detectableWithVB || (navigator.plugins && navigator.plugins.length > 0)){
		return true;
    }else{
		return false;
    }
}
function detectFlash(redirectURL, redirectIfFound){
    pluginFound = detectPlugin('Shockwave','Flash'); 
    if(!pluginFound && detectableWithVB){
		pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1');
    }
    return redirectCheck(pluginFound, redirectURL, redirectIfFound);
}
function detectPlugin() {
    var daPlugins = detectPlugin.arguments;
    var pluginFound = false;
    if (navigator.plugins && navigator.plugins.length > 0){
		var pluginsArrayLength = navigator.plugins.length;
			for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ){
	    		var numFound = 0;
	    		for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++){
					if((navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0)){
						numFound++;
					}   
	    		}
	    		if(numFound == daPlugins.length){
					pluginFound = true;
					break;
	    		}
			}
    }
    return pluginFound;
}

// VBSCRIPT FOR IE/WINDOWS

if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){
    document.writeln('<script language="VBscript">');
    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');
    document.writeln('\'this next function will detect most plugins');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');
    document.writeln('\'and the following function handles QuickTime');
    document.writeln('Function detectQuickTimeActiveXControl()');
    document.writeln('  on error resume next');
    document.writeln('  detectQuickTimeActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('    detectQuickTimeActiveXControl = False');
    document.writeln('    hasQuickTimeChecker = false');
    document.writeln('    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');
    document.writeln('    If IsObject(hasQuickTimeChecker) Then');
    document.writeln('      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then ');
    document.writeln('        detectQuickTimeActiveXControl = True');
    document.writeln('      End If');
    document.writeln('    End If');
    document.writeln('  End If');
    document.writeln('End Function');
    document.writeln('</scr' + 'ipt>');
}