var FS_SIZE_DEFAULT_WIDTH=350;var FS_SIZE_DEFAULT_HEIGHT=200;var FS_SIZE_DEFAULT_LEFT=0;var FS_SIZE_DEFAULT_TOP=0;var FS_INVALID_PARAMETER_TYPE=2104;var FS_LOWER_THAN=-1;var FS_GREATER_THAN=1;var FS_EQUAL=0;var fs_InternetExplorer=0;var fs_Mozilla=1;var fs_Opera=2;var fs_browserType=(navigator.userAgent.indexOf('Gecko')!=-1)+2*(navigator.userAgent.indexOf('Opera')!=-1);var fs_Document=document;var fs_LeftButton=1;var fs_RightButton=2;var fs_MiddleButton=4;function fs_getEvent(ev){if(ev==null)
return fs_Document.parentWindow.event;return ev;}
function fs_getTargetElement(event){if(event.target!=null)
return event.target;return event.srcElement;}
function fs_getMouseButton(ev){if(fs_browserType==fs_Mozilla){switch(ev.button){case 0:return 1;case 1:return 4;}}
return ev.button;}
function fs_getInt(src){var val=parseInt(src);if(isNaN(val))
return 0;else
return val;}
function fs_getPx(val){if(new String(val).toLowerCase().indexOf("px")==-1)
return val+'px';else return val;}
function fs_isInstanceOf(a_class,an_object){return a_class.prototype.isPrototypeOf(an_object);}
function fs_isObject(obj){return typeof(obj)=='object';}
function fs_isId(id){return isObject(getElementById(id));}
function fs_getObject(obj){if(fs_isObject(obj))
return obj;return fs_Document.getElementById(obj);}
function fs_changeParentNode(n,p){var node=fs_getObject(n);var newParent=fs_getObject(p);if(node==null||newParent==null)
return false;newParent.appendChild(node);return true;}
function fs_getDocument(doc){if(doc==null||doc.nodeName!="#document")
return fs_Document;return doc;}
function fs_getElement(parentNode,nodeName,createIfNotExist){pN=fs_getObject(parentNode,true);if(!fs_isObject(pN))
return null;for(var i=0;i<parentNode.childNodes.length;i++){var element=parentNode.childNodes.item(i);if(element.nodeName==nodeName){return element;}}
if(createIfNotExist){var element=fs_Document.createElement(nodeName);parentNode.appendChild(element);return element;}
return null;}
function fs_loadScript(filename,forceReload){if(forceReload==null)
var forceReload=false;var Head=fs_getElement(fs_getElement(fs_Document,'HTML'),'HEAD',true);var script=fs_Document.createElement('SCRIPT');script.src=filename;for(var i=0;i<Head.childNodes.length;i++){var el=Head.childNodes.item(i);if(el.nodeName=="SCRIPT"){if(el.src==script.src){var sPos=script.src.lastIndexOf("/");if(sPos!=-1)sPos++;if(forceReload!=true||confirm(script.src.substr(sPos)+" is already loaded. Do you want to reload it?")){Head.insertBefore(script,el,0);Head.removeChild(el);return;}}}}
Head.appendChild(script);}
function fs_delayCode(code,mseconds){if(isNaN(mseconds))
mseconds=1;setTimeout(function(){eval(code);},mseconds);}
function fs_addListener(obj,evStr,handler,captureEvent){evStr=new String(evStr).toLowerCase();if(evStr.substr(0,2)=='on')
evStr=evStr.substr(2,evStr.length-2);obj=fs_getObject(obj);if(obj.attachEvent)
return obj.attachEvent('on'+evStr,handler);else
if(obj.addEventListener){if(!captureEvent)
captureEvent=false
return obj.addEventListener(evStr,handler,captureEvent);}
eval(obj+'.on'+evStr+'='+handler);}
function fs_removeListener(obj,evStr,handler){evStr=new String(evStr).toLowerCase();if(evStr.substr(0,2)=='on')
evStr=evStr.substr(2,evStr.length-2);obj=fs_getObject(obj);if(obj==null)
return;if(obj.detachEvent)
return obj.detachEvent('on'+evStr,handler);else if(obj.removeEventListener){return obj.removeEventListener(evStr,handler,true);}
eval(obj+'.on'+evStr+'= null');}
function fs_setCookie(name,value,duration){var now=new Date();document.cookie=name+'='+value+';expires='+new Date(now+duration).toGMTString();}
function fs_readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function get_color_text(str,pos,c){return str.substr(0,pos)+'<spa'+'an style="color:'+c+'">'+str.substr(pos,1)+'<'+'/span>'+str.substr(pos+1);}
var str="The most challenging horse sim game";var pos=0;var colors=new Array("blue","green");function change_c(){document.getElementById("str").innerHTML=get_color_text(str,pos,colors[pos%2]);pos+=1;if(pos==str.length)
pos=0;setTimeout(change_c,100);}
function LightBox(boxWidth,topPos){this.boxWidth=boxWidth?boxWidth:600;this.topPos=topPos?topPos:100;}
LightBox.prototype.init=function(options){if($("lightb"))
Element.remove($("lightb"))
this.lightb=document.createElement("DIV");this.lightb.id="lightb";var width=options==null||options.width==null?this.boxWidth:options.width
this.lightb.innerHTML='\
    <div id="lightb_container">\
      <div id="lightb_msg" style="position: absolute; top: 0px; left: 0px;width:'+width+'px;z-index: 11;">\
        <table cellpadding="0" cellspacing="0">\
          <thead>\
            <tr>\
              <th class="lft crn"></th>\
              <td class="brd"><a class="close" href="#" onclick="lightb.hide();return false;"></a></td>\
              <th class="rgt crn"></th>\
            </tr>\
          </thead>\
          <tbody>\
            <tr>\
              <th class="lft brd"></th>\
              <td id="lightb_td">\
                <div id="lb_msg_cntr">\
                </div>\
              </td>\
              <th class="rgt brd"></th>\
            </tr>\
          </tbody>\
          <tfoot>\
            <tr>\
              <th class="lft crn"></th>\
              <td class="brd"></td>\
              <th class="rgt crn"></th>\
            </tr>\
          </tfoot>\
        </table>\
      </div>\
    </div>';document.body.appendChild(this.lightb);}
