// JavaScript Document
if (document.images)
{
  pic1= new Image(108,19); 
  pic1.src="http://www.nakedheart.org/ru/images/generic/about_us.png"; 

  pic2= new Image(108,19); 
  pic2.src="http://www.nakedheart.org/ru/images/generic/what_we_do.png"; 
  
  pic3= new Image(108,19); 
  pic3.src="http://www.nakedheart.org/ru/images/generic/support.png";
  
  pic4= new Image(108,19); 
  pic4.src="http://www.nakedheart.org/ru/images/generic/news_events.png";
  
  pic5= new Image(108,19); 
  pic5.src="http://www.nakedheart.org/ru/images/generic/why_play.png";
  
  pic6= new Image(108,19); 
  pic6.src="http://www.nakedheart.org/ru/images/generic/contact.png";
}



var gLoaded=0;
var img1='';
var img2='';
var img3='';
var img4='';
var img5='';
var img7='';
function fInit(){
  
  if(section==1){
	  img1='http://www.nakedheart.org/ru/images/generic/about_us_on.png';
  }else{
	  img1='http://www.nakedheart.org/ru/images/generic/about_us.png';
  }
  if(section==2){
	  img2='http://www.nakedheart.org/ru/images/generic/what_we_do_on.png';
  }else{
	  img2='http://www.nakedheart.org/ru/images/generic/what_we_do.png';
  }
  if(section==3){
	  img3='http://www.nakedheart.org/ru/images/generic/support_on.png';
  }else{
	  img3='http://www.nakedheart.org/ru/images/generic/support.png';
  }
  if(section==4){
	  img4='http://www.nakedheart.org/ru/images/generic/news_events_on.png';
  }else{
	  img4='http://www.nakedheart.org/ru/images/generic/news_events.png';
  }
  if(section==5){
	  img5='http://www.nakedheart.org/ru/images/generic/why_play_on.png';
  }else{
	  img5='http://www.nakedheart.org/ru/images/generic/why_play.png';
  }
  if(section==6){
	  img7='http://www.nakedheart.org/ru/images/generic/contact_on.png';
  }else{
	  img7='http://www.nakedheart.org/ru/images/generic/contact.png';
  }
  gLoaded=1;
  fResetNav();
  pickimage();
}
function fHardResetSubNav(){
	if(gLoaded==1){
 document.getElementById("nav1").setAttribute("src", img1);
 document.getElementById("nav2a").setAttribute("src", img2);
 document.getElementById("nav3").setAttribute("src", img3);
 document.getElementById("nav4").setAttribute("src", img4);
 document.getElementById("nav5").setAttribute("src", img5);
 document.getElementById("nav7").setAttribute("src", img7);
 document.getElementById('subnav1').style.top='-1184px';
 document.getElementById('subnav1Close').style.top='-1184px';
 document.getElementById('subnav2').style.top='-1184px';
 document.getElementById('subnav2Close').style.top='-1184px';
 document.getElementById('subnav3').style.top='-1184px';
 document.getElementById('subnav3Close').style.top='-1184px';
 document.getElementById('subnav4').style.top='-1184px';
 document.getElementById('subnav4Close').style.top='-1184px';
 document.getElementById('subnav5').style.top='-1184px';
 document.getElementById('subnav5Close').style.top='-1184px';
 document.getElementById('subnav6').style.top='-1184px';
 document.getElementById('subnav6Close').style.top='-1184px';
 bLockSubNav=true;
	}
}

