

(function(){

		var ow = "";
		if (typeof ma288LiveOddsTableWidth != "undefined"){
		   ow = "style='width:"+ma288LiveOddsTableWidth+"px;'";
		}
        var uniqueId = Math.round(Math.random()*100); 
        document.write("<div id='ma288-widget-liveodds-"+uniqueId+"' "+ow+"><div class='ma288-raceNo' id='ma288-liveodds-raceSelector-"+uniqueId+"'></div><div id='ma288-liveodds-"+uniqueId+"'></div><div class='ma288-remark' id='ma288-liveodds-remark-"+uniqueId+"'></div></div>");

        
        function scriptLoaded(){
		    Ma288WidgetCore.getInstance().addEventListener("ready", function(){
//		        $(document).ready(function() {
		               new Ma288Widget.LiveOdds(uniqueId);
//		        });
		    });
		}
		
		if (typeof Ma288WidgetCore == 'undefined'){
		    var headID = document.getElementsByTagName("head")[0];         
		    var newScript = document.createElement('script');
		    newScript.type = 'text/javascript';
		    if (document.all){
		        newScript.onreadystatechange = function(){
		            if (newScript.readyState == "loaded"){
		                scriptLoaded();
		            }
		        }
		    }else{
		        newScript.onload=scriptLoaded;
		    }
		    
		    newScript.src = 'http://www.ma288.com/has/jscripts/ma288-widget.js';
		    headID.appendChild(newScript);
		
		}else{
		    scriptLoaded();
		}


})();

	
