// -----VARIABLES-------
loaderWidth = 550;
loaderHeight = 400;
swfBgColor = "#E7E7E7";
fplink = "http://www.adobe.com/go/getflashplayer";


// ----------------------------------------LOADER---------------------------------------------------


function loaderCreate(){
  layerLeft =  (document.body.clientWidth - loaderWidth ) / 2 + document.body.scrollLeft;
  layerTop = (document.body.clientHeight - loaderHeight ) / 2 + document.body.scrollTop;
  document.write('<div id="layerLoader" style="position:absolute;  top:' + layerTop +'px; left:' + layerLeft +'px;  visibility:hidden;"></div>');
  var so = new SWFObject("preloader.swf?temp=01", "loader", loaderWidth, loaderHeight, "0", swfBgColor);
  so.write("layerLoader");
}

function elemVisible(elemId,value){
  document.getElementById(elemId).style.visibility = value;
}

function elemSetStyleSize(elemId,width,heigh){
  elem = document.getElementById(elemId);
  elem.style.width = width;
  elem.style.height = heigh;
}

function loaderScroll(){ 	
      var elem=document.getElementById("layerLoader");
      layerLeft =  (document.body.clientWidth - loaderWidth ) / 2 + document.body.scrollLeft;
      layerTop = (document.body.clientHeight - loaderHeight ) / 2 + document.body.scrollTop;
      elem.style.left=layerLeft+"px";
      elem.style.top=layerTop+"px";
}

function on_main_flash_load(){
//	alert("123");
/*
	elemVisible("layerLoader","hidden");
	elemVisible("flashcontent","visible");
	document.getElementById("myflash").focus();
*/
    elemVisible("layerLoader","hidden");
    elemSetStyleSize("flashcontent","100%","100%");
}
// -------------------------------------------------------------------------------------------------

function loadFlash(){
	   	  loaderCreate();
          elemVisible("layerLoader","visible");


    	  var so = new SWFObject("index6.swf?temp=03", "myflash", "100%", "100%", "0", swfBgColor);
	      so.addVariable("flashVarText", "this is passed in via FlashVars for example only");
          so.addParam("scale", "noscale");
		  so.write("flashcontent");         
}

function flashDetectGetText(version){
  if (document.getElementById && (version['major'] > 0)) {
    fv = version['major'] + '.'+ version['minor']+ '.' + version['rev'];
    text1 = "You Flash Player is " + fv + '<br>';
    text2 = "Версия вашего Flash Player - " + fv + '<br>';
  }
  else{
    text1 = "Flash Player not installed. <br> ";
    text2 = "Flash Player не установлен. <br>" ;
  }
  
  text = 
		text2 + 
	    '<b>Для корректной работы необходим Flash Player версии 8 или выше. </b><br>'+
	    '<a href="' + fplink + '">Установить Flash Player</a> <br>'+
	    '<a href="?detectflash=false">Пропустить проверку</a>.'+
	    '<br><br>'+
        text1 + 
        '<b> You need Flash Player 8 or above.</b> <br>'+
		'<a href="' + fplink + '">Install Flash Player</a><br>'+
		'<a href="?detectflash=false">Bypass the detection</a>';
  return text;            
}
