$(document).ready(function() {
	$('.anythingSlider').anythingSlider({easing: 'swing',autoPlay: true,delay: 7000,startStopped: false,animationTime: 1000,hashTags: true,buildNavigation: true,pauseOnHover: false,startText: '',stopText: '',buildNextBackNavigation: true});
	$('.LogoPS').dbssprite({down: 'ADown', up: 'AEnter', enter: 'AEnter', leave: 'AEnter' });
	$('.DemoButton').dbssprite({down: 'ADown', up: 'AEnter', enter: 'AEnter', leave: 'AEnter' });
	$('.submit').dbssprite({down: 'ADown', up: 'AEnter', enter: 'AEnter', leave: 'AEnter' });
	$('.Chat').dbssprite({down: 'ChatDown', up: 'ChatEnter', enter: 'ChatEnter', leave: 'ChatEnter' });
	$('.CenChek').dbssprite({down: 'CenDown', up: 'CenEnter', enter: 'CenEnter', leave: 'CenEnter' });
	$("#date").datepicker({
		dateFormat: 'yy-mm-dd'
	});
	videoMenu();
	userfeelings();
	cennikUpDown();
	opinion();
});
function jById(href,id){var h=$('#'+id);h.load(href,{},function(){
});}

function ajaxRq(href,id,form_id) 
{
	var h=$('#'+id);
	h.load(href,$('#'+form_id).serializeArray());
}
function opinion()
{
	$('.Opinion').mouseover(function(){
		$(this).animate({
			width: '70px'
		});
	});
	$('.Opinion').mouseleave(function(){
		$(this).animate({
			width: '34px'
		});
	});
	$('.Opinion').click(function(){
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: 'http://www.projectshelf.com/pcc,5.html'
		});
	});
}

function cennikUpDown()
{
	$('#liczba').keypress(function(event) {
  		if (event.keyCode == '38') {
     		val = $('#liczba').val();
     		$('#liczba').attr('value',parseInt(val)+1);
   		}
  		if (event.keyCode == '40') {
     		val = $('#liczba').val();
     		$('#liczba').attr('value',parseInt(val)-1);
   		}
   	});
}

function videoMenu()
{
	$('.OneVideo a').click(function() {
		$('.Left').children().removeClass('Playing');
		$(this).parent().addClass('Playing');
	});
}
function userfeelings()
{
	$('.element a').click( function() {
		$(this).parent().css('margin-top','1px');
	});
	$('.MenuElement a').click( function() {
		$(this).parent().css('top','1px');
	});
	$('.BottomTabs li a').click( function() {
		$(this).parent().css('margin-top','-1px');
	});
}
function closeMe()
{
	$('.OrderSucces').remove();
}
