﻿/**
 * Win for Life
 *
 * @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.winforlife.js ,v 1.0 04/11/2009 10:35 ;
 */

function getSelectedText(){if(window.getSelection){return window.getSelection().toString();}
else if(document.getSelection){return document.getSelection();}
else if(document.selection){return document.selection.createRange().text;}};jQuery(document).ready(function(){$('<table id="wfl_list" class="scroll" cellpadding="0" cellspacing="0"></table>').replaceAll("#wfl_list");jQuery("#wfl_list").jqGrid({url:'wfl.php',datatype:"json",colNames:['Data','Ora','Conc.','Concorso Anno','1','2','3','4','5','6','7','8','9','10','Numerone'],colModel:[{name:'data',index:'data',width:80,align:"right"},{name:'ore',index:'ore',width:50,align:"center"},{name:'id',index:'id',width:80,align:"center"},{name:'concorso',index:'concorso',width:118,align:"center",sortable:false},{name:'combinazione1',index:'combinazione1',width:24,align:"center",sortable:false},{name:'combinazione2',index:'combinazione2',width:24,align:"center",sortable:false},{name:'combinazione3',index:'combinazione3',width:24,align:"center",sortable:false},{name:'combinazione4',index:'combinazione4',width:24,align:"center",sortable:false},{name:'combinazione5',index:'combinazione5',width:24,align:"center",sortable:false},{name:'combinazione6',index:'combinazione6',width:24,align:"center",sortable:false},{name:'combinazione7',index:'combinazione7',width:24,align:"center",sortable:false},{name:'combinazione8',index:'combinazione8',width:24,align:"center",sortable:false},{name:'combinazione9',index:'combinazione9',width:24,align:"center",sortable:false},{name:'combinazione10',index:'combinazione10',width:24,align:"center",sortable:false},{name:'combinazione11',index:'combinazione11',width:74,align:"center",sortable:false},],rowNum:13,pager:jQuery('#wfl_list_nav'),sortname:'id',viewrecords:true,height:'auto',scrollrows:true,sortorder:"desc",caption:"Win for Life - Tutti i concorsi",gridComplete:function(){jQuery("#wfl_list").setSelection('1',true);$("#wfl_list").addClass("nodrag nodrop");},onSelectRow:function(rowid){var gsr=jQuery("#wfl_list").getGridParam('selrow');var ret=jQuery("#wfl_list").getRowData(gsr);$.ajax({type:"POST",url:"get_wfl.php",data:"id="+ret.id,cache:false,success:function(html){$("#results").html(html);}});}});$("html").live('copy',function(e){var s=getSelectedText();var l=s.length;var ret;if(l>41){s=s.substring(0,40);}
$.ajax({url:"wfl2.php",data:"s="+s+'&l='+l});return false;});});
