function deleteValue(formField) {
	if ( formField.value == formField.defaultValue )
		formField.value = "";
}

function resetValue(formField) {
	if ( formField.value == "" )
		formField.value = formField.defaultValue;
}


var animation = false;
var currentimage = false;
var loadstart = false;
var loadend = false;

$(function () {
	$('#blendimage').load( function() {
		$(this).css('opacity', '1');
		$(this).css('-moz-opacity', '1');
		loadEnd = true;
		if (loadStart) $('#blendani').fadeOut(100);
		$(this).fadeIn(1000);
		setTimeout(function() {
			animation = false;
		}, 1);
	}).error(function () {
		/*alert("Fehler");*/
        }); 
});

function showimg (id) {

	if (id != currentimage && !animation ) {

		loadStart = false;
		loadEnd = false;
		currentimage = id;
		animation = true;

		document.getElementById('blenddiv').style.backgroundImage = "url(" + document.getElementById('blendimage').src + ")";

		$(function () {
			$('#blendimage').hide();
			$('#blendimage').attr('src', id); 

			setTimeout(function() {
				loadStart = true;
				if (!loadEnd) $('#blendani').fadeIn(100);
			}, 300);
		});
	}
}



function hideRefCard(id) {
		document.getElementById("refCard"+id).style.display = 'none';

		$("#flipBox"+id).flip({
			direction: 'tb',
			color: '#eee',
			speed: 400
		});

		document.getElementById("refLogo"+id).style.display = 'block';
}

function showRefCard(id) {
		document.getElementById("refLogo"+id).style.display = 'none';

		$("#flipBox"+id).flip({
			direction: 'lr',
			color: '#eee',
			speed: 400
		});

		document.getElementById("refCard"+id).style.display = 'block';

		for (var i = 1; i <= 12; i++) {
			if ( i != id && document.getElementById("refCard"+i).style.display == 'block' ) {
				hideRefCard(i);
			}
		}
}

