var image = new Array("label20let.gif","label20let.gif","label20let.gif");
//"img1.gif","img2.gif","img0.gif"
var id='m';
var relbox_show="s_contentform";
var relbox_hide="h_contentform";
var relbox_status='hidden';

function setTextYear()
{
  IDyearhide=document.getElementById('yearreplace');
  IDyearswho=document.getElementById('showyear');
  IDyearhide.innerHTML = IDyearswho.innerHTML;
}

function RandomHead() 
{
  document.getElementById('background_image').src = '/images/'+image[Math.floor( Math.random( ) * (2+1) )]; 
}

function shown(num)
{
   document.getElementById(id+num).style.visibility='visible';
   document.getElementById(id+num).style.display='block';
}

function mhideAdd(num)
{
  document.getElementById(id+num+'a').style.visibility='hidden';
  document.getElementById(id+num+'a').style.display='none'; 
}
function mhide()
{
  for(var i=1; i<=7;i++) document.getElementById(id+i).style.visibility='hidden';
}

function clPol()
{
  if(document.forms['FindForm'].elements['query'].value == ' поиск...')
    document.forms['FindForm'].elements['query'].value='';
}

function chPol()
{
  if(document.forms['FindForm'].elements['query'].value == '')
    document.forms['FindForm'].elements['query'].value = ' поиск...';
}
function setNowBlock(num,end,id)
{
  linker='menuTxT'+num;
  unlinker='menuTxT'+end;
  
  document.getElementById(linker).className='activeTitle';
  document.getElementById(unlinker).className='exampleTitle';
  $('text').set('html',$(id).get('html'));
}


window.addEvent('domready', function() {
SexyLightbox = new SexyLightBox({color:'black', dir: 'http://www.weld.su/images/sexyimages'});

$$('.pressing').each(function(el) {
    el.addEvent('click', function(e) {
      var myFx = new Fx.Morph('content-block', {
        duration: 500,
        transition: Fx.Transitions.Sine.easeOut});
      if(relbox_status=='hidden') {
        $('content-block').fade('in');
        myFx.start('.' + relbox_show);
        relbox_status='show';}
      else {
        $('content-block').fade('out');
        myFx.start('.' + relbox_hide);
        relbox_status='hidden';
      }
    });
  });
  $$('.pressings').each(function(el) {
    el.addEvent('click', function(e) {
      var myFx = new Fx.Morph('content-block', {
        duration: 500,
        transition: Fx.Transitions.Sine.easeOut});
      if(relbox_status=='hidden') {
        $('content-block').fade('in');
        myFx.start('.' + relbox_show);
        relbox_status='show';}
      else {
        $('content-block').fade('out');
        myFx.start('.' + relbox_hide);
        relbox_status='hidden';
      }
    });
  });
  var myFx=new Fx.Morph('migalka',{
        duration: 1600,
        transition: Fx.Transitions.Sine.easeOut});
        myFx.start('.phones_b');
        
        var testElem=$('m1').getElements('a');
        testElem.each(function(item, i){
        var parentItem=item.parentNode;
        item.addEvents({
        'mouseenter': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.linehovers');
          if('childlink'==parentItem.get('class'))
          {
            var myParentMor = new Fx.Morph(parentItem.parentNode, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
            myParentMor.start('.'+parentItem.parentNode.get('class'));
          }
        },
        'mouseleave': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.'+item.get('class'));
        }
      });
    });
    
           var testElem=$('m2').getElements('a');
        testElem.each(function(item, i){
        var parentItem=item.parentNode;
        item.addEvents({
        'mouseenter': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.linehovers');
          if('childlink'==parentItem.get('class'))
          {
            var myParentMor = new Fx.Morph(parentItem.parentNode, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
            myParentMor.start('.'+parentItem.parentNode.get('class'));
          }
        },
        'mouseleave': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.'+item.get('class'));
        }
      });
    });
            var testElem=$('m3').getElements('a');
        testElem.each(function(item, i){
        var parentItem=item.parentNode;
        item.addEvents({
        'mouseenter': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.linehovers');
          if('childlink'==parentItem.get('class'))
          {
            var myParentMor = new Fx.Morph(parentItem.parentNode, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
            myParentMor.start('.'+parentItem.parentNode.get('class'));
          }
        },
        'mouseleave': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.'+item.get('class'));
        }
      });
    });
            var testElem=$('m4').getElements('a');
        testElem.each(function(item, i){
        var parentItem=item.parentNode;
        item.addEvents({
        'mouseenter': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.linehovers');
          if('childlink'==parentItem.get('class'))
          {
            var myParentMor = new Fx.Morph(parentItem.parentNode, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
            myParentMor.start('.'+parentItem.parentNode.get('class'));
          }
        },
        'mouseleave': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.'+item.get('class'));
        }
      });
    });
            var testElem=$('m5').getElements('a');
        testElem.each(function(item, i){
        var parentItem=item.parentNode;
        item.addEvents({
        'mouseenter': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.linehovers');
          if('childlink'==parentItem.get('class'))
          {
            var myParentMor = new Fx.Morph(parentItem.parentNode, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
            myParentMor.start('.'+parentItem.parentNode.get('class'));
          }
        },
        'mouseleave': function () {
          var myTestMor = new Fx.Morph(item, { duration: 0, transition: Fx.Transitions.Sine.easeOut});
          myTestMor.start('.'+item.get('class'));
        }
      });
    });
});

