var opacity = 0.5;
var cyclespeed = 2000;
var timeout = 1000;

jQuery(document).ready(function($){
	
	$('.popup-images').cycle({ 
		fx:    'fade', 
		speed:  cyclespeed ,
		timeout: timeout ,
		next: '.popup-images'
	});
	
	$('.fadeimg').hover(function(){
		$(this).fadeTo('fast', 1.0); 
	},function(){
		$(this).fadeTo('fast', opacity); 
	});
	
	$('.fadeimg').fadeTo('fast', opacity);

	$("#myController").jFlow({
		slides: "#slides",
		controller: ".jFlowControl", // must be class, use . sign
		slideWrapper : "#jFlowSlide", // must be id, use # sign
		selectedWrapper: "jFlowSelected",  // just pure text, no sign
		easing: "swing",
		width: "840px",
		height: "220px",
		duration: 600,
		prev: ".jFlowPrev", // must be class, use . sign
		next: ".jFlowNext" // must be class, use . sign
	});

	
//for lavalamp slider image
$(function() { $(".lavaLamp").lavaLamp({ fx: "easeOutBack", speed: 700 })});


 //for amazon popup form          
// Use the each() method to gain access to each elements attributes
$('#awsBook a[rel]').each(function()
{
$(this).qtip(
	  {

   content: {
	  text: 'Retrieving Book Info...'  ,
	  url: 'res/php/book.php',

	  data: { bookId: $(this).attr('rel') },
	  method: 'get',
	  
	  title: {
		   text: 'Book Details From Amazon.com', 
		   button: 'Close' // Show a close link in the title
		}

   }, 
	 position: {
		corner: {
		   target: 'topRight', // Position the tooltip above the link
		   tooltip: 'bottomLeft'
		},
		adjust: {
		   screen: true // Keep the tooltip on-screen at all times
		}
	 },
	 hide: 'unfocus',
	 style: {
		tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
		border: {
		   width: 0,
		   radius: 4  
		},
		name: 'light', // Use the default light style
		width: 550, // Set the tooltip width
		button: { 'font-weight': 'bold' } ,
		title: { 'overflow': 'hidden' }
		
	 },
	 show: { 
		 solo: true, // only one tool tip visible at a time 
		 effect: { 
			 type: 'slide',
			 length: 430  
		 } 
	 
	 }  
			 
  })
})     


});

