function show_answer(id){
	var div_id   = "m" + id;    //id блока с собщением
	var img_id   = "img" + id;  //id картинки со стрелочкой
	var div      = document.getElementById(div_id);
	var img      = document.getElementById(img_id);
	
    if(div.style.display == 'block') {
        div.style.display = 'none';
	img.src = "images/main/1.gif";
    }
	else{
                div.style.display = 'block';
		img.src = "images/main/2.gif";
            }
}


function OpenBigPic (fn, w, h) {
    window.open (fn, "bigpic", "width=600,height=600,resizable=no");
}



var width;
width = screen.width;
if (width >= 800 & width < 1024)
{
	document.write('<link rel="stylesheet" href="style1.css" type="text/css" >');
}
else
if (width >= 1024 & width < 1280)
{
	document.write('<link rel="stylesheet" href="style2.css" type="text/css" >');
}
else
if (width >= 1280 & width < 1600)
{
	document.write('<link rel="stylesheet" href="style3.css" type="text/css" >');
}
else
if (width >= 1600)
{
	document.write('<link rel="stylesheet" href="style5.css" type="text/css" >');
}
else
{
	document.write('<link rel="stylesheet" href="style4.css" type="text/css" >');
}



  var cssFix = function(){
  var u = navigator.userAgent.toLowerCase(),
  addClass = function(el,val){
    if(!el.className) {
      el.className = val;
    } else {
      var newCl = el.className;
      newCl+=(" "+val);
      el.className = newCl;
    }
  },
  is = function(t){return (u.indexOf(t)!=-1)};
  addClass(document.getElementsByTagName('html')[0],[
    (!(/opera|webtv/i.test(u))&&/msie (\d)/.test(u))?('ie ie'+RegExp.$1)
      :is('firefox/2')?'gecko ff2'
      :is('firefox/3')?'gecko ff3'
      :is('gecko/')?'gecko'
      :is('opera/9')?'opera opera9':/opera (\d)/.test(u)?'opera opera'+RegExp.$1
      :is('konqueror')?'konqueror'
      :is('applewebkit/')?'webkit safari'
      :is('mozilla/')?'gecko':'',
    (is('x11')||is('linux'))?' linux'
      :is('mac')?' mac'
      :is('win')?' win':''
  ].join(" "));
}();


$(function(){
  //Get our elements for faster access and set overlay width
  var div = $('div.video_lenta'),
               ul = $('ul.video_lenta'),
               // unordered list's left margin
               ulPadding = 10;

  //Get menu width
  var divWidth = div.width();

  //Remove scrollbars
  div.css({overflow: 'hidden'});

  //Find last image container
  var lastLi = ul.find('li:last-child');

  //When user move mouse over menu
  div.mousemove(function(e){

    //As images are loaded ul width increases,
    //so we recalculate it each time
    var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;

    var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
    div.scrollLeft(left);
  });
});

