var escobar = {};escobar.accordianize = function() {	var nav = $( "ul#view-navigation" ), anchors = $( "ul#view-navigation > li > a" ), thumb_anchors = $( "ul.thumbnails li a", nav );	anchors.stop().animate({ padding:"8px 0" }, "fast", "linear");	anchors.live("mouseover", function () {		if (!$(this).is(".current"))        	$(this).stop().animate({ padding:"11px 0" }, "fast", "linear");    });    anchors.live("mouseout", function () {    	if (!$(this).is(".current"))        	$(this).stop().animate({ padding:"8px 0" }, "fast", "linear");    });	anchors.live( "click", function() {		var current_wrapper = $( "div.wrapper:visible", nav ), ul = $( "ul.hfeed", "div#window" );		$( ".transparent" ).remove();		$.ajax({			url: $( this ).attr( "href" ),			success: function(rsp) {				ul.html( rsp );				var lis = $( "li", ul );				// lis.css( "width", $( window ).width() + "px" );				lis.css( "width", "9999px" );				ul.css( "width", ( $( "li:first", ul ).width() * lis.length ) + "px" );				$( "div#window" ).css("left", "0px");				//$( "li.hentry", ul ).css( "width", $( window ).width() + "px" );				$( "li.hentry", ul ).css( "width", "9999px" );				/** Image grows with the browser. The maxImageResize function I wrote on top of a JQuery plugin. I added the .active class to the image on the user's					screen so that the maxImageResize function can be called on only that image and not all the images in the list.					The image size is suppose to recalculate on any events, such as moving to the next/prev image, browser resize, switching galleries */				var curli = $("li:first", ul);				$( "img", curli ).addClass("active");				maxImageResize($('img.active', '.entry-content'), {					verticalOffset: 140,					horizontalOffset: 250,					position: 'relative',					maxFollows: 'both',					maxAtOrigImageSize:   true,					topSpace: 5				});							}		});		current_wrapper.slideUp( "fast" ).siblings( "a.current" ).removeClass( "current" );		// The old way of doing the navigation		// $( this ).addClass( "current" ).parent().prependTo( $( "ul#view-navigation" ) ).children( "div.wrapper" ).slideDown( "fast", function() {		// 	escobar.positionize();		// });		// The new way of doing the navigation		$( "ul#view-navigation > li:lt(" +  $( "ul#view-navigation > li" ).index( $( this ).parent() ) + ")" ).appendTo( nav );		$( this ).addClass( "current" ).siblings( "div.wrapper" ).slideDown( "fast", function() {			escobar.positionize();		});		return false;	});	thumb_anchors.live( "click", function() {		var div = $( "div#window" ), lis = $( "li.hentry", div ), li = $( this.hash );		$( ".transparent" ).remove();		div.animate({			"left": -( lis.index( li ) * li.width() ) + "px"		}, "fast" );		$("img.active", ".entry-content").removeClass("active");		var picId = 'li'+$(this).attr("href");		$("img", picId).addClass("active");		maxImageResize($('img.active', '.entry-content'), {			verticalOffset: 140,			horizontalOffset: 250,			position: 'relative',			maxFollows: 'both',			maxAtOrigImageSize:   true,			topSpace: 5		});		return false;	});};escobar.flip = function() {	var list = $( "ul#view-navigation" ), prevs = $( "a.prev", list ), nexts = $( "a.next", list );	prevs.click( function() {		var div = $( "div#window" ), lis = $( "li.hentry", div ), start = div.offset().left, end = start + $( "li.hentry:first", div ).width();		$( ".transparent" ).remove();		if ( end > 0 ) {			return false;		} else {			div.animate({				"left": end + "px"			}, "fast" );		}		var curli = $("img.active", ".entry-content").parent().parent().prev();		$("img.active", ".entry-content").removeClass("active");		$("img", curli).addClass("active");		maxImageResize($('img.active', '.entry-content'), {			verticalOffset: 140,			horizontalOffset: 250,			position: 'relative',			maxFollows: 'both',			maxAtOrigImageSize:   true,			topSpace: 5		});		return false;	});	nexts.click( function() {		var div = $( "div#window" ), lis = $( "li.hentry", div ), w = $( "li.hentry:first", div ).width(), start = div.offset().left, end = start - w;		$( ".transparent" ).remove();		if ( Math.abs( end ) >= ( w * lis.length ) ) {			return false;		} else {			div.animate({				"left": end + "px"			}, "fast" );		}		var curli = $("img.active", ".entry-content").parent().parent().next();		$("img.active", ".entry-content").removeClass("active");		$("img", curli).addClass("active");		maxImageResize($('img.active', '.entry-content'), {			verticalOffset: 140,			horizontalOffset: 250,			position: 'relative',			maxFollows: 'both',			maxAtOrigImageSize:   true,			topSpace: 5		});		return false;	});};escobar.navigate = function() {	var list = $( "ul#view-navigation" );	$( "a#nav-view" ).click( function() {		// Revewal the email and phone number		// document.getElementById('email').style.display = 'block';		// Remove any existing transparent DIVs		$( ".transparent" ).remove();		list.slideDown( "fast", function() {			escobar.positionize();		});		return false;	});	$( "a#nav-contact" ).click( function() {		var transDiv = '<div class="transparent" id="contact"><img class="graphic" src="/themes/escobar/images/contact-icon.gif" />';		// Remove any existing transparent DIVs		$( ".transparent" ).remove();		// Get text from PHP via AJAX		$.ajax({			url: $( this ).attr( "href" ),			success: function(rsp) {				transDiv += '<div class="text">'+rsp.toString()+'</div>';				// Create DIV				$("img.active").parent().parent().prepend(transDiv +'<a href="#" class="close"><img class="close" src="/themes/escobar/images/close.gif" /></a></div>');				$( "a.close" ).click( function() {						$(this).parent().remove();				});			}		});		return false;	});	$( "a#nav-about" ).click( function() {		var transDiv = '<div class="transparent" id="about"><img class="graphic" src="/themes/escobar/images/about-icon.gif" />';		// Remove any existing transparent DIVs		$( ".transparent" ).remove();		// Get text from PHP via AJAX		$.ajax({			url: $( this ).attr( "href" ),			success: function(rsp) {				transDiv += '<div class="text">'+rsp.toString()+'</div>';				// Create DIV				$("img.active").parent().parent().prepend(transDiv +'<a href="#" class="close"><img class="close" src="/themes/escobar/images/close.gif" /></a></div>');				$( "a.close" ).click( function() {						$(this).parent().remove();				});			}		});		return false;	});};escobar.positionize = function() {	var container = $( "div#container" );	container.animate({		top: ( ( $( window ).height() - container.height() ) / 2 ) + "px"	}, "fast" );	$('h1#title', container).click( function() {		window.location.reload();	});		$('h3#title', container).click( function() {        var mailto_link = 'mailto:dan@danescobar.com';        win = window.open(mailto_link,'tempWindow');        if (win && win.open &&!win.closed) win.close();		//window.open('mailto:dan@danescobar','tempWindow'); 		//window.open( "mailto:dan@danescobar.com" );	});};$().ready( function() {	escobar.positionize();	escobar.navigate();	escobar.accordianize();	escobar.flip();/*	$(window).resize(function () {		var ul = $( "ul.hfeed", "div#window" ), lis = $( "li", ul );		// lis.css( "width", $( window ).width() + "px" );		lis.css( "width", "9999px" );		ul.css( "width", ( $( "li:first", ul ).width() * lis.length ) + "px" );		$( "li.hentry", ul ).css( "width", $( window ).width() + "px" );	});*/	$('img', '.entry-content').maxImage({		verticalOffset: 140,		horizontalOffset: 250,		position: 'relative',		maxFollows: 'both',		maxAtOrigImageSize:   true,		topSpace: 5	});});
