// Disable Right Click

var message="Sorry, No Right Click Allowed.";
function clickIE6(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE6;
}
document.oncontextmenu=new Function("alert(message);return false")

// Photo Shuffler

 <!--//--><![CDATA[//><!--
 
  //
  // CSS Photo Shuffler v1.0 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // SetOpacity Function and inpiration from Photo Fade by
  //   Richard Rutter
  //   http://clagnut.com
  //
  // License: Creative Commons Attribution 2.5  License
  //   http://creativecommons.org/licenses/by/2.5/
  //

  // Customize your photo shuffle settings
  // 
  // * Surround the target < img /> with a < div >. specify id= in both
  // * The first and final photo displayed is in the html <img> tag
  // * The array contains paths to photos you want in the rotation. 
  //   If you want the first photo in the rotation, then it's best to
  //   put it as the final array image.  All photos must be same dimension
  // * The rotations variable specifies how many times to repeat array.
  //   images. zero is a valid rotation value.

  var gblPhotoShufflerDivId = "photodiv";
  var gblPhotoShufflerImgId = "photoimg"; 
  var gblImg = new Array(
    "/images/image-holder4.jpg?v=0",
    "/images/image-holder3.jpg?v=0",
    "/images/image-holder2.jpg?v=0",
	"/images/image-holder.jpg?v=0"
    );
  var gblPauseSeconds = 7.25;
  var gblFadeSeconds = .85;
  var gblRotations = 3;

  // End Customization section
  
  var gblDeckSize = gblImg.length;
  var gblOpacity = 100;
  var gblOnDeck = 0;
  var gblStartImg;
  var gblImageRotations = gblDeckSize * (gblRotations+1);

  window.onload = photoShufflerLaunch;
  
  function photoShufflerLaunch()
  {
  	var theimg = document.getElementById(gblPhotoShufflerImgId);
        gblStartImg = theimg.src; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivId).style.backgroundImage='url(' + gblImg[gblOnDeck] + ')';
	setTimeout("photoShufflerFade()",gblPauseSeconds*1000);
  }

  function photoShufflerFade()
  {
  	var theimg = document.getElementById(gblPhotoShufflerImgId);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDelta = 100 / (30 * gblFadeSeconds);

	// fade top out to reveal bottom image
	if (gblOpacity < 2*fadeDelta ) 
	{
	  gblOpacity = 100;
	  // stop the rotation if we're done
	  if (gblImageRotations < 1) return;
	  photoShufflerShuffle();
	  // pause before next fade
          setTimeout("photoShufflerFade()",gblPauseSeconds*1000);
	}
	else
	{
	  gblOpacity -= fadeDelta;
	  setOpacity(theimg,gblOpacity);
	  setTimeout("photoShufflerFade()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffle()
  {
	var thediv = document.getElementById(gblPhotoShufflerDivId);
	var theimg = document.getElementById(gblPhotoShufflerImgId);
	
	// copy div background-image to img.src
	theimg.src = gblImg[gblOnDeck];
	// set img opacity to 100
	setOpacity(theimg,100);

        // shuffle the deck
	gblOnDeck = ++gblOnDeck % gblDeckSize;
	// decrement rotation counter
	if (--gblImageRotations < 1)
	{
	  // insert start/final image if we're done
	  gblImg[gblOnDeck] = gblStartImg;
	}

	// slide next image underneath
	thediv.style.backgroundImage='url(' + gblImg[gblOnDeck] + ')';
  }

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;

  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;

  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

//--><!]]>

// New Browser Window

function open_window(url,w,h) { mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+''); }

// Preload any rollon images here

// Global Navigation Buttons Array
// This array preloads every time, under the assumption that
// not everyone is going to enter the site via the home page.
btnGlobal = new Array (				
			  "art-selection1-off.jpg",
			  "art-selection2-off.jpg",
			  "art-selection3-off.jpg",
			  "art-selection4-off.jpg",
			  "art-selection5-off.jpg",
			  "art-selection6-off.jpg",
			  "art-selection7-off.jpg",
			  "art-selection8-off.jpg",
			  "art-selection9-off.jpg",
			  "art-selection10-off.jpg",
			  "services-selection1-off.jpg",
			  "services-selection2-off.jpg",
			  "services-selection3-off.jpg",
			  "services-selection4-off.jpg",
			  "services-selection5-off.jpg",
			  "services-selection6-off.jpg"
)

function preloadem(btnSidenav){
		
	// Always preload Global Navigation
	arImageList = new Array();
	sDirectory = "/images/";
		
	for (counter in btnGlobal) {
		arImageList[counter] = new Image();
		arImageList[counter].src = sDirectory + btnGlobal[counter];
	}
	// Preload Sub Navigation if required
	if(btnSidenav) {
		arImageList2 = new Array();
		for (counter in btnSidenav) {
			arImageList2[counter] = new Image();
			arImageList2[counter].src = sDirectory + btnSidenav[counter];
		}
	}
}

/* This function does the actual image rollover */

function changeIt(oImage){
	var sSrc = oImage.src;

	var iUnderscore = sSrc.lastIndexOf("-");
	
	var iDot = sSrc.lastIndexOf(".");
	var sState = sSrc.slice(iUnderscore, iDot);
	var sNewImg = sSrc.slice(0, iUnderscore);
	var sExtension = sSrc.slice(iDot);
	if(sState == "-off")
	{
					sNewImg = sNewImg + "-on" + sExtension;
					eval(oImage).src = sNewImg;
	}
	else
	{
					sNewImg = sNewImg + "-off" + sExtension;
					eval(oImage).src = sNewImg;
	}

}

/* JavaScript Image Gallery */

function showPic(whichpic) {
  if (document.getElementById) {
  	document.getElementById('placeholder').src = whichpic.href;
  	return false;
  }
  else {
  	return true;
 }
}


