Cufon.replace('#header h1, div#follow-us .get-social p, div.step-inscription strong, div.rotator-title strong', { fontFamily: 'Just The Way You Are' });
Cufon.replace('div#follow-us .get-social h3, div.step-inscription h3, div.rotator-title span', { fontFamily: 'Helvetica Neue LT Std' });
Cufon.replace('ul.step li h3, div#footer-panel h3, div.step-inscription h3', { fontFamily: 'Helvetica Neue LT Std1' });
Cufon.replace('div.rotator-title b', { fontFamily: '1Helvetica Neue LT Std' });
Cufon.replace('.content h2, .theme-ul h3.arial-fonts, div.blog-entry h3, .service-level0-entry h4, .service-level0-entry span, .helvetica, h3 span.widget-title-main, .custom-sidebar-title h3, .just-the-way', { fontFamily: '1Helvetica Neue LT Std' });


// Easy Slider
$(document).ready(function()
{	
	$("#img-slider").easySlider({
		auto: true, 
		continuous: true,
		speed: 800,
		pause: 8000
	});
	

	$("#vid-slider").easySlider({
		auto: false, 
		continuous: true,
		speed: 800,
		pause: 8000
	});	


// Pretty Photo
$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto();
});

	// Logo Ticker
$(function() {
	$("div#logoParade").smoothDivScroll({ autoScroll: "always", autoScrollDirection: "endlessloopright", autoScrollStep: 1, autoScrollInterval: 55 });

	// Logo parade event handlers
	$("div#logoParade").bind("mouseover", function() {
		$(this).smoothDivScroll("stopAutoScroll");
	}).bind("mouseout", function() {
		$(this).smoothDivScroll("startAutoScroll");
	});

});


// Dropdown Menu
var arrowimages={down:['downarrowclass', 'down.gif', 23], right:['rightarrowclass', 'right.gif']}

var jqueryslidemenu={

animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
	jQuery(document).ready(function($){
		var $mainmenu=$("#"+menuid+">ul")
		var $headers=$mainmenu.find("ul").parent()
		$headers.each(function(i){
			var $curobj=$(this)
			var $subul=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
			this.istopheader=$curobj.parents("ul").length==1? true : false
			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
			/*$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
				'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
				+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
				+ '" style="border:0;" />'
			)*/
			$curobj.hover(
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
					var menuleft=this.istopheader? 0 : this._dimensions.w
					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
					if ($targetul.queue().length<=1) //if 1 or less queued animations
						$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over)
				},
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					$targetul.slideUp(jqueryslidemenu.animateduration.out)
				}
			) //end hover
			$curobj.click(function(){
				$(this).children("ul:eq(0)").hide()
			})
		}) //end $headers.each()
		$mainmenu.find("ul").css({display:'none', visibility:'visible'})
	}) //end document.ready
}
}

//build menu with ID="myslidemenu" on page:
jqueryslidemenu.buildmenu("myslidemenu", arrowimages);

	//$('ul#projects h1.cat-title').css('display', 'none');

// filter choosen elements
$("#filters li").click(function() {

	$("#filters li.active").removeClass("active");
	$(this).addClass("active");
	var element_index = $("#filters li").index(this);
	
	var filterBy = $("#filters li a").eq(element_index).attr("rel");

	
	var number_of_items = $('ul#projects li.'+filterBy+'').length;

	obecnie_klas = filterBy;
	//calculate the number of pages we are going to have
	number_of_pages1 = Math.ceil(number_of_items/show_per_page);
	
	var navigation_html = '<ul class="page align-right"><li class="page-left"><a href="javascript:javascript:previous();" title="prev"><img src="images/pagenav-left.png" alt="" /></a></li>';
	var current_link = 0;
	while(number_of_pages1 > current_link){
		navigation_html += '<li class="page-page"><a href="javascript:go_to_page(' + current_link +')" longdesc="' + current_link +'">'+ (current_link + 1) +'</a></li>';
		current_link++;
	}
	navigation_html += '<li class="page-right"><a href="javascript:next();" title="next"><img src="images/pagenav-right.png" alt="" /></a></li></ul>';
	
	$('.page_navigation').html(navigation_html);
	
	//add active_page class to the first page link
	$('.page_navigation li.page-page:first').addClass('active');
	
	//hide all the elements inside content div
	$('ul#projects li, ul#projects h1.cat-title').css('display', 'none');
		
	//and show the first n (show_per_page) elements
	$('ul#projects li.'+filterBy+'').slice(0, show_per_page).css('display', 'block');
	$('ul#projects h1.'+filterBy+'').slice(0, show_per_page).css('display', 'block');	
	
	go_to_page(0);
	
});

/* Rotator */

