$(document).ready(function() {
	
	$('#search_str').click(function(){
		$(this).val('');
	});
	
	/*$('table.index_links_table div.cont_div').hover(
		function () {
			return $('div.voting_block').animate({width: 'toggle'}, 200);
		},
		function () {
			return $('div.voting_block').hide();
		}
	);*/
	
	$('table.index_links_table div.opn_lyr, , div.voting_block span.closes').live('click',
		function () {
			$('div.voting_block').animate({width: 'toggle'}, 200);
			$('table.index_links_table div.cont_div a.button_1').toggleClass('button_1_back');
		}
	);
	
	/*$('table.index_links_table td.voting_lines img').hover(
		function(){
			var title = $(this).attr('title');
			$('.vote_answr').html(title);
		},
		function(){
			$('.vote_answr').html('');
		}
	);*/
	
	$('a.radio').click(function(){
		
		$('a.radio').each(function(){
			$('a.radio').removeClass('radio_checked');
			$('a.radio').children('input').attr('checked', '');
			$('a.radio').children('input').attr('value', '');
		});
		$(this).addClass('radio_checked');
		$(this).children('input').val($(this).children('input').attr('id'));
		$(this).children('input').attr('checked', 'checked');
	});

	$('a.radio').each(function(){
		$(this).children('input').hide();
	});
	
	
	/*Redesign menu*/
	
	$('table.index_links_table div.sub_container ul').each(function(){
		var ul_height = $(this)
						.parent('.sub_container')
						.parent('td')
						.parent('tr')
						.parent('thead')
						.parent('table')
						.children('tbody')
						.height();
		$(this).height(ul_height - 7)
	});
	
	$('table.index_links_table td.blue_bg_1, table.index_links_table td.blue_bg_2').hover(
		function(){
			$('table.index_links_table ul.blue_bg_2').show()
		},
		function(){
			$('table.index_links_table ul.blue_bg_2').hide()
		}
	);
	
	$('table.index_links_table td.rose_bg_1, table.index_links_table td.rose_bg_2').hover(
		function(){
			$('table.index_links_table ul.rose_bg_2').show()
		},
		function(){
			$('table.index_links_table ul.rose_bg_2').hide()
		}
	);
	
	$('table.index_links_table td.violet_bg_1, table.index_links_table td.violet_bg_2').hover(
		function(){
			$('table.index_links_table ul.violet_bg_2').show()
		},
		function(){
			$('table.index_links_table ul.violet_bg_2').hide()
		}
	);
	
	$('table.index_links_table td.yellow_bg_1, table.index_links_table td.yellow_bg_2').hover(
		function(){
			$('table.index_links_table ul.yellow_bg_2').show()
		},
		function(){
			$('table.index_links_table ul.yellow_bg_2').hide()
		}
	);
	
	$('table.index_links_table td.orange_bg_1, table.index_links_table td.orange_bg_2').hover(
		function(){
			$('table.index_links_table ul.orange_bg_2').show()
		},
		function(){
			$('table.index_links_table ul.orange_bg_2').hide()
		}
	);
	
	$('table.index_links_table td.green_bg_1, table.index_links_table td.green_bg_2').hover(
		function(){
			$('table.index_links_table ul.green_bg_2').show()
		},
		function(){
			$('table.index_links_table ul.green_bg_2').hide()
		}
	);
	
	
	
	/**/
	
	
	/*FAQ js*/
	
	$('ul.faq_block li span.asme, ul.faq_block li a.asme *').bind('click', function(){
		$('ul.faq_block span.ats').hide();
		$('ul.faq_block .open').html('+');
		$(this).children('.open').html('&ndash;');
		$(this).parents('li').children('.ats').css('display','block');
	})
	
	
	
});

search = function()
{
	$('#search_form').submit();
}

change_text_focus = function(obj, text)
{
    if($(obj).val() == text)
    {
        $(obj).val('');
    }
} 

change_text_blur = function(obj, text)
{
    if($(obj).val() == '')
    {
        $(obj).val(text);
    }
}


