var current_image = 0;
var bslideshow = 0;
var timer;

var a = 0;
var stop_slide = 476;
var slideAmount = 4;
var img_no = 1;
var stage_width = 900;
var stage_center = 450;
var pause_move = 0;
var pause_it = 0;
var fadelevel = 1;
var scrollingDirection = 1;


function navover( navid )
{
if( navid == "narr" )
  {
  document.getElementById( 'narr-off' ).setAttribute("style", "display:none");
  document.getElementById( 'narr-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.4;
    }
  //turn on subnav
  document.getElementById( 'conflict-off' ).style.display = 'inline';
  document.getElementById( 'awcost-off' ).style.display = 'inline';
  document.getElementById( 'onlocation-off' ).style.display = 'inline';
  document.getElementById( 'shattered-off' ).style.display = 'inline';
  }
else if( navid == "people" )
  {
  document.getElementById( 'people-off' ).setAttribute("style", "display:none");
  document.getElementById( 'people-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'people-on-a') )
    {
    document.getElementById( 'people-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "arch" )
  {
  document.getElementById( 'arch-off' ).setAttribute("style", "display:none");
  document.getElementById( 'arch-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'arch-on-a') )
    {
    document.getElementById( 'arch-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "glam" )
  {
  document.getElementById( 'glam-off' ).setAttribute("style", "display:none");
  document.getElementById( 'glam-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'glam-on-a') )
    {
    document.getElementById( 'glam-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "nature" )
  {
  document.getElementById( 'nature-off' ).setAttribute("style", "display:none");
  document.getElementById( 'nature-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'nature-on-a') )
    {
    document.getElementById( 'nature-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "nude" )
  {
  document.getElementById( 'nude-off' ).setAttribute("style", "display:none");
  document.getElementById( 'nude-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'nude-on-a') )
    {
    document.getElementById( 'nude-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "suhler" )
  {
  document.getElementById( 'suhler-off' ).setAttribute("style", "display:none");
  document.getElementById( 'suhler-on' ).setAttribute("style", "display:inline");
  if( document.getElementById( 'suhler-on-a') )
    {
    document.getElementById( 'suhler-on-a').style.opacity = 0.4;
    }
  //turn on sub nav
  document.getElementById( 'events-off' ).style.display = 'inline';
  document.getElementById( 'about-off' ).style.display = 'inline';
  document.getElementById( 'events-on' ).style.display = 'none';
  document.getElementById( 'about-on' ).style.display = 'none';

  }

if( navid == "conflict" )
  {
  document.getElementById( 'conflict-off' ).style.display = 'none';
  document.getElementById( 'conflict-on' ).style.display = 'inline';
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "awcost" )
  {
  document.getElementById( 'awcost-off' ).style.display = 'none';
  document.getElementById( 'awcost-on' ).style.display = 'inline';
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "onlocation" )
  {
  document.getElementById( 'onlocation-off' ).style.display = 'none';
  document.getElementById( 'onlocation-on' ).style.display = 'inline';
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "shattered" )
  {
  document.getElementById( 'shattered-off' ).style.display = 'none';
  document.getElementById( 'shattered-on' ).style.display = 'inline';
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "events" )
  {
//  document.getElementById( 'events-off' ).setAttribute("style", "display:none");
//  document.getElementById( 'events-on' ).setAttribute("style", "display:inline");
//  document.getElementById( 'events-off' ).style.visibility = 'hidden';
//  document.getElementById( 'events-on' ).style.visibility = 'visible';
  document.getElementById( 'events-off' ).style.display = 'none';
  document.getElementById( 'events-on' ).style.display = 'inline';
  if( document.getElementById( 'suhler-on-a') )
    {
    document.getElementById( 'suhler-on-a').style.opacity = 0.4;
    }
  }
else if( navid == "about" )
  {
//  document.getElementById( 'about-off' ).setAttribute("style", "display:none");
//  document.getElementById( 'about-on' ).setAttribute("style", "display:inline");
//  document.getElementById( 'about-off' ).style.visibility = 'hidden';
//  document.getElementById( 'about-on' ).style.visibility = 'visible';
  document.getElementById( 'about-off' ).style.display = 'none';
  document.getElementById( 'about-on' ).style.display = 'inline';
  if( document.getElementById( 'suhler-on-a') )
    {
    document.getElementById( 'suhler-on-a').style.opacity = 0.4;
    }
  }

//Turn off suhler-subnav
if( navid != "about" && navid != "events" && navid != "suhler" )
  {
  document.getElementById( 'about-off' ).style.display = 'none';
  document.getElementById( 'events-off' ).style.display = 'none';
  if( document.getElementById( 'suhler-on-a') )
    {
    document.getElementById( 'suhler-on-a').style.opacity = 0.0;
    }
  }
//Turn off narr-subnav
if( navid != "conflict" && navid != "awcost" && navid != "onlocation" && navid != "shattered" && navid != "narr" )
  {
  document.getElementById( 'conflict-off' ).style.display = 'none';
  document.getElementById( 'awcost-off' ).style.display = 'none';
  document.getElementById( 'onlocation-off' ).style.display = 'none';
  document.getElementById( 'shattered-off' ).style.display = 'none';
  document.getElementById( 'narr-on-a').style.opacity = 0.0;
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.0;
    }
  }

}

function navout( navid )
{
if( navid == "narr" )
  {
  document.getElementById( 'narr-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'narr-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'narr-on-a') )
    {
    document.getElementById( 'narr-on-a').style.opacity = 0.0;
    }
  }
else if( navid == "people" )
  {
  document.getElementById( 'people-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'people-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'people-on-a') )
    {
    document.getElementById( 'people-on-a').style.opacity = 0.0;
    }
  }
else if( navid == "arch" )
  {
  document.getElementById( 'arch-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'arch-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'arch-on-a') )
    {
    document.getElementById( 'arch-on-a').style.opacity = 0.0;
    }
  }
else if( navid == "glam" )
  {
  document.getElementById( 'glam-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'glam-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'glam-on-a') )
    {
    document.getElementById( 'glam-on-a').style.opacity = 0.0;
    }
  }
else if( navid == "nature" )
  {
  document.getElementById( 'nature-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'nature-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'nature-on-a') )
    {
    document.getElementById( 'nature-on-a').style.opacity = 0.0;
    }
  }
else if( navid == "nude" )
  {
  document.getElementById( 'nude-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'nude-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'nude-on-a') )
    {
    document.getElementById( 'nude-on-a').style.opacity = 0.0;
    }
  }
else if( navid == "suhler" )
  {
  document.getElementById( 'suhler-off' ).setAttribute("style", "display:inline");
  document.getElementById( 'suhler-on' ).setAttribute("style", "display:none");
  if( document.getElementById( 'suhler-on-a') )
    {
    document.getElementById( 'suhler-on-a').style.opacity = 0.0;
    }
  }

if( navid == "conflict" )
  {
  document.getElementById( 'conflict-off' ).style.display = 'inline';
  document.getElementById( 'conflict-on' ).style.display = 'none';
  }
else if( navid == "awcost" )
  {
  document.getElementById( 'awcost-off' ).style.display = 'inline';
  document.getElementById( 'awcost-on' ).style.display = 'none';
  }
else if( navid == "onlocation" )
  {
  document.getElementById( 'onlocation-off' ).style.display = 'inline';
  document.getElementById( 'onlocation-on' ).style.display = 'none';
  }
else if( navid == "shattered" )
  {
  document.getElementById( 'shattered-off' ).style.display = 'inline';
  document.getElementById( 'shattered-on' ).style.display = 'none';
  }
else if( navid == "events" )
  {
//  document.getElementById( 'events-off' ).setAttribute("style", "display:inline");
//  document.getElementById( 'events-on' ).setAttribute("style", "display:none");
//  document.getElementById( 'events-off' ).style.visibility = 'visible';
//  document.getElementById( 'events-on' ).style.visibility = 'hidden';
  document.getElementById( 'events-off' ).style.display = 'inline';
  document.getElementById( 'events-on' ).style.display = 'none';
  }
else if( navid == "about" )
  {
//  document.getElementById( 'about-off' ).setAttribute("style", "display:inline");
//  document.getElementById( 'about-on' ).setAttribute("style", "display:none");
//  document.getElementById( 'about-off' ).style.visibility = 'visible';
//  document.getElementById( 'about-on' ).style.visibility = 'hidden';
  document.getElementById( 'about-off' ).style.display = 'inline';
  document.getElementById( 'about-on' ).style.display = 'none';
  }

}

function slide()
{
if( parseInt( document.getElementById( 'image_count' ).value ) == current_image + 1 )
  {
  current_image = -1;
  }
gotoImage( current_image + 1 );
}


function slideShow()
{
//Turn it on
if( bslideshow  == 0 )
  {
  bslideshow = 1;
  timer = self.setInterval(slide,2000);
  document.getElementById( 'slideshow' ).setAttribute("style", "display:none");
  document.getElementById( 'pause' ).setAttribute("style", "display:inline");
  }
else
  {
  bslideshow = 0;
  window.clearInterval(timer);
  document.getElementById( 'slideshow' ).setAttribute("style", "display:inline");
  document.getElementById( 'pause' ).setAttribute("style", "display:none");
  }
}

function moveImage(direct)
{
if( current_image == 0 && direct == -1 )
  {
  alert( 'You are viewing the first photograph.' );
  }
else if( parseInt( document.getElementById( 'image_count' ).value ) == current_image + 1 && direct == 1 )
  {
  alert( 'You are viewing the last photograph.' );
  }
else
  {
  gotoImage( current_image + direct );
  }
}


function gotoImage( imgno )
{
current_image = imgno;
imgno = imgno * 900;
document.getElementById("image-div1").scrollLeft = imgno;
}

//Start Finger swipe
function scrollImage(direct)
{
if( current_image == 0 && direct == -1 )
  {
  alert( 'You are viewing the first photograph.' );
  }
else if( parseInt( document.getElementById( 'image_count' ).value ) == current_image + 1 && direct == 1 )
  {
  alert( 'You are viewing the last photograph.' );
  }
else
  {
  //Set where to scroll to
  current_image = current_image + direct;
  scrollingDirection = direct;
  timer = self.setInterval(scrollToImage,5);
  }
}


function scrollToImage( imgno )
{
current_image * 900;
document.getElementById("image-div1").scrollLeft = document.getElementById("image-div1").scrollLeft + ( 20 * scrollingDirection );
//Stop scroll
if( scrollingDirection == 1 && document.getElementById("image-div1").scrollLeft >= current_image * 900 )
  {
  window.clearInterval(timer);
  document.getElementById("image-div1").scrollLeft = current_image * 900;
  }
else if( scrollingDirection == -1 && document.getElementById("image-div1").scrollLeft <= current_image * 900 )
  {
  window.clearInterval(timer);
  document.getElementById("image-div1").scrollLeft = current_image * 900;
  }
}

//End Finger swipe


function showPage( apage )
{
if( apage == "glamour" )
  {
  window.location = 'tom-suhler-glamour.php';
  }
else if( apage == "nudes" )
  {
  window.location = 'tom-suhler-nudes.php';
  }
else if( apage == "nature" )
  {
  window.location = 'tom-suhler-nature.php';
  }
else if( apage == "arch" )
  {
  window.location = 'tom-suhler-architecture.php';
  }
else if( apage == "people" )
  {
  window.location = 'tom-suhler-people.php';
  }
else if( apage == "conflict" )
  {
  window.location = 'tom-suhler-conflict-in-the-hood.php';
  }
else if( apage == "onlocation1" )
  {
  window.location = 'tom-suhler-on-location1.php';
  }
else if( apage == "awcost" )
  {
  window.location = 'tom-suhler-at-what-cost.php';
  }
else if( apage == "shattered" )
  {
  window.location = 'tom-suhler-shattered.php';
  }
else if( apage == "about" )
  {
  window.location = 'tom-suhler-about.php';
  }
else if( apage == "events" )
  {
  window.location = 'tom-suhler-events-news.php';
  }
}

//***********Home page only

function startIntro()
{
timer = self.setInterval(fadeLanding,50);
}


//
function reSlide()
{
timer = self.setInterval(slideImages,5);
}

//makes images appear in the center of the screen 
//Then they slide to the right eventually stopping and only leaving a slice of the image
function slideImages()
{
var img_width = 0;
//New Image
if( a == 0 )
  {
  //Make it visible
  document.getElementById( 'image'+img_no.toString() ).setAttribute("style", "display:block");
  //Center it
  img_width = parseInt( document.getElementById( 'image'+img_no.toString() ).width );
  a = Math.floor( stage_center - (img_width / 2));
  document.getElementById( 'image'+img_no.toString() ).style.left = a.toString()+'px';
  //Set the slide limit
  if( img_no == 4 )
    { stop_slide = 626; }
  else if( img_no == 6 )
    { stop_slide = 550; }
  else if( img_no == 7 )
    { stop_slide = 712; }
  else 
    { stop_slide = 476; }
  //Pause so they can see it
  window.clearInterval(timer);
  setTimeout( "reSlide()", 750 );
  }

a = a + slideAmount;
document.getElementById('image'+img_no.toString() ).style.left = a.toString()+'px';
//Time to stop moving
if( a > stop_slide )
  {
  //Show Slice
  document.getElementById( 'slice'+img_no.toString() ).setAttribute("style", "visibility:visible");

  //Hide Image
  document.getElementById( 'image'+img_no.toString() ).setAttribute("style", "visibility:hidden");

  //Move to next image
  img_no++;
  //reset starting point
  a = 0;
  //if last image then start moving slices
  if( img_no > 7 )
    {
    window.clearInterval(timer);
    timer = self.setInterval(slideSlices,500);
    }
  }
}

//slides the slices to the left until the final position of all is obtained
function slideSlices()
{
if( img_no == 6 )
  {
  document.getElementById('slice6').style.left = '640px';
  }
else if( img_no == 5 )
  {
  document.getElementById('slice5').style.left = '640px';
  document.getElementById('slice6').style.left = '512px';
  }

else if( img_no == 4 )
  {
  document.getElementById('slice4').style.left = '640px';
  document.getElementById('slice5').style.left = '512px';
  document.getElementById('slice6').style.left = '384px';
  }

else if( img_no == 3 )
  {
  document.getElementById('slice3').style.left = '640px';
  document.getElementById('slice4').style.left = '512px';
  document.getElementById('slice5').style.left = '384px';
  document.getElementById('slice6').style.left = '256px';
  }

else if( img_no == 2 )
  {
  document.getElementById('slice2').style.left = '640px';
  document.getElementById('slice3').style.left = '512px';
  document.getElementById('slice4').style.left = '384px';
  document.getElementById('slice5').style.left = '256px';
  document.getElementById('slice6').style.left = '128px';
  }

else if( img_no == 1 )
  {
  document.getElementById('slice1').style.left = '640px';
  document.getElementById('slice2').style.left = '512px';
  document.getElementById('slice3').style.left = '384px';
  document.getElementById('slice4').style.left = '256px';
  document.getElementById('slice5').style.left = '128px';
  document.getElementById('slice6').style.left = '0px';
  document.getElementById( 'heading1' ).setAttribute("style", "visibility:visible;position:absolute;top:60px;left:40px");

  showNav();
  }
img_no--;

if( img_no == 0)
  {
  window.clearInterval(timer);
  }
}

function StartSlide()
{
timer = self.setInterval(slideImages,5);
}

//Landing has an option to enter the photography site or fine art site
//if they select photography then the landing page slowly fades before the slide opening starts
function fadeLanding()
{
fadelevel = fadelevel - 0.1;
document.getElementById('landing-div').style.opacity = fadelevel;
document.getElementById('fadeshow1').style.opacity = fadelevel;
document.getElementById('fadeshow2').style.opacity = fadelevel;
if( fadelevel < -1 )
  {
  window.clearInterval(timer);
  document.getElementById( 'landing-div' ).setAttribute("style", "display:none");
  document.getElementById( 'fadeshow1' ).setAttribute("style", "display:none");
  document.getElementById( 'fadeshow2' ).setAttribute("style", "display:none");
  StartSlide();
  }
}


function showNav()
{
//Narratives
document.getElementById( 'narr1' ).setAttribute("style", "position:absolute;top:150px;left:54px");
document.getElementById( 'narr2' ).setAttribute("style", "position:absolute;top:550px;left:54px");
document.getElementById( 'narr3' ).setAttribute("style", "position:absolute;top:150px;left:54px");
document.getElementById( 'narr-sub' ).setAttribute("style", "position:absolute;top:570px;left:67px");
//People
document.getElementById( 'people1' ).setAttribute("style", "position:absolute;top:150px;left:182px");
document.getElementById( 'people2' ).setAttribute("style", "position:absolute;top:550px;left:182px");
document.getElementById( 'people3' ).setAttribute("style", "position:absolute;top:150px;left:182px");
//Architecture
document.getElementById( 'arch1' ).setAttribute("style", "position:absolute;top:150px;left:310px");
document.getElementById( 'arch2' ).setAttribute("style", "position:absolute;top:550px;left:310px");
document.getElementById( 'arch3' ).setAttribute("style", "position:absolute;top:150px;left:310px");
//Glamour
document.getElementById( 'glam1' ).setAttribute("style", "position:absolute;top:150px;left:438px");
document.getElementById( 'glam2' ).setAttribute("style", "position:absolute;top:550px;left:438px");
document.getElementById( 'glam3' ).setAttribute("style", "position:absolute;top:150px;left:438px");
//Nature
document.getElementById( 'nature1' ).setAttribute("style", "position:absolute;top:150px;left:566px");
document.getElementById( 'nature2' ).setAttribute("style", "position:absolute;top:550px;left:566px");
document.getElementById( 'nature3' ).setAttribute("style", "position:absolute;top:150px;left:566px");
//Nudes
document.getElementById( 'nude1' ).setAttribute("style", "position:absolute;top:150px;left:694px");
document.getElementById( 'nude2' ).setAttribute("style", "position:absolute;top:550px;left:694px");
document.getElementById( 'nude3' ).setAttribute("style", "position:absolute;top:150px;left:694px");
//Suhler
document.getElementById( 'suhler1' ).setAttribute("style", "position:absolute;top:150px;left:822px");
document.getElementById( 'suhler2' ).setAttribute("style", "position:absolute;top:550px;left:822px");
document.getElementById( 'suhler3' ).setAttribute("style", "position:absolute;top:150px;left:822px");
document.getElementById( 'suhler-sub' ).setAttribute("style", "position:absolute;top:570px;left:812px");
}


	// TOUCH-EVENTS SINGLE-FINGER SWIPE-SENSING JAVASCRIPT
	// Courtesy of PADILICIOUS.COM and MACOSXAUTOMATION.COM
	
	// this script can be used with one or more page elements to perform actions based on them being swiped with a single finger

	var triggerElementID = null; // this variable is used to identity the triggering element
	var fingerCount = 0;
	var startX = 0;
	var startY = 0;
	var curX = 0;
	var curY = 0;
	var deltaX = 0;
	var deltaY = 0;
	var horzDiff = 0;
	var vertDiff = 0;
	var minLength = 72; // the shortest distance the user may swipe
	var swipeLength = 0;
	var swipeAngle = null;
	var swipeDirection = null;
	
	// The 4 Touch Event Handlers
	
	// NOTE: the touchStart handler should also receive the ID of the triggering element
	// make sure its ID is passed in the event call placed in the element declaration, like:
	// <div id="picture-frame" ontouchstart="touchStart(event,'picture-frame');"  ontouchend="touchEnd(event);" ontouchmove="touchMove(event);" ontouchcancel="touchCancel(event);">

	function touchStart(event,passedName) {
		// disable the standard ability to select the touched object
		event.preventDefault();
		// get the total number of fingers touching the screen
		fingerCount = event.touches.length;
		// since we're looking for a swipe (single finger) and not a gesture (multiple fingers),
		// check that only one finger was used
		if ( fingerCount == 1 ) {
			// get the coordinates of the touch
			startX = event.touches[0].pageX;
			startY = event.touches[0].pageY;
			// store the triggering element ID
			triggerElementID = passedName;
		} else {
			// more than one finger touched so cancel
			touchCancel(event);
		}
	}

	function touchMove(event) {
		event.preventDefault();
		if ( event.touches.length == 1 ) {
			curX = event.touches[0].pageX;
			curY = event.touches[0].pageY;
		} else {
			touchCancel(event);
		}
	}
	
	function touchEnd(event) {
		event.preventDefault();
		// check to see if more than one finger was used and that there is an ending coordinate
		if ( fingerCount == 1 && curX != 0 ) {
			// use the Distance Formula to determine the length of the swipe
			swipeLength = Math.round(Math.sqrt(Math.pow(curX - startX,2) + Math.pow(curY - startY,2)));
			// if the user swiped more than the minimum length, perform the appropriate action
			if ( swipeLength >= minLength ) {
				caluculateAngle();
				determineSwipeDirection();
				processingRoutine();
				touchCancel(event); // reset the variables
			} else {
				touchCancel(event);
			}	
		} else {
			touchCancel(event);
		}
	}

	function touchCancel(event) {
		// reset the variables back to default values
		fingerCount = 0;
		startX = 0;
		startY = 0;
		curX = 0;
		curY = 0;
		deltaX = 0;
		deltaY = 0;
		horzDiff = 0;
		vertDiff = 0;
		swipeLength = 0;
		swipeAngle = null;
		swipeDirection = null;
		triggerElementID = null;
	}
	
	function caluculateAngle() {
		var X = startX-curX;
		var Y = curY-startY;
		var Z = Math.round(Math.sqrt(Math.pow(X,2)+Math.pow(Y,2))); //the distance - rounded - in pixels
		var r = Math.atan2(Y,X); //angle in radians (Cartesian system)
		swipeAngle = Math.round(r*180/Math.PI); //angle in degrees
		if ( swipeAngle < 0 ) { swipeAngle =  360 - Math.abs(swipeAngle); }
	}
	
	function determineSwipeDirection() {
		if ( (swipeAngle <= 45) && (swipeAngle >= 0) ) {
			swipeDirection = 'left';
		} else if ( (swipeAngle <= 360) && (swipeAngle >= 315) ) {
			swipeDirection = 'left';
		} else if ( (swipeAngle >= 135) && (swipeAngle <= 225) ) {
			swipeDirection = 'right';
		} else if ( (swipeAngle > 45) && (swipeAngle < 135) ) {
			swipeDirection = 'down';
		} else {
			swipeDirection = 'up';
		}
	}
	
	function processingRoutine() {
		var swipedElement = document.getElementById(triggerElementID);
		if ( swipeDirection == 'left' ) {

scrollImage( 1 );
		} else if ( swipeDirection == 'right' ) {
scrollImage( -1 );
		} else if ( swipeDirection == 'up' ) {
			// REPLACE WITH YOUR ROUTINES
			swipedElement.style.backgroundColor = 'maroon';
		} else if ( swipeDirection == 'down' ) {
			// REPLACE WITH YOUR ROUTINES
			swipedElement.style.backgroundColor = 'purple';
alert('down');
		}
	}



