/*/////////////////////////////////////////////////////////////////////////////////////////////////////*/
/* seydoggy.js.min */
/* @group phpjs.include */function include(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 */
/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

jQuery.noConflict();
jQuery(document).ready(function($){
	/* @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 = 3;
			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) $('.headerContainer .preContent').show();
		if ($(myEC + '2').length > 0) $('.wrapperPostContainer').show();
		if ($(myEC + '3').length > 0) $('.wrapperFooter').show();
	})();
	/* @end */
	
	/* @group Header Height */
	var sdHeader = (function(){
		// if header height variable set .pageHeader/.seydoggySlideshow height to content height
		// test if varaible header is selected
		if (typeof headerHeightVariable != "undefined") {
			ecTallest = 0;
			$('#extraContainer1 div').each(function() {
				if ($(this).outerHeight(true) > ecTallest) ecTallest = $(this).outerHeight(true);
			});
			$('.seydoggySlideshow,.pageHeader').height(ecTallest + 30);
		}
	})();
	/* @end */
	
	/* @group toolbar split/vertical options */
	var sdNavOptions = (function(){
		var tbh = '#toolbar_horizontal';
		var tbs = '#toolbar_sub';
		var tbv = '#toolbar_vertical';
		var tbH = $(tbh);
		var tbS = $(tbs);
		var tbV = $(tbv);
		if (tbH.children()) {
			if (verticalNavigation == 0 || verticalNavigation == 1) {
				// if option 3-tier or 2-tier (a)
				// show navigation children
				$(tbH.children()).parent().show();
				// styles for toolbar_horizontal
				$(tbh + ' a').css('background-position','0' + ' ' + ((($(tbh + ' a').outerHeight(true) / 2) - 23) + 'px'));
				$(tbh + ' .current,' + tbh + ' .currentAncestor').css('background-position','left top');
				$(tbh + ' ul:first').addClass('radiusAll contentShadow');
				if ($(tbh + ' ul li:first').siblings().length == 0) {
					$(tbh + ' a').addClass('radiusAll').css('border-style','none');
				}else{
					$(tbh + ' a:first').addClass('radiusLeft').css('border-left-style','none');
					$(tbh + ' a:last').addClass('radiusRight').css('border-right-style','none');
				}
				// generate #toolbar_sub/#toolbar_vertical on the fly
				if ($(tbh + ' ul ul').length) {
					if (verticalNavigation == 0) {
						// generate #toolbar_sub on the fly
						tbS.prepend($(tbh + ' > .toolbarList > .currentListItem > .toolbarList, #toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList').clone()).show();
						// set #toolbar_sub background position
						$(tbs + ' a').css('background-position','left bottom');
						// clear #toolbar_sub floats
						$(tbs + ' ul').append('<div class="clear">');
						// add classes to #toolbar_sub
						$(tbs + ' ul li a').addClass('radiusTop outerShadowTop');
						// generate #toolbar_vertical on the fly
						if ($(tbh + ' ul ul ul').length) {
							// prepend #toolbar_horizontal ul ul ul to #toolbar_vertical
							tbV.prepend($(tbh + ' > .toolbarList > .currentAncestorListItem > .toolbarList > .currentListItem > .toolbarList, #toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList > .currentAncestorListItem > .toolbarList')).show();
							$(tbv + ' a').addClass('radiusAll contentShadowLight');
						}
					}else{
						// generate #toolbar_vertical on the fly
						// prepend #toolbar_horizontal ul ul ul to #toolbar_vertical
						tbV.prepend($(tbh + ' > .toolbarList > .currentListItem > .toolbarList, #toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList').clone()).show();
						$(tbv + ' a').addClass('radiusAll contentShadowLight');
					}					
				}
				// styles for navigation center
				if (tbH.css('float') == 'none') {
					tbH.width($(tbh + ' ul:first').outerWidth(true) + 1);
				}
			}else{
				// if option 2-tier (b) or Vertical
				if (verticalNavigation == 2) {
					tbS.prepend($(tbh + ' > ul').clone()).show();
					// set #toolbar_sub background position
					$(tbs + ' a').css('background-position','left bottom');
					// clear #toolbar_sub floats
					$(tbs + ' ul').append('<div class="clear">');
					// add classes to #toolbar_sub
					$(tbs + ' ul li a').addClass('radiusTop outerShadowTop');
					// generate #toolbar_vertical on the fly
					if ($(tbh + ' ul ul').length) {
						// prepend #toolbar_horizontal ul ul ul to #toolbar_vertical
						tbV.prepend($(tbh + ' > .toolbarList > .currentListItem > .toolbarList, #toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList').clone()).show();
						$(tbv + ' a').addClass('radiusAll contentShadowLight');
					}
				}else{
					// prepend #toolbar_horizontal ul to #toolbar_vertical
					tbV.prepend($(tbh + ' > ul')).show();
					$(tbv + ' a').addClass('radiusAll contentShadowLight');
				}
				tbH.remove();
			}
			// styles for toolbar_vertical
			$(tbv + ' a').css('background-position','0' + ' ' + ((($(tbv + ' a').outerHeight(true) / 2) - 26) + 'px'));
			$(tbv + ' .current,' + tbv + ' .currentAncestor').css('background-position','left top');
		}
	})();
	/* @end */
	
	/* @group Sidebar Height */
	var sdSidebar = (function(){
		var sbC = $('.sidebarContent');
		var mC = $('.mainContent');
		if (sbC.css('display') != 'none') {
			if (sbC.css('float') == 'left') {
				// styles for left sidebar
				mC.css('min-height',sbC.height());
				mC.addClass('innerShadowLeft');
			} else if (sbC.css('float') == 'right') {
				// styles for right sidebar
				mC.css('min-height',sbC.height());
				mC.addClass('innerShadowRight');
			}
		}
	})();
	/* @end */
	
	/* @group various common styles */
	var sdCommonStyles = (function(){
		// set width of .headerContainer .preContent to .pageHeader
		$('.headerContainer .preContent').width($('.pageHeader').outerWidth(true) - 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 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 slideshowEnabled != "undefined") {
	include(RwGet.pathto('scripts/slideshow/seydoggy.slideshow.js'));
}

