function lmenus_switch(type) {
	switch(type) {
		case 'prn':
		$("#ghkjljklkjlkjlj").hide();
		i=$("#current_content").html();
		j=$("body").html();
		$("body").html('<INPUT type="button" value="Print" class="lmenus_prn" id="lmenus_prn_print"> &nbsp; <INPUT type="button" value="Back" class="lmenus_prn" id="lmenus_prn_back"><br><br><br>'+i);
		$(".lmenus_prn").click(function() {
			switch($(this).attr('id')) {
				case 'lmenus_prn_print':
				window.print();
				setTimeout('$("#lmenus_prn_back").click()',2000);
				break;
				case 'lmenus_prn_back':
				$("body").html(j);
				$("#ghkjljklkjlkjlj").show();
				$("#ml_back, #ml_back1").click(function() {
					$("#mails").hide();
				});
				$("#ml_back1").mouseover(function() {
					$(this).css('cursor','pointer');
				});
				$("#ml_send").click(function() {
					counter=0;
					data='';
					$(".mails").each(function() {
						if($(this).val()!='') {
							counter++;
							data=data+'&'+$(this).attr('id')+'='+$(this).val();
						}
					});
					data=data+'&var='+location.href;
					if(counter==4) {
						$.ajax({
							type:		"POST",
							url:		"view_news.php",
							data:		"task=send_mail"+data,
							success:	function(msg) {
								if(msg=='good') {
									alert('Email was sent.');
									$("#mails").hide();
								} else {
									alert(msg);
								}
							}
						});
					} else {
						alert('Fill empty fields, please.');
					}
				});
				//-------
				$(".lmenus").click(function() {
					lmenus_switch($(this).attr('id').substring(7));
				});
				break;
			}
		});
		break;
		case 'eml':
		mails_show();
		break;
		case 'hom':
		location.href='http://www.pewsitter.com/';
		break;
	}
}
//------------------------------
function mails_show() {
	//-------
	$("#mails").show();
	//-------
}
//------------------------------
function qqq() {

}
//------------------------------
$(document).ready(function() {
	//-------
	$("#ml_back1").mouseover(function() {
		$(this).css('cursor','pointer');
	});
	$("#ml_back, #ml_back1").click(function() {
		$("#mails").hide();
	});
	//-------
	$("#ml_send").click(function() {
		counter=0;
		data='';
		$(".mails").each(function() {
			if($(this).val()!='') {
				counter++;
				data=data+'&'+$(this).attr('id')+'='+$(this).val();
			}
		});
		data=data+'&var='+location.href;
		if(counter==4) {
			$.ajax({
				type:		"POST",
				url:		"view_news.php",
				data:		"task=send_mail"+data,
				success:	function(msg) {
					if(msg=='good') {
						alert('Email was sent.');
						$("#mails").hide();
					} else {
						alert(msg);
					}
				}
			});
		} else {
			alert('Fill empty fields, please.');
		}
	});
	//-------
	$(".lmenus").click(function() {
		lmenus_switch($(this).attr('id').substring(7));
	});
	//-------
	$(".lmenus").mouseover(function() {
		$(this).css('background-color','#FFFCE8');
		$(this).css('cursor','pointer');
	});
	$(".lmenus").mouseout(function() {
		$(this).css('background-color','#FFFFF9');
	});
	//-------
});
//------------------------------