function fResetNav(){
	if(gLoaded==1){
  if(bLockSubNav==false){
	 document.getElementById("nav1").setAttribute("src", img1);
 document.getElementById("nav2a").setAttribute("src", img2);
 document.getElementById("nav3").setAttribute("src", img3);
 document.getElementById("nav4").setAttribute("src", img4);
 document.getElementById("nav5").setAttribute("src", img5);
 document.getElementById("nav7").setAttribute("src", img7);
 document.getElementById('subnav1').style.top='-1184px';
 document.getElementById('subnav1Close').style.top='-1184px';
 document.getElementById('subnav2').style.top='-1184px';
 document.getElementById('subnav2Close').style.top='-1184px';
 document.getElementById('subnav3').style.top='-1184px';
 document.getElementById('subnav3Close').style.top='-1184px';
 document.getElementById('subnav4').style.top='-1184px';
 document.getElementById('subnav4Close').style.top='-1184px';
 document.getElementById('subnav5').style.top='-1184px';
 document.getElementById('subnav5Close').style.top='-1184px';
 document.getElementById('subnav6').style.top='-1184px';
 document.getElementById('subnav6Close').style.top='-1184px';
	 bLockSubNav=true;
  }
	}
}
function fSubNav(menuNum) { //v2.0
      if(gLoaded==1){
       // reset all
       document.getElementById("nav1").setAttribute("src", img1);
 document.getElementById("nav2a").setAttribute("src", img2);
 document.getElementById("nav3").setAttribute("src", img3);
 document.getElementById("nav4").setAttribute("src", img4);
 document.getElementById("nav5").setAttribute("src", img5);
 document.getElementById("nav7").setAttribute("src", img7);
 document.getElementById('subnav1').style.top='-1184px';
 document.getElementById('subnav1Close').style.top='-1184px';
 document.getElementById('subnav2').style.top='-1184px';
 document.getElementById('subnav2Close').style.top='-1184px';
 document.getElementById('subnav3').style.top='-1184px';
 document.getElementById('subnav3Close').style.top='-1184px';
 document.getElementById('subnav4').style.top='-1184px';
 document.getElementById('subnav4Close').style.top='-1184px';
 document.getElementById('subnav5').style.top='-1184px';
 document.getElementById('subnav5Close').style.top='-1184px';
 document.getElementById('subnav6').style.top='-1184px';
 document.getElementById('subnav6Close').style.top='-1184px';
	   bLockSubNav=true;
  
  if(menuNum=='1'){ 
  document.getElementById("nav1").setAttribute("src", 'http://www.nakedheart.org/ru/images/generic/about_us_on.png');
  document.getElementById('subnav1').style.top='214px';
  document.getElementById('subnav1Close').style.top='218px';
  }
  
  if(menuNum=='2'){
  document.getElementById("nav2a").setAttribute("src", 'http://www.nakedheart.org/ru/images/generic/what_we_do_on.png');
  document.getElementById('subnav2').style.top='214px';
  document.getElementById('subnav2Close').style.top='218px';
  }
  
  if(menuNum=='3'){ 
  document.getElementById("nav3").setAttribute("src", 'http://www.nakedheart.org/ru/images/generic/support_on.png');
  document.getElementById('subnav3').style.top='214px';
  document.getElementById('subnav3Close').style.top='218px';
  }
  
  if(menuNum=='4'){ 
  document.getElementById("nav4").setAttribute("src", 'http://www.nakedheart.org/ru/images/generic/news_events_on.png');
  document.getElementById('subnav4').style.top='214px';
  document.getElementById('subnav4Close').style.top='218px';
  }
  if(menuNum=='5'){ 
  document.getElementById("nav5").setAttribute("src", 'http://www.nakedheart.org/ru/images/generic/why_play_on.png');
  document.getElementById('subnav6').style.top='214px';
  document.getElementById('subnav6Close').style.top='218px';
  }
  
  if(menuNum=='6'){ 
   document.getElementById("nav7").setAttribute("src", 'http://www.nakedheart.org/ru/images/generic/contact_on.png');
  document.getElementById('subnav5').style.top='215px';
  document.getElementById('subnav5Close').style.top='218px';
  }
	  }
}

var bLockSubNav=false;
function fLockSubNav(){
  bLockSubNav=true;
}

function fUnLockSubNav(){
  bLockSubNav=false;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function fLoadVideo(s,m){
   fGetComments(s,m);
   window.sMovieName=m;
   fLoadFile(s,m);
}

function fLoadFile(s,m,vMedia){
     
	 var sendPath = m;
	 var vType = vMedia;
	 //if (vType=="video"){
        window.document.mediaplayer.SetVariable("vVideoPath", sendPath);
     //}
	 if (vType=="pic"){
	    window.document.mediaplayer.SetVariable("vPicturePath", sendPath);
		window.document.href='#top';
		window.location='#top';
	 }
}

function fFlashLoadComments(s,m){
	 fGetComments(s,m);
     window.sMovieName=m;
	 //alert(s);
}
function fFlashReady(){
	window.document.mediaplayer.SetVariable("vSection", sSection);
	//alert("Flash Ready");
}

var backgroundSrcs = new Array("http://www.nakedheart.org/ru/images/homepage/nhf_banner-01.jpg","http://www.nakedheart.org/ru/images/homepage/nhf_banner-02.jpg","http://www.nakedheart.org/ru/images/homepage/nhf_banner-03.jpg","http://www.nakedheart.org/ru/images/homepage/nhf_banner-04.jpg","http://www.nakedheart.org/ru/images/homepage/nhf_banner-05.jpg","http://www.nakedheart.org/ru/images/homepage/nhf_banner-06.jpg");

function pickimage(){
       var bgimage=backgroundSrcs[(Math.floor(Math.random()*(backgroundSrcs.length)))];
       document.getElementById("flash").style.backgroundImage = "url('" + bgimage + "')";
}

function sortNumeric(a,b)
{
return a - b
}