// do not remove
jQuery.ajaxSetup(
	{
		cache:false,
		global: false
	}
);

/**
 * Add us to your favorites
 */
function bookmark() {
var title = 'Title of Bookmark';
var url = 'http://yourdomain.com';
   if (document.all)
     window.external.AddFavorite(url, title);
   else if (window.sidebar)
     window.sidebar.addPanel(title, url, "")
   else if (window.sidebar&&window.sidebar.addPanel)
     window.sidebar.addPanel(title,url,"");
}

(function($) {
	//	$(document).ready(function(){
		/*$(".btn_signup").click(function(event) {
			$("#url_from_register").val(document.location.href);
		});*/
	//});
	//$(document).ready(function(){
		
		
		/**
		 * click on "forgot my password"
		 */
		$("#link_forgot").click(function(event) {
			event.preventDefault();
			event.stopPropagation();
			$('#forgot_link').hide();
		});
		$("#link_forgot").click(function(event) {
			event.preventDefault();
			event.stopPropagation();
			$('#forgot_form').show();
		});

		/**
		 * click on "Close" link
		 */
		$("#close_edit_zone").click(function(event){
			event.preventDefault();
			event.stopPropagation();
			$("#announcments").empty();
			$.get("/editzones/announcements_close");
		});
	//});
	
	/**
	 * Header menu
	 */	
	//$(document).ready(function(){
/*		$(".btn_login").click(function(event) {
			alert(document.location.href);
			//event.preventDefault();
			//event.stopPropagation();
			$("#url_from_login").val(document.location.href);
		});*/

		/**
		 * Handles combo
		 */
		if ($("#combo").length > 0) 
		{
			$("#combo").jqm({
				modal:true, 
				toTop:false
			});
		}
				
		$("#combo_x").click(function(event){
			event.preventDefault();
			event.stopPropagation();
			if (global_eid) {
				//$('#combo').html('<img src="/imgs/loading_big.gif" />');
				pageTracker._trackPageview('/pop_login/skip');
				var submited_div = '#' + global_eid + '_poll_form';
				$(submited_div).action = '/votes/vote/';
				$(submited_div).submit();
				global_eid = "";
			}
			else if(global_votenow)
			{
				global_votenow = 0;
				pollsbcom_goVote();
			}
		});
	//});
})(jQuery);

function enableDots(t, h)
{
	var target = document.getElementById('option_' + t);
	if(target && h)
	{
//		alert(target.scrollHeight + ' ' + h);
		if(	target.scrollHeight > h)
		{
			document.getElementById('option_' + t + '_dots').style.display = 'block';
		}
	}
}
