JQ(document).ready(
	function(){
		JQ('#submit-button').click(
			function()
			{
				JQ('#ajaxloading').css('display', 'inline');
				JQ.ajax(
					{ 
						type: "POST",
						url: "/ajax/register_email.php",
						data: "prenume=" + JQ('#prenume').val() + "&mobil=" + JQ('#mobil').val() + "&e-mail=" + JQ('#e-mail').val(),
						success: function(xml){
							errors = JQ('error', xml).each(
									function(){
										targetEl = JQ('#' + JQ(this).attr('id'));
										targetEl.parent('div').addClass('required-field');
									}
								);
							ok = JQ('ok', xml).each(
								function()
								{
									targetEl = JQ('#' + JQ(this).attr('id'));
									if (jQuery.className.has(targetEl,'required-field')) {
										targetEl.removeClass('required-field');
									}
								}
							);
							
							if(ok.size() == 2) {
								JQ('#newsletter').fadeOut(
									800,
									function() {
										JQ('#response_message').fadeIn(800);
									}
								);
							}
						},
						complete: function()
						{
								JQ('#ajaxloading').css('display', 'none');
						}
					}
				);
				return false;
			}
		);
	}
);

JQ(function(){      
        JQ(".player").PopUpWindow({
          address:"/thesessions-player.html",
          width:320,
          height: 275
        });
});

JQ(function(){
		JQ("input.numeric").numeric();
});
