			$(document).ready(function(){
				$("a[name=click]").click(function(){ 
					$(".col-left").load("pages/"+this.id+".php");
					$(".col-right").load("pages/"+this.id+"-menu.php");
				});

				$("a.links").click( function(){
					var margin = $("#wrapper").css("margin-left").replace("px",""); //to capture current wrapper left margin
					var move = 0, indicator = 0; //var to hold how px to move
					move = parseInt(this.id)*700;
					indicator = parseInt(this.id)*30;
					move = "-"+String(move)+"px";
					indicator = "+"+String(indicator)+"px";
					$("#wrapper").animate({
						marginLeft: move	
					}, 1000);	
					$(".pointer").animate({
						marginTop: indicator	
					}, 300);
				});
				
				$("#slider li").hover(
					function(){
						$(this).stop().animate({marginLeft: "-5px"},{queue:false,duration:100});
					},
					function(){
						$(this).stop().animate({marginLeft: "0px"},{queue:false,duration:100});
					}
				).click(function(){
						$(this).addClass('selected');
					}
				);
				
				$(".frame").hover(
					function(){
						$(".caption",this).stop().animate({bottom:'0px'},{queue:false,duration:160});
					},
					function(){
						$(".caption",this).stop().animate({bottom:'-100px'},{queue:false,duration:160});
					}
				);
				
				$('#wysiwyg').wysiwyg();
				
				$("form[name=sendMessage]").submit(function(){
					$.post("pages/dataCtl.php", { name: $("input[name=name]").val(), 
					email: $("input[name=email]").val(), 
					message: $("textarea[name=wysiwyg]").val() },
					function(data){
						alert(data.message);
					},'json');
					return false;
				});				
			
			});