//This function will be call by flash apps

var showflash=0;
function setMenuTopping(vl)
{
	try
	{
		for(i=0; i < menuArr.length; i++)
			document.getElementById(menuArr[i]).style.top=vl;		
	}
	catch (e)
	{
		alert('setMenuTopping yells an errors:' + e);
		return false;
	}

}


function hideMainFlash(id,size,gotoUrl,extra) 
{ 
	try
	{
		if( gotoUrl == 'undefined' || gotoUrl == 'null'){ gotoUrl = '';}
		var styleFlash = document.getElementById(id).style;
		var styleLink = document.getElementById('logosml').style;
		styleFlash.overflow = 'hidden';
		if(size>0 && showflash==1)
		{ 
		  styleFlash.height = size+'px'; 
		  setTimeout ( "hideMainFlash('"+id+"', "+(size-15)+",'"+gotoUrl+"','"+extra+"')", 5 ); 
		}
		else
		{

		  //document.getElementById(id).innerHTML = ''; //no need to clear content if they wish to remember the content
		  styleFlash.height = '0px'; 
		  styleFlash.width = '0px';
		  setMenuTopping('27px');
		  showflash=0;
		  if(gotoUrl.length>4)
	      {
			window.location = gotoUrl; //variable extra will store ID, AKA content path name like "rural-escapes" 
		  }
		}		
	}
	catch (e)
	{
		alert('hideMainFlash yells an errors:' + e);
		return false;
	}
}

function showMainFlash(id,size,orisize,embed) 
{ 
	try
	{
		var styleFlash = document.getElementById(id).style;
		var styleLink = document.getElementById('logosml').style;
		styleFlash.overflow = 'hidden';

		if(orisize>size && showflash==0)
		{ 
		  if(embed==true)
		  {
			  styleFlash.display = 'none';

			  if(document.getElementById(id).innerHTML.length < 100) //Hide or show flash with remember last open status
			  {
				embedMainFlash();
			  }

			  styleFlash.width = '0px'; 
			  styleFlash.height = '0px';
		  }
		  else
		  {
			  styleFlash.display	= 'block'; 
			  styleFlash.width		= 'auto'; 
			  styleFlash.display	= 'block'; 
			  
			  
		  }
		  styleFlash.height = size+'px';
		  setTimeout ( "showMainFlash('"+id+"', "+(size+15)+", "+orisize+",false)", 5 ); 
		}
		else
		{
		  setMenuTopping('505px');
		  showflash=1;
		  styleFlash.height = orisize+'px'; 
		  styleFlash.width = 'auto';
		}		
	}
	catch (e)
	{
		alert('showMainFlash yells an errors:' + e);
		return false;
	}

}



function embedMainFlash()
{
	try
	{

		  var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'

		  + 'width="990" height="480"'

		  + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'

		  + '<param name="movie" value="/swf/LT-Flash.mainFrame.swf?'+Math.random()+'" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#000000" />'

		  + '<embed src="/swf/LT-Flash.mainFrame.swf?'+Math.random()+'" quality="high" scale="noscale" bgcolor="#000000" '

		  + 'width="990" height="480" wmode="transparent" name="LT-Flash.mainFrame" align="middle"'

		  + 'play="true"'

		  + 'loop="false"'

		  + 'quality="high"'

		  + 'allowScriptAccess="sameDomain"'

		  + 'type="application/x-shockwave-flash"'

		  + 'pluginspage="http://www.adobe.com/products/flashplayer/">'

		  + '<\/embed>'

		  + '<\/object>';

		  document.getElementById('header_heroshotFlash').innerHTML  = '';

		  document.getElementById('header_heroshotFlash').innerHTML  = oeTags;	
	}
	catch (e)
	{
		alert('embedMainFlash yells an errors:' + e);
		return false;
	}



}
