$(document).ready(function()
	{
	 $('#table_compare').columnManager({listTargetID:'targetall', onClass: 'advon', offClass: 'advoff', hideInList: [],  
                    saveState: false, colsHidden: [5,6,7,8,9,10,11,12,13,14]}); 
		
	//checking for IE8 shit
	var version = -1;
	if (navigator.appName == 'Microsoft Internet Explorer') {
		var ua = navigator.userAgent;
		var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null)
			version = parseFloat(RegExp.$1);
		}
	
	
	var opt = {listTargetID: 'targetall', onClass: 'advon', offClass: 'advoff',  
		hide: function(c){ 
			$(c).fadeOut(); 
		},  
		show: function(c){ 
			$(c).fadeIn(); 
		}}; 
	

	if (version >= 8.0) {
		opt = {listTargetID: 'targetall', onClass: 'advon', offClass: 'advoff'}; 
	}	
	
	document.getElementById('button_prev').disabled = true;
	var left=1;
	var right=4;
	
	$('#table_compare').tableHover({colClass: 'table_compare_hover'}); 
	
	$('#button_next').click( show_next );
	$('#button_next2').click( show_next );
	
	$('#button_prev').click( show_prev );
	$('#button_prev2').click( show_prev );
	
	function show_next(){
		if (right < 14) {
			right++;
			$('#table_compare').showColumns(right,opt); 
			left++;
			$('#table_compare').hideColumns(left); 
			
			if (right == 14) document.getElementById('button_next').disabled = true;
			document.getElementById('button_prev').disabled = false;
		}
		
		}
	function show_prev(){
		if (left > 1) {
		$('#table_compare').hideColumns(right); 
		right--;
		$('#table_compare').showColumns(left,opt); 
		left--;
		if (left == 1) document.getElementById('button_prev').disabled = true;
		document.getElementById('button_next').disabled = false;
		}
		}
		
	});