var isIE6 = false;
var fname='';

window.onload = myOnload;

function myOnload() {
// reduce image flicker in IE6
 if (isIE6) {
   try {
     document.execCommand('BackgroundImageCache', false, true);
   } 
   catch(e) {}; // ignore it
 }

 loadFlash();
}


function overOut(obj, isOver){

// if (!isIE6) return;
 while (obj.tagName!='LI' && obj.tagName!='BODY'){
  obj=obj.parentNode;
 }
 if (obj.tagName!='LI') return;

 var liCss = obj.className; //.parentNode.parentNode.className;

 if (isOver) { liCss = liCss.replace('_item', '_over'); }
 else { liCss = liCss.replace('_over', '_item'); }

 obj.className = liCss;
}


function zoomFotoShow(fileName){
  window.open(fileName,'_blank','width=320,height=320,left=70,top=50,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes');
}

var strDog = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="65" height="76" id="dog_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/swf/dog3.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/images/swf/dog3.swf" menu="false" quality="high" wmode="transparent" width="65" height="76" name="dog_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
var strHorse = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="165" height="180" id="horse_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/swf/horse.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/images/swf/horse.swf" menu="false" quality="high" wmode="transparent" width="165" height="180" name="horse_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
var strMenu = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="250" height="330" id="menu_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/swf/menu5.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/images/swf/menu5.swf" menu="false" quality="high" wmode="transparent" width="250" height="330" name="menu_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
var strSmoke = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="smoke_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/swf/smoke.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/images/swf/smoke.swf" menu="false" quality="high" wmode="transparent" width="100%" height="100%" name="smoke_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
var strButterfly =   '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="butterfly_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/swf/butterfly.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/images/swf/butterfly.swf" menu="false" quality="high" wmode="transparent" width="100%" height="100%" name="butterfly_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
var strBook = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="book_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/swf/lirika.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/images/swf/lirika.swf" menu="false" quality="high" wmode="transparent" width="100%" height="100%" name="book_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

var strVideoPlayer = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"  width="470" height="353"><PARAM name="movie" value="http://video.rutube.ru/b8c223884b0828c8c9b5284a5dc21371"></PARAM><PARAM name="wmode" value="window"></PARAM><PARAM name="allowFullScreen" value="true"></PARAM><EMBED src="http://video.rutube.ru/b8c223884b0828c8c9b5284a5dc21371" type="application/x-shockwave-flash" wmode="window" width="470" height="353" allowFullScreen="true" ></EMBED></OBJECT>';
//var strYubileyBabkina ='<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/i4UtGS0mzoQ&hl=ru_RU&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/i4UtGS0mzoQ&hl=ru_RU&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>';
var strYubileyBabkina ='<object  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="405"><param name="movie" value="http://www.youtube.com/v/i4UtGS0mzoQ&hl=ru_RU&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/i4UtGS0mzoQ&hl=ru_RU&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="405"></embed></object>';

var strYubileyBabkina2 ='<object style="height: 344px; width: 425px"><param name="movie" value="http://www.youtube.com/v/i4UtGS0mzoQ"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/i4UtGS0mzoQ" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object>';

function setFlash(fileFlash, objID, _width, _height){

   var swfTest = new SWFObject();  
   if (swfTest.installedVer.major >0 ) {
     var so = new SWFObject(fileFlash, "mymovie", _width, _height, "9","","high");
     so.addParam("wmode", "transparent");
     so.addParam("scale", "noscale");
     so.addParam("allowscriptaccess", "always");
     so.write(objID);
    return true;
   } else return false;
}

