		if( (typeof(window.onorientationchange) !== "object") ) {
			function changeOrientation(orient,docheight) {
				window.jQT.updateOrientation( orient, docheight );
			}
		}

		var jQT = new $.jQTouch({
			icon: './images/wedding_desktop_icon.png',
			addGlossToIcon: true,
			startupScreen: './images/vuitlive-startupt.png',
			statusBar: 'black',
			fixedViewport: true,
			fullScreen: true,
			preloadImages: [
				'./images/pinstripeBackground.png',
				'./images/toolbarBackground.png',
				'./images/buttonHome.png',
				'./images/buttonBack.png',
				'./images/buttonAbout.png',
				'./images/loading-big.gif',
				'./images/chevron.pnp',
				'./images/whiteButton.png',
				'./images/iv-icon.png',
				'./images/iv-touch-icon.png'
				]
		});

		window.jQT = jQT;

		$(function() {

			$('#swipeme').swipe(function(event, data) {
				$(this).html('You swiped <strong>' + data.direction + '</strong>!');
				console.log("swipeme: "+data.direction);
			});

			$('a[target="_blank"]').click(function() {
				if (confirm('This link opens in a new window.')) {
					return true;
				} else {
					$(this).removeClass('active');
					return false;
				}
			});

			$('#pageevents').
				bind('pageAnimationStart', function(e, info) {
					///$(this).find('.info').append('Started animating ' + info.direction + '&hellip; ');
					console.log('Started animating ' + $(this).id + info.direction);
				}).
				bind('pageAnimationEnd', function(e, info) {
					///$(this).find('.info').append(' finished animating ' + info.direction + '.<br /><br />');
					console.log('Finished animating ' + $(this).id + info.direction );
				});

			$('#callback').bind('pageAnimationEnd', function(e, info) {
				// Page animations end with AJAX callback event, example 1 (load remote HTML only first time)
				if (!$(this).data('loaded')) {					    // Make sure the data hasn't already been loaded (we'll set 'loaded' to true a couple lines further down)
					$(this).append($('<div>Loading...</div>').	    // Append a placeholder in case the remote HTML takes its sweet time making it back
						load('ajax.html .info', function() {		// Overwrite the "Loading" placeholder text with the remote HTML
							$(this).parent().data('loaded', true);  // Set the 'loaded' var to true so we know not to re-load the HTML next time the #callback div animation ends
						}));
				}
			});

			$('body').bind('turn', function(e, data) {
				$('#orient').html('Orientation: ' + data.orientation);
			});

			if ( typeof(console) !== "object" ){
				console = { log:function(){return null;} };
			}

			$('a.divLoadMore').click( divLoadMoreClick );
			function divLoadMoreClick(e) {
				e.preventDefault();
				$(this).addClass('loading');
				$(this).addClass('active');
				$(this).blur();
				$(this).html('Loading...');
				jQT.addMoreByHref( $(this).attr('href'), {
						data: null,  /// switches for php...
						method: "GET",
						callback: function(vo) {
							console.log("*** "+vo.status+" / "+vo.data);
							if(vo.status === true) {
								var $el = $(vo.$referrer).parent('div');
								$(vo.$referrer).replaceWith(vo.data);
								$el.find('a.divLoadMore').click( divLoadMoreClick );
							} else {
								console.log("ajax failure: "+ $(vo.$referrer).attr('class'));
							}
							jQT.adjustBodyToEl();
						},
						$referrer: $(this)
					} );
				return false;
			}

			$('a.liLoadMore').click( liLoadMoreClick );
			function liLoadMoreClick(e) {
				e.preventDefault();
				$(this).parent('li').addClass('loading');
				$(this).addClass('active');
				$(this).blur();
				$(this).html('Loading...');
				jQT.addMoreByHref( $(this).attr('href'), {
						data: null,  /// switches for php...
						method: "GET",
						callback: function(vo) {
							console.log("*** "+vo.status+" / "+vo.data);
							if(vo.status === true) {
								var $el = $(vo.$referrer).parent('li');
								var $p = $el.parent('ul');
								$el.replaceWith(vo.data);
								$p.find('a.liLoadMore').click( liLoadMoreClick );
							} else {
								console.log("ajax failure: "+ $(vo.$referrer).attr('class'));
							}
							jQT.adjustBodyToEl();
						},
						$referrer: $(this)
					} );
				return false;
			}

			$(document).bind('scroll', function() {
				if ( window.pageYOffset<1 ) window.scrollTo(0,1);
				//console.log("window.pageYOffset: "+window.pageYOffset);
			} );

		});
