$(document).ready(function() {

if ($('.carousel')){
	//alert(current)
	if (typeof(current) == "undefined"){//move the carousel to the current documents position
		current = 0;
		}else{
		current = current+1;
			}
	
   $('.carousel').jcarousel({start:current});
}

$(".holder .col:last").addClass('last');

$("a[rel='colorbox_new']").colorbox();

if ($(".gallery1")){
	loadGallery();
	}
});

function loadEnquiry(enc){
	
$('.TextAreaField').val("I am inquiring about the work "+enc);
	
	}

function loadGallery(){
	
	}
	
		var setLoad = "";
	
function showVideo(url){
	// Load a new video
player.sendEvent("LOAD","http://content.bitsontherun.com/jwp/"+url+".xml");

	}	

function showVideoInit(url){
	
	setLoad = url;
	}
	
var player;

function playerReady(obj) {

player = document.getElementById(obj['id']);
  
  showVideo(setLoad);
  
};

	function viewVideo(key){
	

showVideo(key);
		
		}
	
	function loadImage(isrc){
		//$.colorbox.remove();
		$.colorbox.close();
		
$(".mainimage img").attr('src', isrc+"?width=349");
$("a[rel='colorbox_new']:first").attr('href', isrc+"?maxsidesize=800");
$("a[rel='colorbox_new']").colorbox();

	}
