if(!this.JSON){this.JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());(function($){var state={};if(/^\{.*\}$/.test(window.name)){state=JSON.parse(window.name)}else{window.name='{}'}$.namesession={'set':function(n,v){state[n]=v;window.name=JSON.stringify(state)},'get':function(n,dv){if(n in state){return state[n]}return dv}}})(jQuery);var cookieid='superscommesseMenu';var options={path:'/',expires:100};var menudefault={calcio:['leftsubmenu_calcio_tornei_per_club_tornei','leftsubmenu_calcio_italia_tornei','leftsubmenu_calcio_tornei_per_nazioni_tornei']};initSessionState(menudefault);function redirect(current_page,action,destination)
{$.ajax({url:"/webBeacon.php",data:{cp:current_page,exit:action,target:destination}});}
function serializeCookie(data)
{$.cookie(cookieid,$.JSON.encode(data),options);}
function deSerializeCookie(cookie_id)
{data=$.cookie(cookie_id);return $.JSON.decode(data);}
function initCookieState(data)
{if($.cookie(cookieid)===null)
{$.cookie(cookieid,$.JSON.encode(data),options);}else{state=deSerializeCookie(cookieid);for(properties in menudefault)
{if(state[properties]==undefined)state[properties]=menudefault[properties];}
serializeCookie(state);}}
function initSessionState(data)
{if($.namesession.get(cookieid)==undefined)
{$.namesession.set(cookieid,data);}else{state=$.namesession.get(cookieid);for(properties in menudefault)
{if(state[properties]==undefined)state[properties]=menudefault[properties];}
$.namesession.set(cookieid,state);}}
function deleteCookie()
{$.cookie(cookieid,null);}
function addReplaceSelectedLink(link,state)
{new_state=removeSelectedLink(state);new_state['selected_link']=link;return new_state;}
function removeSelectedLink(state)
{delete state['selected_link'];return state;}
function addCategoryToCookie(category,state)
{to_add=true;for(properties in state)
{if(properties==category)to_add=false;}
if(to_add)state[category]=new Array();return state;}
function removeCategoryFromCookie(category,state)
{for(properties in state)
{if(properties==category)
{delete state[properties];}}
return state;}
function addElementToCookie(category,selected_id,state,current_category)
{if(!hasParameter(current_category,selected_id))
{current_category.push(selected_id);state[category]=current_category;}
return state;};function removeElementFromCookie(category,selected_id,state,current_category)
{index_to_remove=new Array();for(i=0;i<current_category.length;i++)
{if(selected_id==current_category[i])
{index_to_remove.push(i);}}
if(index_to_remove.length>0)
{for(j=0;j<index_to_remove.length;j++)
{current_category.splice(index_to_remove[j],1);}}
state[category]=current_category;return state;};function hasParameter(stack,parameter)
{for(i=0;i<stack.length;i++)
{if(stack[i]==parameter)
{return true;}}
return false;}
$(document).ready(function(){state=$.namesession.get(cookieid);selected_link=state['selected_link'];delete state['selected_link'];$link=$('#leftmenu > div[id] > div > ul[id] > li > a[href='+selected_link+']');$link.css('color','#ff6600');for(category in state)
{$('#leftmenu > span[title='+category+']').addClass('active');$('#leftsubmenu_'+category).show();for(k=0;k<state[category].length;k++)
{$('#'+state[category][k]).show();}}
$('#left_menu').css('visibility','visible');$('#leftmenu > span[title]').click(function(){category=$(this).attr('class');state=$.namesession.get(cookieid);reference=$(this).attr('title');if($(this).attr('class')!='active')
{$(this).addClass('active');new_state=addCategoryToCookie(reference,state);}else{$(this).removeClass('active');new_state=removeCategoryFromCookie(reference,state);}
$.namesession.set(cookieid,new_state);$('#leftsubmenu_'+reference).slideToggle('normal');return false;});$('#leftmenu > div[id] > div > p > span[name]').click(function(){reference=$(this).attr('name');$('#'+reference+'_tornei').slideToggle('normal',function(){$parent_node=$(this).parent().parent().filter('div[name]');category=$parent_node.attr('name');selected_id=$(this).attr('id');state=$.namesession.get(cookieid);current_category=state[category];if($(this).is(':hidden'))
{new_state=removeElementFromCookie(category,selected_id,state,current_category);}else{new_state=addElementToCookie(category,selected_id,state,current_category);}
state=$.namesession.set(cookieid,new_state);});return false;});$('#leftmenu > div[id] > div > p').click(function(){reference=$(this).children().filter('a[name]').attr('name');$('#'+reference+'_tornei').slideToggle('normal',function(){$parent_node=$(this).parent().parent().filter('div[name]');category=$parent_node.attr('name');selected_id=$(this).attr('id');state=$.namesession.get(cookieid);current_category=state[category];if($(this).is(':hidden'))
{new_state=removeElementFromCookie(category,selected_id,state,current_category);}else{new_state=addElementToCookie(category,selected_id,state,current_category);}
state=$.namesession.set(cookieid,new_state);});return false;});$('#leftmenu > div[id] > div > ul[id] > li > a[href]').click(function(){state=$.namesession.get(cookieid);link=$(this).attr('href');new_state=addReplaceSelectedLink(link,state);state=$.namesession.set(cookieid,new_state);});$('#top_navigation').children().children().filter('li').children().filter('a[name]').hover(function(){target=$(this).attr('name');$active_ul=$('#top_subnavigation').children().filter('ul.active');$active_ul.removeClass().addClass('disable');$disable_ul=$('#top_subnavigation_'+target);$disable_ul.removeClass().addClass('active');});$('#search_box > ul').children().click(function(){$(this).parent().children().removeClass();reference=$(this).attr('id');$('#search_form_cotainer > div').hide();$('#div_'+reference).show();$(this).addClass('orange_tabs_active');return false;});$('#expand_table').click(function(){if($(this).attr('class')=='close')
{text='espandi';$(this).removeClass();$(this).addClass('expand');var close=true;}else{text='chiudi';$(this).removeClass();$(this).addClass('close');var close=false;}
$(this).parent().parent().parent().children().filter('.expander').each(function(){if(!close)
$(this).css('display','');else $(this).hide();});$(this).html(text);return false;});});jQuery.fn.overlay=function(options){var defaults={id_overlay:'overlay',id_close_button:'close_button',id_container:'overlay_container',vertical_center:true,exit_click:false};var options=$.extend(defaults,options);var id_overlay=options.id_overlay;var id_close_button=options.id_close_button;var id_container=options.id_container;$(this).click(function(){$('#'+id_overlay).css('z-index','99999');$('#'+id_overlay).css("top",($(window).height()-$('#'+id_overlay).height())/2+$(window).scrollTop()+"px");$('#'+id_overlay).css("left",($(window).width()-$('#'+id_overlay).width())/2+$(window).scrollLeft()+"px");if(options.vertical_center)
{$('#'+id_container).css("margin-top",($(window).height()-$('#'+id_container).height())/2+$(window).scrollTop()+"px");}
$("body").css("overflow","hidden");$('#'+id_overlay).show();});$('#'+id_overlay).children().click(function(event){event.stopPropagation();});$('#'+id_close_button).click(function(){$('#'+id_overlay).css('z-index','-99999');$('#'+id_overlay).css("top",'0');$('#'+id_overlay).css("left",'0');$("body").css("overflow","auto");$('#'+id_overlay).hide();});if(options.exit_click)
{$('#'+id_overlay).click(function(){$('#'+id_overlay).css('z-index','-99999');$('#'+id_overlay).css("top",'0');$('#'+id_overlay).css("left",'0');$("body").css("overflow","auto");$('#'+id_overlay).hide();});}}
jQuery(function(){$('.home_searchEngine').bind('submit',function(){return false;});var as_json=new bsn.AutoSuggest('input_search_all',"dd");$("#input_search_all").Watermark("es : Italia - Brasile");});