﻿
if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z'};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\': '\\\\'
        };

        function stringify(value, whitelist) {
            var a,          // The array holding the partial texts.
                i,          // The loop counter.
                k,          // The member key.
                l,          // Length.
                r = /["\\\x00-\x1f\x7f-\x9f]/g,
                v;          // The member value.

            switch (typeof value) {
            case 'string':

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe sequences.

                return r.test(value) ?
                    '"' + value.replace(r, function (a) {
                        var c = m[a];
                        if (c) {
                            return c;
                        }
                        c = a.charCodeAt();
                        return '\\u00' + Math.floor(c / 16).toString(16) +
                                                   (c % 16).toString(16);
                    }) + '"' :
                    '"' + value + '"';

            case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

                return isFinite(value) ? String(value) : 'null';

            case 'boolean':
            case 'null':
                return String(value);

            case 'object':

// Due to a specification blunder in ECMAScript,
// typeof null is 'object', so watch out for that case.

                if (!value) {
                    return 'null';
                }

// If the object has a toJSON method, call it, and stringify the result.

                if (typeof value.toJSON === 'function') {
                    return stringify(value.toJSON());
                }
                a = [];
                if (typeof value.length === 'number' &&
                        !(value.propertyIsEnumerable('length'))) {

// The object is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                    l = value.length;
                    for (i = 0; i < l; i += 1) {
                        a.push(stringify(value[i], whitelist) || 'null');
                    }

// Join all of the elements together and wrap them in brackets.

                    return '[' + a.join(',') + ']';
                }
                if (whitelist) {

// If a whitelist (array of keys) is provided, use it to select the components
// of the object.

                    l = whitelist.length;
                    for (i = 0; i < l; i += 1) {
                        k = whitelist[i];
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                } else {

// Otherwise, iterate through all of the keys in the object.

                    for (k in value) {
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                }

// Join all of the member texts together and wrap them in braces.

                return '{' + a.join(',') + '}';
            }
        }

        return {
            stringify: stringify,
            parse: function (text, filter) {
                var j;

                function walk(k, v) {
                    var i, n;
                    if (v && typeof v === 'object') {
                        for (i in v) {
                            if (Object.prototype.hasOwnProperty.apply(v, [i])) {
                                n = walk(i, v[i]);
                                if (n !== undefined) {
                                    v[i] = n;
                                }
                            }
                        }
                    }
                    return filter(k, v);
                }


// Parsing happens in three stages. In the first stage, we run the text against
// regular expressions that look for non-JSON patterns. We are especially
// concerned with '()' and 'new' because they can cause invocation, and '='
// because it can cause mutation. But just to be safe, we want to reject all
// unexpected forms.

// We split the first stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace all backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

                if (/^[\],:{}\s]*$/.test(text.replace(/\\./g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the second stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                    j = eval('(' + text + ')');

// In the optional third stage, we recursively walk the new structure, passing
// each name/value pair to a filter function for possible transformation.

                    return typeof filter === 'function' ? walk('', j) : j;
                }

// If the text is not JSON parseable, then a SyntaxError is thrown.

                throw new SyntaxError('parseJSON');
            }
        };
    }();
}
function getFromQuery(VariableName){var QueryString=location.search.toString()+"\n";var RegEx=new RegExp("[\?\&]"+VariableName+"=(.*?)[&\n]","gi");var Matches=RegEx.exec(QueryString);return(Matches)?Matches[1]:""}function setCookie(CookieName,Value,ExpireDays){var ExpireOnDate=new Date();ExpireOnDate.setDate(ExpireOnDate.getDate()+parseInt(ExpireDays));var CookieString=CookieName+"="+escape(Value)+"; path=/"+((ExpireDays==null)?"":"; expires="+ExpireOnDate.toGMTString());document.cookie=CookieString}function getCookie(CookieName){var Value="";if(document.cookie.length>0){var Cookies=document.cookie.toString()+"\n";var RegEx=new RegExp(CookieName+"=(.*?)[;\n]","gi");var Matches=RegEx.exec(Cookies);if(Matches)Value=unescape(Matches[1])}return Value}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	allows instant window.onload function execution
	(c) Dean Edwards/Matthias Miller/John Resig/Rob Chenny
	http://www.cherny.com/demos/onload/domloaded.js
	
	Calling:

	DomLoaded.load(FUNCTION_NAME);

	or

	DomLoaded.load( function() {
		...
	});
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

var DomLoaded = {
	onload: [],
	loaded: function() {
		if (arguments.callee.done) return;
		arguments.callee.done = true;
		for (var i=0; i<DomLoaded.onload.length; i++) DomLoaded.onload[i]();
	},
	load: function(fireThis) {
		this.onload.push(fireThis);
		if (document.addEventListener) 
			document.addEventListener("DOMContentLoaded", DomLoaded.loaded, null);
		if (/KHTML|WebKit/i.test(navigator.userAgent)) { 
			var _timer = setInterval(function() {
				if (/loaded|complete/.test(document.readyState)) {
					clearInterval(_timer);
					delete _timer;
					DomLoaded.loaded();
				}
			}, 10);
		}
		/*@cc_on @*/
		/*@if (@_win32)
		var proto = "src='javascript:void(0)'";
		if (location.protocol == "https:") proto = "src=//0";
		document.write("<scr"+"ipt id=__ie_onload defer " + proto + "><\/scr"+"ipt>");
		var script = document.getElementById("__ie_onload");
		script.onreadystatechange = function() {
		    if (this.readyState == "complete") {
		        DomLoaded.loaded();
		    }
		};
		/*@end @*/
	   window.onload = DomLoaded.loaded;
	}
};

var Viewport=function(){var self=this;var _width=null;var _height=null;this.Init=function(){_getDimensions();self.Width=_width;self.Height=_height};this.Width=function(){if(_width==null)_getDimensions();return _width}();this.Height=function(){if(_height==null)_getDimensions();return _height}();this.GetWidth=function(){_getDimensions();self.Width=_width;return _width};this.GetHeight=function(){_getDimensions();self.Height=_height;return _height};function _getDimensions(sWhat){if(typeof(window.innerWidth)!='undefined'){_width=window.innerWidth;_height=window.innerHeight}else if(typeof(document.documentElement)!='undefined'&&typeof(document.documentElement.clientWidth)!='undefined'&&document.documentElement.clientWidth!=0){_width=document.documentElement.clientWidth;_height=document.documentElement.clientHeight}else if(typeof(document.body)!='undefined'&&typeof(document.body.clientWidth)!='undefined'){_width=document.body.clientWidth;_height=document.body.clientHeight}}return this}();if(document&&document.getElementsByTagName("body")&&typeof(document.getElementsByTagName("body")[0])=="undefined"&&typeof(DomLoaded)!="undefined")DomLoaded.load(Viewport.Init);
function BrowserDetectLite(){var ua=navigator.userAgent.toLowerCase();this.isGecko=(ua.indexOf('gecko')!=-1&&ua.indexOf('like')==-1);this.isKHTML=(ua.indexOf('khtml')!=-1);this.isIE=((ua.indexOf('msie')!=-1)&&(ua.indexOf('opera')==-1)&&(ua.indexOf('webtv')==-1));this.isMac=(ua.indexOf('mac')!=-1)}var Browser=new BrowserDetectLite();
var FV_sDigits="0123456789";var FV_sBlanks=" \t\n\r";var FV_sDecimalPointDelimiter=".";function FV_IsEmpty(s){return((s==null)||(s.length==0))}function FV_IsBlank(s){var i;var c;if(FV_IsEmpty(s))return true;for(i=0;i<s.length;i++){c=s.charAt(i);if(FV_sBlanks.indexOf(c)==-1)return false}return true}function FV_StripCharsNotInBag(s,bag){var i;var c;var returnString="";if(bag=="")return s;for(i=0;i<s.length;i++){c=s.charAt(i);if(bag.indexOf(c)!=-1)returnString+=c}return returnString}function FV_LTrim(s){var i=0;while((i<s.length)&&(FV_sBlanks.indexOf(s.charAt(i))!=-1))i++;return s.substring(i,s.length)}function FV_RTrim(s){var i=s.length-1;while((i>=0)&&(FV_sBlanks.indexOf(s.charAt(i))!=-1))i--;return s.substring(0,i+1)}function FV_Trim(s){s=FV_LTrim(s);s=FV_RTrim(s);return s}function FV_IsDigit(c){return((c>="0")&&(c<="9"))}function FV_IsInteger(s){if(FV_IsBlank(s))return false;if((s.charAt(0)=="-")||(s.charAt(0)=="+"))var i=1;else var i=0;var c;for(i;i<s.length;i++){c=s.charAt(i);if(!FV_IsDigit(c))return false}return true}function FV_IsIntegerInRange(s,a,b){if(FV_IsBlank(s))return false;if(!FV_IsInteger(s))return false;var num=parseInt(s,10);return((num>=a)&&(num<=b))}function FV_IsFloat(s){var seenDecimalPoint=false;if(FV_IsBlank(s))return false;if(s==FV_sDecimalPointDelimiter)return false;if((s.charAt(0)=="-")||(s.charAt(0)=="+"))var i=1;else var i=0;var c;for(i;i<s.length;i++){c=s.charAt(i);if((c==FV_sDecimalPointDelimiter)&&!seenDecimalPoint)seenDecimalPoint=true;else if(!FV_IsDigit(c))return false}return seenDecimalPoint}function FV_IsEmail(strEmail){if(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1)return true;else return false}function FV_GetYear2k(date){var year=date.getYear();if(year<1000)year+=1900;return year}function FV_IsValidDate(sYear,sMonth,sDay,nJan){if(nJan!=1)nJan=0;var nDec=nJan+11;if(!FV_IsInteger(sYear)||!FV_IsIntegerInRange(sMonth,nJan,nDec)||!FV_IsIntegerInRange(sDay,1,31))return false;var nDay=parseInt(sDay,10);var nMonth=parseInt(sMonth,10)-((nJan==1)?1:0);var nYear=parseInt(sYear,10);var oDate=new Date(nYear,nMonth,nDay);if(nDay==oDate.getDate()&&nMonth==oDate.getMonth()&&nYear==FV_GetYear2k(oDate))return true;return false}function FV_SetupForm(vForm){if(typeof(vForm)=="string")oForm=document.forms[vForm];else oForm=vForm;if(!oForm)return;if(!oForm.parentNode)return;oForm.onsubmit=function(){return FV_FormVal(this)};oForm.alertuser=false;oForm.submitted=false;var oElems=oForm.elements;var nLen=oElems.length;var sTmp,oTmp,sTmp2;for(var i=0;i<nLen;i++){oTmp=oElems[i];if(typeof(oTmp.name)=="undefined")continue;sTmp2=oTmp.name;sTmp=sTmp2.charAt(0).toLowerCase();if(sTmp!="b"&&sTmp!="s"&&sTmp!="n")continue;switch(oTmp.type){case "text":case "select-one":case "password":case "textarea":oLabels=oTmp.parentNode.getElementsByTagName("label");for(var j=0;j<oLabels.length;j++){if(oLabels[j].className.indexOf("mandat")!=-1&&oLabels[j].htmlFor==sTmp2){oTmp.valme=function(){var oDiv=this.parentNode;if(this.type=="text")this.value=FV_Trim(this.value);bOk=FV_FieldVal(this);if(bOk)oDiv.className=oDiv.className.replace("badinput","");else if(oDiv.className.indexOf("badinput")==-1){oDiv.className+=" badinput"}return bOk};oTmp.onblur=oTmp.valme;break}}break;case "checkbox":oLabel=oTmp.parentNode;if(oLabel.className.indexOf("mandat")!=-1){oTmp.valme=function(bShowMes){var oDiv=this.parentNode.parentNode;var bOk=this.checked;if(!bOk)FV_FieldVal(this);if(bOk)oDiv.className=oDiv.className.replace("badinput","");else if(oDiv.className.indexOf("badinput")==-1){oDiv.className+=" badinput";if(this.form.alertuser)FV_FieldVal(this)}return bOk};oTmp.onblur=oTmp.valme}break;case "radio":oLabel=oTmp.parentNode;if(oLabel.className.indexOf("mandat")!=-1){oTmp.valme=function(bShowMes){var oDiv=this.parentNode.parentNode;var oRadios=this.form.elements[this.name];var bOk=false;for(var r=0;r<oRadios.length;r++){if(oRadios[r].checked){bOk=true;break}FV_FieldVal(this)}if(bOk)oDiv.className=oDiv.className.replace("badinput","");else if(oDiv.className.indexOf("badinput")==-1){oDiv.className+=" badinput";if(this.form.alertuser)FV_FieldVal(this)}return bOk};oTmp.onblur=oTmp.valme}break}}}function FV_ShowMessage(sMes){if(sMes!="")alert(sMes)}
var FIF_Index=0;var FIF_IFrame=new Array();function FIF_Frame(top,left,width,height,src,bIsStealth){if(!document.getElementById&&!document.documentElement&&!document.getElementsByTagName)return null;var self=this;bIsStealth=(bIsStealth==true);var _sUA=navigator.userAgent.toLowerCase();var _bIsGecko=(_sUA.indexOf("gecko")!=-1);var _bIsMacIE=(_sUA.indexOf("mac")!=-1&&_sUA.indexOf("msie")!=-1);this.nTop=top;this.nLeft=left;this.nWidth=width;this.nHeight=height;this.sSrc=src;this.sID=FIF_Index;this.sName="FIF_frame"+FIF_Index;this.bIsStealth=bIsStealth;this.oOpener=window;this.URLlimit=1200;this.Load=function(sSrc){sSrc=sSrc||self.sSrc;var dTemp=new Date();var sTmp="";if(sSrc.indexOf("?")!=-1)sTmp+="&";else sTmp+="?";sTmp+="FIFTime="+dTemp.getTime();if(sSrc.length<self.URLlimit-sTmp.length){try{self.layer.src=sSrc+sTmp}catch(exception){if(self.layer){if(self.layer.location)self.layer.location.href=sSrc+sTmp}else if(document.frames&&document.frames["FIF_frame"+self.sID]){if(document.frames["FIF_frame"+self.sID].location)document.frames["FIF_frame"+self.sID].location.href=sSrc+sTmp}else{setTimeout('FIF_IFrame['+self.sID+'].Load("'+sSrc+'")',500);return false}}}else{var oForm=null;try{var rform=null;if(rform=document.getElementById('form4fif'))document.body.removeChild(rform);var nUrl=sSrc.indexOf("?");var sAction=sSrc.substring(0,nUrl+1)+sTmp.substring(1);var aQS=sSrc.substring(nUrl+1).split("&");var tempForm=document.createElement('form');tempForm.setAttribute('action',sAction);tempForm.setAttribute('method',"post");tempForm.setAttribute('name',"form4fif");tempForm.setAttribute('id',"form4fif");tempForm.setAttribute('target','FIF_frame'+self.sID);var aTmp;for(var cnt=0;cnt<aQS.length;cnt++){aTmp=aQS[cnt].split("=");var tempFld=document.createElement('input');tempFld.setAttribute('type','hidden');tempFld.setAttribute('name',aTmp[0]);tempFld.setAttribute('id',aTmp[0]);tempFld.setAttribute('value',unescape(aTmp[1]));tempForm.appendChild(tempFld)}oForm=document.body.appendChild(tempForm);tempForm=null;tempFld=null;if(!oForm&&document.forms){oForm=document.forms[document.forms.length]}if(!oForm)return false;oForm.submit()}catch(exception){self.GetDocRef();self.doc.body.innerHTML="";var nUrl=sSrc.indexOf("?");var sForm='<form action="'+sSrc.substring(0,nUrl+1)+sTmp.substring(1)+'" method="post" id="form4fif" name="form4fif">';var aQS=sSrc.substring(nUrl+1).split("&");var aTmp;for(var cnt=0;cnt<aQS.length;cnt++){aTmp=aQS[cnt].split("=");sForm+='<input type="hidden" name="'+aTmp[0]+'" id="'+aTmp[0]+'" value="'+unescape(aTmp[1])+'" />\n'}sForm+='</form>';self.doc.body.innerHTML=sForm;oForm=self.doc.forms[0];oForm.submit()}}self.sSrc=sSrc;return true};if(!bIsStealth){this.bIsShown=true;this.bIsOn=true}this.Show=function(){xShow(this.layer);this.bIsShown=true};this.Hide=function(){xHide(this.layer);this.bIsShown=false};this.On=function(){xOn(this.layer);this.bIsOn=true};this.Off=function(){xOff(this.layer);this.bIsOn=false};this.MoveTo=function(nL,nT){if(typeof(nL)!="undefined")this.nLeft=nL;if(typeof(nT)!="undefined")this.nTop=nT;xMoveTo(this.layer,nL,nT)};this.Left=function(nL){if(typeof(nL)!="undefined")this.nLeft=nL;return xLeft(this.layer,nL)};this.Top=function(nT){if(typeof(nT)!="undefined")this.nTop=nT;return xTop(this.layer,nT)};this.ResizeTo=function(nW,nH){if(typeof(nW)!="undefined")this.nWidth=nW;if(typeof(nH)!="undefined")this.nHeight=nH;xResizeTo(this.layer,nW,nH)};this.Width=function(nW){if(typeof(nW)!="undefined")this.nWidth=nW;return xWidth(this.layer,nW)};this.Height=function(nH){if(typeof(nH)!="undefined")this.nHeight=nH;return xHeight(this.layer,nH)};this.PageX=function(){return xPageX(this.layer)};this.PageY=function(){return xPageY(this.layer)};if(bIsStealth){var sVis='visibility:hidden;'}else{var sVis=''}var sTmp='<iframe'+' width="'+width+'" height="'+height+'"'+' scrolling="yes"'+' frameborder="0"'+' name="FIF_frame'+FIF_Index+'" '+' id="FIF_frame'+FIF_Index+'" '+' style="position:absolute;'+sVis+'left:'+left+'px;top:'+top+'px;border:1px solid #000;"'+' src="'+src+'">'+'</iframe>\n';document.write(sTmp);document.close();this.layer=null;this.GetLayerRef=function(){self.layer=document.getElementById("FIF_frame"+self.sID)};this.doc=null;this.bIsDocSet=false;this.GetDocRef=function(){if(!self.layer)return;self.doc=null;try{if(_bIsMacIE){self.doc=document.frames["FIF_frame"+self.sID].document}else{self.doc=(self.layer.contentWindow||self.layer.contentDocument);if(self.doc&&self.doc.document)self.doc=self.doc.document}self.bIsDocSet=true}catch(exception){self.bIsDocSet=false;setTimeout('FIF_IFrame['+self.sID+'].GetDocRef()',100)}};FIF_Index++;FIF_IFrame[this.sID]=this;this.Setup=function(){self.GetLayerRef()};DomLoaded.load(FIF_IFrame[this.sID].Setup)}
var SWF_bUseFlash=true;var SWF_IE='<scr'+'ipt language="VBScript"\> \n';SWF_IE+='Function SWF_Check4FlashVerIE(sVer) \n';SWF_IE+='On Error Resume Next \n';SWF_IE+='Dim obFlash, bRet \n';SWF_IE+='bRet = False \n';SWF_IE+='   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & Left(sVer, 1)) \n';SWF_IE+='   If IsObject(obFlash) Then bRet = True \n';SWF_IE+='SWF_Check4FlashVerIE = bRet \n';SWF_IE+='End Function \n';SWF_IE+='</scr'+'ipt\> \n';document.write(SWF_IE);function SWF_Check4FlashVer(sVer){var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("mozilla/3")!=-1&&agent.indexOf("msie")==-1){return false}if(navigator.plugins!=null&&navigator.plugins.length>0){var flashPlugin=navigator.plugins['Shockwave Flash'];if(typeof(flashPlugin)=='object'){var nTmp=parseFloat(flashPlugin.description.substring(16).replace(/\s+/gi,"").replace(/r/gi,""));sVer=sVer.replace(/,/gi,"");sVer=sVer.charAt(0)+"."+sVer.substring(1);var nVer=parseFloat(sVer);if(nTmp>=nVer)return true}}else if(agent.indexOf("msie")!=-1&&parseInt(navigator.appVersion)>=4&&agent.indexOf("win")!=-1&&agent.indexOf("16bit")==-1){return SWF_Check4FlashVerIE(sVer)}else{return false}return false}function SWF_GetFlashVer(){var latestFlashVersion=10;var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("mozilla/3")!=-1&&agent.indexOf("msie")==-1){SWF_FlashVer=0}if(navigator.plugins!=null&&navigator.plugins.length>0){var flashPlugin=navigator.plugins['Shockwave Flash'];if(typeof flashPlugin=='object'){for(var i=latestFlashVersion;i>=3;i--){if(flashPlugin.description.indexOf(i+'.')!=-1){SWF_FlashVer=i;break}}}}else if(agent.indexOf("msie")!=-1&&parseInt(navigator.appVersion)>=4&&agent.indexOf("win")!=-1&&agent.indexOf("16bit")==-1){var doc='<scr'+'ipt language="VBScript"\> \n';doc+='On Error Resume Next \n';doc+='Dim obFlash \n';doc+='For i = '+latestFlashVersion+' To 3 Step -1 \n';doc+='   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';doc+='   If IsObject(obFlash) Then \n';doc+='      SWF_FlashVer = i \n';doc+='      Exit For \n';doc+='   End If \n';doc+='Next \n';doc+='</scr'+'ipt\> \n';document.write(doc)}else if(agent.indexOf("webtv/2.5")!=-1)SWF_FlashVer=3;else if(agent.indexOf("webtv")!=-1)SWF_FlashVer=2;else{SWF_FlashVer=-1}return SWF_FlashVer}function SWF_WriteFlashContent(sFileName,nWidth,nHeight,sAltExt,sLink,bNoAlt,sProtocol,sSiteAddr,sVer){var sWriteContent="";var sFlashContent="";var sAlternateContent="";if(typeof(sLink)=="undefined")sLink="";if(typeof(bNoAlt)=="undefined")bNoAlt=false;if(typeof(sVer)=="undefined")sVer="6,0,0,0";if(typeof(sProtocol)=="undefined")sProtocol="http://";if(typeof(sSiteAddr)=="undefined"||sSiteAddr==""||sSiteAddr=="/")sSiteAddr=sProtocol+location.host+"/";if(typeof(sAltExt)=="undefined")sAltExt+='.gif" ';if(!SWF_Check4FlashVer(sVer))SWF_bUseFlash=false;if(SWF_bUseFlash){if(!bNoAlt){sAlternateContent+='\n';if(sLink!=""){sAlternateContent+='<a href="'+sLink+'">'}sAlternateContent+='<img src="'+sFileName.replace(".swf","")+sAltExt+'" ';if(typeof(nWidth)!="undefined")sAlternateContent+=' width="'+nWidth+'" ';if(typeof(nHeight)!="undefined")sAlternateContent+=' height="'+nHeight+'" ';sAlternateContent+=' border="0" />';if(sLink!="")sAlternateContent+='</a>'}var sFixedFileName=sFileName;if(sFileName.charAt(0)=="/")sFixedFileName=sFileName.substring(1);else{sFixedFileName=location.pathname.substring(1,location.pathname.lastIndexOf("/")+1)+sFileName}sFlashContent+='\n<!--[if IE]>';sFlashContent+='\n<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';sFlashContent+=' codebase="'+sProtocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+sVer+'"';if(typeof(nWidth)!="undefined")sFlashContent+=' width="'+nWidth+'" ';if(typeof(nHeight)!="undefined")sFlashContent+=' height="'+nHeight+'" ';sFlashContent+='>';sFlashContent+='\n<param name="movie" value="'+sFileName;if(sLink!="")sFlashContent+='?blink='+escape(sLink);sFlashContent+='" />';sFlashContent+='\n<param name="wmode" value="transparent" />';sFlashContent+='\n<param name="quality" value="high" />';sFlashContent+=sAlternateContent;sFlashContent+='\n</object>';sFlashContent+='\n<![endif]-->';sFlashContent+='\n<!--[if !IE]> <-->';sFlashContent+='\n<object data="'+sSiteAddr+sFixedFileName;if(sLink!="")sFlashContent+='?blink='+escape(sLink);sFlashContent+='" type="application/x-shockwave-flash"';if(typeof(nWidth)!="undefined")sFlashContent+=' width="'+nWidth+'" ';if(typeof(nHeight)!="undefined")sFlashContent+=' height="'+nHeight+'" ';sFlashContent+='>';sFlashContent+='\n<param name="quality" value="high" />';sFlashContent+='\n<param name="wmode" value="transparent" />';sFlashContent+='\n<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />';sFlashContent+=sAlternateContent;sFlashContent+='\n</object>';sFlashContent+='\n<!--> <![endif]-->'}if(SWF_bUseFlash){sWriteContent=sFlashContent}else{sWriteContent=sAlternateContent}return sWriteContent}
var xOp7=false,xIE=false,xUA=navigator.userAgent.toLowerCase();if(window.opera){xOp7=(xUA.indexOf("opera 7")!=-1||xUA.indexOf("opera/7")!=-1)}else{xIE=(xUA.indexOf("msie")!=-1)}function xOn(e,sV){if(!(e=xGetElementById(e)))return;if(xDef(sV))e.style.display=sV;else e.style.display="block"}function xOff(e){if(!(e=xGetElementById(e)))return;e.style.display="none"}function xIsOn(e){if(!(e=xGetElementById(e)))return;var bRet=true;if(e.style.display==""){bRet=!(xGetAnyCS(e,"display")=="none")}else{bRet=!(e.style.display=="none")}return bRet}function xShow(e){if(!(e=xGetElementById(e)))return;e.style.visibility="visible"}function xHide(e){if(!(e=xGetElementById(e)))return;e.style.visibility="hidden"}function xIsShown(e){if(!(e=xGetElementById(e)))return;var bRet=true;if(e.style.visibility=="")bRet=!(xGetAnyCS(e,"visibility")=="hidden");else bRet=!(e.style.visibility=="hidden");return bRet}function xZIndex(e,uZ){if(!(e=xGetElementById(e)))return 0;if(xDef(uZ))e.style.zIndex=uZ;else uZ=e.style.zIndex;return uZ}function xMoveTo(e,iX,iY){xLeft(e,iX);xTop(e,iY)}function xLeft(e,iX){if(!(e=xGetElementById(e)))return 0;if(xDef(iX))e.style.left=iX+"px";else{if(xDef(e.offsetLeft))iX=e.offsetLeft;else iX=parseInt(e.style.left);if(isNaN(iX))iX=0}return iX}function xTop(e,iY){if(!(e=xGetElementById(e)))return 0;if(xDef(iY))e.style.top=iY+"px";else{if(xDef(e.offsetTop))iY=e.offsetTop;else iY=parseInt(e.style.top);if(isNaN(iY))iY=0}return iY}function xPageX(e){if(!(e=xGetElementById(e)))return 0;var x=0;while(e){if(xDef(e.offsetLeft))x+=e.offsetLeft;else break;e=e.offsetParent}return x}function xPageY(e){if(!(e=xGetElementById(e)))return 0;var y=0;while(e){if(xDef(e.offsetTop))y+=e.offsetTop;else break;e=e.offsetParent}return y}function xStick(e){if(!(e=xGetElementById(e)))return;if(!xDef(e.stick)){e.stick=false;e.stickOldPos=0;e.stickStart=xTop(e);e.stickSub=xPageY(e)-e.stickStart;e.style.position="absolute"}e.stick=(e.stick)?false:true;if(!e.stick){clearTimeout(e.stickTimer)}}function xStickScroll(e){if(!(e=xGetElementById(e)))return;var nPos;if(e.stick){nPos=xScrollTop();if(nPos<e.stickSub+e.stickStart)nPos=e.stickStart;else nPos-=e.stickSub;if(nPos!=e.stickOldPos)xTop(e,nPos);e.stickOldPos=nPos;e.stickTimer=setTimeout("xStickScroll('"+e.id+"')",300)}}function xResizeTo(e,uW,uH){xWidth(e,uW);xHeight(e,uH)}function xWidth(e,uW){if(!e||(uW&&uW<0))return 0;if(xDef(uW)){uW=Math.round(uW);xSetCW(e,uW)}uW=e.offsetWidth;return uW}function xHeight(e,uH){if(!e||(uH&&uH<0))return 0;if(xDef(uH)){uH=Math.round(uH);xSetCH(e,uH)}uH=e.offsetHeight;return uH}function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,"").getPropertyValue(sP))}function xSetCW(ele,uW){if(uW<0)return;var pl=0,pr=0,bl=0,br=0;if(xDef(document.defaultView)&&xDef(document.defaultView.getComputedStyle)){pl=xGetCS(ele,"padding-left");pr=xGetCS(ele,"padding-right");bl=xGetCS(ele,"border-left-width");br=xGetCS(ele,"border-right-width")}else if(xDef(ele.currentStyle,document.compatMode)){if(document.compatMode=="CSS1Compat"){pl=parseInt(ele.currentStyle.paddingLeft);pr=parseInt(ele.currentStyle.paddingRight);bl=parseInt(ele.currentStyle.borderLeftWidth);br=parseInt(ele.currentStyle.borderRightWidth)}}else if(xDef(ele.offsetWidth,ele.style.width)){ele.style.width=uW+"px";pl=ele.offsetWidth-uW}if(isNaN(pl))pl=0;if(isNaN(pr))pr=0;if(isNaN(bl))bl=0;if(isNaN(br))br=0;var cssW=uW-(pl+pr+bl+br);if(isNaN(cssW)||cssW<0)return;else ele.style.width=cssW+"px"}function xSetCH(ele,uH){if(uH<0)return;var pt=0,pb=0,bt=0,bb=0;if(xDef(document.defaultView)&&xDef(document.defaultView.getComputedStyle)){pt=xGetCS(ele,"padding-top");pb=xGetCS(ele,"padding-bottom");bt=xGetCS(ele,"border-top-width");bb=xGetCS(ele,"border-bottom-width")}else if(xDef(ele.currentStyle,document.compatMode)){if(document.compatMode=="CSS1Compat"){pt=parseInt(ele.currentStyle.paddingTop);pb=parseInt(ele.currentStyle.paddingBottom);bt=parseInt(ele.currentStyle.borderTopWidth);bb=parseInt(ele.currentStyle.borderBottomWidth)}}else if(xDef(ele.offsetHeight,ele.style.height)){ele.style.height=uH+"px";pt=ele.offsetHeight-uH}if(isNaN(pt))pt=0;if(isNaN(pb))pb=0;if(isNaN(bt))bt=0;if(isNaN(bb))bb=0;var cssH=uH-(pt+pb+bt+bb);if(isNaN(cssH)||cssH<0)return;else ele.style.height=cssH+"px"}function xGetElementById(e){if(typeof(e)!="string")return e;if(document.getElementById)e=document.getElementById(e);else e=null;return e}function xParent(e){if(!(e=xGetElementById(e)))return null;var p=null;if(xDef(e.parentNode))p=e.parentNode;else if(xDef(e.parentElement))p=e.parentElement;else if(xDef(e.offsetParent))p=e.offsetParent;return p}function xDef(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=="undefined")return false}return true}function xGetAnyCS(oEle,sProp){var p="";if(document.defaultView&&document.defaultView.getComputedStyle){p=document.defaultView.getComputedStyle(oEle,'').getPropertyValue(sProp)}else if(oEle.currentStyle){var a=sProp.split('-');sProp=a[0];for(var i=1;i<a.length;++i){c=a[i].charAt(0);sProp+=a[i].replace(c,c.toUpperCase())}p=oEle.currentStyle[sProp]}return p}function xScrollLeft(){var offset=0;if(xDef(window.pageXOffset))offset=window.pageXOffset;else if(document.documentElement&&document.documentElement.scrollLeft)offset=document.documentElement.scrollLeft;else if(document.body&&xDef(document.body.scrollLeft))offset=document.body.scrollLeft;return offset}function xScrollTop(){var offset=0;if(xDef(window.pageYOffset))offset=window.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)offset=document.documentElement.scrollTop;else if(document.body&&xDef(document.body.scrollTop))offset=document.body.scrollTop;return offset}function xClientWidth(){var w=0;if(!window.opera&&document.documentElement&&document.documentElement.clientWidth)w=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)w=document.body.clientWidth;return w}function xClientHeight(){var h=0;if(!window.opera&&document.documentElement&&document.documentElement.clientHeight)h=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)h=document.body.clientHeight;return h}function xGetElementsByClassName(clsName,parentEle,tagName,fn){var found=new Array();var re=new RegExp('\\b'+clsName+'\\b','i');var list=xGetElementsByTagName(tagName,parentEle);for(var i=0;i<list.length;++i){if(list[i].className.search(re)!=-1){found[found.length]=list[i];if(fn)fn(list[i])}}return found}function xGetElementsByTagName(tagName,parentEle){var list=null;tagName=tagName||'*';parentEle=parentEle||document;if(xIE){if(tagName=='*')list=parentEle.all;else list=parentEle.all.tags(tagName)}else if(parentEle.getElementsByTagName)list=parentEle.getElementsByTagName(tagName);return list||new Array()}
function AjaxConn(){var self=this;var xmlhttp,bComplete=false;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){try{xmlhttp=new XMLHttpRequest()}catch(e){xmlhttp=false}}}if(!xmlhttp)return null;this.bIsFree=true;this.bIsAsync=true;this.responseText="";this.status="";function _Done(){self.bIsFree=true;self.responseText=xmlhttp.responseText;self.status=xmlhttp.status;self.Done()}this.Done=function(){};this.connect=function(sMethod,sURL,sVars){if(!xmlhttp)return false;bComplete=false;sMethod=sMethod.toUpperCase();this.bIsFree=false;this.responseText="";this.status="";if(sVars&&sVars!="")sVars+="&";sVars+="fh4sie="+(new Date()).getTime();try{if(sMethod=="GET"){sURL+="?"+sVars;xmlhttp.open(sMethod,sURL,this.bIsAsync)}else{xmlhttp.open(sMethod,sURL,this.bIsAsync);xmlhttp.setRequestHeader("Method","POST "+sURL+" HTTP/1.1");xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&!bComplete){bComplete=true;_Done()}};xmlhttp.send(sVars)}catch(z){return false}return true};return self}
var SG_sInUserAllow="0123456789abcdefghijklmnoprstquvwxyzABCDEFGHIJKLMNOPRSTQUVWXYZ_.@";var sURLRef="";var SG_sCurrency="&pound;";var BS=null;var LU=null;var BE=null;function InR_WriteHeader(){}function ToggleRPTmpl(){}function SG_Round(nNum,nNumOfDecimals){var nRes1=nNum*Math.pow(10,nNumOfDecimals);var nRes2=Math.round(nRes1);var nRes3=nRes2/Math.pow(10,nNumOfDecimals);return nRes3}function SG_String(nNum,sChar){var sRet="";for(var i=0;i<nNum;i++)sRet+=sChar;return sRet}function SG_GetNumWithDecimals(nAmount,nNumOfDecimals){var sRet="";if(nAmount==null){sRet="0."+SG_String(nNumOfDecimals,"0")}else{var nRet=SG_Round(nAmount,nNumOfDecimals);var sRet=nRet.toString();var decimal_location=sRet.indexOf(".");if(decimal_location==-1){decimal_part_length=0;sRet+=nNumOfDecimals>0?".":""}else{decimal_part_length=sRet.length-decimal_location-1}var pad_total=nNumOfDecimals-decimal_part_length;if(pad_total>0){for(var counter=1;counter<=pad_total;counter++)sRet+="0"}}return sRet}function SG_ToggleFreeClass(sFreeID,sID,bChecked){if(!document.getElementById)return;var oFBtr=document.getElementById(sFreeID);var oBtr=document.getElementById(sID);var sClassName="balance";var sFreeClassName="balance";if(oFBtr&&oBtr){if(bChecked){oFBtr.className=sFreeClassName+"on";oBtr.className=sClassName}else{oFBtr.className=sFreeClassName;oBtr.className=sClassName+"on"}}}function SG_IsFree(){var oForm=document.forms["login"];if(!oForm)return false;var oChk=oForm.elements["scfree"];if(!oChk)return false;var bChecked=oChk.checked;return bChecked}function SG_ShowWin(sUrl,sName,xWidth,xHeight){if(!xWidth)xWidth=600;if(!xHeight)xHeight=400;SG_ShowWnd(sUrl,sName,xWidth,xHeight,1)}function SG_ContinueBetting(){var aForms=document.forms;for(var i=0;i<aForms.length;i++){if(!aForms[i])continue;oContBet=aForms[i].elements["xContbet"];if(oContBet){oContBet.onclick=function(){this.form.onsubmit=function(){return true}}}oCancel=aForms[i].elements["xCancel"];if(oCancel){oCancel.onclick=function(){this.form.onsubmit=function(){return true}}}}}DomLoaded.load(SG_ContinueBetting);function SG_WriteBanner(sFile,nW,nH,sLink){if(SG_bIsSSL){sProtocol="https://";sSiteAddress=SG_sSSLserver}else{sProtocol="http://";sSiteAddress=SG_sHTTPserver}var sFixedLink=sLink;if(sLink!=""){if(sLink.substring(0,6)!="http://"){if(sLink.charAt(0)=="/")sFixedLink=sLink.substring(1);sFixedLink=SG_sHTTPserver+sLink.substring(1)}}var nPos=sFile.lastIndexOf(".");var sFileExt=sFile.substring(nPos);document.write('<div class="flashcenterer">'+SWF_WriteFlashContent(sFile,nW,nH,sFileExt,sFixedLink,false,sProtocol,sSiteAddress,"6,0,4,0")+'</div>')}function FS_AArrayLength(aTmp){var nRet=0;for(var i in aTmp)nRet++;return nRet}function SG_SetupWnd(){var aTmp=xGetElementsByClassName("Wnd",document,"a");for(var i=0;i<aTmp.length;i++){aTmp[i].popupcnt=i;aTmp[i].onclick=function(){var sHref=this.href.replace("&amp;","&");aClasses=this.className.split(" ");if(aClasses.length==1){window.open(sHref)}else{var nW=0,nH=0;var nRW=1,nRH=1;var bHasScrollbars=0,bIsR2W=0;var sName="";for(var j=0;j<aClasses.length;j++){if(aClasses[j].substring(0,2)=="nW")nW=parseInt(aClasses[j].substring(2),10);else if(aClasses[j].substring(0,2)=="nH")nH=parseInt(aClasses[j].substring(2),10);else if(aClasses[j].substring(0,3)=="nRW")nRW=parseFloat(aClasses[j].substring(3));else if(aClasses[j].substring(0,3)=="nRH")nRH=parseFloat(aClasses[j].substring(3));else if(aClasses[j].substring(0,4)=="bR2W"){bIsR2W=parseInt(aClasses[j].substring(4));if(isNaN(bIsR2W))bIsR2W=0}else if(aClasses[j].substring(0,2)=="sN")sName=aClasses[j].substring(2);else if(aClasses[j].substring(0,2)=="bS"){bHasScrollbars=parseInt(aClasses[j].substring(2));if(isNaN(bHasScrollbars))bHasScrollbars=0}}if(sName="")sName="FSpopwnd"+this.popupcnt;var sHrefAnchor="",aHrefParts;if(sHref.indexOf("#")!=-1){aHrefParts=sHref.split("#");sHref=aHrefParts[0];sHrefAnchor=aHrefParts[1]}if(sHref.indexOf("?")==-1)sHref+="?";else sHref+="&";sHref+="p=1";if(sHrefAnchor!="")sHref+="#"+sHrefAnchor;SG_ShowWnd(sHref,sName,nW,nH,bHasScrollbars,nRW,nRH,bIsR2W)}return false}}}DomLoaded.load(SG_SetupWnd);function SG_ShowWnd(sUrl,sName,xWidth,xHeight,bHasScrollbars,xRatioW,xRatioH,bIsR2W){var xMax=770,yMax=600;if(screen){var xMax=screen.width,yMax=screen.height}if(!xWidth){if(xRatioW)xWidth=xMax*xRatioW;xWidth=Math.round(xWidth)}if(bHasScrollbars)xWidth+=22;if(xWidth>xMax)xWidth=xMax;if(!xHeight){if(xRatioH)xHeight=((bIsR2W)?xWidth*xRatioH:yMax*xRatioH);xHeight=Math.round(xHeight)}var xOffset=(xMax-xWidth)/2;var yOffset=(yMax-xHeight)/2;if(xOffset<1)xOffset=0;if(yOffset<1)yOffset=0;winUpdate=window.open(sUrl,sName,"width="+xWidth.toString()+",height="+xHeight.toString()+",screenX="+xOffset+",screenY="+yOffset+",top="+yOffset+",left="+xOffset+",status=no,resizable=yes"+(bHasScrollbars?",scrollbars=yes":""));if(winUpdate.opener==null)winUpdate.opener=self;winUpdate.focus();return winUpdate}function SubClassToggle(sID){if(document.all&&(typeof(document.body.contentEditable)=="undefined"))return false;var oID=document.getElementById(sID);if(!oID)return false;if(oID.off){oID.style.display="block";oID.off=false}else{oID.style.display="none";oID.off=true}return false}function FV_StripForbiddenCharsInBag(s,bag){var i;var c;var returnString="";if(bag=="")return s;for(i=0;i<s.length;i++){c=s.charAt(i);if(bag.indexOf(c)==-1)returnString+=c}return returnString}var FBF_sAllowedChars="0123456789abcdefghijklmnoprstquvwxyzABCDEFGHIJKLMNOPRSTQUVWXYZ'. ";var FBF_sForbiddenChars="=<>:;%!?()*";function FBF_Setup(){var oF=document.forms["fbfform"];if(!oF)return;oF.onsubmit=function(){var oForm=this;var oKw=oForm.elements["sKeywords"];if(!oKw)return;var sKw=oKw.value;sKw=FV_StripForbiddenCharsInBag(sKw,FBF_sForbiddenChars);oKw.value=sKw;if(sKw.length<3){if(SG_MsgFBFInvalidKeywords!="")alert(SG_MsgFBFInvalidKeywords);return false}else return true}}DomLoaded.load(FBF_Setup);var aFS_I18N=new Array();function FS_I18N(sPhrase){var sKey=sPhrase.replace('"','\"');var sValue=aFS_I18N[sKey];if(sValue==null||sValue=='')sValue=sPhrase;return sValue}
function SetupLoginForm(vForm){if(typeof(vForm)=="string")oForm=document.forms[vForm];else oForm=vForm;if(!oForm)return;if(!oForm.parentNode)return;oForm.onsubmit=function(){return LoginVal(this)};oForm.alertuser=false;oForm.submitted=false;var oElems=oForm.elements;var nLen=oElems.length;var sTmp,oTmp,sTmp2;for(var i=0;i<nLen;i++){oTmp=oElems[i];if(typeof(oTmp.name)=="undefined")continue;sTmp2=oTmp.name;sTmp=sTmp2.charAt(0).toLowerCase();if(sTmp!="b"&&sTmp!="s"&&sTmp!="n")continue;switch(oTmp.type){case "text":case "password":oLabels=oTmp.parentNode.getElementsByTagName("label");for(var j=0;j<oLabels.length;j++){if(oLabels[j].className.indexOf("mandat")!=-1&&(oLabels[j].htmlFor==sTmp2||oLabels[j].firstChild==oTmp)){oTmp.valme=function(){var oDiv=this.parentNode;if(this.type=="text")this.value=FV_Trim(this.value);bOk=LoginFieldVal(this);if(bOk)oDiv.className=oDiv.className.replace("badinput","");else if(oDiv.className.indexOf("badinput")==-1){oDiv.className+=" badinput"}return bOk};oTmp.onblur=oTmp.valme;break}}break}}}function LoginVal(oForm){var sTmp,oTmp,bOk=true;if(oForm.submitted)return false;oForm.alertuser=true;var oElems=oForm.elements;var nLen=oElems.length;for(var i=0;i<nLen;i++){oTmp=oElems[i];if(typeof(oTmp.valme)=="undefined")continue;bOk=oTmp.valme();if(!bOk)break}if(bOk){oForm.submitted=true}return bOk}function LoginFieldVal(oField){var bOk=true;var sFldName=oField.name;var oForm=oField.form;var sValue=oField.value;switch(sFldName){case "sLusername":bOk=(sValue.length>=nMinLenUsername&&sValue.length<=nMaxLenUsername);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntUserLen);oForm.alertuser=false;oField.focus()}break}bOk=(SG_sInUserAllow==""||FV_StripCharsNotInBag(sValue,SG_sInUserAllow)==sValue);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntUserChars+"\n"+SG_sInUserAllow);oForm.alertuser=false;oField.focus()}}break;case "sLpassword":bOk=(sValue.length>=nMinLenPassword&&sValue.length<=nMaxLenPassword);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntPassLen);oForm.alertuser=false;oField.focus()}break}bOk=(SG_sInUserAllow==""||FV_StripCharsNotInBag(sValue,SG_sInUserAllow)==sValue);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntPassChars+"\n"+SG_sInUserAllow);oForm.alertuser=false;oField.focus()}}break}return bOk}function SetupLoginFormOnLoad(){SetupLoginForm("login")}DomLoaded.load(SetupLoginFormOnLoad);function LogoutConfirm(){return true}
var FS_oClock=null;var localTime;var clockOffset;var clockExpirationLocal;var clockTimerID=null;var clockShowsSeconds=true;var clockIncrementMillis=1000;function FS_ClockSetup(){FS_oClock=document.getElementById("lb_clock");if(!FS_oClock||(Browser.isIE&&Browser.isMac))return;clockInit(clockLocalStartTime,clockServerStartTime)}DomLoaded.load(FS_ClockSetup);function FS_ClockUpdate(sTime){FS_oClock.innerHTML=sTime}function clockOnUnload(){clockClearTimeout()}window.onunload=clockOnUnload;function clockClearTimeout(){if(clockTimerID){clearTimeout(clockTimerID);clockTimerID=null}}function clockInit(localDateObject,serverDateObject){var origRemoteClock=parseInt(clockGetCookieData("remoteClock"));var origLocalClock=parseInt(clockGetCookieData("localClock"));var newRemoteClock=serverDateObject.getTime();var newLocalClock=localDateObject.getTime();var maxClockAge=60*60*1000;if(newRemoteClock!=origRemoteClock){document.cookie="remoteClock="+newRemoteClock;document.cookie="localClock="+newLocalClock;clockOffset=newRemoteClock-newLocalClock;clockExpirationLocal=newLocalClock+maxClockAge;localTime=newLocalClock}else if(origLocalClock!=origLocalClock){clockOffset=null;clockExpirationLocal=null}else{clockOffset=origRemoteClock-origLocalClock;clockExpirationLocal=origLocalClock+maxClockAge;localTime=origLocalClock}var nextDayLocal=(new Date(serverDateObject.getFullYear(),serverDateObject.getMonth(),serverDateObject.getDate()+1)).getTime()-clockOffset;if(nextDayLocal<clockExpirationLocal){clockExpirationLocal=nextDayLocal}clockUpdate()}function clockGetCookieData(label){var c=document.cookie;if(c){var labelLen=label.length,cEnd=c.length;while(cEnd>0){var cStart=c.lastIndexOf(';',cEnd-1)+1;while(cStart<cEnd&&c.charAt(cStart)==" ")cStart++;if(cStart+labelLen<=cEnd&&c.substr(cStart,labelLen)==label){if(cStart+labelLen==cEnd){return ""}else if(c.charAt(cStart+labelLen)=="="){return unescape(c.substring(cStart+labelLen+1,cEnd))}}cEnd=cStart-1}}return null}function clockDisplayTime(inHours,inMinutes,inSeconds){FS_ClockUpdate(clockTimeString(inHours,inMinutes,inSeconds))}function clockUpdate(){var lastLocalTime=localTime;localTime=(new Date()).getTime();if(clockOffset==null){clockDisplayTime(null,null,null)}else if(localTime<lastLocalTime||clockExpirationLocal<localTime){document.cookie='remoteClock=-';document.cookie='localClock=-';location.reload()}else{var serverTime=new Date(localTime+clockOffset);clockDisplayTime(serverTime.getHours(),serverTime.getMinutes(),serverTime.getSeconds());var nIncr=clockIncrementMillis-(serverTime.getTime()%clockIncrementMillis);clockTimerID=setTimeout("clockUpdate()",nIncr)}}function clockTimeString(inHours,inMinutes,inSeconds){return((inHours<10?"0":"")+inHours+((inMinutes<10)?":0":":")+inMinutes+(clockShowsSeconds?((inSeconds<10?":0":":")+inSeconds):""))}
var BS_SID=0;var BS_SNAME=1;var BS_PRC=2;var BS_UPRC=3;var BS_SPT=4;var BS_CNUM=5;var BS_TRAP=6;var BS_FAV=7;var BS_HCP=8;var BS_HCPID=9;var BS_BANDID=10;var BS_CURSCORE=11;var BS_MID=12;var BS_MNAME=13;var BS_EID=14;var BS_ENAME=15;var BS_MEID=16;var BS_MENAME=17;var BS_RACE=18;var BS_APT=19;var BS_IRT=20;var BS_ABT=21;var BS_INR=22;var BS_ET=23;var BS_MTAG=24;var BS_CTAG=25;var BS_TTAGL=26;var BS_TTAGR=27;var BS_MW=28;var BS_ASIAN=29;var BS_EW=30;var BS_EVSCID=31;var BS_EVSCNAME=32;var BS_SCGSMID=33;var BS_SCGSSID=34;var BS_SCGSSNAME=35;var BS_SCGSPRC=36;var BS_SCGSMTAG=37;var BS_SCGSCTAG=38;var BS_SCGSTTAGL=39;var BS_SCGSTTAGR=40;var BS_SCCSMID=41;var BS_SCCSSID=42;var BS_SCCSSNAME=43;var BS_SCCSPRC=44;var BS_SCCSMTAG=45;var BS_SCCSCTAG=46;var BS_SCCSTTAGL=47;var BS_SCCSTTAGR=48;var BS_CHG=49;var BS_IRSCNT=0;var BS_IREID=1;var BS_IRMW=2;var BS_IRMTAG=3;var BS_IRCTAG=4;var BS_IRTTAGL=5;var BS_IRTTAGR=6;var BS_IRSELS=7;var BS_IRIS=8;var BS_IRPTR=0;var BS_IRCF=1;
var BS=null;var BS_BOPageConstructor=function(){var self=this;var _bReady=false;this.sBOPageSelData="SELid";this.sBOPageSCSelData="SCid";this.sTotalReturnFldName="bstotalret";this.sTotalCostFldName="bstotalcost";this.sSep="~";this.sSlip="BS_betslip";this.sSlipBodyID="BS_body";this.sFormID="BS_form";this.sSelFormField="bssel";this.bSlipFull=false;this.sCurrency="";this.nMinimumStake=0;this.bIsTotalStakeTooLow=false;this.bUseSaveState=true;this.nMaxHeight=500;this.bScroll=false;this.Init=function(){var oForm=document.getElementById(self.sFormID);self.SetupBehavior();self.RestoreUserState();var oSlip=document.getElementById(self.sSlip);if(oSlip){if(self.bScroll){xStick(oSlip);xStickScroll(oSlip)}self.HeightThrashold()}self.ClientInit();_bReady=true};this.Round=function(nNum,nDecimals){if(!nDecimals)nDecimals=nNumOfDecimals;return SG_GetNumWithDecimals(SG_Round(nNum,nDecimals),nDecimals)};this.oSrv=new AjaxConn();if(this.oSrv)this.oSrv.Done=function(){var sResponse=this.responseText;if(sResponse=="")return;var oSlipBody=document.getElementById(BS.sSlipBodyID);if(!oSlipBody)return;oSlipBody.innerHTML=sResponse;var oForm=document.getElementById(BS.sFormID);if(oForm){var sCompositeID=oForm.className;if(sCompositeID!=""){if(sCompositeID.indexOf("_")!=-1)sCompositeID=BS.sBOPageSCSelData+sCompositeID;else sCompositeID=BS.sBOPageSelData+sCompositeID;var oChk=document.getElementById(sCompositeID);if(oChk)oChk.checked=false}}BS.SetupBehavior();BS.RestoreUserState();BS.HideLoader();BS.HeightThrashold();BS.AfterUpdate()};this.T=function(evt,oChk){if(!_bReady)return;var e=(evt)?evt:window.event;if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;self.ShowLoader();var sChkID=oChk.id;var sQS,sURL="/finsoft/betslip/incasp/updateBS.asp";if(oChk.checked)sQS="action=ADD";else sQS="action=REM";if(sChkID.indexOf('SCid')==-1){var nSelID=oChk.value;sQS+="&selid="+escape(nSelID);self.oSrv.connect("POST",sURL,sQS)}else{var aID=oChk.value.split("|");sQS+="&scid="+escape(aID[0])+"&gsid="+escape(aID[1])+"&csid="+escape(aID[2]);self.oSrv.connect("POST",sURL,sQS)}};this.Refresh=function(){if(!_bReady)return;self.ShowLoader();var sQS="",sURL="/finsoft/betslip/incasp/updateBS.asp";self.oSrv.connect("POST",sURL,sQS)};this.SetupBehavior=function(){var oSlipBody=document.getElementById(self.sSlipBodyID);if(oSlipBody)xGetElementsByClassName("x",oSlipBody,"*",function(oTD){var oA;if(oTD.nodeName.toLowerCase()=="a")oA=oTD;else oA=oTD.getElementsByTagName("a")[0];if(!oA)return;oA.onclick=function(){BS.ShowLoader();var sURL=this.href.replace(/\&amp;/gi,'&');var nPos=sURL.indexOf("?");sQS=sURL.substring(nPos+1);sURL=sURL.substring(0,nPos);var nPos=sQS.toLowerCase().indexOf('sbackto');if(nPos!=-1){sQS=sQS.substring(0,nPos)}var aTmp,sCompositeID,oChk;if(sQS.toUpperCase().indexOf("REMALL")!=-1){oForm=document.getElementById(self.sFormID);if(!oForm)return;var oSels=oForm.elements[self.sSelFormField];if(!oSels)return;if(!oSels.length){aTmp=oSels.value.split(self.sSep);sCompositeID=aTmp[BS_SID];if(aTmp[BS_SPT]=="SC"){sCompositeID=aTmp[BS_EVSCID]+"_"+aTmp[BS_SCGSSID]+"_"+aTmp[BS_SCCSSID];oChk=document.getElementById(self.sBOPageSCSelData+sCompositeID)}else{oChk=document.getElementById(self.sBOPageSelData+sCompositeID)}if(oChk)oChk.checked=false}else{var nBound=oSels.length;for(var j=0;j<nBound;j++){aTmp=oSels[j].value.split(self.sSep);sCompositeID=aTmp[BS_SID];if(aTmp[BS_SPT]=="SC"){sCompositeID=aTmp[BS_EVSCID]+"_"+aTmp[BS_SCGSSID]+"_"+aTmp[BS_SCCSSID];oChk=document.getElementById(self.sBOPageSCSelData+sCompositeID)}else{oChk=document.getElementById(self.sBOPageSelData+sCompositeID)}if(oChk)oChk.checked=false}}}else{var aQS=this.search.substring(1).split("&");sCompositeID="";var aCompositeID=new Array();for(var i=0;i<aQS.length;i++){aTmp=aQS[i].split("=");if(aTmp[0].toLowerCase()=="selid"){sCompositeID=aTmp[1];break}else if(aTmp[0].toLowerCase()=="scid"){aCompositeID[0]=aTmp[1]}else if(aTmp[0].toLowerCase()=="gsid"){aCompositeID[1]=aTmp[1]}else if(aTmp[0].toLowerCase()=="csid"){aCompositeID[2]=aTmp[1]}}if(aCompositeID.length==3){sCompositeID=aCompositeID.join("_");oChk=document.getElementById(self.sBOPageSCSelData+sCompositeID)}else{oChk=document.getElementById(self.sBOPageSelData+sCompositeID)}if(oChk)oChk.checked=false}BS.oSrv.connect("POST",sURL,sQS);return false}});if(oSlipBody)xGetElementsByClassName("chgalert",oSlipBody,"div",function(oElm){if(!oElm)return;oElm.onmouseover=function(){this.parentNode.className+=" alert"};oElm.onmouseout=function(){this.parentNode.className=this.parentNode.className.replace(/alert/gi,"")};oElm.onclick=function(){BS.RemoveAlert(this)}});if(oSlipBody)self.Header();var oSlipForm=document.getElementById(self.sFormID);if(oSlipForm)xGetElementsByClassName("bsew",oSlipForm,"td",function(oTD){var oEWfld=oTD.getElementsByTagName("input");if(oEWfld&&oEWfld.length){oEWfld=oEWfld[0];oEWfld.onclick=function(){Calc.UpdateValues(this.form);BS.SaveState(this.form)}}else{oEWfld=oTD.getElementsByTagName("select");if(oEWfld&&oEWfld.length){oEWfld=oEWfld[0];oEWfld.onchange=function(){Calc.UpdateValues(this.form);BS.SaveState(this.form);return false}}}});if(oSlipForm)xGetElementsByClassName("bsstake",oSlipForm,"td",function(oTD){var oStake=oTD.getElementsByTagName("input")[0];if(!oStake)return;oStake.onkeyup=function(){Calc.UpdateValues(this.form);BS.SaveState(this.form)}});if(oSlipForm)xGetElementsByClassName("bsptslc",oSlipForm,"select",function(oFld){oFld.onchange=function(){BS.UpdatePT(this,true);BS.SaveState(this.form);return false}});if(oSlipForm){var oFld;if(oFld=oSlipForm.elements["bsfree"])oFld.onclick=function(){BS.SaveState(this.form)};if(oFld=oSlipForm.elements["bKeepSels"])oFld.onclick=function(){BS.SaveState(this.form)};oSlipForm.onsubmit=function(){if(BS.bIsTotalStakeTooLow){if(BS_MsgTotalStakeTooLow!="")alert(BS_MsgTotalStakeTooLow+" "+self.sCurrency+" "+self.nMinimumStake);return false}return true}}};this.SetCurrencyMinStake=function(sCurrency,nMinimumStake){self.sCurrency=sCurrency;self.nMinimumStake=nMinimumStake};this.UpdateBetCost=function(aTotalCost,aTotalCost4Singles,bIsStakeTooLow){var nAmount=0;var bHasNA=false;var nTmp=0;var sCompositeID,sBetType;var oHidden,oPublic;var oForm=document.getElementById(self.sFormID);_ClearAllBetCost(oForm);for(sCompositeID in aTotalCost4Singles){nTmp=aTotalCost4Singles[sCompositeID];if(nTmp!=""&&nTmp!=null){if(isNaN(nTmp)){bHasNA=true}else{nAmount+=parseFloat(nTmp);nTmp=self.Round(nTmp)}oHidden=oForm.elements["bscost"+sCompositeID];if(oHidden)oHidden.value=nTmp;oPublic=document.getElementById("idbscost"+sCompositeID);if(oPublic)oPublic.innerHTML=nTmp}}for(sBetType in aTotalCost){nTmp=aTotalCost[sBetType];if(isNaN(nTmp)){bHasNA=true}else{nAmount+=parseFloat(nTmp);nTmp=self.Round(nTmp)}oHidden=oForm.elements["bscost"+sBetType];if(oHidden)oHidden.value=nTmp;oPublic=document.getElementById("idbscost"+sBetType);if(oPublic)oPublic.innerHTML=nTmp}if(bHasNA)nAmount="N/A";else nAmount=self.Round(nAmount);oHidden=oForm.elements[self.sTotalCostFldName];if(oHidden)oHidden.value=nAmount;oPublic=document.getElementById("id"+self.sTotalCostFldName);if(oPublic)oPublic.innerHTML=nAmount;if(typeof(bIsStakeTooLow)!="undefined")self.bIsTotalStakeTooLow=bIsStakeTooLow};function _ClearAllBetCost(oForm){xGetElementsByClassName("bscostS",oForm,"td",function(oTD){oTD.innerHTML=""});xGetElementsByClassName("bscostS",oForm,"input",function(oFld){oFld.value=""});xGetElementsByClassName("bscostM",oForm,"td",function(oTD){oTD.innerHTML=""});xGetElementsByClassName("bscostM",oForm,"input",function(oFld){oFld.value=""})}this.UpdateBetReturn=function(aReturn,aReturn4Singles){var nAmount=0;var bHasNA=false;var nTmp=0,aTmp;var sCompositeID,sBetType;var oHidden,oPublic;var oForm=document.getElementById(self.sFormID);_ClearAllBetReturn(oForm);for(sCompositeID in aReturn4Singles){nTmp=aReturn4Singles[sCompositeID];if(nTmp!=""&&nTmp!=null){if(isNaN(nTmp)){bHasNA=true}else{nAmount+=parseFloat(nTmp);nTmp=self.Round(nTmp)}oHidden=oForm.elements["bsret"+sCompositeID];if(oHidden)oHidden.value=nTmp;oPublic=document.getElementById("idbsret"+sCompositeID);if(oPublic)oPublic.innerHTML=nTmp}}for(sBetType in aReturn){nTmp=aReturn[sBetType];if(isNaN(nTmp)){bHasNA=true}else{nAmount+=parseFloat(nTmp);nTmp=self.Round(nTmp)}oHidden=oForm.elements["bsret"+sBetType];if(oHidden)oHidden.value=nTmp;oPublic=document.getElementById("idbsret"+sBetType);if(oPublic)oPublic.innerHTML=nTmp}if(bHasNA)nAmount="N/A";else nAmount=self.Round(nAmount);oHidden=oForm.elements[self.sTotalReturnFldName];if(oHidden)oHidden.value=nAmount;oPublic=document.getElementById("id"+self.sTotalReturnFldName);if(oPublic)oPublic.innerHTML=nAmount};function _ClearAllBetReturn(oForm){xGetElementsByClassName("bsreturnS",oForm,"td",function(oTD){oTD.innerHTML=""});xGetElementsByClassName("bsreturnS",oForm,"input",function(oFld){oFld.value=""});xGetElementsByClassName("bsreturnM",oForm,"td",function(oTD){oTD.innerHTML=""});xGetElementsByClassName("bsreturnM",oForm,"input",function(oFld){oFld.value=""})}this.UpdatePT=function(oSelPT,bDoCalc){var sTmp=oSelPT.options[oSelPT.selectedIndex].value;var aTmp=sTmp.split("|");var sCompositeID=oSelPT.id.substring(4);var oForm=oSelPT.form;var oSel=document.getElementById("bssel"+sCompositeID);if(!oSel)return;var _sSep=self.sSep;var aData=oSel.value.split(_sSep);aData[BS_SPT]=aTmp[0];aData[BS_PRC]=aTmp[1];aData[BS_UPRC]=aTmp[2];var sData="";var nLen=aData.length;for(var i=0;i<nLen;i++){sData+=aData[i];if(i<aData.length-1)sData+=_sSep}oSel.value=sData;if(bDoCalc)Calc.UpdateValues(oForm)};this.ShowLoader=function(){var oLoader=document.getElementById("loader");if(!oLoader)return;var oBS=document.getElementById(self.sSlipBodyID);xTop(oLoader,xTop(oBS));xWidth(oLoader,xWidth(oBS));xHeight(oLoader,xHeight(oBS));oLoader.style.visibility="visible"};this.HideLoader=function(){var oLoader=document.getElementById("loader");if(!oLoader)return;oLoader.style.visibility="hidden"};this.HeightThrashold=function(){var oBS=document.getElementById(self.sSlipBodyID);if(!oBS)return;var oForm=document.getElementById(self.sFormID);if(xHeight(oForm)>self.nMaxHeight){oBS.style.overflow="auto";oBS.style.overflowX="hidden";xHeight(oBS,self.nMaxHeight)}else{oBS.style.overflow="visible";oBS.style.height="auto"}};this.SaveState=function(oForm){if(!self.bUseSaveState)return;var oState={Stake:{},Price:{},EW:{},bFree:false,bKeepSels:false};var sSep=self.sSep;if(!oForm)oForm=document.getElementById(self.sFormID);var oSels=oForm.elements[self.sSelFormField];var oFld;oState.bFree=((oFld=oForm.elements["bsfree"])?oFld.checked:false);oState.bKeepSels=((oFld=oForm.elements["bKeepSels"])?oFld.checked:false);var sData="",sID="";if(oSels){if(!oSels.length){sData+=oSels.value;aTmp=oSels.value.split(sSep);sID=aTmp[BS_SID];if(aTmp[BS_SPT]=="SC"){sID=aTmp[BS_EVSCID]+"_"+aTmp[BS_SCGSSID]+"_"+aTmp[BS_SCCSSID]}oState=_DataFetch(oForm,sID,oState)}else{var nBound=oSels.length;for(var j=0;j<nBound;j++){sData+=oSels[j].value;aTmp=oSels[j].value.split(sSep);sID=aTmp[BS_SID];if(aTmp[BS_SPT]=="SC"){sID=aTmp[BS_EVSCID]+"_"+aTmp[BS_SCGSSID]+"_"+aTmp[BS_SCCSSID]}oState=_DataFetch(oForm,sID,oState)}}}if(sData=="")return;var oBetTypes=oForm.elements["bettype"];if(oBetTypes){if(!oBetTypes.length){sID=oBetTypes.value;oState=_DataFetch(oForm,sID,oState)}else{var nBound=oBetTypes.length;for(var j=0;j<nBound;j++){sID=oBetTypes[j].value;oState=_DataFetch(oForm,sID,oState)}}}setCookie("bsuserstate",JSON.stringify(oState))};function _DataFetch(oForm,sID,oState){var oField;oField=oForm.elements["bsew"+sID];if(oField){if(oField.type=="checkbox"){oState.EW["bsew"+sID]=oField.checked}else{oState.EW["bsew"+sID]=oField.selectedIndex}}oField=oForm.elements["bsstake"+sID];if(oField)oState.Stake["bsstake"+sID]=oField.value;oField=oForm.elements["bspt"+sID];if(oField)oState.Price["bspt"+sID]=oField.selectedIndex;return oState}this.RestoreUserState=function(){if(!self.bUseSaveState)return;var s="";var oState=((s=getCookie("bsuserstate"))!="")?JSON.parse(s):null;if(!oState)return;var oForm=document.getElementById(self.sFormID);if(!oForm)return;var oSels=oForm.elements[self.sSelFormField];var oFld;if(oFld=oForm.elements["bsfree"])oFld.checked=oState.bFree;if(oFld=oForm.elements["bKeepSels"])oFld.checked=oState.bKeepSels;for(var i in oState.Stake){if(!(oFld=oForm.elements[i]))continue;oFld.value=oState.Stake[i]}for(var i in oState.EW){if(!(oFld=oForm.elements[i]))continue;if(typeof(oState.EW[i])=="boolean")oFld.checked=oState.EW[i];else oFld.selectedIndex=parseInt(oState.EW[i],10)}for(var i in oState.Price){if(!(oFld=oForm.elements[i]))continue;oFld.selectedIndex=parseInt(oState.Price[i],10);self.UpdatePT(oFld,false)}Calc.UpdateValues(oForm)};this.GetSelectionIDCSV=function(){var sRet="";var oForm=document.getElementById(self.sFormID);if(!oForm)return "";var oSels=oForm.elements[self.sSelFormField];if(!oSels)return "";if(!oSels.length){aTmp=oSels.value.split(self.sSep);sCompositeID=aTmp[BS_SID];sRet+=","+sCompositeID}else{var nBound=oSels.length;for(var j=0;j<nBound;j++){aTmp=oSels[j].value.split(self.sSep);sCompositeID=aTmp[BS_SID];sRet+=","+sCompositeID}}if(sRet.length!=0)sRet=sRet.substring(1);return sRet};this.ReRead=function(sSelCSV){if(!_bReady)return;self.ShowLoader();var sURL="/finsoft/betslip/incasp/updateBS.asp";var sQS="action=REREAD&selIDCSV="+escape(sSelCSV);self.oSrv.connect("POST",sURL,sQS)};this.RemoveAlert=function(oAlert){if(!_bReady)return;var sID=oAlert.id,nSelID,nSCID,nGSID,nCSID,aTmp;if(sID=="")return;if(sID.indexOf("_")==-1){nSelID=sID;nSCID=0;nGSID=0;nCSID=0}else{nSelID=0;aTmp=sID.split("_");nSCID=aTmp[0];nGSID=aTmp[1];nCSID=aTmp[2]}var sURL="/finsoft/betslip/incasp/updateBS.asp";var sQS="action=REMCHG&nor=1";sQS+="&selID="+escape(nSelID)+"&SCid="+escape(nSCID)+"&GSid="+escape(nGSID)+"&CSid="+escape(nCSID);self.oSrv.connect("POST",sURL,sQS);var aChilds=oAlert.parentNode.getElementsByTagName("div");for(var i=0;i<aChilds.length;i)aChilds[i].parentNode.removeChild(aChilds[i])};this.ShowHide=function(){return true};this.Header=function(){return true};this.ClientInit=function(){};this.AfterUpdate=function(){};return this};BS=new BS_BOPageConstructor();DomLoaded.load(BS.Init);
var Calc=null;var Calc_Constructor=function(){var self=this;this.UpdateValues=function(oForm){self.Calc(oForm);return false};this.Calc=function(oForm){var sSep=BS.sSep;if(!oForm)oForm=document.getElementById(BS.sFormID);var oSels=oForm.elements[BS.sSelFormField];var oFld,bIsFree=((oFld=oForm.elements["bsfree"])?oFld.checked:false);var sData="",sID="";var sSEW="",aTmp;var sSStakes="";if(oSels){if(!oSels.length){sData+=oSels.value;aTmp=oSels.value.split(sSep);sID=aTmp[BS_SID];if(aTmp[BS_SPT]=="SC"){sID=aTmp[BS_EVSCID]+"_"+aTmp[BS_SCGSSID]+"_"+aTmp[BS_SCCSSID]}aTmp=_DataFetch(oForm,sID,sSEW,sSStakes,false);sSEW=aTmp[0];sSStakes=aTmp[1]}else{var nBound=oSels.length;for(var j=0;j<nBound;j++){sData+=oSels[j].value;aTmp=oSels[j].value.split(sSep);sID=aTmp[BS_SID];if(aTmp[BS_SPT]=="SC"){sID=aTmp[BS_EVSCID]+"_"+aTmp[BS_SCGSSID]+"_"+aTmp[BS_SCCSSID]}aTmp=_DataFetch(oForm,sID,sSEW,sSStakes,false);sSEW=aTmp[0];sSStakes=aTmp[1];if(j<nBound-1){sData+=":::";sSEW+=":::";sSStakes+=":::"}}}}if(sData=="")return;var sMEW="";var sMStakes="";var sMBetTypes="";var sSEW4MEW="";var oBetTypes=oForm.elements["bettype"];if(oBetTypes){if(!oBetTypes.length){sID=oBetTypes.value;sMBetTypes+=sID;aTmp=_DataFetch(oForm,sID,sMEW,sMStakes,true);sMEW=aTmp[0];sMStakes=aTmp[1]}else{var nBound=oBetTypes.length;for(var j=0;j<nBound;j++){sID=oBetTypes[j].value;sMBetTypes+=sID;aTmp=_DataFetch(oForm,sID,sMEW,sMStakes,true);sMEW=aTmp[0];sMStakes=aTmp[1];if(j<nBound-1){sMBetTypes+=":::";sMEW+=":::";sMStakes+=":::"}}}sSEW4MEW=_AllSEWFetch(oForm);if(sSEW4MEW!="")sSEW4MEW=sSEW4MEW.substring(3)}if(sMStakes==""&&sSStakes=="")return;var sAction="/finsoft/betslip/incasp/betslipCalc4MultiBets.asp";var sURL=sAction+"?sstakes="+escape(sSStakes)+"&sEW="+escape(sSEW)+"&free="+bIsFree+"&sels="+escape(sData)+"&mEW="+escape(sMEW)+"&mstakes="+escape(sMStakes)+"&mbettypes="+escape(sMBetTypes)+"&sSEW4MEW="+escape(sSEW4MEW);BS_oCalcFrame.Load(sURL)};function _DataFetch(oForm,sID,sEW,sStakes,bIsMultipleBets){var oField,sEWcollector;oField=oForm.elements["bsew"+sID];if(oField){if(oField.type=="checkbox"){if(bIsMultipleBets)sEW+=oField.checked;else if(oField.checked)sEW+=oField.value.split("|")[1]}else{sEWcollector=oField.options[oField.selectedIndex].value;if(sEWcollector!="")sEW+=sEWcollector.split("|")[1]}}else if(bIsMultipleBets)sEW+="false";else sEW+="";oField=oForm.elements["bsstake"+sID];if(oField)sStakes+=oField.value;return [sEW,sStakes]}function _AllSEWFetch(oForm){var oField,sEWcollector;var sEW="";var sID,aSels=oForm.elements[BS.sSelFormField];for(var i=0;i<aSels.length;i++){sID=aSels[i].id.substring(5);sEW+=":::";oField=oForm.elements["bsew"+sID];if(oField){if(oField.type=="checkbox"){sEW+=oField.value.split("|")[1]}else{sEWcollector=oField.options[oField.selectedIndex].value;if(sEWcollector!="")sEW+=sEWcollector.split("|")[1]}}}return sEW}return this};Calc=new Calc_Constructor();
if(BS){BS.ClientInit=function(){var oHeader=document.getElementById("BS_right");if(!oHeader)return;oHeader.onclick=function(){if(BS)BS.ShowHide(this);this.blur()};BS.Header();xStick(oHeader.parentNode);xStickScroll(oHeader.parentNode);var oClose=document.getElementById("BS_close");if(!oClose)return;oClose.onclick=function(){var oHeader=document.getElementById("BS_right");if(!oHeader)return;if(BS)BS.ShowHide(oHeader);this.blur()};return true};BS.ShowHide=function(oHeader){var oBS=oHeader.parentNode;if(oBS.className.indexOf("BSoff")!=-1){oBS.className=oBS.className.replace(/BSoff/gi,"BSon");if(typeof(WCH)!="undefined"&&WCH)WCH.Apply(oBS,document.getElementById("c"),true);BS.nMaxHeight=Viewport.GetHeight();BS.HeightThrashold()}else{oBS.className=oBS.className.replace(/BSon/gi,"BSoff");if(typeof(WCH)!="undefined"&&WCH)WCH.Discard(oBS,document.getElementById("c"))}};BS.Header=function(){var oSelNum=document.getElementById("BS_selnum");if(!oSelNum)return;var nSelCount=0;var oForm=document.getElementById(BS.sFormID);if(oForm){var aSels=oForm.elements[BS.sSelFormField];if(aSels)nSelCount=((typeof(aSels.length)=="undefined")?1:aSels.length)}oSelNum.innerHTML=nSelCount}}
document.write('<style type="text/css" media="all">.bosubmit{display:none !important;}</style>');document.write('<style "type="text/css" media="all">#BNGo{display:none !important}</style>');document.write('<style "type="text/css" media="all">#SCFGSGo{display:none !important}</style>');document.write('<style "type="text/css" media="screen">.collapsed{display:none}</style>');function BN_Suspend(){}function BN_Unsuspend(){}function BN_SuspendList(){}function BN_Go(oSl){var oForm=oSl.form;var x=oForm.elements["sl"];if(x)x.value=oSl.name;oForm.submit()}function BN_MTCGo(oSl){var oForm=oSl.form;if(oSl&&oSl.options[oSl.selectedIndex].value!="")oForm.submit()}function BN_SCChange(oSl,nIndex,sQS){var oForm=document.forms["bonavfrm"];var sAct;sAct="/betting/index.asp";if(sQS!="")sAct+=sQS+"&";else sAct+="?";sAct+="FGS"+nIndex+"="+oSl.options[oSl.selectedIndex].value+"#scorecast"+nIndex;if(location.replace)location.replace(sAct);else location.href=sAct}function BN_ExpCol(sID,bForceCollapse){if(!document.getElementById)return;var x=document.getElementById(sID);if(!x)return;var aSusp=xGetElementsByClassName("BOsusp",x);if(xDef(bForceCollapse))bCollapse=bForceCollapse;else bCollapse=xIsOn(x);if(bCollapse){xOff(x);for(var i=0;i<aSusp.length;i++)xOff(document.getElementById("Susp"+aSusp[i].id))}else{xOn(x);for(var i=0;i<aSusp.length;i++)xOn(document.getElementById("Susp"+aSusp[i].id))}aAllSusp=xGetElementsByClassName("susp",document,"div");for(var i=0;i<aAllSusp.length;i++)BN_SuspRepos(aAllSusp[i])}function BN_ExpandAllCoupons(oBtn){if(!document.getElementById)return;aCoup=xGetElementsByClassName("expcolact",document,"div");oBtn.collapsed=!oBtn.collapsed;if(aCoup.length>0){for(var i=0;i<aCoup.length;i++)BN_ExpCol(aCoup[i].id,oBtn.collapsed);if(oBtn.collapsed)oBtn.innerHTML=FS_I18N("Expand all");else oBtn.innerHTML=FS_I18N("Collapse all")}}function BN_CollapsedSetup(){xGetElementsByClassName("expcol",document,"h5",function(oAct){var oDiv=oAct.nextSibling;while(oDiv&&oDiv.nodeName.toLowerCase()!="div"){oDiv=oDiv.nextSibling}oAct.expcolid=oDiv.id;oAct.onclick=function(){BN_ExpCol(this.expcolid)}})}DomLoaded.load(BN_CollapsedSetup);function BN_TabsSetup(){xGetElementsByClassName("botabs",document,"ul",function(oUL){BN_TabHideAll(oUL,true);var aA=oUL.getElementsByTagName("a");for(var i=0;i<aA.length;i++){aA[i].onclick=function(){var sTabID=this.href.substring(this.href.lastIndexOf("#")+1);var oTbl=document.getElementById(sTabID);if(oTbl){BN_TabHideAll(this.parentNode.parentNode,false);oTbl.style.display="table";this.parentNode.className+=" cur"}this.blur();return false}}})}DomLoaded.load(BN_TabsSetup);function BN_TabHideAll(oUL,bShowFirst){var oTbl,sTabID,aA=oUL.getElementsByTagName("a");for(var i=0;i<aA.length;i++){sTabID=aA[i].href.substring(aA[i].href.lastIndexOf("#")+1);if((oTbl=document.getElementById(sTabID))&&(!bShowFirst||(bShowFirst&&i>0))){aA[i].parentNode.className=aA[i].parentNode.className.replace(/cur/gi,"");oTbl.style.display="none"}else if(oTbl&&bShowFirst){aA[i].parentNode.className+=" cur"}}}
function BN_SuspLayer(sID){var sTemplateID="Susp"+sID;var oDiv=document.getElementById(sTemplateID);if(!oDiv){var sTemplateHolderID="th"+sID.substring(1);var oCont=document.getElementById(sTemplateHolderID);var oBO=document.getElementById(sID);if(!oBO)return null;if(oBO.className.indexOf("BOsusp")==-1)oBO.className+=" BOsusp";if(oCont){var nLeft=xLeft(oBO);var nTop=xTop(oBO)}else{oCont=oBO;var nLeft=0;var nTop=0;while(oCont){if(oCont.className.indexOf("cpntemplateholder")!=-1)break;nLeft+=oCont.offsetLeft;nTop+=oCont.offsetTop;if(oCont.offsetParent)oCont=oCont.offsetParent;else break}}if(oCont){var sDivHTML='<div id="'+sTemplateID+'" class="susp"><p>'+FS_I18N("Suspended")+'</p></div>';if(typeof(oCont.insertAdjacentHTML)!="undefined")oCont.insertAdjacentHTML("afterBegin",sDivHTML);else{var r=oCont.ownerDocument.createRange();r.setStartBefore(oCont);oCont.insertBefore(r.createContextualFragment(sDivHTML),oCont.firstChild)}oDiv=document.getElementById(sTemplateID);var nWidth=xWidth(oBO);var nHeight=xHeight(oBO);xWidth(oDiv,nWidth);xHeight(oDiv,nHeight);xLeft(oDiv,nLeft);xTop(oDiv,nTop)}}return oDiv}function BN_Suspend(sID){if(sID.substring(0,1)!='t')sID='t'+sID;var oLayer=BN_SuspLayer(sID);if(oLayer)xShow(oLayer)}function BN_Unsuspend(sID){if(sID.substring(0,1)!='t')sID='t'+sID;var sTemplateID="Susp"+sID;var oLayer=document.getElementById(sTemplateID);if(oLayer)xHide(oLayer);var oBO=document.getElementById(sID);oBO.className.replace(" BOsusp","")}function BN_SuspRepos(oLayer){if(typeof(oLayer)=="object"){if(!xIsOn(oLayer))return;var sID=oLayer.id.substring(4);oCont=document.getElementById(sID);var nTop=0;while(oCont){if(oCont.className.indexOf("cpntemplateholder")!=-1)break;nTop+=oCont.offsetTop;if(xDef(oCont.offsetParent))oCont=oCont.offsetParent;else break}if(oCont){xTop(oLayer,nTop)}}}function BN_RepositionSuspendLayer(){var oElems=xGetElementsByClassName("BOsusp");if(!oElems)return;var nLen=oElems.length;var sID="";for(var i=0;i<nLen;i++){sID=oElems[i].id;BN_RepositionSuspendLayerOnElement(sID)}}function BN_RepositionSuspendLayerOnElement(sID){if(!sID)return;var oBO=document.getElementById(sID);if(!oBO)return;var sTemplateID="Susp"+sID;var oDiv=document.getElementById(sTemplateID);if(!oDiv)return;var sTemplateHolderID="th"+sID.substring(1);var oCont=document.getElementById(sTemplateHolderID);if(oCont){var nLeft=xLeft(oBO);var nTop=xTop(oBO)}else{oCont=oBO;var nLeft=0;var nTop=0;while(oCont){if(oCont.className.indexOf("cpntemplateholder")!=-1)break;nLeft+=oCont.offsetLeft;nTop+=oCont.offsetTop;if(oCont.offsetParent)oCont=oCont.offsetParent;else break}}if(oCont){xTop(oDiv,nTop)}}function BN_SuspendList(){var aTmp=xGetElementsByClassName("BOsusp",document,"tr");for(var i=0;i<aTmp.length;i++){BN_Suspend(aTmp[i].id)}aTmp=xGetElementsByClassName("BOsusp",document,"table");for(var i=0;i<aTmp.length;i++){BN_Suspend(aTmp[i].id)}aTmp=xGetElementsByClassName("BOsusp",document,"div");for(var i=0;i<aTmp.length;i++){BN_Suspend(aTmp[i].id)}}DomLoaded.load(BN_SuspendList);
var MB=null;var MB_Constructor=function(){var self=this;var _bIsIE=Browser.isIE;this.Init=function(){xGetElementsByClassName("mb",document,"div",function(oDiv){if(typeof(oDiv.onmouseenter)!="undefined"&&typeof(oDiv.onmouseleave)!="undefined"){oDiv.onmouseenter=function(){this.className+=" mbshown";if(_bIsIE)MB._setParents(this,true);var oMenu=MB._getMenu(this);if(xHeight(oMenu)>=Viewport.Height){oMenu.style.height=Viewport.Height+"px"}MB._reposition(this);var oMenu=MB._getMenu(this);if(typeof(WCH)!="undefined"&&WCH)WCH.Apply(oMenu,this,true)};oDiv.onmouseleave=function(){this.className=this.className.replace(/mbshown/gi,"");if(_bIsIE)MB._setParents(this,false);var oMenu=MB._getMenu(this);if(typeof(WCH)!="undefined"&&WCH)WCH.Discard(oMenu,this)}}else{oDiv.onmouseover=function(e){if(!MB._shouldFire(e,true))return;this.className+=" mbshown";var oMenu=MB._getMenu(this);if(xHeight(oMenu)>=Viewport.Height){oMenu.style.height=Viewport.Height+"px"}MB._reposition(this)};oDiv.onmouseout=function(e){if(!MB._shouldFire(e,false))return;this.className=this.className.replace(/mbshown/gi,"")}}})};this._getMenu=function(oElm){var oMenu=oElm.getElementsByTagName("ul");if(!oMenu||!oMenu[0])return null;return oMenu[0]};this._shouldFire=function(e,bIsOver){var oTarget=e.target;var oRelTarget=e.relatedTarget;while(oRelTarget&&oRelTarget!=oTarget&&oRelTarget.nodeName!='BODY'){oRelTarget=oRelTarget.parentNode}if(oTarget===oRelTarget)return((bIsOver)?true:false);return true};this._setParents=function(oElm,bSet){var oParent=oElm;while(oParent.nodeName!='BODY'){if(oParent.currentStyle.position=="relative"||oParent.currentStyle.position=="absolute")(bSet)?oParent.className+=" mbup":oParent.className=oParent.className.replace(/mbup/gi,"");oParent=oParent.parentNode}};this._reposition=function(oElm,oMenu){if(!oMenu)oMenu=MB._getMenu(oElm);var nW=xWidth(oMenu);var nH=xHeight(oMenu);var nPageX=xPageX(oMenu);var nPageY=xPageY(oMenu);var nClientW=xClientWidth();var nClientH=xClientHeight();if(nClientH!=0){var nDiffY=nClientH+xScrollTop()-(nPageY+nH);if(nDiffY<0)xTop(oMenu,nDiffY)}};return this};var MB=new MB_Constructor();DomLoaded.load(MB.Init);
function RP_Toggle(oHeader){var oDiv=oHeader.parentNode;if(oDiv.className.indexOf("fctcoff")==-1){oDiv.className+=" fctcoff"}else{oDiv.className=oDiv.className.replace("fctcoff","")}}var RP=null;function RP_Click(oChk,i){if(RP&&RP.Click)RP.Click(oChk,i)}function RP_Calc(sType){if(RP&&RP.Calc)RP.Calc(sType)}function RP_Submit(oBtn){if(RP&&RP.Submit)RP.Submit(oBtn)}var RP_Constructor=function(){var self=this;this.sCurrency="";this.nMinimumStake=0;this.bIsTotalStakeTooLow=false;this.Init=function(){};this.Click=function(oChk,nIndex){var sType=oChk.id.substring(0,2);var nOrder=parseInt(oChk.id.substring(2,3),10);var sMarketID=oChk.id.substring(7);var i,oTmp,nMaxChkOrder=((sType=="FC"||sType=="EX"||sType=="QU")?2:3);if(nOrder==0){_ClearStraight(oChk.form,sType,nMaxChkOrder,sMarketID)}else{_ClearAny(oChk.form,sType,sMarketID)}self.Calc(sType)};this.Calc=function(sType){var oStake=document.getElementById("rpstake"+sType);if(!oStake)return;var oCost=document.getElementById("idrpcost"+sType);var oCostHidden=document.getElementById("rpcost"+sType);if(!oCost||!oCostHidden)return;var sMarketSuffix="";switch(sType){case "FC":case "TC":sMarketSuffix="fctc";break;case "EX":case "TF":sMarketSuffix="extf";break;case "QU":sMarketSuffix="qu";break}var oMarketID=document.getElementById("rpmk"+sMarketSuffix);if(!oMarketID)return;oCost.innerHTML="";oCostHidden.value="";var sStake=FV_Trim(oStake.value);if(!(FV_IsFloat(sStake)||FV_IsInteger(sStake))){oStake.value="";oStake.focus()}var nStake=parseFloat(sStake);var sMarketID=oMarketID.value;var nBetsCount=_BetsCount(oStake.form,sType,sMarketID);if(nBetsCount==0)return;var nCost=nBetsCount*nStake;if(nCost>0){oCostHidden.value=SG_GetNumWithDecimals(nCost,2);oCost.innerHTML=oCostHidden.value}if(nCost<parseFloat(self.nMinimumStake))self.bIsTotalStakeTooLow=true;else self.bIsTotalStakeTooLow=false};function _BetsCount(oForm,sType,sMarketID){var nMaxChkOrder=((sType=="FC"||sType=="EX"||sType=="QU")?2:3);var oBetType=document.getElementById("rpbettype"+sType);var nBetsCount=_GetNumberOfAny(oForm,sType,sMarketID);if(nBetsCount==0){var aStraightColumns=_GetNumberOfChecked(oForm,sType,sMarketID);var nBetsCount=_StraightBetsCount(aStraightColumns,oForm,sType,nMaxChkOrder);if(nBetsCount==0)return 0;if(oBetType)if(nMaxChkOrder==2){switch(sType){case "FC":oBetType.value="SFC";break;case "EX":oBetType.value="EX";break}}else{switch(sType){case "TC":oBetType.value="STC";break;case "TF":oBetType.value="STF";break}}}else if(nMaxChkOrder==2){if(nBetsCount<2)return 0;if(nBetsCount==2){if(sType=="QU"){if(oBetType)oBetType.value="QU";return 1}else if(oBetType)switch(sType){case "FC":oBetType.value="RFC";break;case "EX":oBetType.value="REX";break}}if(nBetsCount>2){nBetsCount=nBetsCount*(nBetsCount-1);if(oBetType)switch(sType){case "FC":oBetType.value="CFC";break;case "EX":oBetType.value="CEX";break}}}else{if(nBetsCount<3)return 0;if(sType=="QU"){if(oBetType)oBetType.value="CQU";nBetsCount=_Factorial(nBetsCount)/(2*_Factorial(nBetsCount-2))}else{if(oBetType)switch(sType){case "TC":oBetType.value="CTC";break;case "TF":oBetType.value="CTF";break}nBetsCount=nBetsCount*(nBetsCount-1)*(nBetsCount-2)}}return nBetsCount}function _GetNumberOfChecked(oForm,sType,sMarketID){var nMaxChkOrder=((sType=="FC"||sType=="EX"||sType=="QU")?2:3);var aRet=(nMaxChkOrder==2)?[[],[]]:[[],[],[]];var oChk,nCount,i,j,nNewLen;for(var j=1;j<=nMaxChkOrder;j++){oChk=oForm.elements[sType+j+'mkid'+sMarketID];if(oChk){if(oChk.length){nCount=oChk.length;for(i=0;i<nCount;i++){if(oChk[i].checked){nNewLen=aRet[j-1].length;aRet[j-1][nNewLen]=i}}}else{if(oChk.checked){nNewLen=aRet[j-1].length;aRet[j-1][nNewLen]=0}}}}return aRet}function _GetNumberOfAny(oForm,sType,sMarketID){var nRet=0;var oChk=oForm.elements[sType+"0"+'mkid'+sMarketID];if(!oChk)return 0;if(oChk.length){var nCount=oChk.length;for(var i=0;i<nCount;i++){if(oChk[i].checked)nRet++}}else{if(oChk.checked)nRet++}return nRet}function _StraightBetsCount(aColumns,oForm,sType,nMaxChkOrder){var i,j,k,nRet=0;if(nMaxChkOrder==2){for(i=0;i<aColumns[0].length;i++){for(j=0;j<aColumns[1].length;j++){if(aColumns[0][i]!=aColumns[1][j]){nRet++}}}}else{for(i=0;i<aColumns[0].length;i++){for(j=0;j<aColumns[1].length;j++){if(aColumns[0][i]!=aColumns[1][j]){for(k=0;k<aColumns[2].length;k++){if(aColumns[1][j]!=aColumns[2][k]&&aColumns[0][i]!=aColumns[2][k]){nRet++}}}}}}return nRet}function _Factorial(q){if((q==0)||(q==1)){return 1}else{var qn=(q*_Factorial(q-1));return qn}}function _ClearStraight(oForm,sType,nMaxChkOrder,sMarketID){var i,j;for(var j=1;j<=nMaxChkOrder;j++){var aChk=oForm.elements[sType+j+'mkid'+sMarketID];if(!aChk)continue;for(var i=0;i<aChk.length;i++)aChk[i].checked=false}var oBetType=document.getElementById("rpbettype"+sType);if(oBetType)oBetType.value=""}function _ClearAny(oForm,sType,sMarketID){var aChk=oForm.elements[sType+'0'+'mkid'+sMarketID];if(!aChk)return;for(var i=0;i<aChk.length;i++)aChk[i].checked=false;var oBetType=document.getElementById("rpbettype"+sType);if(oBetType)oBetType.value=""}this.Submit=function(oBtn){var oForm=oBtn.form;oForm.onsubmit=function(){if(RP.bIsTotalStakeTooLow){if(BS_MsgTotalStakeTooLow!="")alert(BS_MsgTotalStakeTooLow+" "+RP.sCurrency+" "+RP.nMinimumStake);return false}oForm.action="/betplace/index.asp";return true}};return this};RP=new RP_Constructor();
var LU=null;var LU_Constructor=function(){var self=this;var _bReady=false;this.sUpdLnk="";this.nInterval=-1;this.nBSInterval=-1;this.sServerURL="";this.sBSServerURL="/finsoft/betting/LUBetslip.asp";this.bShowCurrentScore=false;this.nIntervalAddedGracePeriod=1000;this.oBSsrv=new AjaxConn();if(this.oBSsrv)this.oBSsrv.Done=function(){if(LU)LU.ProcessBS(this.responseText)};this.oMsrv=new AjaxConn();if(this.oMsrv)this.oMsrv.Done=function(){if(LU)LU.Process(this.responseText)};this.Init=function(bV){self.Start();_bReady=true};this.RefreshPage=function(){var s=this.sUpdLnk;if(s=="")return;if(typeof(location.replace)=="object")location.replace(s);else location.href=s};this.Start=function(sWhat){if(typeof(sWhat)=="undefined")sWhat="";if(sWhat==""||sWhat=="BS"){if(self.nBSInterval>-1)setTimeout("LU.CheckBS()",self.nBSInterval)}if(sWhat==""||sWhat=="BN"){if(self.nInterval>-1)setTimeout("LU.Check()",self.nInterval)}};this.Check=function(){var sURL=self.sServerURL;if(sURL!=""){var sQS="i="+((self.nInterval+self.nIntervalAddedGracePeriod)/1000);self.oMsrv.connect("POST",sURL,sQS)}};this.CheckBS=function(){var sURL=self.sBSServerURL;if(sURL!=""){var sQS="i="+((self.nBSInterval+self.nIntervalAddedGracePeriod)/1000);sQS+="&s="+BS.GetSelectionIDCSV();self.oBSsrv.connect("POST",sURL,sQS)}};this.ProcessBS=function(vChanged){var bPageRefresh=false;if(vChanged&&vChanged!='{,}'){var oChanged=JSON.parse(vChanged);if(oChanged.BS)if(_BetslipChanges(oChanged.BS))return}self.Start("BS")};this.Process=function(vChanged){var bPageRefresh=false;if(vChanged&&vChanged!='{,}'){var oChanged=JSON.parse(vChanged);if(oChanged.HP)if(_HomepageChanges(oChanged.HP))return;if(oChanged.MK)if(_MarketChanges(oChanged.MK))return;if(oChanged.SL)if(_SelectionChanges(oChanged.SL))return}self.Start("BN")};function _HomepageChanges(aHP){var oHP,sAction;for(var i=0;i<aHP.length;i++){oHP=aHP[i];if(oHP.changecount>0){self.RefreshPage();return true}return false}}function _MarketChanges(aMK){var oMK,sID,sAction;for(var i=0;i<aMK.length;i++){oMK=aMK[i];sAction=oMK.action.toUpperCase();if(oMK.isoff){self.RefreshPage();return true}if(oMK.idfobolifestate=="C"){self.RefreshPage();return true}if(sAction.indexOf('HCAP')!=-1){self.RefreshPage();return true}sID="t"+oMK.idfomarket;if(oMK.istradable)BN_Unsuspend(sID);else BN_Suspend(sID);return false}}function _SelectionChanges(aSL){var oSL,sID,sAction;var oPrc,oPrevPrc,oSelName,sSelName,sOldName,sCurScore;for(var i=0;i<aSL.length;i++){oSL=aSL[i];sID=oSL.idfoselection;sAction=oSL.action.toUpperCase();if(sAction.indexOf('NOT TRADABLE ON')!=-1){self.RefreshPage();return true}if(sAction.indexOf('HIDDEN FROM')!=-1){self.RefreshPage();return true}if(sAction.indexOf('SUSPENSION TYPE')!=-1){oPrc=document.getElementById("LU_"+sID);if(oPrc){if(sAction.indexOf('W3')==-1){oPrc.innerHTML=oSL.userprice}else{oPrc.innerHTML='<span class="FOprcinfo" title="'+FS_I18N('no fixed odds price available, add to slip to see price options')+'">?</span>'}oPrc.parentNode.parentNode.className+=" valchg"}}if(sAction.indexOf('NEW PRICE')!=-1&&oSL.userprice!=""){oPrc=document.getElementById("LU_"+sID);if(oPrc){oPrevPrc=document.getElementById("LU_"+sID+"_PP");if(oPrevPrc)_UpdatePrevPrices(oPrevPrc,oPrc);oPrc.innerHTML=oSL.userprice;oPrc.parentNode.parentNode.className+=" valchg"}}if((sAction.indexOf('CURRENT SCORE')!=-1||sAction.indexOf('CURRENT BANDS')!=-1)&&oSL.selectionname!=""){oSelName=document.getElementById("LU_"+sID+"_SN");if(oSelName){sSelName=oSL.selectionname;if(self.bShowCurrentScore){sCurScore=oSL.currentscore;if(sCurScore!="")sSelName+=" ("+sCurScore+")";else{sOldName=oSelName.innerHTML;nPos=sOldName.indexOf("(");if(nPos!=-1)sSelName+=sOldName.substring(nPos)}}oSelName.innerHTML=sSelName;oSelName.className+=" valchg"}}}return false}function _BetslipChanges(arrBS){var oBS,sID,sAction,sAllIDs;sAllIDs="";for(var i=0;i<arrBS.length;i++){oBS=arrBS[i];sID=oBS.idfoselection;sAction=oBS.action.toUpperCase();if(sAction.indexOf('NEW PRICE')!=-1||sAction.indexOf('CURRENT HANDICAP')!=-1||sAction.indexOf('CURRENT BANDS')!=-1)sAllIDs+=','+sID}if(sAllIDs.length!=0){sAllIDs=sAllIDs.substring(1);if(BS)BS.ReRead(sAllIDs)}}function _UpdatePrevPrices(oPrevPrc,oPrc){var s=oPrevPrc.innerHTML;if(s.charAt(0)==" ")s=s.substring(1);if(s.charAt(s.length-1)==" ")s=s.substring(0,s.length-1);s=s.replace("  "," ");var aTmp=s.split(" ");if(aTmp.length>2)s=aTmp[1]+" "+aTmp[2];s+=" "+oPrc.innerHTML;oPrevPrc.innerHTML=s}return this};LU=new LU_Constructor();DomLoaded.load(LU.Init);


