
	
 //   setContainerWidth = function (){    
 //       var browserWidth = $(window).width();
 //       if(browserWidth < 1130){
 //       	if(browserWidth > 1000){
 //       		var setWidth = browserWidth + 130 + 'px';
 //           	$('body').width(setWidth);
 //           } else {
 //           	$('body').css('width', '1000px');
 //           }
 //       } else {
 //           $('body').css('width','auto');    
 //       }
 //  	}
        
   
 //       setContainerWidth();
        
 //       $(window).resize(function(){
 //           setContainerWidth();
 //       });


$(document).ready(function(){

	var paid_icons = $(".paid p span");
	$(paid_icons).hover(function(){
			$(this).append("<img src='_files/css/images/paid_tooltip.png' />");
	},
	function(){
			$(this).text("");
	});
	
	// ======================================================================= Tables Zebra stiping
	$('tbody tr:odd').addClass('zebra');
	
	// ======================================================================= Table highlight
	$('tbody tr td').hover(function(){
			$(this).parent().addClass('table_highlight');
			var columnIndex = $(this).index();
			$('tbody tr').each(function(){
				$(this).find('td').eq(columnIndex).addClass('column_highlight');
			});
		},function(){
			$(this).parent().removeClass('table_highlight');
			$('tbody tr td').removeClass('column_highlight');
	});

	

	

	
});
	
	// ======================================================================= Banner gallery
	
		function slideShow() {
			if($("#gallery a").length > 1){
				var direction;
				var left = $('#control_left');
				var right = $('#control_right'); 
				left.css('visibility','visible');  
				right.css('visibility','visible');    
				left.click(function(){
					direction = 'back';				
					gallery(direction);
				});   
				right.click(function(){	
					gallery();
				});
			   
			   
				//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
				var interval = setInterval('gallery()', 5000);
			   
				$('#gallery img').hover(function(){
					interval = clearInterval(interval);
				}, function() {
					interval = setInterval('gallery()', 3000);
				});   
				left.hover(function(){
					interval = clearInterval(interval);
					
				}, function() {
					interval = setInterval('gallery()', 3000);
				});
				right.hover(function(){
					interval = clearInterval(interval);
				}, function() {
					interval = setInterval('gallery()', 3000);
				});
			}
		};
		
		function gallery(direction) {
			//if no IMGs have the show class, grab the first image
			var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));
			//Get next image, if it reached the end of the slideshow, rotate it back to the first image
			var itemIndex = ($('#gallery a').index(current));
			if(direction == 'back'){
				var next = ((current.prev().length) ? ((current.prev().hasClass('caption'))? $('#gallery a:last') :current.prev()) : $('#gallery a:last'));   
				direction = '';	
			} else {
				var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));   
			}
		   
			//Set the fade in effect for the next image, show class has higher z-index
			next.css({opacity: 0.0})
			.addClass('show')
			.animate({opacity: 1.0}, 2000);
		
			//Hide the current image
			current.animate({opacity: 0.0}, 2000)
			.removeClass('show');
		   
			//Set the opacity to 0 and height to 1px
			$('#gallery .caption').animate({opacity: 0.0}, { queue:true, duration:1000 }).animate({height: '1px'}, { queue:true, duration:300 });   
		   
			//Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect
			$(next).find('.caption').animate({opacity: 0.7},1 ).animate({height: '50px'},300 );
		};
	
// ======================================================================= 
	
	
		function formatNumber(number, decimalPlaces)
	{
		var num = parseFloat(number).toFixed(decimalPlaces);
		document.write(num.toString());
	}
	
// ======================================================================= Conent nav	

	function ContentMenu(tab, content, element, showContent){
		var list = tab.parentNode.parentNode.getElementsByTagName('a');
		for(i = 0; i < list.length; i++ ){
			list[i].className = '';
		}
		tab.className = 'selected';
		var contentList = document.getElementById(content).getElementsByTagName(element);
		for(i = 0; i < contentList.length; i++ ){
			contentList[i].style.display = 'none';
		}
		contentList[showContent].style.display = '';
	}

	function ContentMenuTarget(tab, content, className, showContent){
		var list = tab.parentNode.parentNode.getElementsByTagName('a');
		for(i = 0; i < list.length; i++ ){
			list[i].className = '';
		}
		tab.className = 'selected';
		var contentList = document.getElementById(content).getElementsByClassName(className);
		for(i = 0; i < contentList.length; i++ ){
			contentList[i].style.display = 'none';
		}
		contentList[showContent].style.display = '';
	}

// ======================================================================= Get Elements By Attribute
	
	function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue) {

		var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
		var arrReturnElements = new Array();
		var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)", "i") : null;
		var oCurrent;
		var oAttribute;
		for(var i=0; i<arrElements.length; i++) {
		    oCurrent = arrElements[i];
		    if (strAttributeName.toLowerCase() != "class")
		        oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName);
		    else
		        oAttribute = oCurrent.className;
			
			if (typeof oAttribute == "string" && oAttribute.length > 0) {			    
			    if (typeof strAttributeValue == "undefined" || !strAttributeValue || (oAttributeValue && oAttributeValue.test(oAttribute))) {
					arrReturnElements.push(oCurrent);
				}
			}
		}
		return arrReturnElements;
	}
	
