/*
 * ajax.js
 * 
 * contains the Ajax functions for the Xavier Guardans Photography website
 *
 */



function LoadPageSwipeBack(url, divID) {
	$.get(url, function(data) {
	$('#'+divID+' img').animate({left: '100%'}, 600, function() {
		 	$('#'+divID+' img').hide();

		 	$('#'+divID).html(data);

		 	$('#arrows_container').html($('p.arrows', $('#'+divID)).parent().html());
		 	$('p.arrows', $('#'+divID)).html('');
	 	

		 	$('#'+divID+' img').hide();
		 	$('#'+divID+' img').css('left', '-100%');
		 	$('#'+divID+' img').show();
		 	$('#'+divID+' img').animate({ left: '0%' }, 600);
		});
	}
	);
	return false;
	
}


function LoadPageSwipe( url, divID) {	
	$.get(url, function(data) {
				$('#'+divID+' img').animate({left: '-100%'}, 600, function() {
					 	$('#'+divID+' img').hide();
					 	$('#'+divID).html(data);

					 	$('#arrows_container').html($('p.arrows', $('#'+divID)).parent().html());
					 	$('p.arrows', $('#'+divID)).html('');

					 	$('#'+divID+' img').hide();
					 	$('#'+divID+' img').css('left', '100%');
					 	$('#'+divID+' img').show();
					 	$('#'+divID+' img').animate({ left: '0%' }, 600, "linear");
					});
				}
		);
	return false;
}

function LoadPageBlinds( url, divID) {	
	$.get(url, function(data) {
			$('#'+divID).hide();
			$('#'+divID).html(data);
			$('#'+divID).slideDown();
			}
		);
	return false;
}

function LoadPage(url, divID) {
	$.get(url, function(data) {
			$('#'+divID).html(data);
			}
		);
	return false;
}




function LoadPageFadeMenu(url, divID) {
	$('#' + divID).fadeOut(100, function() {
		$.get(url, function(data) {
				$('#'+divID).hide().html(data);

			 	$('#arrows_container').html($('p.arrows', $('#'+divID)).parent().html());
			 	$('p.arrows', $('#'+divID)).html('');

				$('#'+divID).fadeIn(100);
				}
			);
	});
	return false;
}



function LoadPageFade(url, divID) {
	$('#' + divID).fadeOut(100, function() {
		$.get(url, function(data) {
				if ( divID != 'pic_title' ) {
			 		$('#arrows_container').html('');
			 	}


				$('#'+divID).html(data).fadeIn(100);
				}
			);
	});
	return false;
}
