// JavaScript Document
Cufon.replace('h1, h2');
//shadowbox
	Shadowbox.init();

//page fade
	/*$('body').css("display", "none");
	$('body').fadeIn(2000);
	$('ul#mainNav a').click(function(event) {
		event.preventDefault();
		linkLocation = this.href;
		$('body').fadeOut(1000, redirectPage);
	});
	   
	function redirectPage() {
	window.location = linkLocation;
	}
*/
	
$(function(){
// imagePreload   
   $(".sliderBox").preloader();  
  
//scroll  
	var win = $(window);
	// Full body scroll
	var isResizing = false;
	win.bind(
		'resize',
		function()
		{
			if (!isResizing) {
				isResizing = true;
				var container = $('#container');
				// Temporarily make the container tiny so it doesn't influence the calculation of the size of the document
				container.css(
					{
						'width': 1,
						'height': 1
					}
				);
				// Now make it the size of the window...
				container.css(
					{
						'width': win.width(),
						'height': win.height()
					}
				);
				isResizing = false;
				container.jScrollPane(
					{
						'animateScroll'				: true,
						'showArrows'				: false,
						'enableKeyboardNavigation'	: true,
						'verticalDragMinHeight'		: 100,
						'verticalDragMaxHeight'		: 100
					}
				);
			}
		}
	).trigger('resize');

	// Workaround for known Opera issue which breaks demo (see http://jscrollpane.kelvinluck.com/known_issues.html#opera-scrollbar )
	$('body').css('overflow', 'hidden');

	// IE calculates the width incorrectly first time round (it doesn't count the space used by the native scrollbar) so we re-trigger if necessary.
	if ($('#container').width() != win.width()) {
		win.trigger('resize');
	}

// Internal scrollpanes
	$('.scroll-pane').jScrollPane({showArrows: false});

       
   
// font color animation 
	$("ul#mainNav a").stop().hover(function() {
			$(this).stop().animate({ color: "#e8a03a"}, 300);
		},function() {
			$(this).animate({ color: "#8f8f80"}, 300);
	});
	
	if ($.browser.msie && $.browser.version < 9) {
		$("article").hover(function() {
			$(this).animate({ backgroundColor: "#030303" }, 300);
		},function() {
			$(this).animate({ backgroundColor: "#131313" }, 300);
		});
	};
	 
	$("article a").hover(function() {
			$(this).animate({ color: "#e8a03a" }, 200);
		},function() {
			$(this).animate({ color: "#ffffff" }, 200);
	});

//mousy slider
	//$("#alka, #dAkademi, #borusanLojistik, #borusanLimani, #denizbanIK, #etsun, #cemBialetti, #kayaHomes, #deepist, #ict-turkey, #supsan, #borGumruk, #stsCephe, #basiliIsler, #denizbankpgp, #elitPc").mouseSlider();
	$('.sliderBox').mouseSlider();  
	
}); 
