// --> menu started		
	//var dropBoxShowed = null;
	var menuShowed = false;
	var closetmr = null;

		
	$(document).ready(
		function()
		{
			
			//mouseover mouseout emulation using jquery for submenu showing
			$('.sub').mouseover(
				function() {
					mopen($(this).attr('rel'), $(this));
					//alert('mouseover');
				}
			);
	
			$('.sub').mouseout(
				function() {
					mclosetime();
				}
			);
			
			$('#smenu').mouseover(
				function() {
					mcancelclosetime();	
				}
			);
			$('#smenu').mouseout(
				function() {
					mclosetime();	
				}
			);

			// preload search button img!
			if (document.images) {
      				preload_image = new Image(29,24); 
      				preload_image.src="images/tmpl/submit_small_search_hover.jpg"; 
    			}
		}
	);

// --> menu ends


// fixing width of blocks
// fixing lenght of content bg

function layoutFix()
{
	if (($('.cntrl_right').height() - $('.slogan').height()) > $('.content').height()) {
					var height = $('.cntrl_right').height() - $('.slogan').height();
					$('.content').css( { 'height' : height } );	
	}
}


// auth required!
var pollObject = false;

function authRequired(where, cObj)
{
	switch (where) {
		case 'poll':
		case 'poll_results':
			PollAuthReq(cObj);
		break;
			
		default : break;
	}
	//return false;
	
}
function PollAuthReq(cObj)
{
	$('li.poll').css({
		'color':'red'
	}); 
	$('li.poll').html('Необходима авторизация');
	
	window.pollObject = cObj;
	window.setTimeout('authForms()', 500);
	//return false;
}

function authForms()
{
	var cObj = window.pollObject;
	//alert( cObj);
	return hs.htmlExpand(
		cObj, {
			contentId: 'highslide-html-loginform',
			wrapperClassName: 'mod_cd_login',
			outlineType: 'rounded-white',
			align: 'center',
			anchor: 'center',
			dimmingOpacity: '0',
			slideshowGroup: 'mod_cd_login_loginform'
		}
	);
	
}

			
	

	