// OAS OPERATIONS
_version=10;
_version=11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1) {
	_version=10;
}

var oas='http://ads.mgnetwork.com/RealMedia/ads/';
	var RN = new String (Math.random());
	var RNS = RN.substring (2,11);
 var sitepage = "golfcast.com/index.html";
	function DisplayOasAd (position) {
		var oaspage = sitepage + '/1' + RNS + '@' + position;
		if (_version < 11) {
			document.write ('<a href="' + oas + 'click_nx.ads/' + oaspage + '" target="_top"><img src="' + oas + 'adstream_nx.ads/' + oaspage + '" border="0"></a>');
		}
		else {
			document.write ('<script language="JavaScript1.1" src="' + oas + 'adstream_jx.ads/' + oaspage + '"><\/script>');
		}
	}


// Slideshow

function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder').src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}


// Jumpto
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Date Stamp
function stampIt() {
	var monthNames = new Array();
	monthNames[0] = "January";
	monthNames[1] = "February";
	monthNames[2] = "March";
	monthNames[3] = "April";
	monthNames[4] = "May";
	monthNames[5] = "June";
	monthNames[6] = "July";
	monthNames[7] = "August";
	monthNames[8] = "September";
	monthNames[9] = "October";
	monthNames[10] = "November";
	monthNames[11] = "December";
	var now = new Date();
	var myDate = now.getDate();
	var month = now.getMonth();
	var year = now.getFullYear();
	document.write("<p class='stamp'><strong>" + monthNames[month] + " " + myDate + ", " + year + " | Augusta, Georgia</strong></p>");
}


// rolodex

/* global variables */
var section;

/* just a bit of browser sniffing is necessary. */

var ie = (document.all) ? true: false;
var isWin = (navigator.platform.indexOf("Win") != -1) ? true : false;
var ieWin = (ie && isWin) ? true : false;
var ieWin50 = (isWin && navigator.appVersion.indexOf('MSIE 5.0') != -1) ? true : false;

/* the menu open/close function. */

function togglemenu(num) {

var submenu = "sub"+num;
var square = "sq"+num;

/* Set the display style to "none" if the value is null */
if (document.getElementById(submenu).style.display == null) {
 document.getElementById(submenu).style.display = "none";
 }

if (document.getElementById(submenu).style.display == "none") {
document.getElementById(submenu).style.display = "block";
document.getElementById(square).src = "http://webstage.themeganet.com/web/mgn/media/jbf/images/minus.gif";
}
else {
document.getElementById(submenu).style.display = "none";
document.getElementById(square).src = "http://webstage.themeganet.com/web/mgn/media/jbf/images/plus.gif";
 }
}

/* Get all the elements with a given class name */
function getElementsByClassName(tagname, classname) {

 /* only execute in 5+ browsers. */
 if (!document.getElementById) return false;

 /* get all elements with the tag name tagname. */

 var TagElements = document.getElementsByTagName(tagname);

 /* define an array which will hold the elements with the class name classname. */
 var elementsByClassName = new Array();

 /* Look at all the elements in TagElements, and find the ones with the class name classname. */

 for (i=0; i<TagElements.length; i++) {
  if (TagElements[i].className == classname) {
    elementsByClassName[elementsByClassName.length] = TagElements[i];
    }
 }
  return elementsByClassName;
}


function changeclassstyle(tagname,classname,styleproperty,newstyle) {
 var tochange = getElementsByClassName(tagname,classname);
  for (k=0; k < tochange.length; k++) {
    eval("tochange[k].style." + styleproperty + " = " + "'" + newstyle + "'");
  }
}

/* change the cursor style */
function changecursor(num) {
var square = "sq" + num;
if (ieWin50) {
 var cursorstyle = 'hand'; }
else {
 var cursorstyle = 'pointer';
 }

document.getElementById(square).style.cursor = cursorstyle;
}

var section;
function init() {
if (document.getElementById) {
changeclassstyle('div','sublevel','display','none');
changeclassstyle('td','pic','display','none');

if (section > 0) { togglemenu(section); }
 }
}

/* rotate Vipir thumbs */
var vipirImg = new Array();
  vipirImg[0]="http://doppler.wjbf.com/csra1_s.jpg";
  vipirImg[1]="http://doppler.wjbf.com/metro1_s.jpg";
  vipirImg[2]="http://doppler.wjbf.com/augusta1_s.jpg";
  vipirImg[3]="http://doppler.wjbf.com/aiken1_s.jpg";