function loadFlash() {

 var objFlashBox = document.getElementById('mnu_flash');
 if (objFlashBox) {
 setFlash('/images/swf/menu7.swf','mnu_flash', "250", "330");
//     objFlashBox.innerHTML = strMenu; 
 }

 objFlashBox = document.getElementById('smoke');
 if (objFlashBox) {
 setFlash('/images/swf/smoke.swf','smoke',"100%","100%");
//     objFlashBox.innerHTML = strSmoke; 
 }

 objFlashBox = document.getElementById('butterfly');
 if (objFlashBox) {
 setFlash('/images/swf/butterfly.swf','butterfly', "100%", "100%");
//     objFlashBox.innerHTML = strButterfly; 
 }

 objFlashBox = document.getElementById('dog');
 if (objFlashBox) {
 setFlash('/images/swf/dog3.swf','dog', "65", "76");
//     objFlashBox.innerHTML = strDog; 
 }

 objFlashBox = document.getElementById('girl_horse2');
 if (objFlashBox) {
 setFlash('/images/swf/horse.swf','girl_horse2',"165","180");
//     objFlashBox.innerHTML = strHorse; 
 }

 objFlashBox = document.getElementById('player_1');
 if (objFlashBox) {
     objFlashBox.innerHTML = strVideoPlayer; 
 }

 objFlashBox = document.getElementById('player_2');
 if (objFlashBox) {
     objFlashBox.innerHTML = strYubileyBabkina; 
 }


 objFlashBox = document.getElementById('lyric');
 if (objFlashBox) {
      if ( setFlash('/images/swf/lirika.swf','lyric',"100%","100%"))       objFlashBox.style.background='none';
//     objFlashBox.innerHTML = strBook; 
 }



}


var objLiActive = null;

function show_poems(objId, objLi) {
 var objText = document.getElementById(objId);
 if(!objText) return;
 var objBox = document.getElementById('text_poems');
 if(!objBox) return;

 objBox.innerHTML =objText.innerHTML;

 if(objLiActive) objLiActive.className='item';
 if(objLi) {
   objLiActive = objLi;
   objLiActive.className = 'active';
 } else {
  objUl = document.getElementById('tables');
  if(!objUl) return; 
  for(i=0;i<objUl.childNodes.length;i++) {
    objLi = objUl.childNodes[i]; 
    if(objLi.nodeType!=3) break;
  }
  objLiActive = objLi;
  objLiActive.className = 'active';
 }

}

function getPageHeight(objDiv) {
 var pageHeight;
 if(!objDiv) return 0;

 if (objDiv.clientHeight) {	// all except Explorer
	pageHeight = objDiv.clientHeight;
 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
	pageHeight = document.documentElement.clientHeight;
 }	

 return pageHeight;
}


 // ***************************************************
var Root;
var LinkDivActive=0;
var onDiv;
var layerRef;
var styleRef;
var showVar;
var hideVar;
var ua=navigator.userAgent.toLowerCase();
var dom=(document.getElementById) ? 1 : 0;
var nn4=(document.layers) ? 1 : 0;
nn4 = nn4 && !dom;
var opera=(window.opera) ? 1 : 0; 
var ie=(document.all && !opera) ? 1 : 0;
var XMenuOffset=(ie)? 136: (opera) ? 133 : 130;
var YMenuOffset=(ie)? -293: (opera) ? -293 : -292;

if (dom) {
	layerRef="document.getElementById(divId)";
	styleRef=".style";
	showVar="'visible'";
	hideVar="'hidden'";
} else if (ie) {
	layerRef="document.all[divId]";
	styleRef=".style";
	showVar="'visible'";
	hideVar="'hidden'";
} else if (nn4) {
	layerRef="document.layers[divId]";
	styleRef="";
	showVar="'show'";
	hideVar="'hide'";
}


function relPosY(divId) {

	if (eval(layerRef)) {
		if (nn4) return eval(layerRef+styleRef+'.pageY');
		else {
			var elem=eval(layerRef);
			var pos=elem.offsetTop;
			while (elem.offsetParent!=null) {
				elem=elem.offsetParent;
				pos+=elem.offsetTop;
			}
			return pos;
		}
	}
}
