/*/////////////////////////////////////////////////////////////////////////////////////////////////////*/
/* seydoggy.js.min */
/* @group phpjs.include */var include = function(script_filename) { document.write('<' + 'script'); document.write(' src="' + script_filename + '">'); document.write('</' + 'script' + '>'); }/* @end */
/* @group RwGet */RwGet = { pathto: function(path, file) { var rtrim = function(str, list) { var charlist = !list ? 's\xA0': (list + '').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '$1'); var re = new RegExp('[' + charlist + ']+$', 'g'); return (str + '').replace(re, ''); }; var jspathto = rtrim(RwSet.pathto, "javascript.js"); if ((path !== undefined) && (file !== undefined)) { jspathto = jspathto + path + file; } else if (path !== undefined) { jspathto = jspathto + path; } return jspathto; }, baseurl: function(path, file) { var jsbaseurl = RwSet.baseurl; if ((path !== undefined) && (file !== undefined)) { jsbaseurl = jsbaseurl + path + file; } else if (path !== undefined) { jsbaseurl = jsbaseurl + path; } return jsbaseurl; } };/* @end */
/* @group seydoggySetHeight plugin v1.0.1 06-28-10 13:29 */ (function($) { $.fn.seydoggySetHeight = function(value) { var tallest = 0; $(this).each(function() { if ($(this).outerHeight(true) > tallest) tallest = $(this).outerHeight(true); }); $(this).height(tallest + value); }; })(jQuery); /* @end */
/* @group rwPageOn plugin v1.0.0 05-13-10 14:25 */ (function($) { $.fn.rwPageOn = function() { var i = 0; var rwPage = $(this)[0]; for (i = 0; i <= 10; i++) { if ($($(this)[i]).length > 0) { rwPage = $(this)[i]; break; } } return rwPage; }; })(jQuery); /* @end */
/* @group rwAddLinks v1.0.0 06-17-11 07:54*/ (function($) { $.fn.rwAddLinks = function(linkArr) { var i = 0; $(this).each(function(i) { $(this).click(function() { location.href = linkArr[i++]; }).hover(function() { $(this).css("cursor", "pointer"); }); }); }; })(jQuery); /* @end */
/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