var newVipir = 0;
var totalImg = vipirImg.length;

function cycleImg() {
  newVipir++;
  if (newVipir == totalImg) {
    newVipir = 0;
  }
  document.vipir.src=vipirImg[newVipir];
  setTimeout("cycleImg()", 4*1000);
}
/*	window.onload=cycleImg;	*/

function setCompanionAd (new_rns) {
	var idc = frames["videoCompanionPosition"];
	idc.location.href = "http://imdtestapps1.mgnetwork.com/iframe.html?sitepage=" + sitepage + "&rns=" + new_rns + "&flash_request=1";
}

// show-hide data grid layers

function displayToggle(id) {
	var dgLayer = document.getElementById(id).style;
	if(dgLayer.display == "none") {
		dgLayer.display = "block";
	}
	else if(dgLayer.display == "block") {
		dgLayer.display = "none";
	}
}


// plug-in detection

<!--
// initialize a variable to test for JavaScript 1.1.
// which is necessary for the window.location.replace method
var javascriptVersion1_1 = false;
// -->

<!--
javascriptVersion1_1 = true;
// -->



<!--

// initialize global variables
var detectableWithVB = false;
var pluginFound = false;

function goURL(daURL) {
    // if the browser can do it, use replace to preserve back button
    if(javascriptVersion1_1) {
	window.location.replace(daURL);
    } else {
	window.location = daURL;
    }
    return;
}

function redirectCheck(pluginFound, redirectURL, redirectIfFound) {
    // check for redirection
    if( redirectURL && ((pluginFound && redirectIfFound) ||
	(!pluginFound && !redirectIfFound)) ) {
	// go away
	goURL(redirectURL);
	return pluginFound;
    } else {
	// stay here and return result of plugin detection
	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 not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1');
    }
    // check for redirection
    return redirectCheck(pluginFound, redirectURL, redirectIfFound);
}

function detectDirector(redirectURL, redirectIfFound) {
    pluginFound = detectPlugin('Shockwave','Director');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectActiveXControl('SWCtl.SWCtl.1');
    }
    // check for redirection
    return redirectCheck(pluginFound, redirectURL, redirectIfFound);
}

function detectQuickTime(redirectURL, redirectIfFound) {
    pluginFound = detectPlugin('QuickTime');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectQuickTimeActiveXControl();
    }
    return redirectCheck(pluginFound, redirectURL, redirectIfFound);
}

function detectReal(redirectURL, redirectIfFound) {
    pluginFound = detectPlugin('RealPlayer');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = (detectActiveXControl('rmocx.RealPlayer G2 Control') ||
		       detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') ||
		       detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));
    }
    return redirectCheck(pluginFound, redirectURL, redirectIfFound);
}

function detectWindowsMedia(redirectURL, redirectIfFound) {
    pluginFound = detectPlugin('Windows Media');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectActiveXControl('MediaPlayer.MediaPlayer.1');
    }
    return redirectCheck(pluginFound, redirectURL, redirectIfFound);
}

function detectPlugin() {
    // allow for multiple checks in a single pass
    var daPlugins = detectPlugin.arguments;
    // consider pluginFound to be false until proven true
    var pluginFound = false;
    // if plugins array is there and not fake
    if (navigator.plugins && navigator.plugins.length > 0) {
	var pluginsArrayLength = navigator.plugins.length;
	// for each plugin...
	for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
	    // loop through all desired names and check each against the current plugin name
	    var numFound = 0;
	    for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
		// if desired plugin name is found in either plugin name or description
		if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) ||
		    (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
		    // this name was found
		    numFound++;
		}
	    }
	    // now that we have checked all the required names against this one plugin,
	    // if the number we found matches the total number provided then we were successful
	    if(numFound == daPlugins.length) {
		pluginFound = true;
		// if we've found the plugin, we can stop looking through at the rest of the plugins
		break;
	    }
	}
    }
    return pluginFound;
} // detectPlugin

// Here we write out the VBScript block for MSIE 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>');
}
// -->

// MG IMD open.window

function createWindow(pageURL,wWidth,hHeight) {
	window.open(pageURL, "secondWindow", "toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=" + wWidth + ",height=" + hHeight)
}