function rollPic(strOffSrc, strOverSrc) {
	if (document.images) {
		this.off = new Image();
		this.over = new Image();
		this.off.src = strOffSrc;
		this.over.src = strOverSrc;
	}
}
function roll(strPic, strAction, strMsg) {
	if (document.images) {
		document.images[strPic].src = eval(strPic + '.' + strAction + '.src')
	}
	if (strMsg) {
		window.status = strMsg;
		return true;
	}
}

function OW(page, w, h) {
   if (!w) w = 790
   if (!h) h = 460
   var newWin = window.open(page, 'newWindow', 'width='+w+',height='+h+',location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes')
   newWin.focus()
   return void(0)
}

function OW2(page, w, h) {
   if (!w) w = 790
   if (!h) h = 460
   var newWin = window.open(page, 'newWindow', 'width='+w+',height='+h+',location=no,menubar=no,scrollbars=auto,status=no,toolbar=no,resizable=yes')
   newWin.focus()
   return void(0)
}

var g_objHideTimer;
function StartTimer() {
	var strCmd = "PlayFlashMovie()";
	if (!g_objHideTimer) {
		g_objHideTimer = setTimeout(strCmd, 1000);
	}
}



function getFlashMovieObject()
{
   if (navigator.appName.indexOf("Microsoft Internet")!=-1)
   {
     return window.FlashMap;
   }
   else
   {
     return window.document.FlashMap; 
	}     
}

function StopFlashMovie()
{
	var flashMovie=getFlashMovieObject();
	flashMovie.StopPlay();
}

function PlayFlashMovie()
{
	var flashMovie=getFlashMovieObject();
	flashMovie.Play();
}


function SendDataToFlashMovie()
{
	var flashMovie=getFlashMovieObject();
	flashMovie.SetVariable("item_source", document.controller.Data.value);
}

function ReceiveDataFromFlashMovie()
{
	var flashMovie=getFlashMovieObject();
	var message=flashMovie.GetVariable("item_source");
	document.controller.DataText.value=item_source;
}

function SetFlashMovie()
{

var flashVersion = 0;
var flash2Installed = false;	
var flash3Installed = false;	
var flash4Installed = false;	
var flash5Installed = false;	
var flash6Installed = false;	
var flash7Installed = false;	
var flash8Installed = false;	
var flash9Installed = false;	

var flashDiv = document.getElementById("flashsection");

var maxVersion = 9; 
 
// Loop through all versions we're checking, and
// set actualVersion to highest detected version.
  for(var i=8; i>0; i--){
		try{
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
            if(flashVersion==0)
            {
              flashVersion = i;
            }		
		}
		catch(e){
		}
	}

  if(flashVersion==0)
  {

    if (navigator.plugins) {
	// ...then check for flash 2 or flash 3+.
	if (navigator.plugins["Shockwave Flash 2.0"]
		|| navigator.plugins["Shockwave Flash"]) {
	 var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
	 var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
	 flashVersion = parseInt(flashDescription.substring(16));
	 flash2Installed = flashVersion == 2;	
	 flash3Installed = flashVersion == 3;
	 flash4Installed = flashVersion == 4;
	 flash5Installed = flashVersion == 5;
	 flash6Installed = flashVersion == 6;
	 flash7Installed = flashVersion == 7;
	 flash8Installed = flashVersion == 8;
	 flash9Installed = flashVersion >= 9;
	}
      }

      for (var i = 2; i <= maxVersion; i++) { 
	if (eval("flash" + i + "Installed") == true) flashVersion= i;
      }
    }

    if(flashVersion>5)
    {
    
      flashDiv = document.getElementById("flashsection");
        
	  var embed_element = document.createElement("embed");
      embed_element.setAttribute('src','/images/laatumaa-banner-flash6.swf');
      embed_element.setAttribute('width', '300');
      embed_element.setAttribute('height','300');
      flashDiv.parentNode.replaceChild(embed_element, flashDiv);

     
   }
}

