var sliding = false;

jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

function init(loc) {	
	var worksHoverColor = '#FF4400';
	$('.worksbg').hover(
		function() {
			if (!($(this).hasClass('dimmed'))) {
				$(this).stop().animate({'backgroundColor':worksHoverColor},600 );
				$(this).find('.desc').stop().animate({'color':'#FFFFFF'}, 200 );
			}
		},
		function() {
			if (!($(this).hasClass('dimmed'))) {
				$(this).stop().animate({'backgroundColor':'#ececec'}, 600 );
				$(this).find('.desc').stop().animate({'color':'#777777'}, 200 );
			}
		}
	);
		
	$('.dropdown').each( // Init dropdown menus
		function(i) {
			$(this).hover(
				function() {
					$(this).find('ul').css('position','absolute').show();
					$(this).find('ul').css('z-index',20000);
				},
				function() {
					$(this).find('ul').hide();
				}
			);
		}
	);
	if ($('body').hasClass("single")) {
		
		$('div.cycling-project-images').before('<div id="project-pager">').cycle({ 
		    fx:     'fade',
		    timeout: 5000, 
		    pager:  '.project-pager'
		});
		
		
		$('.project-pager a').corner("3px");
	}
	
	$('.rounded').corner("3px");

	$('.project-pager a').click(function() {
		$('div.cycling-project-images').cycle('pause', true);
	});
	
	$("div.scrollable").scrollable({ vertical:true,  clickable:false, size: 3});
	$("div.scrollableInsanlar").scrollable({ vertical:true,  clickable:false, size: 3});
	
	$('#fuarlar a').lightBox();
	$('#basinda a').lightBox();
	
	$('.wall').masonry({
		columnWidth: 196,
		singleMode: true,
		itemSelector: '.works'
	});	
	
	$(".bio-expand").tooltip();
	
	// Remove all title attributes from images
	$("img").removeAttr("title");
	
	// Initializa Google Maps
	if ($('body').hasClass("page-id-225")) { //information page id is 225
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map_canvas"));
			map.setCenter(new GLatLng(41.031885,28.979428), 17);	
			var point = new GLatLng(41.031885,28.979428);
			map.addOverlay(new GMarker(point));
			map.setUIToDefault();
		}
	}
	
	$('body').css('visibility', 'visible');
}
