hs.graphicsDir = '/js/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
//hs.dimmingOpacity = 0.75;

// Add the controlbar
hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: 0.75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});
function collapsElement(id) {
  if ( document.getElementById(id).style.display != "none" ) {
  document.getElementById(id).style.display = 'none';
  }else {document.getElementById(id).style.display = '';}
}
function get_selection(){
    if (document.selection){var selectionline = document.selection.createRange().text;}else{var selectionline = window.getSelection();}
    selectionline.length=selectionline.toString().length;
    return selectionline;
}
$(document).ready(function(){
  // коррекция высоты
  var whei=$(document).height();
  if(whei<850)
  $("#footer").css({width:674,position:'absolute',bottom:0});
  $('a.collapse').click(function(){
    var n=$(this).attr('n');
    var state=$(this).attr('state');
    if(state==1){
      $(this).attr('state',0);
      $('.text'+n).slideUp(500);
    }else{
      $(this).attr('state',1);
      $('.text'+n).slideDown(500);
    }
  });
  // работа с выделением
  //$(document).mouseup(function({});

});  //      {,document}
$(window).keydown(keydown_event);
$(document).keydown(keydown_event);
function keydown_event(e){
    if((e.ctrlKey) && ((e.keyCode == 0xA)||(e.keyCode == 0xD))){
//      alert('lalalalala');
      var selection=get_selection();
      if(selection.length > 0){
        //alert('Этот текст надо отправить: '+selection.toString());encodeURI( )
        TINY.box.show('/js/mistake.php?mistake='+selection.toString(),1,450,450,1,0);

      }
    }
}

