/*



						:::::::::   :::::::::       squarehead design studio
						:::::::::   :::::::::
						:::::::::   :::::::::
						:::::::::   :::::::::
							
						:::::::::   :::::::::       CSS: DEFAULT
						:::::::::   :::::::::       
						:::::::::   :::::::::
						:::::::::   :::::::::    





													www.squarehead.com
													sblissinc@me.com
													845.389.8953

													10.2009
													Center for Spectrum Services
													Kingston NY 12401

	
-----------------------------------------------------------------------------------------------------------------------------

	DEPENDENCIES: 
	MooTools - version 1.20              
	copyright 2007 | Valerio Proietti | http://mootools.net/
	MIT-style license | http://www.opensource.org/licenses/mit-license.php
	
	Clientside CNET Libraries for MooTools
	For descriptions and documentation: http://clientside.cnet.com/wiki/cnet-libraries
	
-----------------------------------------------------------------------------------------------------------------------------

	:: squarehead design studio   -  845.331.1953 | www.squarehead.com | sbliss@squarehead.com
	
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/


// :::::::::::::::::::::::::: initialize page

function initPage(){	
	
	winScroller = new Fx.Scroll(window);
	
// :::::::::::::::::::::::::: initialize primary menu dropdowns

	var myMenu = new MenuMatic({ 
		opacity: 90,
		duration: 600,
		hideDelay: 300,
		physics: Fx.Transitions.Pow.easeOut,
		tweakInitial: {y:-1}
		});
		
		$('primary').setStyle('visibility', 'visible');
		
// :::::::::::::::::::::::::: add enlarge icons	
		
	if($$('.photo a')){
			
		var enlarge_icon = new Element('div', {
		    'class': 'enlarge_icon',
		    'styles': {
				'margin-top': '135px',
				'margin-left': '5px',
				'position': 'absolute'
		    }
		});
		
		target = $$('.photo a');
		target.each(function(item){	
			if(item.get('rel').substr(0,7) == 'milkbox'){
				newelem = enlarge_icon.clone();
				newelem.inject(item, 'top');				
			}
		});

	}
		
		
}

// :::::::::::::::::::::::::: AJAX

// --------> Request for pages 
//           page = page to load, target = id of container to load it in

function getPage(project_id,target){
		
	$$('.project-item').removeClass('selected');
	$('project_'+project_id).addClass('selected');
	
	page = 'project.php?project_id='+project_id;
	
	
	$('show').setStyle('opacity', 0);
	var pageRequest = new Request({
		url: page,
		method: 'get',
		evalScripts: true,
		onSuccess: function(responseText, responseXML) {
		$(target).innerHTML = responseText;
		Cufon.refresh();
		Cufon.now();
		showContent(target);
		}
	});
	pageRequest.send();	
}

function showContent(target){

// --------> move to top
	winScroller.toTop();
	
// --------> show inner content
	$('show').tween('opacity', 1);
	
}

// :::::::::::::::::::::::::: AUTO COPYRIGHT
function copyright(){
	document.write("&copy;", new Date().getFullYear(), " All rights reserved.");
}


/* 	INITIALIZE STUFF AFTER DOM LOADS
---------------------------------------------------------------------------------------------------------------------------*/
window.addEvent('domready', function(){
	initPage();
});


















