// Call Scripts - Nesnel Theme - Orkun Gursel


Cufon.replace("#footer h1,#footer h2,#footer h3,#footer h4,#footer h5,#footer h6");	
Cufon.replace("#breadcrumb > ul > li > a, #menu > li > a",{hover: true});

$(document).ready(function() {
						   
// GET OPTIONS FROM THE PAGES
var nav_interval = $("meta[name=nav_interval]").attr('content') || 50;
var nav_timeout = $("meta[name=nav_timeout]").attr('content') || 100;
var autorotation = parseInt($("meta[name=autorotation]").attr('content'));
var interval = $("meta[name=interval]").attr('content');
var orientation = $("meta[name=orientation]").attr('content');
$('#menu').themenu({
		menu_speed: nav_interval,
		menu_speed_timeout: nav_timeout
	});


$('#slider1').bxSlider({
	alignment: orientation,
	wrapper_class: 'slider1_wrapper',
	auto: autorotation ? true:false,
	auto_controls: true,
	pager: true,
	controls: true,
	speed: 400,
	pause: interval,
	margin:150
});

$("#slider1 a").SVEP({width:850, height:350});

$('#slider2-init').nivoSlider({
	effect:'fade',
	slices:10,
	animSpeed:300,
	pauseTime:6000,
	startSlide:0,
	directionNav:true,
	directionNavHide:true,
	controlNav:true,
	keyboardNav:true,
	pauseOnHover:true,
	manualAdvance:false,
	captionOpacity:0.8,
	beforeChange: function(){},
	afterChange: function(){},
	slideshowEnd: function(){}
});

$("#slider3").featureCarousel({
	smallFeatureWidth:.85,
	smallFeatureHeight:.85,
	autoPlay: (autorotation) ? interval : 0
});

$('.wide,.full').hoverIntent({
	sensitivity: 1,
	interval: 100,
	over: function(){
		 $(this).children().find("h3").slideDown(function(){Cufon.refresh();});
	},
	timeout: 100,
	out: function() {
		$(this).children().find("h3").slideUp(function(){Cufon.refresh();});
	}});

$('.content-box-expandable').click(function(){
			
	var el = $(this);
	var eltoggle = el.parents().children(".content-box-inline").last();
	if (eltoggle.css("display")=="none") {eltoggle.slideDown();}else {eltoggle.slideUp();};return false;
		
});

$('#portfolio-slider').bxSlider({
	alignment: 'horizontal',
	wrapper_class: 'portfolio-slider-wrapper',
	auto: true,
	auto_controls: false,
	pager: true,
	controls: false,
	speed: 400,
	pause: 7000,
	margin:150,
	navigation: 'append'
});

$('.portfolio-items').each(function() {$(this).CloudPortfolio();});
$('.tabs').each(function() {$(this).CloudTabs();});
$('.toggle').each(function() {$(this).CloudToggle();});
$('.contact_form').CloudSendMessage();
$("div[ID^='gallery'] a").each(function() {
	$gettheid = $(this).closest("div").attr("id");
	$usethisrel = "prettyPhoto[P" + $gettheid + "]";
    this.rel += $usethisrel;
});
$("a[rel^='prettyPhoto'], .gallery-icon > a").prettyPhoto({show_title: false,overlay_gallery: true});
$("input").labelify({text: "label"});
$("abbr.timeago").timeago();
$('.galleria').galleria({
	autoplay: 5000,
	carouselSpeed: 3000,
	pause_on_interaction: true,
	thumbnails:true,
	image_crop: 'width',
	image_position: 'top',
});


$('#commentform').click(function(){
	
	$('#hidden-comment-form-parts').slideDown();
								 
	});

$('#quotes').slides({
	preload: true,
	play: 9000,
	pause: 9000,
	hoverPause: true
});
$('#videos').slides({
	generateNextPrev: true,
	preload: true,
	play: 6000,
	pause: 6000,
	hoverPause: true
});

$('.scroll-pane-arrows').jScrollPane({
	showArrows: true,
	horizontalGutter: 10,
	autoReinitialise: true,
	autoReinitialiseDelay: 5000,
	animateTo: true,
	contentWidth: 240
});

$('div.portfolio-items').last().addClass('archive');

});