$("ul.rotator-list").children().css("display", "none");	
$("ul.rotator-list").children().eq(0).css("display", "block");	
$("ul.rotator-pagenav").children().eq(0).addClass("active");	
var obecnie1 = 0;
var wszystkie1 = $("ul.rotator-pagenav li").length;
var block = 0;

//setInterval(rotate,20000);

function rotate() {
	
	if(block == 0) {
	
	if(obecnie1+1 < wszystkie1) {
	
		obecnie1++
		var element_index = obecnie1;
		$("ul.rotator-list").children().css("display", "none");	
		$("ul.rotator-list").children().eq(element_index).css("display", "block");	
		$("ul.rotator-list").children().eq(element_index).css("opacity","0.2");
		$("ul.rotator-list").children().eq(element_index).animate({ opacity: "1" }, 700);
		$("ul.rotator-pagenav").children().removeClass("active");	
		$("ul.rotator-pagenav").children().eq(element_index).addClass("active");	
	
	} else {
	
		obecnie1 = 0;
		var element_index = 0;
		$("ul.rotator-list").children().css("display", "none");	
		$("ul.rotator-list").children().eq(element_index).css("display", "block");	
		$("ul.rotator-list").children().eq(element_index).css("opacity","0.2");
		$("ul.rotator-list").children().eq(element_index).animate({ opacity: "1" }, 700);
		$("ul.rotator-pagenav").children().removeClass("active");	
		$("ul.rotator-pagenav").children().eq(element_index).addClass("active");	
	
	}
	
	}

}

$("ul.rotator-pagenav li a").click(function() {
	
	var element_index = $("ul.rotator-pagenav li a").index(this);
	obecnie1 = element_index;
	block = 1;
	$("ul.rotator-list").children().css("display", "none");	
	$("ul.rotator-list").children().eq(element_index).css("display", "block");	
	$("ul.rotator-list").children().eq(element_index).css("opacity","0.2");
	$("ul.rotator-list").children().eq(element_index).animate({ opacity: "1" }, 700);
	$("ul.rotator-pagenav").children().removeClass("active");	
	$("ul.rotator-pagenav").children().eq(element_index).addClass("active");	

});

/* Footer testimonials */

var obecnie = 0;
var wszystkie = $("ul.testimonials-list li").length;

$("span.allpages").html(wszystkie);

		
	$("li.pagenav-next a").click(function() {
	
		if(wszystkie>1) {
		
		if(obecnie+1 < wszystkie) {
		
			obecnie++;
			$("ul.testimonials-list li").css("display", "none");	
			$("ul.testimonials-list li").eq(obecnie).css("display", "block");	
			$("ul.testimonials-list li").eq(obecnie).css("opacity","0.2");
			$("ul.testimonials-list li").eq(obecnie).animate({ opacity: "1" }, 700);
			$("span.page").html(obecnie+1);
		
		} else {
		
			obecnie = 0;
			$("ul.testimonials-list li").css("display", "none");	
			$("ul.testimonials-list li").eq(obecnie).css("display", "block");	
			$("ul.testimonials-list li").eq(obecnie).css("opacity","0.2");
			$("ul.testimonials-list li").eq(obecnie).animate({ opacity: "1" }, 700);
			$("span.page").html(obecnie+1);
		
		}
		
		}
		
	});
	
	$("li.pagenav-prev a").click(function() {
	
		if(wszystkie>1) {
		
		if(obecnie-1 >= 0) {
		
			obecnie--;
			$("ul.testimonials-list li").css("display", "none");	
			$("ul.testimonials-list li").eq(obecnie).css("display", "block");	
			$("ul.testimonials-list li").eq(obecnie).css("opacity","0.2");
			$("ul.testimonials-list li").eq(obecnie).animate({ opacity: "1" }, 700);
			$("span.page").html(obecnie+1);
		
		} else {
		
			obecnie = wszystkie-1;
			$("ul.testimonials-list li").css("display", "none");	
			$("ul.testimonials-list li").eq(obecnie).css("display", "block");	
			$("ul.testimonials-list li").eq(obecnie).css("opacity","0.2");
			$("ul.testimonials-list li").eq(obecnie).animate({ opacity: "1" }, 700);
			$("span.page").html(obecnie+1);
		
		}
		
		}
		
	});

/* top menu */
$("#header .right > ul > li").mouseover(function(){
	$(this).find(".sub").css("display", "block");
}).mouseleave(function(){
	$(this).find(".sub").css("display", "none");	
});
// end


/* autoclear function for inputs */
$('.autoclear').click(function() {
if (this.value == this.defaultValue) {
this.value = '';
}
});
$('.autoclear').blur(function() {
if (this.value == '') {
this.value = this.defaultValue;
}
});

/* Corner */

//$('.corner').corner("20px");



});
