// Call Scripts - Nesnel Theme - Orkun Gursel


Cufon.replace("h1,h2,h3,h4,h5,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:'random',
	slices:10,
	animSpeed:500,
	pauseTime:interval,
	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();
$("a[rel^='prettyPhoto'], .gallery-icon > a").prettyPhoto();
$("input").labelify({text: "label"});
$("abbr.timeago").timeago();
$('.galleria').galleria({
	autoplay: 0,
	pause_on_interaction: true,
	thumbnails:true,
	image_crop: 'width',
	image_position: 'top',
	on_image: function( image, thumb ) {
        var gallery = this;
        $( image ).click( function() {
			$.prettyPhoto.open($( image ).attr("src"));
        })
    }
});


$('#commentform').click(function(){
	
	$('#hidden-comment-form-parts').slideDown();
								 
	});

});
