$(document).ready(function() {
	
	$("ul.sf-menu:not(.sf-navbar), ul.sf-navbar ul").supersubs({ // We do not want it for the navbar
			minWidth:    12,   // minimum width of sub-menus in em units
			maxWidth:    27,   // maximum width of sub-menus in em units
			extraWidth:  1     // extra width can ensure lines don't sometimes turn over
                               // due to slight rounding differences and font-family
		}).superfish({
				autoArrows:  true,
				delay:       400,                             // one second delay on mouseout 
				animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
				speed:       'fast',                          // faster animation speed 
				autoArrows:  false,                           // disable generation of arrow mark-up 
				dropShadows: false,                            // disable drop shadows 	
				disableHI:   true
				
	  });
		
		
	
	 $("ul.sf-menu").find('ul').bgIframe({opacity:false}); 
	 
	 if($('a.audio-noplayer').length>0){
		 $.fn.media.defaults.mp3Player = '/js/player.swf';
		 
		 if(jQuery.browser.qtime){
	
		 } else {
			$.fn.media.mapFormat('wav', 'winmedia');
			$.fn.media.mapFormat('mid', 'winmedia');
			$.fn.media.mapFormat('midi', 'winmedia');
		 }
		 
		 
		 $.fn.media.defaults.autoplay = 1;
		 $('a.audio-noplayer').media( { width: 1, height: 1 ,autoplay: true, flashvars: { autostart: 'true' }} );
		 //$('.media').hide();
	 }
	 
	 $("a.taf-form").fancybox({
			'width'				:  640,
			'height'			: 420,
			'autoScale'			: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe',
			'onStart'	:	function() {
		 		$('div.flash-replaced').css('visibility', 'hidden');
	 		},
	 		'onClosed'	:	function() {
	 			$('div.flash-replaced').css({ 'visibility' : 'visible' });
	 		}
		});
	 
	 
	 $('.tafshare').click(function() {
		 var act = new gigya.services.socialize.UserAction();
		 act.setUserMessage('Your comment here...');
		 
	
		var title = document.title;
		var description = $('meta[name=description]').attr("content");
		var href = jQuery(location).attr('href');
	
		
		act.setTitle(title);  
		act.setDescription(description);
		act.setLinkBack(href);  
		act.addActionLink(title, href);  
		
		if($('#thumb_url').length>0){
			thumb_url = $('#thumb_url').val();
			
		}
		
		
		var video = {  
		                 src: href,  
		                 src: thumb_url,  
		                 type: 'image'  
		             }  
		act.addMediaItem(video);  
		
		 var share_params=
		 {
		 	userAction: act,
		 	operationMode: "simpleShare",
		 	showEmailButton: true,
		 	showMoreButton: true,
		 	useHTML: true
		 }
		 gigya.services.socialize.showShareUI(conf,share_params);
	 });
	 
	 
	 
	
	 
});
