function doMail(user,domain)
{
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

function stripeMyStuff (containingID, elementInID, stripeClassName) {
	$(containingID).find(elementInID + ':odd').addClass(stripeClassName);
}

$(document).ready(function(){

	// FANCY ZOOM
	// $('a.zoom').fancyZoom();
	
	// CAROUSEL
	$("div.carousel").carousel( { loop: true, pagination: true } );
	$("div.carousel-wrap").attr( { style:"width:710px; height:425px; overflow:hidden; position:relative;" } );
	$("div.carousel").prepend('<img src="images/hc-portfolio-edge.png" class="edge" />');
	
	// CAROUSEL - iPad
	$("div.iPad-carousel").carousel( { loop: true, pagination: true } );
	$("div.iPad-carousel div.carousel-wrap").attr( { style:"width:587px; height:441px; overflow:hidden; position:relative;" } );
	
	// Google Maps Stuff
	var aboutHeight = $("div#about div.shadow-dark").height();
	$("div#wrapper iframe").height(aboutHeight);
	
	$("a.rolenav").click(function(){
		var id = $(this).attr("id");
		$(".client").slideUp("slow");
	//	$(".client li").hide();
	//	$("li." + id).show();
		$("." + id).slideDown("slow");
		return false;
	});
	
	$("a.rolereset").click(function(){
		$(".client").slideDown("slow");
		return false;
	});
	
	$("div.client").prepend('<a href="#header" class="backTop">back to the top</a>');
	
	// SMOOTH SCROLL
	$('a[href*=#]').click(function() {
	    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	    && location.hostname == this.hostname) {
	      var $target = $(this.hash);
	      $target = $target.length && $target
	      || $('[name=' + this.hash.slice(1) +']');
	      if ($target.length) {
	        var targetOffset = $target.offset().top;
	        $('html,body')
	        .animate({scrollTop: targetOffset}, 1000);
	       return false;
	      }
	    }
	  });
	
	// SCROLL LIST
	var listPos = $('div#client-box').offset().top;
	var refreshScrollTop = setInterval(function() {
		var windowPos = $(window).scrollTop();
		$('div#message').html('windowPos: '+windowPos+'<br/>listPos: '+listPos);
		if (windowPos > listPos) {
			$('div#client-box').css({'position':'fixed', 'top':'0', 'margin-top':'0px'});
		}else{
			$('div#client-box').css('position','relative','top','0');
		}
	}, 10);
	
});
