 

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SETTINGS : Change whatever you like here to point to the necessary files and such ================================================
// ( * Means Essential settings - if things don't work, these are probably the reasons why! )
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var THEME_NAME 			= "designerzen2";				// * the directory name for this theme
var SUBDIRECTORY		= "/blog";					// if your wordpress lives in a folder above root (leave blank)
// Tracking :
var GOOGLE_ANALYTICS_ID 	= "UA-1343475-1";				// * your Google Tracker UID (leave blank if you want to disable)
// Behaviour
var SHOW_DOWNLOAD_LINKS		= true;						// show 'click to download' button
var SHOW_PLAY_BUTTONS		= true;						// show 'click to play' button
var SCROLL_DURATION		= 200;						// how long the animated scrolling takes in ms
var SCROLL_OFFSET		= 12;						// how many pixels of margin to show above the scroll point
// Titles :
var BASE_TITLE 			= 'DesignerZen';				// the document.title base name
var TEXT_LOADING 		= 'Loading...';					// the document.title whilst loading
// AJAX and PHP communication. Add Exceptions to the AJAX handler here :
var AJAX_EXCEPTIONS		= [ "[href*='/wp-']" , "[href$='.mp3']" , "[href*='feed']" ];
var DIV_DYNAMIC			= "#dynamic";					// * the DIV to load DATA into
var DIV_BACKGROUND		= "#container";
var DIV_COMMENTS 		= '#comments';
var DIV_COMMENT_AUTHOR 		= '#author';
var DIV_COMMENT_EMAIL 		= '#email';
var DIV_COMMENT_MESSAGE 	= '#comment';
var DIV_COMMENT_BUTTON		= '#respond';

var DIV_COMMENT_FORM		= "#commentform"; 				// location of the commentForm submit button!
var AJAX_MODIFIER 		= "?-";						// * flag for php to load html without header & footer (this MUST be the same as in functions.php)
// Flash Setup :
var SWF_DIV 			= "#presentation";				// * the div to load the swf into
var SWF_ID 			= "designerswiffage";				// * ID for swf - js gateway
var SWF_URL 			= "presentation.swf";				// * relative url to the swf
var SWF_WIDTH			= '100%';					// Dimensions for the SWF to be housed
var SWF_HEIGHT			= '100%';					// % are allowed if DIV css height is set.
var SWF_BACKGROUND_COLOUR	= '#37acc4';					// wallpaper colour
var SWF_ERROR_FLASH_DISABLED 	= '<h2><img src="http://kb2.adobe.com/images/icons/alert.gif" width="16" height="16" alt="Alert" />This content requires Flash</h2><p>To view this content, you need the latest version of the Adobe Flash Player.<a href="http://get.adobe.com/flashplayer/" class="noHover"><img src="http://kb2.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" border="0" /></a>';

// Flash Music Player Options :
var PLAYER_AUTOSTART 		= 'false';					// start playing music on load
var PLAYER_BUFFER_DURATION 	= '1000';
var PLAYER_CROSSFADE 		= 'true';					// crossfade between tracks ( true / false )
var PLAYER_CROSSFADE_DURATION 	= '500';					// length in ms for the fading between tracks
var PLAYER_CROSSFADE_CURVE 	= '0';						// Curve intensity ( 0-7 : 0 is linear, 7 is Exponential )
var PLAYER_DEFAULT_RSS_FEED	= 'http://www.designerzen.com/category/portfolio/audio/feed';		// the IPTC feed playlist to load @ start
// CSS CLASS styles for action buttons :
var CSS_BUTTON			= 'media-action'; 				// the class for the href mp3s
var CSS_LISTEN			= 'media-listen';				// hover for play
var CSS_REPLAY			= 'media-visited';				// hover for play
var CSS_PLAYING			= 'media-active';				// now playing this track
var CSS_PAUSED			= 'media-inactive';				// this track is now paused (resume)
var CSS_DOWNLOAD		= 'media-download';				// click to download
var CSS_ERROR_PLAYING	= 'media-fail';					// music file damaged : TODO :
var CSS_ACTIVE_LINK		= 'active-link';				// 

var CSS_NOW_LOADING		= 'loading';					// css class for loading (appended to all elements that load)
var CSS_VISITED			= 'visited';					// css class for showing where you already been.
var CSS_ERROR			= 'error';						// A problem has arisen!!!
// Text labels for accessible links :

var LABEL_LISTEN		= 'Listen';						// the label for listen buttons only seen by the blind
var LABEL_DOWNLOAD		= 'Download';					// the alternate text label for the image of download buttons

// Comments
var COMMENT_STATUS_SENDING 	= 'Please wait while I read your comment...';
var COMMENT_STATUS_SUCCESS 	= 'Your comment has been added.';
var COMMENT_STATUS_NO_EMAIL	= 'ENTER AN EMAIL';
var COMMENT_STATUS_BAD_EMAIL	= 'BAD EMAIL';
var COMMENT_STATUS_NO_NAME	= 'PUT YOUR NAME DOWN!!!';
var COMMENT_STATUS_NO_COMMENT	= 'ENTER A COMMENT YOU BADASS!';
// Nerdy shit
// Special dir after theme dir!
var DIRECTORY_TREE				= '/wp-content/themes/';

var W3C_STRICT_MODE		= false;					// use flash satay embed code (not recomended really)
var $jQ = jQuery.noConflict();							// to ensure compatability with other JS libs, I've used this shorthand $jQ

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//==================================================- VISUAL FEEDBACK FUNCTIONS -===================================================///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////
// Set theme specific effects and stuff here!!!
// This is called at runtime once for the entire site
////////////////////////////////////////////////////////////////////////////////////////////////
function themeSpecificInitialisation( divFilter )
{
	if (divFilter == null) divFilter = '';
	//$jQ( divFilter+"post-" ).hover( function(){ $jQ(this).fadeOut(100);$jQ(this).fadeIn(500);} );

      $jQ(divFilter+" .post").hover(function(){
	      // onMouseOver
	      $jQ(this).addClass ("post-highlight" );//.find('.postmetadata a').fadeIn(100);
	     // $jQ(this).addClass ("post-highlight" );//;

      },function(){
	      // onMouseOut
	      $jQ(this).removeClass( "post-highlight" );//.find('.postmetadata a').fadeOut(500);
	    //  $jQ(this).removeClass( "post-highlight" );//;
      });

};

////////////////////////////////////////////////////////////////////////////////////////////////
// Wordpress specific things...
// Called everytime a new url is loaded into the dynamic frame
// This updates the CSS relevant to the new url. 
// We can do all sorts of fancy things
// I should probably add an 'active' class
// for all selected links but instead am using the
// wordpress specific tags
////////////////////////////////////////////////////////////////////////////////////////////////
function updateThemeCss( url )
{	
	$jQ( "a" ).removeClass( CSS_ACTIVE_LINK );					// remove any active class modifiers   .hasClass( CSS_ACTIVE_LINK )
	
	// url is for example category/podcast/
	// Special cases for certain sections :
	// ARCHIVES :
	var year = url.match(/\d{4}/g);							// find the year from the 4 consecutive numbers in the url ( http://2007/ )
	if (year !== null) $jQ( "a[title=" +year+ "]" ).addClass( CSS_ACTIVE_LINK );	// highlight our year marker (even for non-archives)! now thats clever ;)

	// update the anchor link css by adding our active class
	$jQ( "a[href=" +url+ "]" ).addClass( CSS_ACTIVE_LINK );			// add the class 'current-cat' to all links pointing this way...
};


