var buzzshow = false;
$(document).ready(function() {
			
			
			if($.browser.msie && $.browser.version=="6.0"){
				//IE6
			}else{
			$("#slider").easySlider({
				prevText: 'Previous',
				nextText: 'Next',		
				vertical: true, 
				controlsFade: false
			});
			
			$("#slider li").css("float","none");
			
			/*$("#tweets").easySlider({
				prevId: 'prevBtn2',
				nextId: 'nextBtn2',		
				vertical: true, 
				controlsFade: false
			});*/
			//RESET HEIGHT TO SHOW TWO TWEETS
			$("#tweets").height(156);
			
			
			$("#buzz-submit").hide();
			
			$('#jumptomonth').selectbox({
				 onChangeCallback: jumpChange
			});
			
			$('#featured-items').height(380);
			$('#featured-items').Horinaja({
			capture:'featured-items',
			delai:0.5	,
			duree:5,
			pagination:true});
			
			
			}


			$("#menu-tabs").tabs();


			
			//REMOVE DISQUS AVATAR JS
			$(".dsq-header-avatar").each(function(){
			$(this).removeAttr('onclick').removeAttr('onmouseover');
			$(this).find('.dsq-avatar').removeAttr('onclick');
			});
			
			$(".commentlist li:first").css('border-top','none');
			$(".commentlist>li:last").css('border-bottom','none');
			
					
			$('#buzz-menu').menu({ 
				content: $('#buzz-menu').next().html(), // grab content from this page
				showSpeed: 300 ,
				width: 149			});
			
			
			$('#like').click(function(){
									
					likeUpdate($(this).attr('title'));				
					var count = parseInt ( $('#like span').html()); count++; 
					$('#like span').html(count);
					$('#like').unbind();
					
					return false;
					
								
			})	
				
			$('#dislike').click(function(){
								
					dislikeUpdate($(this).attr('title'));				
					var count = parseInt ( $('#dislike span').html()); count++; 
					$('#dislike span').html(count);
					$('#dislike').unbind();
					return false;
			})	
			
			
			$('.more-buzz').click(function(){
				if(buzzshow == false){
					$('#buzz, #tweets').animate({
						height:$('.tweetsul').height()+10
					}, 1000);
					buzzshow = true;
				}else{
					
					$('#buzz, #tweets').animate({
						height:144
					}, 1000);
				buzzshow = false;
				}
				
				if(buzzshow == false){
					$('.more-buzz').addClass('plus');
					$('.more-buzz').removeClass('minus');
				}else{
					$('.more-buzz').addClass('minus');
					$('.more-buzz').removeClass('plus');
				}
				});
			
			///////////////////////////////////////////////////
			//SHOW COMMENTING
			///////////////////////////////////////////////////
			$('#respond,#noJS').toggle();
				
			});//END .READY

			function menuCallBack(s){
			var type;
			$('.dropdown').html(s);
				switch(s){
					case "Show All":
					 	type = "all";
					break;
					case "Our Latest Tweets":
						type = "twh";
					break;
					case "Latest Tweets About Us":
						type = "tw";
					break;
					case "Latest Site Comments":
						type = "dq";
					break;
				}
				
			$.ajax({
			   type: "POST",
			   url: "/wp-19274/wp-content/plugins/hoxton-buzz/ajax.php",
			   data: "type="+type,
			   cache: false,
			   dataType: 'html',
			   success: function (html) {
				
					$('#tweets').html(html);
				
					$('#buzz, #tweets').animate({
						height:$('.tweetsul').height()+10
					}, 1000);
					buzzshow = true;
					FBConnect.init('b5f7cf9bdb485b2f1efde42579d1b6a2', 'http://www.hoxtonsquarebar.com/wp-19274/wp-content/plugins/wp-facebookconnect/', 'http://www.hoxtonsquarebar.com/wp-19274', 1, FBConnect.appconfig_reload);

					if($('.more-buzz').hasClass('plus')){
						$('.more-buzz').addClass('minus');
						
					}
									
				}
			 });
				
				
			}
		
//SET DISQUS STYLE SHEET
var disqus_iframe_css = "http://hoxton.catchdigital.com/wp-19274/wp-content/themes/hoxton/css/comments.css";

			

	function jumpChange(args){
		if( args.selectedVal !="jump to month"){
			window.location = args.selectedVal;
		}
	}
	
	
	////////FORM
	
					//signup validation
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	function clickclear(thisfield, defaulttext) {
		if (thisfield.value == defaulttext) {
			thisfield.value = "";
		}
	}
	function clickrecall(thisfield, defaulttext) {
		if (thisfield.value == "") {
			thisfield.value = defaulttext;
		}
	}
	function validate_signup() {

		if ($('#hymjd-hymjdj').val() == '' || $('#hymjd-hymjd').val() == 'Email Address' || !reg.test($('#hymjd-hymjd').val())) {
			alert('Please enter a valid email address');
			if ($('#hymjd-hymjd').val() == '' || $('#hymjd-hymjd').val() == 'Email Address'){$('#hymjd-hymjd').val('');}
			$('#hymjd-hymjd').focus();
				return false;
		}
		else {
			//SAVE VIA PHP PROXY
			$.ajax({
			   type: "POST",
			   url: "/wp-19274/wp-content/themes/hoxton/email_submit.php",
			   data: "ajax=1&email="+$('#hymjd-hymjd').val(),
			   cache: false,
			   dataType: 'html',
			   success: function (html) {
				if (html==1) {
					$('#success').html('Thank you. Your email has been added');
					$('#success').fadeIn('slow');
					$('#dudkhj_dudkhj').val('Email Address');
					setTimeout(successHide, 2000);
				} else { 
					$('#success').html('Sorry that didn\'t work please try again');
					$('#success').fadeIn('slow');
					setTimeout(successHide, 2000);
				};}
			 });


	return false;
			
		}
	
	}
	
	function successHide(){
		$('#success').slideToggle('slow');
	}


/////////////////////////////////
//LIKE DISLIKE
			function likeUpdate(i){
				return likeAjax(1 , i);
			}
			
			function dislikeUpdate(i){
				return likeAjax(2 , i);
			}
	
			function likeAjax(t, i){
				$.ajax({
				   type: "POST",
				   url: "/like-dislike/",
				   data: "type="+t+"&id="+i,
				   cache: false,
				   dataType: 'html',
				   async: false,
				   success: function (html) {
					if (html==1) {
						return 1;
					} else { 
						return 0;
						};}
					 });	
			}
	
/////////////////////////////////////
//ADD THIS
var addthis_share = 
{ 
// ...
    templates: {
                   twitter: 'Check out {{title}} - {{url}} @hoxtonbar'
               }
}
var addthis_config =
{
   services_compact: "twitter, facebook, myspace, email"}