/*
*	GLOBAL JS CODE HERE
*/
$(function(){
	
	/* PNG FIX */
	$(document).pngFix();
	
	/*
		Predifined actions
	*/

	$( "#topContainer").fadeIn(3000);
	
	
	/* COLOR BOX POPUP (http://colorpowered.com/colorbox/) */
	//$("a[rel='gallery']").colorbox();
	$(".colourbox").colorbox({
		iframe:true,
		innerWidth: 650,
		innerHeight: 470,
		title : true,
		scrolling : false
	});
	
	
	$(".colourbox").colorbox({
		iframe:true,
		innerWidth: 650,
		innerHeight: 470,
		title : true,
		scrolling : false
	});

	
	/* CUFON FONT REPLACEMENT
	Generate More (here(http://cufon.shoqolate.com/generate/) */
	Cufon.replace('.gotham', { fontFamily: 'gotham' });
	Cufon.replace('.helvetica, .titleToggle', { fontFamily: 'helvetica' });
	Cufon.replace('.gotham-light', { fontFamily: 'gotham-light' });
	
	
	
	
	/* POPUP EVENT (replacement for target="_blank") */
	$( ".popup" ).live( "click", function( event ) {
		event.preventDefault();
		var sTarget = $( this ).attr( "href" );
		var iWidth = 1024;
		var iHeight = 768;
		var iScrollbars = 2;
		var iLeft = (screen.width)?(screen.width-iWidth)/2:100;
		var iTop = (screen.height)?(screen.height-iHeight)/2:100;
		var sSettings='width='+iWidth+',height='+iHeight+',top='+iTop+',left='+iLeft+',scrollbars='+iScrollbars+',location=yes,directories=no,status=yes,menubar=yes,toolbar=yes,resizable=yes';
		win=window.open( sTarget, "", sSettings );
	} );
	
	

	
	
	//	CONTENT DROPDOWN
	$('#bottomContainer .titleToggle a').click(function(){
		contentSlide(this,"body");
	});
	
	
	//	NAVIGATION DROPDOWN
	$('#navigationContent .titleToggle').click(function(){
		contentSlide(this,"menu");
	});
	
	
	//	DROPDOWN FUNCTION
	function contentSlide($oThis,$sArea){
		switch($sArea){
			case "menu":

			$($oThis).next().slideToggle(500,"easeOutExpo");	
			$($oThis).find("a").toggleClass("up");
			break;
			
			case "body":
			$($oThis).parent().next().slideToggle(700,"easeOutExpo");	
			$($oThis).toggleClass("up");
			break;
		}
	}
});
	





