/**************************************************************************************
** This function loads the homepage - flash intro. It sets a cookie so that the flash will only display once a day.
***************************************************************************************/
function home_flash()
{
	 //Get the window height and width  
    var winH = $(window).height();  
    var winW = $(window).width();
    if(winH < 750) { winH = 750; }
    if(winW < 990) { winW = 990; }
    
    //Set variable to possible value
    var cookieSplash=getCookie('cookieSplash');

	//Check to see if user visited site today
      if (cookieSplash==null || cookieSplash=="")
		{
		
			cookieSplash='1';	//Set cookie to 1	
			if (cookieSplash!=null && cookieSplash!="")
			{	
				///Set cookie to 1	
				setCookie('cookieSplash',cookieSplash,1);
		}

			$.fancybox(
				'flash/splash.swf',
				{
					
					'autoScale'				: false,
					'padding'					: 0,
					'transitionIn'			: 'elastic',
					'transitionOut'			: 'elastic',
					'width'					: 590,
					'height'					: 412,
					'opacity'					: true,
					'overlayOpacity'		: 0.5,               
					'overlayShow'			:	true,
					'modal'				    : false,
					'padding'                : 0,
					'margin'                  : 0,
					'type'		                : 'swf',
					'swf'					 : {'wmode':'transparent'}
 				});
 				
 				
 				setTimeout('getgoing()',3000);
	}
}

function getgoing()
{
	$.fancybox.close();
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function getCookie(c_name)
{
	
if (document.cookie.length>0)
  {
  
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}


