function activateSwitcher(){$('a.switcherON').live('click',function(){$(this).removeClass('switcherON').addClass('switcherOFF').text('Скрыть подробное описание курса');$('#table-of-contents').slideDown(2000);return false;});$('a.switcherOFF').live('click',function(){$(this).removeClass('switcherOFF').addClass('switcherON').text('Показать подробное описание курса');$('#table-of-contents').slideUp(2000);return false;});}
function getBlock(element,index){return $.ajax({type:'GET',url:element.attr('content_src'),dataType:'html',success:function(data){element.html(data);switch(index){case 0:{$('#table-of-contents').hide();activateRotator();activateSwitcher();break;}
case 1:{activateHoverCatcher();break;}}
return true;},error:function(requestObj,status){return false;}})?true:false;}
function activateRotator(){$('div.rotate ul li a').live('click',function(evtObj){return false;});loadRotatorContent();initRotator(preload);};function rotate(titleNum){if($('div.notebookIll[titleNum='+titleNum+'] ul li').length<=1)
return;var current=($('div.notebookIll[titleNum='+titleNum+'] ul li.show')?$('div.notebookIll[titleNum='+titleNum+'] ul li.show'):$('div.notebookIll[titleNum='+titleNum+'] ul li:first'));var next=((current.next().length)?((current.next().hasClass('show'))?$('div.notebookIll[titleNum='+titleNum+'] ul li:first'):current.next()):$('div.notebookIll[titleNum='+titleNum+'] ul li:first'));next.css({opacity:0.0}).addClass('show').animate({opacity:1.0},1000);current.animate({opacity:0.0},1000).removeClass('show');};function initRotator(preloadArray){$('div.notebookIll').each(function(){var titleNum=$(this).attr('titleNum');$(this).find('ul li').css({opacity:0.0});$(this).find('ul li:first').css({opacity:1.0});addAllIems(preloadArray,titleNum);setInterval('rotate('+titleNum+')',5000);});}
function createListItem(imgUrl,titleNum){$('<img />').attr('src',imgUrl).appendTo('div.rotate[titleNum='+titleNum+'] ul').wrap('<li style="opacity:0.0;"><a></a></li>');}
function addAllIems(preloadArray,titleNum){for(var q=0;q<preloadArray[titleNum-1].length;q++)
createListItem(preloadArray[titleNum-1][q].src,titleNum);}
function loadRotatorContent(){if(document.images){preload[0]=new Array(4);preload[0][0]=new Image(587,366);preload[0][0].src=base_url+'/images/thumbnails/0/02.jpg';preload[0][1]=new Image(587,366);preload[0][1].src=base_url+'/images/thumbnails/0/03.jpg';preload[0][2]=new Image(587,366);preload[0][2].src=base_url+'/images/thumbnails/0/04.jpg';preload[0][3]=new Image(587,366);preload[0][3].src=base_url+'/images/thumbnails/0/05.jpg';preload[1]=new Array(4);preload[1][0]=new Image(587,366);preload[1][0].src=base_url+'/images/thumbnails/1/02.jpg';preload[1][1]=new Image(587,366);preload[1][1].src=base_url+'/images/thumbnails/1/03.jpg';preload[1][2]=new Image(587,366);preload[1][2].src=base_url+'/images/thumbnails/1/04.jpg';preload[1][3]=new Image(587,366);preload[1][3].src=base_url+'/images/thumbnails/1/05.jpg';preload[2]=new Array(4);preload[2][0]=new Image(587,366);preload[2][0].src=base_url+'/images/thumbnails/2/02.jpg';preload[2][1]=new Image(587,366);preload[2][1].src=base_url+'/images/thumbnails/2/03.jpg';preload[2][2]=new Image(587,366);preload[2][2].src=base_url+'/images/thumbnails/2/04.jpg';preload[2][3]=new Image(587,366);preload[2][3].src=base_url+'/images/thumbnails/2/05.jpg';preload[3]=new Array(4);preload[3][0]=new Image(587,366);preload[3][0].src=base_url+'/images/thumbnails/3/02.jpg';preload[3][1]=new Image(587,366);preload[3][1].src=base_url+'/images/thumbnails/3/03.jpg';preload[3][2]=new Image(587,366);preload[3][2].src=base_url+'/images/thumbnails/3/04.jpg';preload[3][3]=new Image(587,366);preload[3][3].src=base_url+'/images/thumbnails/3/05.jpg';preload[4]=new Array(4);preload[4][0]=new Image(587,366);preload[4][0].src=base_url+'/images/thumbnails/4/02.jpg';preload[4][1]=new Image(587,366);preload[4][1].src=base_url+'/images/thumbnails/4/03.jpg';preload[4][2]=new Image(587,366);preload[4][2].src=base_url+'/images/thumbnails/4/04.jpg';preload[4][3]=new Image(587,366);preload[4][3].src=base_url+'/images/thumbnails/4/05.jpg';preload[5]=new Array(4);preload[5][0]=new Image(587,366);preload[5][0].src=base_url+'/images/thumbnails/5/02.jpg';preload[5][1]=new Image(587,366);preload[5][1].src=base_url+'/images/thumbnails/5/03.jpg';preload[5][2]=new Image(587,366);preload[5][2].src=base_url+'/images/thumbnails/5/04.jpg';preload[5][3]=new Image(587,366);preload[5][3].src=base_url+'/images/thumbnails/5/05.jpg';preload[6]=new Array(4);preload[6][0]=new Image(587,366);preload[6][0].src=base_url+'/images/thumbnails/6/02.jpg';preload[6][1]=new Image(587,366);preload[6][1].src=base_url+'/images/thumbnails/6/03.jpg';preload[6][2]=new Image(587,366);preload[6][2].src=base_url+'/images/thumbnails/6/04.jpg';preload[6][3]=new Image(587,366);preload[6][3].src=base_url+'/images/thumbnails/6/05.jpg';preload[7]=new Array(4);preload[7][0]=new Image(587,366);preload[7][0].src=base_url+'/images/thumbnails/7/02.jpg';preload[7][1]=new Image(587,366);preload[7][1].src=base_url+'/images/thumbnails/7/03.jpg';preload[7][2]=new Image(587,366);preload[7][2].src=base_url+'/images/thumbnails/7/04.jpg';preload[7][3]=new Image(587,366);preload[7][3].src=base_url+'/images/thumbnails/7/05.jpg';preload[8]=new Array(4);preload[8][0]=new Image(587,366);preload[8][0].src=base_url+'/images/thumbnails/8/02.jpg';preload[8][1]=new Image(587,366);preload[8][1].src=base_url+'/images/thumbnails/8/03.jpg';preload[8][2]=new Image(587,366);preload[8][2].src=base_url+'/images/thumbnails/8/04.jpg';preload[8][3]=new Image(587,366);preload[8][3].src=base_url+'/images/thumbnails/8/05.jpg';preload[9]=new Array(4);preload[9][0]=new Image(587,366);preload[9][0].src=base_url+'/images/thumbnails/9/02.jpg';preload[9][1]=new Image(587,366);preload[9][1].src=base_url+'/images/thumbnails/9/03.jpg';preload[9][2]=new Image(587,366);preload[9][2].src=base_url+'/images/thumbnails/9/04.jpg';preload[9][3]=new Image(587,366);preload[9][3].src=base_url+'/images/thumbnails/9/05.jpg';preload[10]=new Array(4);preload[10][0]=new Image(587,366);preload[10][0].src=base_url+'/images/thumbnails/10/02.jpg';preload[10][1]=new Image(587,366);preload[10][1].src=base_url+'/images/thumbnails/10/03.jpg';preload[10][2]=new Image(587,366);preload[10][2].src=base_url+'/images/thumbnails/10/04.jpg';preload[10][3]=new Image(587,366);preload[10][3].src=base_url+'/images/thumbnails/10/05.jpg';preload[11]=new Array(4);preload[11][0]=new Image(587,366);preload[11][0].src=base_url+'/images/thumbnails/11/02.jpg';preload[11][1]=new Image(587,366);preload[11][1].src=base_url+'/images/thumbnails/11/03.jpg';preload[11][2]=new Image(587,366);preload[11][2].src=base_url+'/images/thumbnails/11/04.jpg';preload[11][3]=new Image(587,366);preload[11][3].src=base_url+'/images/thumbnails/11/05.jpg';}}
function activateHoverCatcher(){$('table#same tr:gt(0)').find('td:gt(0)').mouseover(function(){$(this).addClass('hoverrow');$(this).siblings('td:first').removeClass('grayback').addClass('hoverrow');$(this).closest('table').find('tr:first td:eq('+$(this).closest('tr').find('td').index(this)+')').removeClass('grayback').addClass('hoverrow');});$('table#same tr:gt(0)').find('td:gt(0)').mouseout(function(){$(this).removeClass('hoverrow');$(this).siblings('td:first').removeClass('hoverrow').addClass('grayback');$(this).closest('table').find('tr:first td:eq('+$(this).closest('tr').find('td').index(this)+')').removeClass('hoverrow').addClass('grayback');});}