LightBox.prototype.load=function(url,options){this.init(options);var ob=this;new Ajax.Updater('lb_msg_cntr',url,{asynchronous:true,evalScripts:true,method:'GET',onComplete:function(request){ob.show();}});}
LightBox.prototype.load_image=function(src,options){if(!options)
options={max_width:800,max_height:600}
this.init();var ob=this;var img=new Image();img.src=src;var ob=this;img.onload=function(){if(img.width>options.max_width)
img.width=options.max_width;if(img.height>options.max_height)
img.height=options.max_height;$('lb_msg_cntr').appendChild(img);ob.show(20);}}
LightBox.prototype.hide=function(){if(this.lightb)
this.lightb.style.display="none";}
LightBox.prototype.display=function(message,options){if(!options)
options={type:'error'};if(!this.lightb||this.lightb.style.display!='block'){this.init();$('lb_msg_cntr').innerHTML="<span class='"+options.type+"'>"+message+"</span>";this.show();new Effect.Pulsate($('lightb_container'));}
else{$('lb_msg_cntr').innerHTML+='<br/>'+"<span class='"+options.type+"'>"+message+"</span>";if(options.shake)
new Effect.Pulsate($('lightb_container'));}}
LightBox.prototype.setWidth=function(width){this.boxWidth=width;}
LightBox.prototype.show=function(extra_width){if(!extra_width)
extra_width=0;this.lightb.style.height=document.body.offsetHeight+'px';var scrollY=this.topPos;if(document.documentElement){scrollY=document.documentElement.scrollTop+this.topPos;}
else{if(document.body.scrollTop==null)
scrollY=(window.pageYOffset+this.topPos);else
scrollY=document.body.scrollTop+this.topPos;}
var w=window.innerWidth?window.innerWidth:document.body.offsetWidth;$('lightb_container').style.visibility="hidden";this.lightb.style.display='block';this.boxWidth=$('lb_msg_cntr').offsetWidth;$('lightb_msg').style.width=(this.boxWidth+extra_width)+'px';$('lightb_container').style.visibility="visible";$('lightb_container').style.left=parseInt(((w-this.boxWidth))/2)+'px';$('lightb_container').style.top=scrollY+'px';}
function show_alert(message,options){lightb.display(message,options)}
function exclaim(message){show_alert(message,{type:'exclamation'})}
function error_popup(message){show_alert(message,{type:'error'})}
function load_popup(url,options){lightb.load(url,options);}
function hide_popup(){lightb.hide();}
function load_image(src){lightb.load_image(src)}
var lightb=new LightBox();