﻿/**
 * Forum
 * @author mario bianco prevot <prevot@pianetalotto.it>
 * @copyright Copyright &copy; 2008-2009, www.pianetalotto.it
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * @version $Id: /jquery.forum.js ,v 1.0 27/12/2009 10:35 ;
 */
(function($){
$.fn.jqDrag=function(h){return i(this,h,'d');};
$.fn.jqResize=function(h){return i(this,h,'r');};
$.jqDnR={dnr:{},e:0,
drag:function(v){
 if(M.k == 'd')E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});
 else E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
  return false;},
stop:function(){E.css('opacity',M.o);$().unbind('mousemove',J.drag).unbind('mouseup',J.stop);}
};
var J=$.jqDnR,M=J.dnr,E=J.e,
i=function(e,h,k){return e.each(function(){h=(h)?$(h,e):e;
 h.bind('mousedown',{e:e,k:k},function(v){var d=v.data,p={};E=d.e;
 if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
 M={X:p.left||f('left')||0,Y:p.top||f('top')||0,W:f('width')||E[0].scrollWidth||0,H:f('height')||E[0].scrollHeight||0,pX:v.pageX,pY:v.pageY,k:d.k,o:E.css('opacity')};
 E.css({opacity:0.9});$().mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
 return false;
 });
});},
f=function(k){return parseInt(E.css(k))||false;};
})(jQuery);

jQuery(document).ready(function(){
	$("#xextr").click(function() {
		$.ajax({
			'url':"estrazioniforum.html",
			'cache': false,
			'dataType': 'html',
			'type':'GET',
			success: function(msg)
			{
				$('<div id="xex"><h6>Estrazioni del Lotto</h6><button id="popxex" onclick="$(this).parent().remove()"><img src="/img/close.gif"/></button><p>'+ msg +'</p></div>').appendTo(document.body);
				$('#xex').css("top","180px");
				$('#xex').css("left","60px");
				$('#xex').css("display","");
				$('#xex').css("z-index","1000");
				$('#xex').css("position","absolute");
				$('#xex h6').css("cursor","move");
				$('#xex').jqDrag('h6');
			}
		})
	});
});  // end jQuery(document).ready(function()
