// JavaScript Document

$('document').ready(function(){
	
//	$('#viewMap').toggle(function(){
//		$(this).animate({ width: '607px', height: '388px' }, 300);
//		$('.viewmap-btn').fadeOut(300);
//	}, function(){
//		$(this).animate({ width: '228px', height: '209px' }, 300);
//		$('.viewmap-btn').fadeIn(300);
//	});
	
	// adding odd (even rather) rows to class='odd'
	$('#newsListing li:odd').addClass('odd'); // for newsListing
	$('.projectList .projectListItem:odd').addClass('odd'); //for operationlist
	$('#searchContent .searchResults:odd').addClass('odd'); // for search results
	$('.detailInfo tr:odd').addClass('odd');
	
	// elements that have 'transparency' hover
	$('.searchButton, .submitBtn').hover(function(){
		$(this).css({opacity: 0.7});
	}, function(){
		$(this).css({opacity: 1});
	});
	
	
	// disable link href for Mining Operations list view
	$('.listView').click(function(){ return false });
	
	// using javascript to remove padding from #content on operations flash map
	// this pressumes there are no other flash throughout the site with id="flashContent"
	$('#flashContent').parent('div.content').css({'padding-bottom': '0px'});
	
	// using javascript to set equal height to all landingFeature paragraphs
	var maxHeight;
	$('.landingFeature p').each(function(){
		var getHeight = $(this).height();
		if(maxHeight){
			if(getHeight > maxHeight){
				maxHeight = getHeight;
			}
		}
		else{
			maxHeight = getHeight;
		}
	});
	$('.landingFeature p').each(function(){
		$(this).css({height: maxHeight + 'px'});
	});
});