	//set initial include

	var thisTarget = "includes/index.php";

	//set initial marker value

	var big = false;



$(document).ready(function() {	



	//set initial bar status

	var thisOpen = false;						   



//	$.historyInit(pageload);



	//subtitute for replace

	function replaceHtml(el, html) {

		var oldEl = typeof el === "string" ? document.getElementById(el) : el;

		var newEl = oldEl.cloneNode(false);

		newEl.innerHTML = html;

		oldEl.parentNode.replaceChild(newEl, oldEl);

		return newEl;

	};

	

	$("#content>img").load(function () {

		$(this).fadeIn("slow");

		//$("#content>img:hidden").fadeIn(1000);

	});

	

	//hide elements on page load

	$("#bar-nav").css("width", "0px");

	$("#bar-content").css("width", "0px");

	$("#bar-content").hide();

	$("#bar-nav-inner").hide();

	$("#ajax-content").hide();

	$('#bar-close').addClass('open');

	

	//initial animate open

	$("#bar-nav").animate({

			width: '140px'

		}, 2000, "easeOutExpo" );	

	$("#bar-nav-inner").fadeTo(1000, 1).fadeIn();	

	

	//ajax setup	

	$.ajaxSetup({

	  url: "/xmlhttp/",

	  global: false,

	  type: "POST"

	});	



	// ajax link load and animation

	 $('.ajax').livequery('click', function(event) { 

	 

		thisTarget = $(this).attr('href');



		$("#content>img").fadeOut(500, function() {				

			$("#content>img").css("display", "none");

			

			if (thisTarget == 'about.php') {

				$("#content>img").attr({"src": "images/large/about.jpg"});

			} else if (thisTarget == 'clients.php') {		

				$("#content>img").attr({"src": "images/large/clients.jpg"});

			} else if (thisTarget == 'work.php') {

				$("#content>img").attr({"src": "images/large/work.jpg"});	

			} else if (thisTarget == 'contact.php') {

				$("#content>img").attr({"src": "images/large/contact.jpg"});

			}

			

		}).fadeIn(500);

		

	 	//animate close

		$("#ajax-content").fadeOut();

		

		if (thisOpen == true) {

			$("#bar-content").animate({

				width: '0px'

			}, 1000, "easeOutExpo" );

		}



		$('#bar-close').addClass('open');

		//fade out any sub container content

		$("#sub-container").fadeTo(750, .01);

		

		$("#ajax-content").fadeTo(500, .01, function() {

			

			$(this).load(thisTarget);

			

			//load client content

			if (thisTarget == "clients.php") {		

				$("#sub-container").fadeTo(100, .01, function() {		

					$("#sub-container").load("includes/clients.php");

				});

				

				$("#bar-nav-inner").fadeTo(100, .01, function() {		

					$("#bar-nav-inner").load("includes/clients-nav.php");

				}).fadeTo(1000, 1);					

			} else {

				$("#sub-container").fadeOut(100);

				replaceHtml("sub-container", "");

					

				$("#bar-nav-inner").fadeOut(100);

				replaceHtml("bar-nav-inner", "");					

			}	

			

			//load work content

			if (thisTarget == "work.php") {		

				$("#bar-nav-inner").fadeTo(100, .01, function() {		

					$("#bar-nav-inner").load("includes/work-nav.php");

				}).fadeTo(1000, 1);				

			} else {

				$("#bar-nav-inner").fadeOut(100);

				replaceHtml("bar-nav-inner", "");

			}	

			

			//load work content

			if (thisTarget == "about.php") {		

				$("#bar-nav-inner").fadeTo(100, .01, function() {		

					$("#bar-nav-inner").load("includes/about-nav.php");

				}).fadeTo(1000, 1);				

			} else {

				$("#bar-nav-inner").fadeOut(100);

				replaceHtml("bar-nav-inner", "");

			}

			

			//load contact content

			if (thisTarget == "contact.php") {		

				$("#bar-nav-inner").fadeTo(100, .01, function() {		

					$("#bar-nav-inner").load("includes/contact-nav.php");

				}).fadeTo(1000, 1);					

			} else {					

				$("#bar-nav-inner").fadeOut(100);

				replaceHtml("bar-nav-inner", "");					

			}			

						

		}).fadeTo(750, 1);

		

		thisOpen = false;

		

		return false;

	});	

	 

	//load client sub content

	$('.ajax-client').livequery('click', function(event) { 	

		

		thisTarget = $(this).attr('href');

		

		$("#ajax-content").fadeTo(500, .01, function() {									

			$(this).load(thisTarget);		

		}).fadeTo(750, 1);

		

		return false;

	});		 



	// close link

	$("#close").click(function() {

			

		if (thisOpen == true) {			

			$("#bar-content").animate({

				width: '0px'

			}, 1000, "easeOutExpo" );

			$("#ajax-content").fadeOut();

			$("#sub-container").fadeTo(750, .01);

			$('#bar-close').toggleClass("open");

			thisOpen = false;

		} else if (thisOpen == false) {			

			$("#bar-content").animate({

				width: '650px'

			}, 1000, "easeOutExpo" );

			$("#ajax-content").fadeIn();

			$("#sub-container").fadeTo(750, 1);			

			$('#bar-close').toggleClass("open");

			thisOpen = true;

		}

	});

	// end close link

	

	//leftnav tab clicked

	 $('.leftnav').livequery('click', function(event) {

		 

		 thisTarget = $(this).attr('href');

	

		$("#ajax-content").fadeTo(250, .01, function() {			

			$(this).load(thisTarget);

			

			if (thisOpen == false) {			

				$("#bar-content").animate({

					width: '650px'

				}, 1000, "easeOutExpo" );		

				$("#ajax-content").fadeIn();

				$('#bar-close').toggleClass("open");

				thisOpen = true;

			}

			

		}).fadeTo(750, 1);

			

		return false;		

	});	

	 

	//open slider, but do not load content

	 $('.slide-open').livequery('click', function(event) {

			

			if (thisOpen == false) {			

				$("#bar-content").animate({

					width: '650px'

				}, 1000, "easeOutExpo" );		

				$("#ajax-content").fadeIn();

				$('#bar-close').toggleClass("open");

				thisOpen = true;

			}

			

			$("#sub-container").fadeTo(1000, 1);

			

		return false;		

	});		 

	 

	//----------------------------------------------------	 

	 //temp breadcrumb work

	 $('.commercial').livequery('click', function(event) {		

		$('#commercial').css('color', '#000');

		$('#educational').css('color', '#53738D');

		$('#resort').css('color', '#53738D');

		$('#residential').css('color', '#53738D');



		bigTarget = "images/work/commercial.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

	

		return false;		

	});	

	 

	 $('.educational').livequery('click', function(event) {		

		$('#commercial').css('color', '#53738D');

		$('#educational').css('color', '#000');

		$('#resort').css('color', '#53738D');

		$('#residential').css('color', '#53738D');



		bigTarget = "images/work/educational.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		return false;		

	});	

	 

	 $('.resort').livequery('click', function(event) {		

		$('#commercial').css('color', '#53738D');

		$('#educational').css('color', '#53738D');

		$('#resort').css('color', '#000');

		$('#residential').css('color', '#53738D');

		

		bigTarget = "images/work/resort.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		return false;		

	});	

	 

	 $('.residential').livequery('click', function(event) {		

		$('#commercial').css('color', '#53738D');

		$('#educational').css('color', '#53738D');

		$('#resort').css('color', '#53738D');

		$('#residential').css('color', '#000');

		

		bigTarget = "images/work/residential.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		return false;		

	});	

	 

	//----------------------------------------------------

	

	 //temp breadcrumb about

	 $('#bill').livequery('click', function(event) {		

		$('#bill').css('color', '#000');

		$('#liza').css('color', '#53738D');

		$('#sustainability').css('color', '#53738D');

		$('#community').css('color', '#53738D');

		 

		return false;		

	});	

	 

	 $('#liza').livequery('click', function(event) {		

		$('#bill').css('color', '#53738D');

		$('#liza').css('color', '#000');

		$('#sustainability').css('color', '#53738D');

		$('#community').css('color', '#53738D');

		return false;		

	});	

	 

	 $('#sustainability').livequery('click', function(event) {		

		$('#bill').css('color', '#53738D');

		$('#liza').css('color', '#53738D');

		$('#sustainability').css('color', '#000');

		$('#community').css('color', '#53738D');

		return false;		

	});	

	 

	 $('#community').livequery('click', function(event) {		

		$('#bill').css('color', '#53738D');

		$('#liza').css('color', '#53738D');

		$('#sustainability').css('color', '#53738D');

		$('#community').css('color', '#000');

		return false;		

	});	

	 

	//----------------------------------------------------	 

	 

	 //greybox

	$("a.greybox").livequery('click', function(event) {

	  var t = "Bill Gardner";

	  //var t = this.title || this.innerHTML || this.href;

	  var target = "includes/about/bill-bio.php";

	  GB_show(t,target,480,520);

	  return false;

	});	

	

	$("a.greybox2").livequery('click', function(event) {

	  var t = "Liza Kilcoyne";

	  //var t = this.title || this.innerHTML || this.href;

	  var target = "includes/about/liza-bio.php";

	  GB_show(t,target,480,520);

	  return false;

	});

	

	$("a.greyboxvideo").livequery('click', function(event) {

	  var t = "RTA";

	  //var t = this.title || this.innerHTML || this.href;

	  var target = "rta-video.html";

	  GB_show(t,target,480,660);

	  return false;

	});	

	

	$("a.greyboxphoto").livequery('click', function(event) {

	  var t = "PhotoCredits";

	  //var t = this.title || this.innerHTML || this.href;

	  var target = "photo-credits.php";

	  GB_show(t,target,480,660);

	  return false;

	});	

	

	//temp whiteface

	 $('#whiteface').livequery('click', function(event) {

		 thisTarget = "includes/projects/white-face-lodge.php";

		

		bigTarget = "images/work/whiteface1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

			

		return false;		

	});		



	//temp lostcove

	 $('#lostcove').livequery('click', function(event) {

		 thisTarget = "includes/projects/lost-cove.php";

		

		bigTarget = "images/large/lost-cove1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

		

		return false;		

	});	

	 

	//temp stowe

	 $('#stowe').livequery('click', function(event) {

		 thisTarget = "includes/projects/stowe.php";

		

		bigTarget = "images/work/stowe1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

			

		return false;		

	});	

	 

	//temp rta

	 $('#rta').livequery('click', function(event) {

		 thisTarget = "includes/projects/rta.php";

		

		bigTarget = "images/work/rta1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);	

			

		return false;		

	});		

	 

	//temp vsac

	 $('#vsac').livequery('click', function(event) {

		 thisTarget = "includes/projects/vsac.php";

		

		bigTarget = "images/work/vsac1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

			

		return false;		

	});	

	 

	//temp higherground

	 $('#higherground').livequery('click', function(event) {

		 thisTarget = "includes/projects/higher-ground.php";

		

		bigTarget = "images/work/higherground1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

			

		return false;		

	});	

	 

	//temp jaypeak

	 $('#jaypeak').livequery('click', function(event) {

		 thisTarget = "includes/projects/jay-peak.php";

		

		bigTarget = "images/work/jaypeak1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

		

		return false;		

	});

	 

	//temp vins

	 $('#vins').livequery('click', function(event) {

		 thisTarget = "includes/projects/vins.php";

		

		bigTarget = "images/work/vins1.jpg";

		$("#content").fadeTo(500, 0, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);		

		

		$("#ajax-content").fadeTo(500, 0, function() {			

			$(this).load(thisTarget);

		}).fadeTo(750, 1);

			

		return false;		

	});		 



	$("a.full-photo").livequery('click', function(event) {

		bigTarget = $(this).attr('href');

		

		$("#content").fadeTo(500, .01, function() {				

			$("#content>img").css("display", "none");

			$("#content>img").attr({"src": bigTarget});

		}).fadeTo(500, 1);

		

		return false;

	});	

	

	//thumbnail swapping

	$(".thumb1").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '0px'

		}, 750, "easeOutExpo" );

		

		//get alt text from thumbnail and load description

		altText1 = $(".thumb1 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText1);

		}).fadeTo(750, 1);			

		

		return false;

	});



	$(".thumb2").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '-140px'

		}, 750, "easeOutExpo" );

		

		//get alt text from thumbnail and load description

		altText2 = $(".thumb2 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText2);

		}).fadeTo(750, 1);			

		

		return false;

	});	

	

	$(".thumb3").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '-140px'

		}, 750, "easeOutExpo" );	

		

		//get alt text from thumbnail and load description

		altText3 = $(".thumb3 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText3);

		}).fadeTo(750, 1);					

	

		return false;

	});	

	

	 // Jay Peak Thumbnail Swapping

	 

	 //thumbnail swapping

	$(".jpthumb1").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '0px'

		}, 750, "easeOutExpo" );

		

		

		

		//get alt text from thumbnail and load description

		altText1 = $(".jpthumb1 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText1);

		}).fadeTo(750, 1);			

		

		return false;

	});



	$(".jpthumb2").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '-140px'

		}, 750, "easeOutExpo" );

		

		//get alt text from thumbnail and load description

		altText2 = $(".jpthumb2 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText2);

		}).fadeTo(750, 1);			

		

		return false;

	});	

	

	$(".jpthumb3").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '0px'

		}, 750, "easeOutExpo" );

		

		$("#thumbnail-slider").animate({

			marginTop: '-85px'

		}, 750, "easeOutExpo" );

		

		//get alt text from thumbnail and load description

		altText3 = $(".jpthumb3 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText3);

		}).fadeTo(750, 1);					

	

		return false;

	});	

	

	 $(".jpthumb4").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '0px'

		}, 750, "easeOutExpo" );

		

		

		//get alt text from thumbnail and load description

		altText4 = $(".jpthumb4 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText4);

		}).fadeTo(750, 1);					

	

		return false;

	});	

	  $(".jpthumb5").livequery('click', function(event) {

		

		$("#thumbnail-slider").animate({

			marginLeft: '0px'

		}, 750, "easeOutExpo" );

		

		$("#thumbnail-slider").animate({

			marginTop: '0px'

		}, 750, "easeOutExpo" );

		

		

		//get alt text from thumbnail and load description

		altText4 = $(".jpthumb5 img").attr("alt");					

		$("#alt-text").fadeTo(750, .1, function() {

				$(this).html(altText4);

		}).fadeTo(750, 1);					

	

		return false;

	});

	 // end the Jay Peak Thumbnail swapping

	

	$('a').click(function() {

           this.blur();

     });



});