// MAVEN CREATIVE

$(document).ready(function () {

	
	
	
///////////////////////////////////
	
//	//set timeout
//	var sTimerId = 0;
//	var sTime = 300;
//	var cT;
//	var pT;
//	var nT;
 //   var fast = 900;
   //photo swappin'
//   $(".cycleImage").mouseenter(function(){				
//			nT = $(this);
//			var thisImage = $(this).attr('href');
//			var thisTarget =  $(this).attr('target');
//			var targetHTML = $(thisTarget).html();
//			var newHTML = '<img src="'+thisImage+'">';
//			var targetD = $(this).attr('dsc');
//			//alert("new :"+newHTML+" = old: "+targetHTML);
//								
	//		sTimerId = setTimeout ( function(){
	//			if(newHTML != targetHTML)
	//			{
	//				$(".headerImage").animate({opacity: 0}, 'fast', switchOut);
	//				$(".dsCcontainer").animate({opacity: 0}, 'fast');
	//				pT = cT;
	//				cT = nT;
	//			}
	//		}, sTime);
		//	function switchOut()
		//	{	
		//		$(".headerImage").html(newHTML);
		//		$(".dsCcontainer").html(targetD);
			//	$(".headerImage").animate({opacity: 1}, 'fast');
			//	$(".dsCcontainer").animate({opacity: 1}, 'fast');
			//	$(cT).css({'background': '#252525'});
			//	$(pT).css({'background': 'none'});
		//	}
		//	return false;
//	});
   
//   $(".cycleImage").click(function(){
//			return false;
//	});
 //   $(".cycleImage").mouseleave(function(){
//			clearTimeout ( sTimerId );
//			return false;
//	});
	
	
	//qTippin
	
	 // Notice the use of the each method to gain access to each element individually
   $('.webLinks .entry a').each(function()
   {
      // Create image content using websnapr thumbnail service
      var content = '<img src="http://images.websnapr.com/?url=';
      content += $(this).attr('href');
      content += '" alt="Loading thumbnail..." height="152" width="202" />';
      
      // Setup the tooltip with the content
      $(this).qtip(
      {
         content: content,
        position: {
	  target: 'mouse',
      adjust: { 
	  	 mouse: true, 
		 x: -10, y: -10
		},
      corner: {
         target: 'topMiddle',
         tooltip: 'bottomMiddle'
      }
   },
         style: {
   				
                 	 border: {
                     width: 0,
                     radius: 0,
					 color:'#222'
                  },
				     background: '#222',
  					 color: '#fff',
                     padding: 5, 
                     textAlign: 'center',
                     tip: false // Give it a speech bubble tip with automatic corner detection
                     //name: 'dark' // Style it according to the preset 'cream' style
                  }
      });
   });

	
	 
   //QTIPPIN'
   $('.navTips a[href][title]').qtip({
   content: {
         text: false // Use each elements title attribute
        },
   position: {
	   adjust: {  
		 x: -5, y: 7
		}, 
      corner: {
         target: 'bottomLeft',
         tooltip: 'topLeft'
        }
   },
   show: { delay: 0 },
   hide: { effect: 'fade'},
   style: {
   				
                 	 border: {
                     width: 0,
                     radius: 0,
					 color:'#222'
                  },
  				  	 width: 140,
				     background: 'none',
  					 color: '#ddd',
                     padding: 0, 
                     textAlign: 'left',
                     tip: false // Give it a speech bubble tip with automatic corner detection
                     //name: 'dark' // Style it according to the preset 'cream' style
                  }

	
	});
    $('#page a[href][title]').qtip({
   content: {
         text: false // Use each elements title attribute
      },
   position: {
	  target: 'mouse',
      adjust: { 
	  	 mouse: true, 
		 x: -10, y: -10
		},
      corner: {
         target: 'topMiddle',
         tooltip: 'bottomMiddle'
      }
   },
   show: { solo: true },
   hide: { effect: 'fade'},
   style: {
   				
                 	 border: {
                     width: 0,
                     radius: 0,
					 color:'none'
                  },
				     background: 'url(http://www.kylekorverfoundation.com/blog/wp-content/themes/default/images/hvrbg.png)',
  					 color: '#fff',
                     padding: 5, 
                     textAlign: 'center',
                     tip: false // Give it a speech bubble tip with automatic corner detection
                     //name: 'dark' // Style it according to the preset 'cream' style
                  }

	
	});

});
