$(document).ready(function () {
/*
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});

	var banner = $.cookie('banner');
	if (banner != 'show') {
		images = ['/_resx/cv1/flash/flash990x764.swf?width=990&height=764'];
		titles = ['Lojer Capre'];
		descriptions = ['Lojer Capre'];
		$.prettyPhoto.open(images,titles,descriptions);
	};

	$.cookie("banner", "show", { path: '/', expires: 1 });
*/

	$('ul.nav').superfish({
		delay: 200,
		animation: {
			opacity: 'show'
		},
		speed: 'fast',
		autoArrows: false,
		dropShadows: false
	});

	$('#cycleImg').cycle({
		fx: 'scrollRight',
		next: '.nextImg',
		timeout: 0,
		easing: 'easeInOutBack'
	});

	var $liveTip = $('<div id="imgTitle"></div>').hide().appendTo('#cycleImg');
	var tipTitle = '', showTip, delay = 0;

	$('#cycleImg').bind('mouseover mouseout', function(event) {

		var $img = $(event.target).closest('img');
		if (!$img.length) { return; }
		var img = $img[0];
	
		if (event.type == 'mouseover') {
			showTip = window.setTimeout(function() {
				$img.data('tipActive', true);
				tipTitle = img.title;
				img.title = '';
				$liveTip
				.html('<div>' + tipTitle + '</div>')
				.show()
	/*			.css({
					top: event.pageY + 12,
					left: event.pageX + 12
				});*/
			}, delay);
		}
	
		if (event.type == 'mouseout') {
			if ($img.data('tipActive')) {
				$img.removeData('tipActive');
				$liveTip.hide();
				img.title = tipTitle || img.title;
			} else {
				window.clearTimeout(showTip);
			}
		}
	/*	if (event.type == 'mousemove' && $img.data('tipActive')) {
			$liveTip.css({
				top: event.pageY + 12,
				left: event.pageX + 12
			});
		}
	*/
	});


	$('#cycleImgII').cycle({
		fx: 'scrollRight',
		next: '.nextImgII',
		timeout: 0,
		easing: 'easeInOutBack'
	});
	
/*	var $liveTipII = $('<div id="imgTitleII"></div>').hide().appendTo('#cycleImgII');
	var tipTitleII = '', showTip, delay = 0;

	$('#cycleImgII').bind('mouseover mouseout', function(event) {

		var $imgII = $(event.target).closest('img');
		if (!$imgII.length) { return; }
		var imgII = $imgII[0];
	
		if (event.type == 'mouseover') {
			showTip = window.setTimeout(function() {
				$imgII.data('tipActive', true);
				tipTitleII = imgII.title;
				imgII.title = '';
				$liveTipII
				.html('<div>' + tipTitleII + '</div>')
				.show()
			}, delay);
		}
	
		if (event.type == 'mouseout') {
			if ($imgII.data('tipActive')) {
				$imgII.removeData('tipActive');
				$liveTipII.hide();
				imgII.title = tipTitleII || imgII.title;
			} else {
				window.clearTimeout(showTip);
			}
		}
	});
*/

	$('#cycleImgIII').cycle({
		fx: 'scrollRight',
		next: '.nextImgIII',
		timeout: 0,
		easing: 'easeInOutBack'
	});

/*	var $liveTipIII = $('<div id="imgTitleIII"></div>').hide().appendTo('#cycleImgIII');
	var tipTitleIII = '', showTip, delay = 0;

	$('#cycleImgIII').bind('mouseover mouseout', function(event) {

		var $imgIII = $(event.target).closest('img');
		if (!$imgIII.length) { return; }
		var imgIII = $imgIII[0];
	
		if (event.type == 'mouseover') {
			showTip = window.setTimeout(function() {
				$imgIII.data('tipActive', true);
				tipTitleIII = imgIII.title;
				imgIII.title = '';
				$liveTipIII
				.html('<div>' + tipTitleIII + '</div>')
				.show()
			}, delay);
		}
	
		if (event.type == 'mouseout') {
			if ($imgIII.data('tipActive')) {
				$imgIII.removeData('tipActive');
				$liveTipIII.hide();
				imgIII.title = tipTitleIII || imgIII.title;
			} else {
				window.clearTimeout(showTip);
			}
		}
	});
*/

	$(".nextImg").hover(
		function() {
			$('.button').stop().fadeTo('normal', 1.0);
		},
		function() {
			$('.button').stop().fadeTo('normal', 0);
		}
	);

	$(".nextImgII").hover(
		function() {
			$('.buttonII').stop().fadeTo('normal', 1.0);
		},
		function() {
			$('.buttonII').stop().fadeTo('normal', 0);
		}
	);

	$(".nextImgIII").hover(
		function() {
			$('.buttonIII').stop().fadeTo('normal', 1.0);
		},
		function() {
			$('.buttonIII').stop().fadeTo('normal', 0);
		}
	);

});