$(document).ready(function(){
  $(".twitter").tweet({
    join_text: "auto",
    username: "staffantan",
    avatar_size: 48,
    count: 3,
    refresh_interval: 60,
    query: "#nnc11",
    template: "<span class='tweet_avatar'>{avatar}</span><span class='tweet_text'>{text} <br />{time} &raquo; {retweet_action}</span>",
    auto_join_text_default: "said,",     
    auto_join_text_ed: "",                   
    auto_join_text_ing: "are",               
    auto_join_text_reply: "replied to",
    auto_join_text_url: "was looking at", 
  });
  
  $('.send_application_dialog').dialog({
		autoOpen: false,
		width: 500,
		height: 500,
		buttons: {
			"Send": function() {
				if($(this).find('#TxtStatus').hasClass('dropSuccess')){
					$(this).find('form').submit();
					$(this).dialog('close');
				}
			},
			"Cancel": function(){
				$(this).dialog('close');
			}
		}
	});
	
	$( ".application_sent_message" ).dialog({
		autoOpen: false,
		modal: true,
		buttons: {
			Ok: function() {
				$( this ).dialog( "close" );
			}
		}
	});
	
	$('.send_application').click(function(){
		$('.send_application_dialog').dialog('open');
		return false;
	});
	$('.send_ticket_dialog').dialog({
		autoOpen: false,
		width: 500,
		height: 500,
		buttons: {
			"Send": function() {
				if($(this).find('#TxtStatus').hasClass('dropSuccess')){
					$(this).find('form').submit();
					$(this).dialog('close');
				}
			},
			"Cancel": function(){
				$(this).dialog('close');
			}
		}
	});
	
	$( ".ticket_sent_message" ).dialog({
		autoOpen: false,
		modal: true,
		buttons: {
			Ok: function() {
				$( this ).dialog( "close" );
			}
		}
	});
	$('.send_ticket').click(function(){
		$('.send_ticket_dialog').dialog('open');
		return false;
	});
	$('.send_volunteer_dialog').dialog({
		autoOpen: false,
		width: 500,
		height: 500,
		buttons: {
			"Send": function() {
				if($(this).find('#TxtStatus').hasClass('dropSuccess')){
					$(this).find('form').submit();
					$(this).dialog('close');
				}
			},
			"Cancel": function(){
				$(this).dialog('close');
			}
		}
	});
	
	$( ".volunteer_sent_message" ).dialog({
		autoOpen: false,
		modal: true,
		buttons: {
			Ok: function() {
				$( this ).dialog( "close" );
			}
		}
	});
	$('.send_volunteer').click(function(){
		$('.send_volunteer_dialog').dialog('open');
		return false;
	});
	$( ".contact_sent_message" ).dialog({
		autoOpen: false,
		modal: true,
		buttons: {
			Ok: function() {
				$( this ).dialog( "close" );
			}
		}
	});
	$('.QapTcha').QapTcha({
		autoRevert: true,
	});
	
	
	$('.gallery_container').galleria({
        width: $('.body_content').css('width').replace("px", ""),
        height: ($('.body_content').css('width').replace("px", "") * .90),
        imageCrop: true
    });
	
	$('.menu_item a').mouseover(function (){
		$(this).parent('.menu_item').addClass('hover');
	}).mouseout(function (){
		$(this).parent('.menu_item').removeClass('hover');
	});
});

