var iCount = 0, bFade = true;

window.onload = function()
{	
	//ApplySifrHeadings();
	//showPageFlash('vintage.swf', 730, 318, '', 'transparent', 'pageflash');
	
	if(document.getElementById('animation'))
	{
		showAnimation();
	}
	
	var splash = document.getElementById('splashimg');
	
	if(splash)
	{				
		if (GetCookie('splash') == null)
		{
			document.getElementById('ctl00_contentPL_splash').style.display = "block";
			setTimeout("fadeSplashImage()", 2000);
		}		
	}
	
}

function fadeSplashImage()
{
    Effect.Fade(document.getElementById('ctl00_contentPL_splash'), { duration: 8.0});
    SetCookie('splash', 'yes') ;
}

function showAnimation()
{	
	if(iCount > 5)
	{
		iCount = 0;		
	}	
	var sImg1 = document.getElementById('img'+ iCount + '_0');
	var sImg2 = document.getElementById('img'+ iCount + '_1');

	if(bFade)
	{
		Effect.Fade(sImg1, { duration: 3.0});
		Effect.Appear(sImg2, { duration: 3.0});
		bFade = false;
	} else {
		Effect.Appear(sImg1, { duration: 3.0});
		Effect.Fade(sImg2, { duration: 3.0});
		bFade = true;
	}	
	if(bFade)
	{
		iCount += 1;		
	}		
	setTimeout("showAnimation()", 3000);
}

function getPage( dd)
{    
    sGoto = dd.options[dd.selectedIndex].value;
    
    if(sGoto != "")
    {
        document.location.href = sGoto;        
    }
}

function GetCookie(name) 
{ 
	// use: getCookie("name");
  var re = new RegExp(name + "=([^;]+)");
  var value = re.exec(document.cookie);
  return (value != null) ? unescape(value[1]) : null;
}
function SetCookie(name, value) 
{ 
  // use: setCookie("name", value);
  document.cookie=name + "=" + escape(value) + "; path=/";
}
