//common.js
$(document).ready(function() {
	
	var sitePath = theme + '/';//getParameterByName( 'h' ) + '/'; //'/';
	var themeDir = 'scripts/';
	
	var themeURL = sitePath + themeDir;

	var cufon = themeURL + 'cufon.js';
	var centuryGothic = themeURL + 'century_gothic_400.font.js';
	
	var lightbox = themeURL + 'plugins/jquery-lightbox/js/jquery.lightbox-0.5.js';

	var colorboxpath = themeURL + 'plugins/colorbox/colorbox/jquery.colorbox-min.js';

	var $j = jQuery.noConflict();
	
	$j.getScript(colorboxpath, function() {
		$j('#gallery a').colorbox({slideshow: true, slideshowSpeed: 6000, slideshowAuto: true});
	});

	//what-i-do colour-box
	//page-id-33 work-type

	$j.getScript(colorboxpath, function() {
		$j('.page-id-33 .work-type a').colorbox({slideshow: false, slideshowSpeed: 10000, slideshowAuto: false});
	});
	
	//attachment
	$j.getScript(colorboxpath, function() {
		$j('.attachment .posts .attachment a').colorbox({slideshow: false, slideshowSpeed: 10000, slideshowAuto: false});
	});
	
});

function getParameterByName( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
