Cufon.replace('.left_content .main_left_menu ul li a, .menu_description ul li a, .menu_description_art ul li a, .projects_list ul li h4, a.link_text_bottom, a.read_more, .article_with_gallary .project_title, .projects_list ul li a.view_pdf, .for_more_inform a, .press_all_articles h2 a, ul.tabs li a, span#lightbox-image-details-caption, .link_for_article a, .for_text p a', {fontFamily:'Vollkorn Regular' });
Cufon.replace('.left_content .main_left_menu ul li a.active, .menu_description ul li a.active', {hover:true,fontFamily:'Vollkorn Bold' });
Cufon.replace('.article_with_gallary h5 span, h1, .article_with_gallary .name_author, .projects_list ul li h4 span, .big_news .for_text h2, .block_news .for_text h2, .press_all_articles h2 span, .main_left_menu li.current-menu-item a', {fontFamily:'Vollkorn Bold' });
Cufon.replace('.sub-menu',{'fontFamily' : 'Vollkorn Regular'})
Cufon.replace('.main_left_menu li.current-menu-item > a, .main_left_menu li.current-menu-ancestor > a', {'fontFamily' : 'Vollkorn Bold'});


$(document).ready(function(){
						   
						   

//---------------------------------------
 $('p a').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  }
  ,
  function(){
   $hoveredObjParent = $('#cufonStyleThis').parent();
   if(($hoveredObjParent.hasClass('current-menu-item')) || ($hoveredObjParent.hasClass('current-menu-ancestor'))){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );


 
 
//---------------------------------------



//---------------------------------------
 $('h2 a').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  }
  ,
  function(){
   $hoveredObjParent = $('#cufonStyleThis').parent();
   if(($hoveredObjParent.hasClass('current-menu-item')) || ($hoveredObjParent.hasClass('current-menu-ancestor'))){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );


 
 
//---------------------------------------

						   

//---------------------------------------
 $('.main_left_menu a').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  }
  ,
  function(){
   $hoveredObjParent = $('#cufonStyleThis').parent();
   if(($hoveredObjParent.hasClass('current-menu-item')) || ($hoveredObjParent.hasClass('current-menu-ancestor'))){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );


 
 
//---------------------------------------


//---------------------------------------
$('.for_text p a.active').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );

 $('.for_text p a').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular'
   });
   }
  $(this).removeAttr('id');
  }
 );
//---------------------------------------


//---------------------------------------
$('.menu_description ul li a.active').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );

 $('.menu_description ul li a').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').hasClass('current')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular'
   });
   }
  $(this).removeAttr('id');
  }
 );
//---------------------------------------



//---------------------------------------
$('.a.link_text_bottom.active').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );

 $('a.link_text_bottom').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular'
   });
   }
  $(this).removeAttr('id');
  }
 );
//---------------------------------------


//---------------------------------------
$('a.read_more.active').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );

 $('a.read_more').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular'
   });
   }
  $(this).removeAttr('id');
  }
 );
//---------------------------------------


//---------------------------------------
$('.projects_list ul li a.view_pdf.active').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );

 $('.projects_list ul li a.view_pdf').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular'
   });
   }
  $(this).removeAttr('id');
  }
 );
//---------------------------------------

//---------------------------------------
$('.for_more_inform a.active').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold',
   'font-weight' : 'bold'
   });
   }
  $(this).removeAttr('id');
  }
 );

 $('.for_more_inform a').hover(
  function(){
   $(this).attr('id' , 'cufonStyleThis');
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Bold'
  });
  },
  function(){
   if($('#cufonStyleThis').parent().hasClass('active')){

   }else {
   Cufon.replace('#cufonStyleThis',{
   'fontFamily' : 'Vollkorn Regular'
   });
   }
  $(this).removeAttr('id');
  }
 );
//---------------------------------------



//---------------------------------------
    $('.wrapper').css({minHeight: $('body').outerHeight(true)+'px'});
//---------------------------------------


//---------------------------------------

	// setup ul.tabs to work as tabs for each div directly under div.panes
	$('ul.tabs').tabs('div.content_tabs > div.content');
    // after the tabs have been initalized the current tab must be
    // highlighted with the bolder font so we call cufon again
    Cufon.replace('ul.tabs a.current', {'fontFamily':'Vollkorn Bold'});

    // on clicking on a link it first resets ALL of them to the regular font
    // after that it applies an ID  to the currently clicked tab
    // sets it to bold then removes the ID
    $('ul.tabs a').click(function(){
        Cufon.replace('ul.tabs a', {'fontFamily':'Vollkorn Regular'});
        $(this).attr('id','cufonStyleThis');
        Cufon.replace('#cufonStyleThis', {'fontFamily':'Vollkorn Bold'});
        $(this).attr('id','');
    });


//---------------------------------------

//----------------------gallery----------
  var currentPosition = 0;
  var slideWidth = 512;
  var slides = $('.slide');
  var numberOfSlides = slides.length;
  // we must get the first slides image
  var $firstSlideImg = slides.eq(0).find('img');
  // and get the first image alt tag
  var firstCaption = $firstSlideImg.attr('alt');
  var $captionContainer = $('.article_with_gallary .project_title');
  // set the content of the caption container
  // now we append the text in the caption container
  $captionContainer.html(firstCaption);

  // and apply cufon to it
  Cufon.replace('.article_with_gallary .project_title', {fontFamily:'Vollkorn Regular' });


  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides
    .wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
  var $scroller = $('#slideInner');
  $scroller.css({'width' : slideWidth * numberOfSlides});

  // Insert controls in the DOM
  $('#slideshow')
    .prepend('<a class="control" id="leftControl"></a>')
    .append('<a class="control" id="rightControl"></a>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $scroller.animate({
      'marginLeft' : slideWidth*(-currentPosition)
    }).queue(function(){
      // this should fire after the slide animation
      // get the scroller position in px, get the actual number
      // and make it positive
      var scrollerPosition = parseInt($scroller.css('margin-left')) * -1;
      // dividing the scroller position by the slide width
      // should always return the index number of the current slide
      // this is 0 based
      var indexNumber = scrollerPosition / slideWidth;

      // knowing the current slide number
      // allows us to get the current image so we can
      // access the alt attribute
      var $currentImg = $scroller.find('div.slide a img').eq(indexNumber);

      // now get the text inside the alt attribute
      var captionText = $currentImg.attr('alt');

      // now we append the text in the caption container
      $captionContainer.html(captionText);

      // and re-apply cufon on it
      Cufon.replace('.article_with_gallary .project_title', {fontFamily:'Vollkorn Regular' });

      $(this).dequeue();
    });

  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  }

  $('.slide a').lightBox();


//---------------------------------------
});


