// Beat Fly JavaScript core document
/*jquery setting*/
$(document).ready(function(){
						   
	//gallery fadeIn
	$("#gallerylist").fadeIn(500);
									   		
	//show-hide info
	$('#info dl').hide();
		
	$('a#panel-show').click(function() {
		$('#info dl').fadeIn();
		return false;
	});
	  
	$('a#panel-hide').click(function() {
		$('#info dl').fadeOut();
		return false;
	});
	
	//mysocialbookmark animation
	$('#mysocialbookmark img').hover(function() {
		$(this).stop().animate({
			opacity : 0.3
		}, 500);
		},
		function(){
		$(this).stop().animate({
			opacity : 1
		}, 500);
	});
	
	//bookmark
	$("a.jQueryBookmark").click(function(e){
		e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
		var bookmarkUrl = this.href;
		var bookmarkTitle = this.title;
	 
		if (window.sidebar) { // For Mozilla Firefox Bookmark
			window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
		} else if( window.external || document.all) { // For IE Favorite
			window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
		} else if(window.opera) { // For Opera Browsers
			$("a.jQueryBookmark").attr("href",bookmarkUrl);
			$("a.jQueryBookmark").attr("title",bookmarkTitle);
			$("a.jQueryBookmark").attr("rel","sidebar");
		} else { // for other browsers which does not support
			 alert('Your browser does not support this bookmark action');
			 return false;
		}
	});
	
	//news ticker
	var first = 0;
	var speed = 700;
	var pause = 5000;
	
		function removeFirst(){
			first = $('ul#listticker li:first').html();
			$('ul#listticker li:first')
			.animate({opacity: 0}, speed)
			.fadeOut('slow', function() {$(this).remove();});
			addLast(first);
		}
		
		function addLast(first){
			last = '<li style="display:none">'+first+'</li>';
			$('ul#listticker').append(last)
			$('ul#listticker li:last')
			.animate({opacity: 1}, speed)
			.fadeIn('slow')
		}
	
	interval = setInterval(removeFirst, pause);
	
	/*newsletter*/
	function request_action(jurl,jdata,jtarget)	
	{
		$(jtarget).html('Loading...');
			
		$.ajax(
		{
		   type: "GET",
		   url: jurl,
		   data: jdata,
		   success: function(data)
		   {
			 $(jtarget).html(data);
		   }
		});
	};
	
	
});



