jQuery.noConflict();
jQuery(document).ready(function($){

	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; } };

	// Navigation
	
	$('nav ul').removeClass('nojs');
	$('nav li').hover(function() { $(this).find('ul:first').stop('true','true').animate({opacity: 'toggle', height: 'toggle'}, + dropSpeed);});

	// Extra Content
	
	var extraContent =  (function() {
		var ecValue = 10;
		for (i=1;i<=ecValue;i++)
		{
			$('#myExtraContent'+i+' script').remove();
			$('#myExtraContent'+i).appendTo('#extraContainer'+i);
		}
	})();
	
	// V IENNA Specific Formatting
	
	$('#asideTitle:empty').each(function () { $('aside hr').remove(); });
	$('#asideTitle:empty, header #contact:empty, header h2:empty').remove();
	$('header h1:empty').remove();
	$('#contact a').appendTo('#headerTop .wrapper');
	$('.social').appendTo('#headerTop .wrapper');
	$('ul#breadcrumb a:last').addClass('currentCrumb');
	$('#breadcrumb li:last-child').each(function(){$(this).addClass( 'last_item' );});
	
	// Lightbox Photo Album
	
	var sdLightboxAlbums = (function() {
    // test if either album is true
	    if ($('.album-wrapper').length || $('.movie-thumbnail-frame').length) {
	    
	        // load js (prettyPhoto)
	        $.getScript(RwGet.pathto('scripts/jquery.prettyPhoto.js'),
	        function() {
	            // once script is loaded
	            // test if photo album is true
	            if ($('.album-wrapper').length) {
	                // get thumbnail links and alter attributes
	                $('.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()
	                    });
	                });
	            }
	            // apply effects (prettyPhoto)
	            $('a[rel^=prettyPhoto]').prettyPhoto({
	                animation_speed: 'fast',
	                opacity: 0.70,
	                show_title: false,
	                theme: 'light_square'
	            });
	        });
	    }
	})();
});
