// HelpOverlay.js
$(document).ready(function() {
          //delivery explaination u-tube overlay
           $('#track').overlay({expose: '#565656',closeSpeed: 1000, finish : {top:30},
            //load in the video. This happens after clicking the button but just before opening the overlay
             onBeforeLoad: function(){
				        var videoContent = $('#overlayVideoContent');
				        var content = '<object width="710" height="427"><param name="movie" value="http://www.youtube.com/v/dczED5ipLlM&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dczED5ipLlM&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" width="710" height="427" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
				        videoContent.html(content);
			      },
			//to ensure video stops playing after overlay is close inject the content where the vid was with an empty string ''. because IE is so bad!!!
			onBeforeClose: function(){
 	        var videoContent = $('#overlayVideoContent');
	        var content = '';
	        videoContent.html(content);       
            }
       });
       
       //to change the cursor to a hand pointer
        $('#track').hover(function(){
          $('#track').css('cursor', 'pointer');
        }); 

       //tooltips delivery
       $('#track').tooltip({position:['top', 'center'], tip: '#trackTip', offset:[8,0]});
	   

	             //delivery explaination u-tube overlay
           $('#returns').overlay({expose: '#565656',closeSpeed: 1000, finish : {top:30},
            //load in the video. This happens after clicking the button but just before opening the overlay
             onBeforeLoad: function(){
				        var videoContent = $('#overlayVideoContentreturns');
				        var content = '<object width="710" height="427"><param name="movie" value="http://www.youtube.com/v/XO91yjRKY2k&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XO91yjRKY2k&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" width="710" height="427" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
				        videoContent.html(content);
			      },
			//to ensure video stops playing after overlay is close inject the content where the vid was with an empty string ''. because IE is so bad!!!
			onBeforeClose: function(){
 	        var videoContent = $('#overlayVideoContentreturns');
	        var content = '';
	        videoContent.html(content);       
            }
       });
       
       //to change the cursor to a hand pointer
        $('#returns').hover(function(){
          $('#returns').css('cursor', 'pointer');
        }); 

       //tooltips delivery
       $('#returns').tooltip({position:['top', 'center'], tip: '#returnsTip', offset:[8,0]});
	   
	   
	   
	   
	   
	   	             //delivery explaination u-tube overlay
           $('#stock').overlay({expose: '#565656',closeSpeed: 1000, finish : {top:30},
            //load in the video. This happens after clicking the button but just before opening the overlay
             onBeforeLoad: function(){
				        var videoContent = $('#overlayVideoContentstock');
				        var content = '<object width="710" height="427"><param name="movie" value="http://www.youtube.com/v/BRb3PM75pPM&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BRb3PM75pPM&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" width="710" height="427" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
				        videoContent.html(content);
			      },
			//to ensure video stops playing after overlay is close inject the content where the vid was with an empty string ''. because IE is so bad!!!
			onBeforeClose: function(){
 	        var videoContent = $('#overlayVideoContentstock');
	        var content = '';
	        videoContent.html(content);       
            }
       });
       
       //to change the cursor to a hand pointer
        $('#stock').hover(function(){
          $('#stock').css('cursor', 'pointer');
        }); 

       //tooltips delivery
       $('#stock').tooltip({position:['top', 'center'], tip: '#stockTip', offset:[8,0]});
	   
	   
	   
	   
	   
	   
	
	   	             //invoice explaination u-tube overlay
           $('#invoice').overlay({expose: '#565656',closeSpeed: 1000, finish : {top:30},
            //load in the video. This happens after clicking the button but just before opening the overlay
             onBeforeLoad: function(){
				        var videoContent = $('#overlayVideoContentinvoice');
				        var content = '<object width="710" height="427"><param name="movie" value="http://www.youtube.com/v/rbmzWpifp-Q&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/rbmzWpifp-Q&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" width="710" height="427" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
				        videoContent.html(content);
			      },
			//to ensure video stops playing after overlay is close inject the content where the vid was with an empty string ''. because IE is so bad!!!
			onBeforeClose: function(){
 	        var videoContent = $('#overlayVideoContentinvoice');
	        var content = '';
	        videoContent.html(content);       
            }
       });
       
       //to change the cursor to a hand pointer
        $('#invoice').hover(function(){
          $('#invoice').css('cursor', 'pointer');
        }); 

       //tooltips delivery
       $('#invoice').tooltip({position:['top', 'center'], tip: '#invoiceTip', offset:[8,0]});
	   
	   
	   
});