/* $Id: main.js 445 2008-12-12 22:13:58Z vincent $ */

$(document).ready(function(){
	shortly = new Date(); 
	    shortly.setSeconds(shortly.getSeconds() + 1.75);
	$('#countdown').countdown({until: shortly, onExpiry: liftOff, compact: true});

	$("#closepopup").click(function () {
	      $("#popup").hide();
		$("#popinside").hide();
	      return false;
	    });

	function liftOff() {
		$("#popup").show();
		$("#popinside").show();
		$('#popinside').centerElement();
	}
	

	
	$("#awberssubmit").click(function () {
		
		$.post("/", {  },
		  function(data){
		    alert("Data Loaded: " + data);
		  });
		return false;
		
	});
	
	// Remove Text From search boxes
	$('.boxinput').focus(function(){
		if($(this).val() == $(this).attr('defaultValue'))
		{
			$(this).val('');
		}
	});
	
	$('.boxinput').blur(function(){
		if($(this).val() == '')
		{
			$(this).val($(this).attr('defaultValue'));
		}
	});
	
});


(function($)
{
	$.fn.centerElement = function() {
        return this.each(function() 
        {
			var el = this;
			$(el)
					.wrap("<div style='position:relative;top:85px;left:50%;width:1px;height:1px; z-index:10001'></div>")
					.css({position: 'relative', left: el.offsetWidth / -2 + "px", top: el.offsetHeight / -2 + "px"});
		});
	};
})(jQuery);


