function make_bold(txtarea) {
	
	var info = $('#'+txtarea).getSelection();
	$("#"+txtarea).replaceSelection('<b>'+info.text+'</b>');
}
function folder_to_gray(folder,val)
{
	if (val == 1)
	{folder.style.backgroundColor="#F0F0F0";}
	else
	{folder.style.backgroundColor="#FFFFFF";}
}
function self_to_red(folder,val)
{
	if (val == 1)
	{folder.style.color="#FF0000";}
	else
	{folder.style.color="#454545";}
}
function send_post(page_num)
{
	var page = document.getElementById('n');
	page.value = page_num;
	var form = document.getElementById('photos_search');
	form.submit();
}
function add_product()
{
		form = document.getElementById('product');
		form.submit();
}function fade_menu(i){
	if(i==0)
		$(".menu").hide("slow");
	if(i==1)
		$(".menu").show("slow");
}

function preview($name_id,$content_id,$editor){
	//tinyMCE.execCommand('mceAddControl', false, 'comment'+object);
	$('#hid_form').submit(function() {
		window.open('', 'formpopup', 'width=750,height=400,resizeable,scrollbars');
		this.target = 'formpopup';
	});
	$('#hid_name').val($('#'+$name_id).val());
	if($editor==1)tinyMCE.execCommand('mceRemoveControl', false,$content_id);
	$('#hid_content').val($('#'+$content_id).val());
	$('#hid_form').submit();
	if($editor==1)tinyMCE.execCommand('mceAddControl', false, $content_id);
	
}

