var userSelectionText = new Array(3);
userSelectionText[1] = '';
userSelectionText[2] = '';
userSelectionText[3] = '';
var userSelectionLastOpened = 1;

$(document).ready(function() {
	// opstil menu
	userSelectionText[2] = $('#userSelection2Content').html();
	userSelectionText[3] = $('#userSelection3Content').html();
	$('#userSelection2Content').html('').width(1);
	$('#userSelection3Content').html('').width(1);

	// Fix for mousewhell over flash i opaque/transparent wmode: tillader scrolling i Firefox og afholder vindue fra at scrolle med
	if ($('#flashContainer')) {
		$('#flashContainer').mousewheel(function fn(e,delta) { 
			// Scroller flash
//			if (delta>0) { delta = 10 } else { delta = -10 }
			document.getElementById('MesseFlash').flashMouseWheel(delta);
			// Cancel event
			e.cancelBubble = false;
			e.cancel = true;
			e.returnValue = false;
			return false;
		}); 
	}
	
});

function changePointer(intPointer) {
	switch (intPointer) {
		case 1:
		 	// Hvem søger dig?
			if (userSelectionText[1] != '') { // Open action
				if (userSelectionText[2] == '') {
					// Luk box 2, hvis åben
					userSelectionText[2] = $('#userSelection2Content').html(); 
					$('#userSelection2Content').html('').animate( { width: 1 }, 200 );
					userSelectionLastOpened = 2;
				} else if (userSelectionText[3] == '') {
					// Luk box 3, hvis åben
					userSelectionText[3] = $('#userSelection3Content').html(); 
					$('#userSelection3Content').html('').animate( { width: 1 }, 200 );
					userSelectionLastOpened = 3;
				}
				// Åbn box 1
				$('#userSelection1Content').animate( { width: 520 }, 200, function () { 
					$('#userSelection1Content').html(userSelectionText[1]);
					userSelectionText[1] = '';
				});
			} else { // Close action
				// Luk box 1
				userSelectionText[1] = $('#userSelection1Content').html(); 
				$('#userSelection1Content').html('').animate( { width: 1 }, 200 );
				// Åbn box 2
				$('#userSelection2Content').animate( { width: 520 }, 200, function () { 
					$('#userSelection2Content').html(userSelectionText[2]);
					userSelectionText[2] = '';
				});
				
			} // end open/close action
			break;
		 	
		case 2:
			// Hvem søger du?
			if (userSelectionText[2] != '') { // Open action
				if (userSelectionText[1] == '') {
					// Luk box 1, hvis åben
					userSelectionText[1] = $('#userSelection1Content').html(); 
					$('#userSelection1Content').html('').animate( { width: 1 }, 200 );
				} else if (userSelectionText[3] == '') {
					// Luk box 3, hvis åben
					userSelectionText[3] = $('#userSelection3Content').html(); 
					$('#userSelection3Content').html('').animate( { width: 1 }, 200 );
				}
				// Åbn box 2
				$('#userSelection2Content').animate( { width: 520 }, 200, function () { 
					$('#userSelection2Content').html(userSelectionText[2]);
					userSelectionText[2] = '';
				});
			} else { // Close action
				// Luk box 2
				userSelectionText[2] = $('#userSelection2Content').html(); 
				$('#userSelection2Content').html('').animate( { width: 1 }, 200 );
				// Åbn box 1
				$('#userSelection1Content').animate( { width: 520 }, 200, function () { 
					$('#userSelection1Content').html(userSelectionText[1]);
					userSelectionText[1] = '';
				});
				
			} // end open/close action
			break;
		case 3:
			// Været her før?
			if (userSelectionText[3] != '') { // Open action
				if (userSelectionText[1] == '') {
					// Luk box 1, hvis åben
					userSelectionText[1] = $('#userSelection1Content').html(); 
					$('#userSelection1Content').html('').animate( { width: 1 }, 200 );
				} else if (userSelectionText[2] == '') {
					// Luk box 2, hvis åben
					userSelectionText[2] = $('#userSelection2Content').html(); 
					$('#userSelection2Content').html('').animate( { width: 1 }, 200 );
				}
				// Åbn box 3
				$('#userSelection3Content').animate( { width: 520 }, 200, function () { 
					$('#userSelection3Content').html(userSelectionText[3]);
					userSelectionText[3] = '';
				});
			} else { // Close action
				// Luk box 3
				userSelectionText[3] = $('#userSelection3Content').html(); 
				$('#userSelection3Content').html('').animate( { width: 1 }, 200 );
				// Åbn box 2
				$('#userSelection2Content').animate( { width: 520 }, 200, function () { 
					$('#userSelection2Content').html(userSelectionText[2]);
					userSelectionText[2] = '';
				});
				
			} // end open/close action
			break;
		}
}



