var MenuWn=null;function ClosePopup(){if(MenuWn!=null){if(!MenuWn.closed){MenuWn.close();MenuWn=null;}}}function pop(id){var popups=getCookie("popups");ClosePopup();if(popups!=null&&popups==1){MenuWn=window.open("showSingleResult?id="+id,"POPUP_MENU1","screenX=0,screenY=0,width=730,height=520,resizable=1,scrollbars=yes,menubar=yes,location=yes,toolbar=yes");}else{document.location="showSingleResult?id="+id;}return false;}function popM(ids,anchor){var popups=getCookie("popups");ClosePopup();if(popups!=null&&popups==1){if(anchor.length==0){MenuWn=window.open("showMultiResult?id="+ids,"POPUP_MENU1","screenX=0,screenY=0,width=730,height=520,resizable=1,scrollbars=yes,menubar=yes,location=yes,toolbar=yes");}else{MenuWn=window.open("showMultiResult?id="+ids+"&a="+anchor,"POPUP_MENU1","screenX=0,screenY=0,width=730,height=520,resizable=1,scrollbars=yes,menubar=yes,location=yes,toolbar=yes");}}else{if(anchor.length==0){document.location="showMultiResult?id="+ids;}else{document.location="showMultiResult?id="+ids+"&a="+anchor;}}return false;}function specialSubmit(form){if(typeof(window.bcorg_embed_node)!="undefined"&&bcorg_embed_node!=null){$("#"+bcorg_embed_node).load(form.action,formToJSON(form));return false;}else{return true;}}function formToJSON(form){var jsonForm=new Object;var elemArray=form.elements;for(var i=0;i<elemArray.length;i++){var element=elemArray[i];var elemType=element.type.toUpperCase();var elemName=element.name;if(elemName){if(elemType=="TEXT"||elemType=="TEXTAREA"||elemType=="PASSWORD"||elemType=="HIDDEN"){jsonForm[elemName]=element.value;}else{if(elemType=="CHECKBOX"&&element.checked){jsonForm[elemName]=element.value?element.value:"On";}else{if(elemType=="RADIO"&&element.checked){jsonForm[elemName]=element.value;}else{if(elemType.indexOf("SELECT")!=-1){for(var j=0;j<element.options.length;j++){var option=element.options[j];if(option.selected){jsonForm[elemName]=option.value?option.value:option.text;}}}}}}}}return jsonForm;}function specialLink(url){if(typeof(window.bcorg_embed_node)!="undefined"&&bcorg_embed_node!=null){if(url.match("^http")==null&&url.charAt(0)!="/"){url="/bcorg/embed/matchmaker/"+url;}$("#"+bcorg_embed_node).load(url);}else{document.location=url;}}function setCookie(name,value,expires,path,domain,secure){if(value==null){return;}var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"");}function getCookie(sName){var results=document.cookie.match("(^|;) ?"+sName+"=([^;]*)(;|$)");if(results){return(unescape(results[2]));}else{return null;}}function redisplayTricks(){var allNodes=document.body.getElementsByTagName("p");var oCurrent;var oAttribute;var loadStyle="TT";for(var i=0;i<allNodes.length;i++){oCurrent=allNodes[i];oAttribute=oCurrent.getAttribute?oCurrent.getAttribute("basec"):null;if(typeof oAttribute=="string"&&oAttribute.length>0&&oCurrent.firstChild.nodeValue&&oCurrent.firstChild.nodeValue.length>0){if(oCurrent.firstChild.nodeValue.indexOf("=")!=-1){loadStyle="EU";break;}if(oCurrent.firstChild.nodeValue.indexOf("+")!=-1){loadStyle="EU";}if(oCurrent.firstChild.nodeValue.indexOf("-")!=-1){loadStyle="US";}}}var style=getCookie("trickStyle");if(style==null){style=clubts!=null?clubts:loadStyle;setStyle(style);styleChecked();return;}if(loadStyle==style){return;}for(var i=0;i<allNodes.length;i++){oCurrent=allNodes[i];oAttribute=oCurrent.getAttribute?oCurrent.getAttribute("basec"):null;if(typeof oAttribute=="string"&&oAttribute.length>0&&oCurrent.firstChild.nodeValue&&oCurrent.firstChild.nodeValue.length>0){var ind=oAttribute.search(/\d/);if(ind!=-1){var baseLevel=new Number(oAttribute.substr(ind,1));var tricks=null;ind=oCurrent.firstChild.nodeValue.search(/\d+/);if(loadStyle=="US"&&ind!=-1){var dtricks=new Number(oCurrent.firstChild.nodeValue);tricks=dtricks+6+(dtricks<0?baseLevel:0);}else{if(loadStyle=="EU"){if(oCurrent.firstChild.nodeValue.indexOf("=")!=-1){tricks=baseLevel+6;}else{if(ind!=-1){var dtricks=new Number(oCurrent.firstChild.nodeValue);tricks=baseLevel+6+dtricks;}}}else{if(ind!=-1){tricks=new Number(oCurrent.firstChild.nodeValue);}}}if(tricks!=null){if(style=="US"){if(baseLevel+6<=tricks){oCurrent.firstChild.nodeValue=tricks-6;}else{oCurrent.firstChild.nodeValue=tricks-6-baseLevel;}}else{if(style=="EU"){if(baseLevel+6==tricks){oCurrent.firstChild.nodeValue="=";}else{if(baseLevel+6>tricks){oCurrent.firstChild.nodeValue=tricks-6-baseLevel;}else{oCurrent.firstChild.nodeValue="+"+(tricks-6-baseLevel);}}}else{oCurrent.firstChild.nodeValue=tricks;}}}}}}}function addOnloadHandler(myFunction){if(window.addEventListener){window.addEventListener("load",myFunction,false);}else{if(window.attachEvent){window.attachEvent("onload",myFunction);}else{window.onload=myFunction;}}}function setStyle(style){setCookie("trickStyle",style,1000,"/");redisplayTricks();}function styleChecked(){var trickStyle=getCookie("trickStyle");if(trickStyle==null){return;}if(trickStyle=="TT"){document.trickDisplay.trickdisp[0].checked=true;}else{if(trickStyle=="EU"){document.trickDisplay.trickdisp[1].checked=true;}else{if(trickStyle=="US"){document.trickDisplay.trickdisp[2].checked=true;}}}}var sortRegular=true;var hcapColumn=null;var regularColumn=null;var tablesToSort=null;function discoverColumns(){var tables=document.getElementsByTagName("table");tablesToSort=new Array();for(var t=0;t<tables.length;t++){if(/placings/.test(tables[t].className)){tablesToSort.push(tables[t]);}}if(tablesToSort.length==0){return false;}t=tablesToSort[0];for(var i=0;i<t.rows[0].cells.length;i++){if(/regcol/.test(t.rows[0].cells[i].className)){regularColumn=i;}else{if(/hcapcol/.test(t.rows[0].cells[i].className)){hcapColumn=i;}}}if(hcapColumn==null||regularColumn==null){return false;}return true;}function compareValues(v1,v2){var f1,f2;f1=parseFloat(v1);f2=parseFloat(v2);if(!isNaN(f1)&&!isNaN(f2)){v1=f1;v2=f2;}if(v1==v2){return 0;}if(v1>v2){return 1;}return -1;}function sortPlacings(button){if(hcapColumn==null&&!discoverColumns()){return;}sortRegular=!sortRegular;var sortColumn=sortRegular?regularColumn:hcapColumn;button.childNodes[0].nodeValue=sortRegular?"Sort by handicap":"Regular sort";var sortfn=function(a,b){return compareValues(b.cells[sortColumn].childNodes[0].nodeValue,a.cells[sortColumn].childNodes[0].nodeValue);};for(var tind=0;tind<tablesToSort.length;tind++){var t=tablesToSort[tind];var newRows=new Array();for(j=0;j<t.childNodes[1].rows.length;j++){newRows[j]=t.childNodes[1].rows[j];}newRows.sort(sortfn);for(i=0;i<newRows.length;i++){t.childNodes[1].appendChild(newRows[i]);}}return false;}