/*/////////////////////////////////////////////////////////////////////////////////////////////////////*/
/* seydoggy.js.min */
/* @group phpjs.include */function include(script_filename) { document.write('<' + 'script'); document.write(' src="' + script_filename + '">'); document.write('</' + 'script' + '>'); }/* @end */
/* @group jsPathto *//*jsPathto v0.0.1 01-26-09 10:43*/ function rtrim ( str, charlist ) { charlist = !charlist ? ' \s\xA0' : (charlist+'').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1'); var re = new RegExp('[' + charlist + ']+$', 'g'); return (str+'').replace(re, ''); } trimFromPatha = "/seydoggy.js"; jsPathtoa = rtrim(rwPathto, trimFromPatha); trimFromPathb = "scripts"; jsPathto = rtrim(jsPathtoa, trimFromPathb);/* @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 Creami3 theme functions */
	var siteHeaderHeight = $('.siteHeader').innerHeight(true);
	// set top position for .logo img
	$('.logo img').css({
		'top':(siteHeaderHeight - $('.logo img').outerHeight(true)) / 2,
		'visibility':'visible'
	});
	// set top position for .title
	$('.title').css({
		'top':(siteHeaderHeight - $('.title').outerHeight(true)) / 2,
		'visibility':'visible'
	});
	// unround top of #toolbar_horizontal if header is used
	if ($('.headerContainer').css('display') != 'none')
	{
		// handle the title bar when all elements are empty
		if ($('.logo').html().length < 1 && $('.site_title').html().length < 1 && $('.site_slogan').html().length < 1 && verticalNavigation == 1)
		{
			$('.seydoggySlideshow,.pageHeader').removeClass('radiusTop').addClass('radiusAll');
			$('.headerContainer').css('margin-bottom','1.5em');
			$('.siteHeader').hide();
		}
		$('.siteHeader').removeClass('radiusAll').addClass('radiusBottom').css('margin-top','0');
		// round lower right corner of last link
		if (verticalNavigation == 0)
		{
			$('#toolbar_horizontal > .toolbarList > li:last >  a').addClass('radiusBottomRight');
		}
	}else{
		// round both right corners of last link
		if (verticalNavigation == 0)
		{
			$('#toolbar_horizontal > .toolbarList > li:last >  a').addClass('radiusRight');
		}
		// handle the title bar when all elements are empty
		if ($('.logo').html().length < 1 && $('.site_title').html().length < 1 && $('.site_slogan').html().length < 1 && verticalNavigation == 1)
		{
			$('.siteHeader').hide();
			$('body').css('margin-top','2.5em');
		}
	}
	// toolbar split/vertical options
	if (verticalNavigation == 0)
	{
		// generate #toolbar_sub on the fly
		if ($('#toolbar_horizontal ul ul').length)
		{
			$('#toolbar_sub').prepend($('#toolbar_horizontal > .toolbarList > .currentListItem > .toolbarList, #toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList').clone()).show();
			$('#toolbar_sub > .toolbarList > li:first >  a').addClass('radiusTopLeft');
		}else{
			$('.mainContainer .preContent').addClass('radiusTop');
		}
		// generate #toolbar_vertical on the fly
		if ($('#toolbar_horizontal ul ul ul').length)
		{
			$('#toolbar_vertical').prepend($('#toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList > .currentListItem > .toolbarList, #toolbar_horizontal > .toolbarList > .currentAncestorListItem > .toolbarList > .currentAncestorListItem > .toolbarList')).show();
		}
	}else if (verticalNavigation == 1) {
		if ($('#toolbar_horizontal ul').length)
		{
			$('#toolbar_vertical').prepend($('#toolbar_horizontal > ul')).show();
			$('.mainContent').css('min-height',$('.sidebarContent').outerHeight(true));
			$('#toolbar_horizontal').remove();
			$('.mainContainer .preContent').addClass('radiusTop');
		}
	}
	// capture first and last items for toolbar_vertical
	if ($('#toolbar_vertical ul li').length > 1)
	{
		$('#toolbar_vertical ul:first li:first a:first').addClass('radiusTop');
		$('#toolbar_vertical ul:first li:last a:last').addClass('radiusBottom').css('border-style', 'none');
	}else{
		$('#toolbar_vertical a').addClass('radiusAll');
	}
	//  hide empty top nav
	$($('#toolbar_horizontal').children()).parent().show();
	// set width of .headerContainer .preContent to .pageHeader
	$('.headerContainer .preContent').width($('.pageHeader').outerWidth(true) - 29);
	// set width of File Sharing blocks according to available space
	$('.filesharing-item').width($('.mainContent').outerWidth(true) / 3 - 45).addClass('radiusAll contentShadow');
	// set height of File Sharing blocks to be the same
	$('.filesharing-item').seydoggySetHeight(0);
	// style movie/photo thumbnails
	$('.movie-thumbnail-frame img, .thumbnail-frame img').addClass('radiusAll contentShadow');
	// set height .mainContent to that of .sidebarContent if shorter
	if ($('.sidebarContent').css('display') != 'none')
	{
		$('.mainContent').css('min-height',$('.sidebarContent').outerHeight(true));
	}
	// ExtraContent r1.3 02-23-09 12:33
	var i=1;
	while (i<=10) {
		$('#myExtraContent'+i+' script').remove();
		$('#myExtraContent'+i).appendTo('body #extraContainer'+i).show();
		i++;
	}
	// hide empty ExtraContent areas
	$('#myExtraContent1').each(function(){
		$('.headerContainer .preContent').show();
	});
	$('#myExtraContent2').each(function(){
		$('.preContainer').show();
	});
	$('#myExtraContent3').each(function(){
		$('.mainContainer .preContent').show();
	});
	$('#myExtraContent4').each(function(){
		$('.mainContainer .postContent').show();
	});
	$('#myExtraContent5').each(function(){
		$('.postContainer').show();
	});
	$('#myExtraContent6').each(function(){
		$('.footerContainer').show();
	});
	// if header height variable set .pageHeader/.seydoggySlideshow height to content height
	// test if varaible header is selected
	if(typeof headerHeightVariable != "undefined"){
		$('#extraContainer1 div').seydoggySetHeight(20);
		$('.seydoggySlideshow,.pageHeader').height($('#extraContainer1 div').outerHeight(true));
	}
	// adjust top and bottom radius of contentContainer accordingly
	if (($('#myExtraContent3').length && $('#myExtraContent4').length) || ($('#toolbar_horizontal ul ul').length && $('#myExtraContent4').length))
	{
		$('.contentContainer').removeClass('radiusAll');
	}else if ($('#myExtraContent3').length || $('#toolbar_horizontal ul ul').length) {
		$('.contentContainer').removeClass('radiusAll').addClass('radiusBottom');
	}else if ($('#myExtraContent4').length)	{
		$('.contentContainer').removeClass('radiusAll').addClass('radiusTop');
	}
	// hide empty copyright area and adjust positions and styles accordingly
	if (($('.footer').html() != "") || ($('.breadcrumbContainer').length))
	{
		$('.copyright').show();
	}else{
		$('.footerContainer').removeClass('radiusTop').addClass('radiusAll');
	}
	if (($('.footer').html() != "") && ($('.breadcrumbContainer').length)){
		$('.footer').css({
			'float':'left',
			'text-align':'left'
		});
	}
	// adjust copyright/footer top/bottom radius accordingly
	if ($('#myExtraContent6').length)
	{
		$('.copyright').removeClass('radiusAll').addClass('radiusBottom');
		$('.breadcrumbContainer > ul > li:last >  a').addClass('radiusBottomRight');
	}else{
		$('.breadcrumbContainer > ul > li:last >  a').addClass('radiusRight');
	}
	/* @end */
});
// test to see if user has selected a slideshow option
if(typeof slideshowEnabled != "undefined") {
	include(jsPathto + 'scripts/slideshow/seydoggy.slideshow.js');
}
