$(document).ready(function(){
	$("#contactus a").fancybox({'frameWidth': 320, 'frameHeight': 410, 'overlayShow': true });
	$(".3").click(function(){
		$('#left').show();
		$('#center').show().width(480);
		$('#right').show();
		return false;
	});
	$(".2r").click(function(){
		$('#left').hide();
		$('#center').show().width(700);
		$('#right').show();
		return false;
	});
	$(".2l").click(function(){
		$('#left').show();
		$('#center').show().width(700);
		$('#right').hide();
		return false;
	});
	
	$(".Sh").toggle(function(){
	$('#header .container').height(150);
	$(".Sh").html('header is 150px deep');
	$('#header h1').css('margin-top', '15px');return false;},
	function(){
	$('#header .container').height(300);
	$(".Sh").html('header is 300px deep');
	$('#header h1').css('margin-top', '40px');return false;
	
	
	});
	

$('.gallery a img').fadeTo('slow',0.7);	

$('.gallery a img').hover(function(){

	$(this).fadeTo("slow", 1.0);},
	function(){
	$(this).fadeTo("slow", 0.7);

});   


$('body').css('backgroundImage', 'none'); 

	$(".togglegrid").toggle(function(){
			$('body').css('backgroundImage', 'url("graphics/background-grid.png")');return false;}, 
			function(){
		$('body').css('backgroundImage','none');return false;});
 
 $(function () {
 	loca = location.href; //  address of this page
 	arr = loca.split('.');
 	arr = arr[arr.length-1].split('/');
 	$("#nav a[href$='" + arr + "']").parent('li').addClass("current");
 });
 
	$('a.toggle').parent('p').next('div').hide();	//select all links with class of toggle, find the next div after the parent and hide them all.
	$('a.toggle').html('Show examples');		// Make all links with class toggle read - show examples
	$('a.toggle').toggle(function(){		// set up the show hide toggle
	$(this).html('Hide examples');		// change the button text to 'hide examples					  
	$(this).parent('p').next('div').slideToggle('slow');return false;},		//then find the next div after the parent and hide it.
	function showExamples(){		// Set up the reverse of the toggle...	
	$(this).html('Show examples');		// change the button text to 'show examples						  
	$(this).parent('p').next('div').slideToggle('slow');return false;		//then find the next div after the parent and show it.
	
	
});

 
    })
