// JavaScript Document
function main_DoFSCommand(command, args)
{
	if (command == "video")
	{
		location.href = "javascript:popUpWindow('video.php?movie=" + args + "', 0, 0, 350, 220)";
	}

	if (command == "getflash")
	{
		location.href = "javascript:popUpWindow('getflash.htm', 0, 0, 500, 320)";
	}

    if (command == "portico")
	{
		location.href = "http://www.hillsanddalesestate.org/portico/current_issue.pdf";
	}

	if (command == "check")
	{
		//sends the return value of true for FlashInstalled (we're checking for 6 and up)
		//to the isInstalled variable in the 'main' flash object
		if (FlashInstalled())
		{
			window.document.main.SetVariable("isInstalled", "true");
		}
	}
	
	if (command == "bookmark")
	{
		//send the text to display for the bookmark prompt
			if (navigator.appName == "Microsoft Internet Explorer")
			{
				window.document.main.SetVariable("bookmarkTxt", "Disable any pop-up blockers you may have activated. Then, bookmark this page by clicking the Bookmark This Page button below so you can return to this page if you are redirected to the Macromedia web site. Next, click the Flash Player button below to install the latest Flash Player.");
				window.document.main.SetVariable("bookmarkBtn", "true");//tell bookmark button to be visible
			}
			else
			{
				window.document.main.SetVariable("bookmarkTxt", "Disable any pop-up blockers you may have activated. Then, bookmark this page by typing the Cntrl and D keys at the same time  so you can return to this page if you are redirected to the Macromedia web site. Next, click the Flash Player button below to install the latest Flash Player.");				
			}
		
	}
	
	if (command == "setBookmark")
	{
		window.external.AddFavorite(args, args);
	}
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar,location,directories=no,status=no,menubar,scrollbars,resizable,copyhistory,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function FlashInstalled()
{
	result = false;

	if (navigator.appName == "Netscape" || navigator.appVersion.indexOf("Mac") != -1)
	{
		numPlugins = navigator.plugins.length;
		for (i = 0; i < numPlugins; i++)
		{
		pluginStr = new String(navigator.plugins[i].description);
			//full pluginStr reads "Shockwave Flash 7"
			if (pluginStr.match("Shockwave Flash"))
			{
				isolateNum = pluginStr.substring(16, 17);//find the version number at these indices
				versionNum = new Number(isolateNum);
				if (isolateNum >= 7)//if we're at version 7 and up
				{
					result = true;
				}
			} 
		}		
	}
	else
	{
		var xObj;
		try 
		{
			xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		} 
		catch (error)	
		{
			xObj = false;
		} 
		if (xObj)
		{
			result = true;
			xObj = null;
		}
		else 
		{
			result = false;  
		}
	}
return (result);
}
