//Detect if the user is using IE on Windows and set opacity filters.
var isIE=0;
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) { isIE=1; }


// ------------------------
//Detect if the user has the Flash Plugin.
var flashPlugin = 0;
flashPlugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( flashPlugin ) {
	flashPlugin = parseInt( flashPlugin.description.substring( flashPlugin.description.indexOf(".")-1)) >= 6;
} else if (isIE) {
	document.write( '<SCRIPT LANGUAGE=VBScript\> \n' );
	document.write( 'on error resume next \n' );
	document.write( 'flashPlugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n' );
	document.write( '</SCRIPT>' );
}
//flashPlugin = 0; //for testing *****
//alert( "flashPlugin: "+ flashPlugin );


//Where am I?
var sURL = window.location.toString();
var aURLSplit = sURL.split("/");
var sPath = aURLSplit[ 3 ];
var sPathSub = aURLSplit[ 4 ];
var myLoc = "home"
if (sPath=="information") { myLoc="information"; }
if (sPath=="rides") { myLoc="rides"; }
if (sPath=="shopping" ) { myLoc="shopping"; }
if (sPath=="accommodations") { myLoc="accommodations"; }
if (sPath=="camping") { myLoc="camping"; }
if (sPath=="food") { myLoc="food"; }
if (sPath=="groups") { myLoc="group"; }
if (sPath=="news") { myLoc="events"; }
if (sPath=="blog") { myLoc="blog"; }
//alert( "sPath: "+ sPath +"\nmyLoc: "+ myLoc );


// ------------------------
// function mail
function mail(box) {
	var domain = "indianabeach.com";

	// This makes the page name (xxx.htm) the subject:
	//var sPath = window.location.pathname;
	//var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	//sSubject = sPage.substring(0, sPage.lastIndexOf('.') );

	// This makes the page title the subject:
	var sSubject = document.title;
	if (box=="xxx") {
		document.write("<a href='mailto:ibinfo@" + domain + "?subject=" + sSubject +"' />Contact Us</a>");
	} else if (box=="web") {
		document.write("<a href='mailto:ibinfo@" + domain + "?subject=" + sSubject +"' />Contact Webmaster</a>");
	} else {
		document.write("<a href='mailto:ibinfo@" + domain + "?subject=" + sSubject +"' />info@" + domain + "</a>");
	}
} // ----- end mail function -----



// ------------------------
// function playFlash
function playFlash( parameter1, parameter2, parameter3 ) {
	if (flashPlugin) {
		filename = "/images/video/" + parameter1;
		width = parameter2;
		height = parameter3;

		//Flash code for IE:
		document.write( "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+ width +"' height='"+ height +"' align='middle' id='flash'>\n" );
		document.write( "	<param name='allowScriptAccess' value='sameDomain' />\n" );
		document.write( "	<param name='movie' value='"+ filename +"' />\n" );
		document.write( "	<param name='quality' value='high' />\n" );
		document.write( "	<param name='loop' value='false' />\n" );
		document.write( "	<param name='menu' value='false' />\n" );
		document.write( "	<param name='play' value='true' />\n" );
		document.write( "	<param name='wmode' value='transparent' />\n" );
		//Flash code for Netscape:
		document.write( "	<embed src='"+ filename +"' width='"+ width +"' height='"+ height +"' wmode='transparent' quality='high' name='flash' loop='false' menu='false' play='true' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\n" );
		document.write( "</object>\n" );
	} //End if Flash.
}	// ----- end playFlash -----