// JavaScript Document

$(document).ready(function()
{
	//preload images
	jQuery.preLoadImages("../images/linkBtn.png", "images/linkBtnHover.png");
	
	// Load modal content dialog on click
	$('.basic').click(function (e) {
		
		$("#basic-modal-content").modal({onOpen: function(dialog) {
				dialog.overlay.fadeIn('slow', function() {
					dialog.data.hide();
					dialog.container.fadeIn('slow', function() {
						dialog.data.slideDown('slow');
					});
				});
		}});

	
	});
	
//content slider 
/*	$("#slider").easySlider({

		prevText: '',
		nextText: ''
	});*/
	
	$('#quoteList').innerfade
			({ 
				animationtype: 'fade', 
				speed: 1000, 
				timeout: 9000, 
				type: 'sequence',
				children: 'li' 
				
			});
			
	var path = window.location.pathname.substring(1);
	
	var path2 = window.location;
	
	if (path2)
	{
		if(path2 == "http://www.polecat.co/")
		{
			$('#navHome').attr('class', 'clicked');		
		}
		else if(path2 == "http://www.polecat.co/news")
		{
			$('#navNews').attr('class', 'clicked');		
		}
		else if(path2 == "http://polecat.co/")
		{
			$('#navHome').attr('class', 'clicked');	
		}
	}
	
	var rightHeight;
	
	if ( path )
	{	
		
		if(path == "index.php")
		{
			$('#navHome').attr('class', 'clicked');	
		}
		else if(path == "news.php")
		{
			$('#navNews').attr('class', 'clicked');	
		}
		else if(path == "meaningmine.php")
		{
			$('#navProduct').attr('class', 'clicked');	
			
			rightHeight = $('#bchLeft').height() - 71;
		}
		else if(path == "consulting.php")
		{
			$('#navServices').attr('class', 'clicked');
			
			rightHeight = $('#bchLeft').height() - 71;	
		}
		else if(path == "about.php")
		{
			$('#navAbout').attr('class', 'clicked');
			
			rightHeight = $('#bchLeft').height() - 91;	
		}
		else if(path == "careers.php")
		{
			$('#navCareers').attr('class', 'clicked');
			rightHeight = $('#bchLeft').height() -70;
		}
		else if(path == "contact.php")
		{
			$('#navContact').attr('class', 'clicked');
				
			rightHeight = $('#bchLeft').height() - 91;
		}
		else if(path == "caseStudies.php")
		{
			rightHeight = $('#bchLeft').height() + 19;
			$('.bchLeftInner').height(rightHeight);
		}
		else if (path == "robust.php")
		{
			rightHeight = $('#bchLeft').height() + 19;
			$('.bchLeftInner').height(rightHeight);	
		}
		else if (path == "researchEngineer.php")
		{
			rightHeight = $('#bchLeft').height() + 19;
			$('.bchLeftInner').height(rightHeight);
		}
		else if (path == "jobs.php")
		{
			rightHeight = $('#bchLeft').height() -90;
			
		}
		
	}	
	
	$('#bchRightInner').height(rightHeight);
	
}); 
