function min_height(_element, _height) {
	if(_element.clientHeight < _height) {
		_element.style.height = _height + 'px';
	}
}

function product_blocks(_string) {
	$('.content_block').hide();
	$('.block_link').show();
	$('#' + _string).show();
	$('#' + _string + '_link').hide();
	
	return false;
}

function switch_display(_id) {
	if($('#' + _id).css('display') == 'block') {
		$('#' + _id).slideUp('slow');
	} else {
		$('#' + _id).slideDown('slow');
	}
}

function switch_display_by_class(_class) {
	if($('.' + _class).css('display') == 'block') {
		$('.' + _class).slideUp('slow');
	} else {
		$('.' + _class).slideDown('slow');
	}
}

function ChangeOption(_ele) {
	value = _ele.options[document.getElementById("products_list").selectedIndex].value;
	var type = document.getElementById('t1').checked ? 1 : (document.getElementById('t2').checked ? 2: 0); 
	if (value == 1 || value == 2 || value == 4) {
		if(type == 1)
			$('#download').attr('href', '/f/support/pay/bank_form.pdf');
		else $('#download').attr('href', '/f/support/pay/post_form.pdf');
	} else if (value == 3) {
		if(type == 1)
			$('#download').attr('href', '/f/support/pay/bank_form.pdf');
		else $('#download').attr('href', '/f/support/pay/post_form.pdf');
	} else if (value == 5 || value == 6) {
		if(type == 1)
			$('#download').attr('href', '/f/support/pay/bank_form_cc.pdf');
		else $('#download').attr('href', '/f/support/pay/post_form_cc.pdf');
	}
}

$(document).ready(function()
{
	$('.bslink').bstip();
	
	$("h2.faqhead").click(function () { 
		if ($(this).next().css('display') == 'none')
		{
			$(this).siblings('dl.faq').css('display','none');
			$(this).next().css('display','block');
		}
		else
		{
			$(this).next().css('display','none');
		}
	});
	
	$("dl.faq dd a.title").click(function () { 
		
		if ($(this).next().css('display') == 'none')
		{
			$("dl.faq dd").find("div").css('display','none');
	    	$(this).next().css('display','block');
	    	return false;
		}
		else
		{
			$(this).siblings("div").css('display','none');
	    	return false;
		}
	});
	
	$("a.showmoar").toggle(
		function () { 
			var d = $(this).attr('rel');
			$("#"+d).css('display','block');
			return false;
		},
		function () { 
			var d = $(this).attr('rel');
			$("#"+d).css('display','none');
			return false;
		}
	);
	
});