var $Q = jQuery.noConflict();

$Q(document).ready(function() {
	// find all links that begin with "http://"
    $Q('a[href^="http://www."]').filter(function(){ 
	
		// filter out links that have the same domain name as the current page
		return this.hostname && this.hostname !== location.hostname; 
	})
        
		// add a CSS class of "external" to each external link (for styling)
		.addClass("external")
		
		// inform visitor that link will open in new window
        .attr( 'title', 'Link will open in new window')
		
		// open link in new window once clicked
		.click( function() {
				window.open(this.href);
				return false;
		});
	
	$Q('a.portfolio-link, a.lightbox').colorbox({transition:"fade", width:"75%"});
	
	$Q('.home-header .menu-header a, .top-arrow').not('#menu-item-42 a, #menu-item-36 a, #menu-item-37 a').click(function(event){
		event.preventDefault();
		var full_url = this.href;
		var parts = full_url.split("#");
		var trgt = parts[1];
		var target_offset = $Q("#"+trgt).offset();
		var target_top = target_offset.top;
		var yOffset = target_top - $Q(window).scrollTop();
		$Q('html, body').animate({scrollTop:yOffset}, 500);
	});
	
	$Q('#menu-item-36 a, #menu-item-37 a').click(function(event){
		event.preventDefault();
		var full_url = this.href;
		var parts = full_url.split("#");
		var trgt = parts[1];
		var target_offset = $Q("#"+trgt).offset();
		var target_top = target_offset.top;
		var yOffset = target_top - $Q(window).scrollTop();
		$Q('html, body').animate({scrollTop:yOffset}, 500);
	});


});
