// Initially set opacity on thumbs and add
// additional styling for hover effect on thumbs
var onMouseOutOpacity = 0.67;
$('#thumbs-adv ul.thumbs li').css('opacity', onMouseOutOpacity)
	.hover(
		function () {
			$(this).not('.selected').fadeTo('fast', 1.0);
		}, 
		function () {
			$(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
		}
	);
	
$(document).ready(function(){

/*	$(".daddy").simpletip({ 
		// Configuration properties  
		content: 'My Simpletip', 
//		fixed: true,
		position: ["-200", "-200"] 
	});

	$(".daddy2").simpletip({ 
		// Configuration properties  
		content: 'My Simpletip', 
		fixed: true,
		position: ["-400", "-200"] 
	});
*/

	// $('.daddy').hover(function() { alert("hijij") })

/*	// third example
	$("#red").treeview({
		animated: "fast",
		collapsed: true,
		unique: true,
		persist: "cookie",
		toggle: function() {
			window.console && console.log("%o was toggled", this);
		}
	});
*/
		//		document.write("<style type='text/css'>.hidden{display:none;}<\/style>");
				//Examples of Global Changes
	//			$.fn.colorbox.settings.bgOpacity = "0.9";

				//Examples of how to assign the ColorBox event to elements.
				//$("a[rel='image']").colorbox({transition:"fade"});
	//			$("a[rel^='image']").colorbox({transition:"elastic", contentCurrent:"{current} / {total}"});

/*				$('#product_carousel').jcarousel({
					// Configuration goes here
					scroll: 1,
					visible: 1
				});*/
				
				
					// Initialize Advanced Galleriffic Gallery    
					
					$("div[id^='content_gal_']").each( 
						function(intIndex) {
							var gals = [];
						  
							last_index = this.id.lastIndexOf("_")
							number_id = this.id.substring(last_index + 1, this.id.length)
							
							type = this.id.match("product") || this.id.match("page") || this.id.match("package") || this.id.match("case_study")
							var gals = $(this).galleriffic('#thumbs-adv-' + type + '-' +  number_id, {
								delay:                  2000,
								numThumbs:              6,
								preloadAhead:           6,
								enableTopPager:         true,
								enableBottomPager:      true,
								imageContainerSel:      '#slideshow-adv-' + type + '-' + number_id,
								controlsContainerSel:   '#controls-adv-' + type + '-' + number_id,
								captionContainerSel:    '#caption-adv-' + type + '-' + number_id,
								loadingContainerSel:    '#loading-adv-' + type + '-' + number_id,
								renderSSControls:       true,
								renderNavControls:      true,
								playLinkText:           'Play Slideshow',
								pauseLinkText:          'Pause Slideshow',
								prevLinkText:           '&lsaquo; Previous Photo',
								nextLinkText:           'Next Photo &rsaquo;',
								nextPageLinkText:       'Next &rsaquo;',
								prevPageLinkText:       '&lsaquo; Prev',
								enableHistory:          true,
								autoStart:              false/*,
										 onChange:               function(prevIndex, nextIndex) {
										  $('#thumbs-adv ul.thumbs').children()
										    .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
										    .eq(nextIndex).fadeTo('fast', 1.0);
										 },
										 onTransitionOut:        function(callback) {
										  $('#slideshow-adv, #caption-adv').fadeOut('fast', callback);
										 },
										 onTransitionIn:         function() {
										  $('#slideshow-adv, #caption-adv').fadeIn('fast');
										 },
										 onPageTransitionOut:    function(callback) {
										  $('#thumbs-adv ul.thumbs').fadeOut('fast', callback);
										 },
										 onPageTransitionIn:     function() {
										  $('#thumbs-adv ul.thumbs').fadeIn('fast');
										 }*/
							});
						}
					);

					$("div[id^='the_page_gallery_']").hide();
					$("div[id^='the_product_gallery_']").hide();
					$("div[id^='the_package_gallery_']").hide();
					$("div[id^='the_case_study_gallery_']").hide();
});