/* Panel Flip */


/* it comms */
function itContent(front) {
	if (front) {
		$(this).parent().find('div.panel_it_comm').show();
		$(this).parent().find('div.panel_it_comm_content').hide();
}
	else {
		$(this).parent().find('div.panel_it_comm').hide();
		$(this).parent().find('div.panel_it_comm_content').show();
	}
}

/* construction */
function consContent(front) {
	if (front) {
		$(this).parent().find('div.panel_cons').show();
		$(this).parent().find('div.panel_cons_content').hide();
}
	else {
		$(this).parent().find('div.panel_cons').hide();
		$(this).parent().find('div.panel_cons_content').show();
	}
}

/* fire security */
function fireContent(front) {
	if (front) {
		$(this).parent().find('div.panel_fire_sec').show();
		$(this).parent().find('div.panel_fire_sec_content').hide();
}
	else {
		$(this).parent().find('div.panel_fire_sec').hide();
		$(this).parent().find('div.panel_fire_sec_content').show();
	}
}

/* middle east africa */
function midafrContent(front) {
	if (front) {
		$(this).parent().find('div.panel_middleeast_africa').show();
		$(this).parent().find('div.panel_middleeast_africa_content').hide();
}
	else {
		$(this).parent().find('div.panel_middleeast_africa').hide();
		$(this).parent().find('div.panel_middleeast_africa_content').show();
	}
}

/* rail */
function railContent(front) {
	if (front) {
		$(this).parent().find('div.panel_rail').show();
		$(this).parent().find('div.panel_rail_content').hide();
}
	else {
		$(this).parent().find('div.panel_rail').hide();
		$(this).parent().find('div.panel_rail_content').show();
	}
}


$(function() {
	
	/* it comms */
	$('#it_comm').hover(
		function () {
			$(this).find('div').stop().rotate3Di('flip', 600, {direction: 'clockwise', sideChange: itContent});
		},
		function () {
			$(this).find('div').stop().rotate3Di('unflip', 350, {sideChange: itContent});
		}
	);
	
	/* construction */
	$('#cons').hover(
		function () {
			$(this).find('div').stop().rotate3Di('flip', 600, {direction: 'clockwise', sideChange: consContent});
		},
		function () {
			$(this).find('div').stop().rotate3Di('unflip', 350, {sideChange: consContent});
		}
	);
	
	/* fire security */
	$('#fire_sec').hover(
		function () {
			$(this).find('div').stop().rotate3Di('flip', 600, {direction: 'clockwise', sideChange: fireContent});
		},
		function () {
			$(this).find('div').stop().rotate3Di('unflip', 350, {sideChange: fireContent});
		}
	);
	
	/* middle east and africa */
	$('#middleeast_africa').hover(
		function () {
			$(this).find('div').stop().rotate3Di('flip', 600, {direction: 'clockwise', sideChange: midafrContent});
		},
		function () {
			$(this).find('div').stop().rotate3Di('unflip', 350, {sideChange: midafrContent});
		}
	);
	
	/* rail */
	$('#rail').hover(
		function () {
			$(this).find('div').stop().rotate3Di('flip', 600, {direction: 'clockwise', sideChange: railContent});
		},
		function () {
			$(this).find('div').stop().rotate3Di('unflip', 350, {sideChange: railContent});
		}
	);


});
