//create object
if( typeof nuvek == 'undefined' )
	nuvek ={};
if( !nuvek.live_right )
	nuvek.live_right = {};

Object.extend( nuvek.live_right,
	{
		product : {
			init : function(){
				var mode = document.compatMode;
				var is_IE = parseFloat( navigator.appVersion.split( 'MSIE' )[1] || 0 );
					if( mode || is_IE )
					window_height = ( mode == 'CSS1Compat' ) ? document.documentElement.clientHeight : document.body.clientHeight;
					return window_height;
			},
			heightDiv1 : function( name_div ){
				var height_div = document.getElementById( name_div ).offsetTop;
				return height_div;
			},
			scrollScreen : function( name_div, height_div ){
				document.getElementById( name_div ).style.top = document.documentElement.scrollTop - height_div + 'px';
			},
			resizeDiv : function( name_bar, name_div ){
			var NLP = nuvek.live_right.product;
			$( name_bar ).setStyle( { height: ( ( ( NLP.init() ) - 35 ) + 'px' ) } );
			$( name_div ).setStyle( { height: ( ( ( NLP.init() ) - 104 ) + 'px' ) } );
			},
			sizeBar : function( name_bar, name_div ){
				var NLP = nuvek.live_right.product;
				var positionY =	document.documentElement.scrollTop;
				var position_div = NLP.heightDiv1( 'table_content' );
				$( name_bar ).setStyle({ height : (( (NLP.init()) -  35 - position_div + positionY )) + 'px'});
				$( name_div ).setStyle({ height : (( (NLP.init()) -  104 - position_div + positionY )) + 'px'});
			}
		}
	}
);
var NLP = nuvek.live_right.product;
function loadSide(){
	NLP.resizeDiv( 'sidebar', 'side_content' );	
}
function loadSize(){
	NLP.sizeBar( 'sidebar', 'side_content' );
}


function initOnLoad(){
		var linkRel = function( e ){
		var ele = Event.element( e );
		window.location = ele.getAttribute( 'href' );
	}
	var right = new FishEyeToolBar( 'side_content',{
		createSub : function( ele, options ){
			return new verticalFishEyeToolBar( ele, options );
		}
	} );
	right.addEventListener( 'itemClick', linkRel );
}
function init(){
	initOnLoad();
	loadSide();
	loadSize();
}

Event.observe( window, 'load', init );
Event.observe( window, 'resize', loadSide );
Event.observe( window, 'resize', loadSize );



window.onscroll = function(){
	var positionY =	document.documentElement.scrollTop;
	var position_div = NLP.heightDiv1( 'table_content' );
	if( positionY >= position_div ){
		NLP.scrollScreen( 'sidebar', position_div );
		loadSide();
	} else{
		document.getElementById( 'sidebar' ).style.top = 0 + "px";
		loadSize();
	} 	
}
 var step = 1;
function scrollUp( name_div ){
	document.getElementById( name_div ).scrollTop -= step;
	timerUp = setTimeout( "scrollUp( '" + name_div + "' )", 10);
}
function scrollDown( name_div ){
	document.getElementById( name_div ).scrollTop += step;
	timerDown = setTimeout( "scrollDown( '" + name_div + "' )", 10);
}

