var currHeader;

$(function() {
	//var froogaloop, container, isvim = false;
	Cufon.replace('h2');Cufon.replace('#projects > h3',{hover: true});
	$( "#projects" ).accordion({autoHeight: false,active: -1,
		changestart: function(event, ui){
				//$(ui.oldContent).find('div:first').tabs( "destroy" );
				//if ($(ui.oldContent).html() != null) { $(ui.oldContent).html('');}
				
               // $(ui.newContent).load($(ui.newHeader).find('a').attr('title'),function() {
					//console.log ("ui.newContent content" + $(ui.newContent).find('#tabs').html());
					// initialize tabs
				  	
				//}); //end of load
        }, // end of changestart
		change: function(event, ui){ 
			$.scrollTo($(ui.newHeader),225, {axis:'y'},{offset: -50});
			currHeader = $(ui.newHeader);
			$(ui.oldHeader).addClass('visited');
		}
	});// end of accordion
	
	$( "#projects > div > img" ).click(function () {
		$('#projects div img').each(function() {
				 $(this).removeClass('large', 500, function(){ $(this).attr('style', '')} );
		});
		
		if ($(this).attr('class') != 'small large' ) {
			$(this).toggleClass('large', 325, function(){ 
		 		$(this).attr('style', ''); 
				//$.scrollTo(currHeader,225, {axis:'y'},{offset: -50});
			});
		
		}else {$(this).removeClass('large', 325, function(){ $(this).attr('style', '')} );}
		
		
		
	});
	
	
});


QueryLoader.selectorPreload = "body";
QueryLoader.init();

