$(document).ready(function (){
	$("#eggcal").show("500");
	$("#eggratecalc").fancybox({
		'width'			: 720,
		'height'		: 480,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'title'				: 'Egg Rate Calculator',
		'type'				: 'iframe',
		'onClosed': function() {
				   parent.location.reload(true);
				  }
	});
	$("#getdistance").click(function() {
	var loc1 = $("#loc1").val();
	var loc2 = $("#loc2").val();
	if((loc1 != "")&&(loc2 !=""))
	{
		$.fancybox({
			'href' : 'http://www.convertunits.com/distance/gadget/?loc1='+loc1+'&loc2='+loc2
			},{
		
			'width'			: 700,
			'height'		: 480,
			'autoScale'			: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});
	}
	else
	{
		$("#loc1").focus();
	}
	});
var tg = 1;
$("#closelist").click(function(){
	if(tg == 1)
	{
		tg = 2;
		$("#closelist").html("+");
		$("#useronline").hide("");
		$("#chatstatus").hide("");
		$("#chatuserlist").height("24px");
		$.get("isonline.php?pre=C");
		$('#useronline').load('isonline.php');
	}
	else
	{
		tg = 1;
		$("#closelist").html("-");
		$("#chatuserlist").height("200px");
		$("#useronline").show("");
		$("#chatstatus").show("");
		$.get("isonline.php?pre=O");
		$('#useronline').load('isonline.php');
	}
});
$("input[name=status]").bind('click',function(){ 
	var stat = this.value;
	$.get("isonline.php?ul="+stat);
	
	$('#chatbox_'+chatboxtitle).css('display','none');
	restructureChatBoxes();

	$.post("chat.php?action="+stat, { chatbox: chatboxtitle} , function(data){	
	});
});
});
