// configure JS calls

$(document).ready(function(){
	
	/* HOME PAGE SLIDER */
	$(".slide_nav").click(function(){ var tempNum = this.href; var tempArray = tempNum.split("#"); $(".scrollContainer").animate({  marginLeft: -((tempArray[1]*940)-940), easing: 'easeOutBack' }, "slow" );});
	
	/* TOOL TIPS */
	$(".tt a").hover(function(){$(this).prev("div").animate({ opacity: 'toggle', marginTop:-75 }, "fast" ); },function(){$(this).prev("div").animate({opacity: 'toggle',marginTop:-85 },"fast");});

	/* SHOW MORE SERVICES INFO */
	$("a.show").click(function(){
		winwidth=document.body.clientWidth;
		$(this).next("div").animate({
			left:winwidth/2 - 1000/2,
			opacity:"toggle"
		},"slow");
	});
	
	/* SHOW MORE PROJECTS */
	$("a.vm").click(function(){
		winwidth=document.body.clientWidth/2 - 1000/2;
		document.getElementById("hidden_pane").style.left = winwidth + "px";
		$(this).prev("div").animate({
			opacity: "toggle"
		}, "slow");
	});
	
	/* SHOW MORE BIO INFO */
	$("a.view_more").click(function(){$(this).prev("div").animate({height: "toggle"}, "slow");});
	
	/* SHOW MORE BIO INFO */
	$("a.view_partner").click(function(){$(this).next("div.bio").animate({height: "toggle"}, "slow");});

	/* CLOSE MORE INFO */
	$("a.close").click(function(){$(this).parent("div").animate({opacity: "toggle"}, "slow");});
	
	/* STYLING THE FORM */
	$(function(){$('form.freeform').jqTransform({imgPath:'http://beta.headspacedesign.ca/js/form/img/'});});
	

	   $(document).ready(function() {
	
			$('#backtotop').click(function(){
			$('html, body').animate({scrollTop:0}, 'slow');
			});
	
	  });


	$('#lb a').lightBox();
});

//BIO's ~ setting the value for the open href's
function viewMore(tempObj)
{
	if (tempObj.innerHTML=="More")
	{
		tempObj.innerHTML = "Close";
	} else {
		tempObj.innerHTML = "More";
	}
}


/*
Preload images script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var myimages=new Array()

function preloadimages(){
	var path = "../images/template/"
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src= path + preloadimages.arguments[i]
	}
}


//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
preloadimages("nav_services_on.png","nav_company_on.png","nav_contact_on.png","nav_work_on.png","nav_client_on.png","nav_blog_on.png")

