var activetimeline = null;

function getHeight(){

  if(jQuery.browser.msie)
  {
    jQuery('#container').css("height",0);
	jQuery('#container').css("height",jQuery('#section').height()+314);
		
	var h = jQuery('#section').height()+70;

  }
  
  else
  {
    jQuery('#container').css("height",jQuery('#centerCol').height()+314);
	
		var h = jQuery('#container').height()-4;
	}
	jQuery('#leftcol').css("height",h); 
	jQuery('#rightcol').css("height",h);

	
  getWidth();
}

function getWidth(){
	if(jQuery.browser.msie)
  {			
	    	//jQuery('#section').css("width",jQuery('#content').width()+100);
  }
  else {
  	    	jQuery('#section').css("width",jQuery('#content').width()-19);

  }

}
jQuery(document).ready(function() {
   	$(".article img").each(function (i) {
		
      		$(this).parent().attr("class","preview");
			$(this).attr("class","preview");
			
      });
	  
	  $("#section img").each(function (i) {
		if($(this).parent().attr("href")!="#")
		{
      		$(this).parent().attr("class","preview");
			$(this).attr("class","preview");
		}
			
      });
	  
  jQuery('a.preview').lightBox();  
  jQuery('.box_link').fancyZoom({width:1024, height:768}); 
  
  getHeight();

  
 });
jQuery(window).resize(function() {
		getHeight();
});

function toggleDiv(id){

	if(jQuery("#"+id).css('display')=='none')
			{
				jQuery("#"+id).toggle(function(){
				getHeight();
				});
				
				jQuery("#"+activetimeline+"timeline").removeClass("activetimeline");
				jQuery("#"+activetimeline).slideUp('fast',function(){
				getHeight();
				});
				activetimeline = id;
				jQuery("#"+id+"timeline").addClass("activetimeline");	

			}	
			else
			{
			jQuery("#"+id).slideUp('fast',function(){
				getHeight();
				});
				activetimeline=null;
				jQuery("#"+id+"timeline").removeClass("activetimeline");	

			}
}