var profiles =
	{
		windowCenter:
		{
			height:390,
			width:500,
			center:1
		}
	};

jQuery(document).ready(function(){
								
	$(".popupwindow").popupwindow(profiles);
	
	$('#content table a').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	showBody: " - "
	});
			
		jQuery('ul.picture-gallery').galleria({
			history   : false, // activates the history object for bookmarking, back-button etc.
			clickNext : true, // helper for making the image clickable
			insert    : '#main_image', // the containing selector for our main image
			onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
				
				// fade in the image & caption
				image.css('display','none').fadeIn(1000);
				//caption.css('display','none').fadeIn(1000);
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// fade out inactive thumbnail
				_li.siblings().children('img.selected').fadeTo(500,0.3);
				
				// fade in active thumbnail
				thumb.fadeTo('fast',1).addClass('selected');
				
				// add a title for the clickable image
				image.attr('title','Next image >>');
			},
			onThumb : function(thumb) { // thumbnail effects goes here
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// if thumbnail is active, fade all the way.
				var _fadeTo = _li.is('.active') ? '1' : '0.3';
				
				// fade in the thumbnail when finnished loading
				thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
				
				// hover effects
				thumb.hover(
					function() { thumb.fadeTo('fast',1); },
					function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active
				)
			}
		});
		
		jQuery("input#search-input")
		.css("border", "1px solid #ffcc00")
		.css("background", "#000")
		.focus(function(){
			jQuery(this).attr("value", "");
			jQuery(this).css("border", "1px solid #ffcc00");
			jQuery(this).css("background", "#333");
			jQuery(this).css("color", "#ffcc00");
		})
		.blur(function(){
			var newValue = jQuery(this).attr("value");
			if (newValue == "") 
			{
				jQuery(this).attr("value", "Search...");
			}
			jQuery(this).css("color", "#ffcc00");
			jQuery(this).css("border", "1px solid #ffcc00");
			jQuery(this).css("background", "#000");
		});
		
		/* form */
		jQuery("#form_container input.element, #form_container select, #form_container textarea")
		.css("border", "1px solid #707070")
		.css("background", "#333")
		.focus(function(){
			jQuery(this).css("border", "1px solid #ffcc00");
			jQuery(this).css("background", "#000");
			jQuery(this).css("color", "#ffcc00");
		})
		.blur(function(){
			jQuery(this).css("color", "#ffffff");
			jQuery(this).css("border", "1px solid #707070");
			jQuery(this).css("background", "#333");
		});
		
		/* tabs */
		jQuery('div#show-video').hide();
		jQuery("#show-the-gallery").addClass("active-tab");
	
		jQuery('a#watch-the-video').click(function() {
		jQuery('div#show-gallery').hide();
		jQuery('div#show-video').show();
		jQuery("a#show-the-gallery").removeClass("active-tab");
		jQuery("a#watch-the-video").addClass("active-tab");
		return false;
		});
		
		jQuery('a#show-the-gallery').click(function() {
		jQuery('div#show-video').hide();
		jQuery('div#show-gallery').show();
		jQuery("a#watch-the-video").removeClass("active-tab");
		jQuery("a#show-the-gallery").addClass("active-tab");
		
		return false;
		});
		
		/* show/hide receive form (toggle) */
		$('.hide-receive-form').hide();
		$('#receive-content').hide();
		 $("input.confirm-button").hide();

		$('.show-receive-form').click(function() {
		$('.show-receive-form').hide();
		$('#receive-content').show();
		$('.hide-receive-form').show();
		$("input.confirm-button").show();
		return false;
	});
	
		$('.hide-receive-form').click(function() {
		$('#receive-content').hide();
		$('.show-receive-form').show();
		$('.hide-receive-form').hide();
		$("input.confirm-button").hide();
		return false;
	});
		
	/* show/hide intro text (toggle) */
		$('#intro-text').hide();
		
		$('#read-more').click(function() {
		$('#read-more').hide();
		$('#intro-text').show();
		return false;
	});
});