$(document).ready(function(){
	fOpacityFaded = '0.5';
	fOpacityUnfaded = 1;
/*
	$('.cImgPhoto').qtip({
		content: fOpacityFaded
	});
*/
	$('.cImgPhoto').each(function(){
		sContentShort = "<div class='cDivQTipTitle'>" + $(this).parent('div.cDivPhotoDetailContainer').children('p.cPPhotoDetailShort').html() + "</div>";
		sContentLong = "<div class='cDivQTipContent'><div class='cDivQTipImage'><img src='" + $(this).attr('src') + "' / width='105' height='105'></div>" + $(this).parent('div.cDivPhotoDetailContainer').children('p.cPPhotoDetailLong').html() + "</div>";

		$(this).qtip({
			content: sContentShort,
			position: {
				target: 'mouse',
				corner: {
					target: 'bottomRight',
					tooltip: 'topMiddle'
				},
				adjust: {
					x: 15,
					y: 15
				}
			},
			style: {
				width: { max: 500 },
				padding: '5px',
				border: {
					width: 1,
					radius: 1,
					color: '#333333'
				},
				name: 'dark'
			}
		});

		$(this).qtip({
			content: {
				title: {
					text: sContentShort,
					button: false
				},
				text: sContentLong
			},
			position: {
				target: 'mouse',
				corner: {
					target: 'bottomRight',
					tooltip: 'topMiddle'
				},
				adjust: {
					x: -55,
					y: 15
				}
			},
			show: {
				when: 'click', // Show it on click
				solo: true, // And hide all other tooltips
				effect: {
					type: 'fade',
					length: 500
				}
			},
			hide: {
				when: 'mouseout',
				effect: {
					type: 'fade',
					length: 500
				}
			},
			style: {
				width: { max: 500 },
				padding: '10px',
				border: {
					width: 3,
					radius: 3,
					color: '#333333'
				},
				name: 'dark'
			}
		});
	});
	$('.cImgPhoto').fadeTo(1, fOpacityFaded);

	$('.cImgPhoto').mouseover(function(){
		$(this).fadeTo(1, fOpacityUnfaded);
	});
	$('.cImgPhoto').mouseout(function(){
		$(this).fadeTo(1, fOpacityFaded);
	});

	$('.cImgPhoto').click(function(){
		//$(this).parent('div.cDivPhotoDetailContainer').children('p.cPPhotoDetailShort').fadeTo(1, 1);

	});

	/* TODO BEGIN - Moved to partners.js - has to be removed */
	var aProjectElements = $('#iDivProjectContainer ul li');
	var iProjectElements = aProjectElements.length;
	var iProjectElementsPerPage = 1;
	if (iProjectElements > iProjectElementsPerPage) {
		$('#iDivProjectContainer').carousel({
			itemsPerPage: iProjectElementsPerPage,
			orientation: 'horizontal',
			pagination: true,
			nextPrevActions: false,
			nextActionText: '',
			prevActionText: '',
			autoScroll: false,
			pause: 5000,
			speed: 2000
		});
	}

	/* TODO END - Moved to partners.js - has to be removed */
});