jQuery.noConflict();
jQuery(document).ready(function($){
	// VARIABLES
	var isNoHeader = $('.wrapperHeader .preContent').css('padding-right') == '0px';
	var isVariable = typeof headerHeightVariable != 'undefined';
	var sdSlideHeight = function(elem){
		ecTallest = 0;
		$(elem).each(function() {
			var thisTallest = $(this).outerHeight(true);
			if (thisTallest > ecTallest) ecTallest = thisTallest;
		});
	}
	
	/* @group ExtraContent */
	// function/styles for ExtraContent
	var sdExtracontent = (function(){
		var myEC = '#myExtraContent';
		/* ExtraContent (jQuery) VERSION: r1.4.2 */
		var extraContent =  (function() {
			// change ecValue to suit your theme
			var ecValue = 5;
			for (i=1;i<=ecValue;i++)
			{
				$(myEC + i + ' script').remove();
				$(myEC + i).appendTo('#extraContainer'+i).show();
			}
		})();

		// !hide !empty ExtraContent areas
		if ($(myEC + '1').length > 0) $('.wrapperHeader .preContent').show();
		if ($(myEC + '2').length > 0) $('.wrapperPostHeader').show();
		if ($(myEC + '3').length > 0) $('.wrapperPreContainer').show();
		if ($(myEC + '4').length > 0) $('.wrapperPostContainer').show();
		if ($(myEC + '5').length > 0) $('.wrapperFooter').show();
	})();
	/* @end */

	/* @group sdVertAlign 1.0.0 */
	var sdVertAlign = function (parent,child) {
		var vcenterParentHeight = $(parent).innerHeight(true);
		var vcenterHeight = $(child).innerHeight(true);
		$(child).css('padding-top',((vcenterParentHeight - vcenterHeight) / 2));
	};
	/* @end */
	
	/* @group title vertical alignment */
	var sdTitleValign = (function(){
		var thisParent = $('.siteHeader');
		// vertical center logo
		if ($('.logo img').length > 0) {
			sdVertAlign(thisParent,$('.logo img'));
		}
		// vertical center title
		if ($('.siteHeader h1').html().length > 0) {
			sdVertAlign(thisParent,$('.title h1'));
		}
		// vertical center slogan
		if ($('.siteHeader h2').html().length > 0) {
			sdVertAlign(thisParent,$('.title h2'));
		}
	})();
	/* @end */
	/* @group title horizontal alignment */
	var sdTitleHalign = (function(){
		// get width of all elements in the siteHeader
		var totalWidth = $('.logo img').outerWidth(true) + $('.site_title').outerWidth(true) + $('.site_slogan').outerWidth(true) + 1;
		// set siteHeader width (center styling done in CSS)
		$('.siteHeader').width(totalWidth);
	})();
	/* @end */
	/* @group Header Height */
	var sdHeader = (function(){
		if(typeof sdSlideNum == "undefined") {
			// if header height variable or if custom header is transparent set .pageHeader/.seydoggySlideshow height to content height
			if (isVariable || isNoHeader) {
				sdSlideHeight('#extraContainer1 div');
				if (isNoHeader) {
					$('.seydoggySlideshow,.pageHeader').height(ecTallest + 30);
					$('.seydoggySlideshow').css('border','none');
					$('.pageHeader').css('background','transparent');
				} else {
					$('.seydoggySlideshow,.pageHeader').height(ecTallest + 60);
				}
			}
		}
	})();
	/* @end */
	
	/* @group toolbar split/vertical options */
	var sdNavOptions = (function(){
		var tbhw = '.wrapperTBH';
		var tbh = '#toolbar_horizontal';
		var tbs = '#toolbar_sub';
		var tbv = '#toolbar_vertical';
		var tbHW = $(tbhw);
		var tbH = $(tbh);
		var tbS = $(tbs);
		var tbV = $(tbv);
		if (tbH.children()) {
			if (verticalNavigation == 0) {
				// if option 2-tier
				// show navigation children
				$(tbH.children()).parent().show();
				// generate #toolbar_vertical on the fly
				if ($(tbh + ' ul ul').length) {
					// prepend #toolbar_horizontal ul ul to #toolbar_vertical
					tbV.prepend($(tbh + ' > .toolbarList > .currentListItem > .toolbarList, ' + tbh + ' > .toolbarList > .currentAncestorListItem > .toolbarList')).show();
					$(tbv + ' a').addClass('radiusButtons contentShadowLight');
				}
				// styles for navigation center
				if (tbH.css('float') == 'none') {
					tbH.width($(tbh + ' ul:first').outerWidth(true) + 1);
				}
			}else{
				// if option Vertical
				// prepend #toolbar_horizontal ul to #toolbar_vertical
				tbV.prepend($(tbh + ' > ul')).show();
				$(tbv + ' a').addClass('radiusButtons contentShadowLight');
				tbHW.remove();
			}
			// styles for toolbar_horizontal
			$(tbh + ' a').addClass('radiusButtons contentShadowLight');
			// toolbar_vertical vertical alignment
			sdVertAlign($('.wrapperTBH'),$(tbh + ' ul'));
		}
	})();
	/* @end */
	
	/* @group various common styles */
	var sdCommonStyles = (function(){
		// set width of .headerContainer .preContent / .wrapperOuter to .siteHeader
		var pageWidth = $('.siteHeader').outerWidth(true);
		$('.headerContainer .preContent').width(pageWidth - 29);
		// styles for title center
		var sdTitle = (function(){
			var tb = $('.titleBlock');
			var t = $('.title');
			var l = $('.logo');
			var li = $('.logo img');
			if (tb.css('float') == 'none') {
				var lw = l.outerWidth(true);
				var tw = t.outerWidth(true);
				var tbw = lw + tw;
				tb.width(tbw);
				if (li.length == 0) {
					t.css({
						'margin-left':'0',
						'text-align':'center'
					});
				}
			}
		})();
		// styles for !empty sidebar title
		if ($('.sidebar_title').html().length) {
			$('.sidebar_title').css('margin-bottom','0.5em');
		}
		// styles for copyright/breadcrumb
		var sdBreadcrumb = (function(){
			// if copyright/breadcrumb are both present
			var f = $('.footer');
			var b = $('.breadcrumbContainer');
			var c = $('.wrapperCopyright');
			if (b.length) {
				// remove leading breadcrumb separator
				 b + $('.separator:first').hide();
				// float left/right if both are present
				if (f.html().length) {
					f.css({
						'float':'left',
						'text-align':'left'
					});
					b.css({
						'float':'right',
						'text-align':'right'
					});
				}
			} else if (!(f.html().length)){
				c.height(50);
			}
		})();
	})();
	/* @end */
	
	/* @group various page style */
	var sdPageStyles = (function(){
		// styles for File Sharing page
		var sdFilesharing = (function(){
			if ($('.filesharing-item').length) {
				var fsI = $('.filesharing-item');
				// set width of File Sharing blocks according to available space
				fsI.width($('.mainContent').outerWidth(true) / 3 - 45).addClass('contentShadow');
				// set height of File Sharing blocks to be the same
				fsI.seydoggySetHeight(0);
			}
		})();
		// styles for Blog page
		var sdBlog = (function(){
			if ($('.blog-entry').length) {
				$('.blog-entry,#blog-categories,#blog-archives,.blog-tag-cloud,#blog-rss-feeds').addClass('contentShadow');
			}	
		})();
	})();
	/* @end */
	
	/* @group Movie/Photo Album functions */
	var sdLightboxAlbums = (function(){
		if ($('.album-wrapper').length || $('.movie-thumbnail-frame').length) {
			// load css (prettyPhoto)
			$("head").append("<link>").children(":last").attr({
		      rel:  "stylesheet",
		      type: "text/css",
		      href: RwGet.pathto('css/jquery.prettyPhoto.css')
		    });
			// load js (prettyPhoto)
			$.getScript(RwGet.pathto('scripts/jquery.prettyPhoto.js'), function() {
				// Photo Album
				if ($('.album-wrapper').length) {
					// style photo thumbnails (!prettyPhoto)
					$('.thumbnail-frame img').addClass('contentShadow');
					// show Photo Album elements (!prettyPhoto)
					var sd_at = $('.album-title');
					var sd_atH = sd_at.html();
					var sd_ad = $('.album-description');
					var sd_adH = sd_ad.html();
					if (sd_at.html() == "" && sd_ad.html() == "") $('.album-wrapper').css('margin-top','3em').append('<div class="clear"/>');
					else if (sd_atH != "" && sd_adH == "") sd_at.show().css('margin-bottom','1em');
					else if (sd_atH == "" && sd_adH != "") sd_ad.show();
					else if (sd_atH != "" && sd_adH != "") sd_at.show();sd_ad.show();
					// get thumbnail links and alter attributes (prettyPhoto)
				  	$('.thumbnail-frame').each(function(){
						var thisAnch = $('a',this);
						var thisImg = $('a img',this);
						var thisCap = $('.thumbnail-caption',this);
				        thisAnch.attr({
				            'href' : thisImg.attr('src').replace(/thumb/i,'full'),
				            'rel' : 'prettyPhoto[gallery]',
				            'title' : thisCap.text()
				        });
				    });
				} else {
					// since photo album is false movie album is true
					// style movie thumbnails
					$('.movie-thumbnail-frame img').addClass('contentShadow');
					// get thumbnails links and alter attributes (prettyPhoto)
					$('.movie-thumbnail-frame').each(function(){
						var thisAnch = $('a',this);
						var thisCap = $('.movie-thumbnail-caption',this);
						var	thisPage = thisAnch.attr('href');
						thisAnch.removeAttr('onclick').removeAttr('onkeypress').attr({
							'href' : thisPage + '?iframe=true&width=75%&height=75%',
							'rel' : 'prettyPhoto[iframes]',
							'title' : thisCap.text()
						});
					});
				}
				// apply effects (prettyPhoto)
				$('a[rel^=prettyPhoto]').prettyPhoto({
					animation_speed: 'fast',
					show_title: false,
					theme: 'light_square'
				});
			});
		}
	})();
	/* @end */
});
// test to see if user has selected a slideshow option
if(typeof sdSlideNum != "undefined") {
	include(RwGet.pathto('scripts/slideshow/jquery.cycle.all.min.js'));
	include(RwGet.pathto('scripts/slideshow/seydoggy.slideshow.js'));
}

