
var TL_UNKNOWN=0;var TL_RED=1;var TL_YELLOW=2;var TL_GREEN=3;var isIE=(-1!=navigator.userAgent.indexOf("MSIE"));function getXMLDOMObject()
{if(isIE)
{return new ActiveXObject("Microsoft.XMLDOM");}
else
{return zXmlDom.createDocument();}}
function reSizeByName(frameName)
{reSizeByNameAndDocument(top.document,frameName)}
function reSizeByNameAndDocument(documentElement,frameName)
{try
{var oFrame=documentElement.getElementById(frameName);var oBody=oFrame.contentWindow.document.body;var h;if(oFrame.contentWindow.innerHeight)
{if(oBody.scrollHeight>oBody.offsetHeight)
{h=oBody.offsetHeight;}
else
{h=oBody.scrollHeight;}}
else
{h=oBody.scrollHeight;}
var w=oBody.scrollWidth;if(h<=0||w<=0)
{return;}
oFrame.style.height=h+"px";oFrame.style.width=w+"px";}
catch(e)
{}}
function findElementById(elementId)
{return findElementByIdInDocument(document,elementId);}
function findElementByIdInDocument(document,elementId)
{var element=document.getElementById(elementId);if(element==null)
{element=top.document.getElementById(elementId);}
return element;}
function findFrameByName(frameName)
{var frame=frames[frameName];if(frame==null)
{frame=top.frames[frameName];}
return frame;}
function getInnerWidth()
{var clientHeight=0;var clientWidth=0;if(top.innerHeight)
{clientWidth=top.innerWidth;clientHeight=top.innerHeight;}
else if(top.document.documentElement&&top.document.documentElement.clientHeight)
{clientWidth=top.document.documentElement.clientWidth;clientHeight=top.document.documentElement.clientHeight;}
else if(top.document.body)
{clientWidth=top.document.body.clientWidth;clientHeight=top.document.body.clientHeight;}
return new Array(clientWidth,clientHeight);}
function getScrollingOffset()
{if(top.pageYOffset)
{scrollLeft=top.pageXOffset;scrollTop=top.pageYOffset;}
else if(top.document.documentElement&&top.document.documentElement.scrollTop)
{scrollLeft=top.document.documentElement.scrollLeft;scrollTop=top.document.documentElement.scrollTop;}
else if(top.document.body)
{scrollLeft=top.document.body.scrollLeft;scrollTop=top.document.body.scrollTop;}
return new Array(scrollLeft,scrollTop);}
function getHtmlDimension()
{if(top.document.body.scrollHeight>top.document.body.offsetHeight)
{x=top.document.body.scrollWidth;y=top.document.body.scrollHeight;}
else
{x=top.document.body.offsetWidth;y=top.document.body.offsetHeight;}
return new Array(x,y);}
function setHtmlDimension(x,y)
{if(top.document.body.scrollHeight>top.document.body.offsetHeight)
{top.document.body.scrollWidth=x;top.document.body.scrollHeight=y;}
else
{top.document.body.offsetWidth=x;top.document.body.offsetHeight=y;}}
function proccessSiteLogin(strURL)
{if(typeof top.g_SMALL_LOGIN_ENABLE!="undefined"&&top.g_SMALL_LOGIN_ENABLE==1)
{showModalWindow(g_ContextPath+"/"+g_strServiceFolderName+"/siteLoginUI.jsp",311,262);}
else
{if(strURL==null)
{strURL=g_ContextPath+"/do/login";}
window.top.location.href=strURL;}}
function hideModalWindow(replaceContentFlag)
{var modalWindow=findElementById("modalWindow");if(replaceContentFlag)
{frames['modalWindowFrame'].location.replace(g_ContextPath+"/"+g_strServiceFolderName+"/empty.jsp");}
modalWindow.style.visibility="hidden";modalWindow.style.zIndex="-1";var mask=findElementById("mask");mask.style.visibility="hidden";return false;}
function startCheckingIsPlayerInstallationFinished()
{window.setTimeout('IsPlayerInstallationFinished()',5000);}
function showModalWindow(src,width,height)
{var tempArray=getInnerWidth();var clientWidth=tempArray[0];var clientHeight=tempArray[1];tempArray=getScrollingOffset();var scrollLeft=tempArray[0];var scrollTop=tempArray[1];var modalWindow=findElementById("modalWindow");var modalWindowTop=((clientHeight-height)/2+scrollTop);if(modalWindowTop<0)
{modalWindowTop=0;}
var modalWindowLeft=((clientWidth-width)/2+scrollLeft);if(modalWindowLeft<0)
{modalWindowLeft=0;}
modalWindow.style.top=modalWindowTop+"px";modalWindow.style.left=modalWindowLeft+"px";modalWindow.style.height=height;modalWindow.style.width=width;var mwf=findElementById("modalWindowFrame");mwf.style.height=height;mwf.style.width=width;mwf.contentWindow.height=height;mwf.contentWindow.width=width;mwf.contentWindow.location.replace(src);modalWindow.style.visibility="visible";modalWindow.style.zIndex="1001";var mask=findElementById("mask");tempArray=getHtmlDimension();var x=tempArray[0];var y=tempArray[1];if(y<height)
{y=height+200;setHtmlDimension(x,y);}
mask.style.width=x+"px";mask.style.height=y+"px";mask.style.visibility="visible";}
function DoRedirectNoBack(strURL)
{if(window.top.location.replace)
{window.top.location.replace(strURL);}
else
{window.top.location.href=strURL;}}
function DoRedirect(strURL)
{if(strURL!="")
{if(strURL.indexOf("/do/login?action=login")!=-1)
{proccessSiteLogin(strURL);}
else
{window.top.location.href=strURL;}}}
function GetSwHwArray(strDBDependencies,g_PCDependencies)
{var arrSwHw=compareSWHWdependency(strDBDependencies,g_PCDependencies,0,"");return arrSwHw;}
function canPlay(strGameOs,strUserOS)
{if(strGameOs!=strUserOS)
{return false;}
if(!g_bClientInstalled)
{return false;}
return true;}
function GetSystemCompatibilityString(strRedirectURL,arrSwHw,strGameOs,strUserOS)
{var strRes="<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconNotOk.png' alt='This game is not compatible with your system and may not run properly' width='15' height='15' border='0' align='absbottom' />";if(!g_bControlInstalled||!g_bClientInstalled)
{return"";}
if(strGameOs!=strUserOS)
{return strRes;}
var iTrafficLightColor=TL_GREEN;for(var i=0;i<arrSwHw.length;i++)
{if(arrSwHw[i][0]=="DisplayAdapter")
{continue;}
else if(arrSwHw[i][1]==TL_RED)
{iTrafficLightColor=TL_RED;break;}
else if((iTrafficLightColor==TL_GREEN)&&(arrSwHw[i][1]!=TL_GREEN))
{iTrafficLightColor=arrSwHw[i][1];}
else if((iTrafficLightColor==TL_YELLOW)&&(arrSwHw[i][1]==TL_UNKNOWN))
{iTrafficLightColor=TL_UNKNOWN;}}
switch(iTrafficLightColor)
{case TL_RED:break;case TL_UNKNOWN:case TL_YELLOW:strRes="<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconWarning.png' alt='This game may not run properly or perform optimally on your system' width='15' height='15' border='0' align='absbottom' />";break;case TL_GREEN:strRes="<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconOk.png' alt='This game will run properly' width='15' height='15' border='0' align='absbottom' />";break;}
if(strRedirectURL!="")
{strRes+="<a href='"+strRedirectURL+"' target='_top' /a>";}
return strRes;}
function GetDependencyString(arrSwHw,strUserOS,bClientInstalled)
{if(bClientInstalled==false)
{return"";}
var strRet=printDependency2D(arrSwHw,g_ContextPath+"/main/osMsg.jsp","","<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconOk.png' width='15' height='15' border='0' align='absbottom' />","<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconWarning.png' width='15' height='15' border='0' align='absbottom' />","<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconNotOk.png' width='15' height='15' border='0' align='absbottom' />","<img src='"+g_strImageServerUrl+"/compatibility/compatibilityIconWarning.png' width='15' height='15' border='0' align='absbottom' />",strUserOS);return strRet;}
function HandleLaunchError(strMasterId,strInputType,strErrorCode)
{showMessageBox(g_strImageServerUrl+"/compatibility/compatibilityIconNotOkBg.png","LAUNCH ERROR","System error. Click <a style=\"color:blue;\" href=\""+g_ContextPath+"/do/general?jspName=support&pageType=User\" target=\"_top\" >here</a> to contact support.");}
function structDirections(strDirections,strDirectionsErrCode,strDirectionsErrString)
{this.strDirections=strDirections;this.strDirectionsErrCode=strDirectionsErrCode;this.strDirectionsErrString=strDirectionsErrString;}
function DownloadAndPlayGame(strMasterId,blnForcePlay,sDirections)
{var strActiveGameId=GPlayerApi_GetActiveGameId();if(!blnForcePlay)
{if(""!=strActiveGameId&&strActiveGameId!=strMasterId)
{try{ShowAnotherGameIsActiveMessage(strActiveGameId);}catch(e){}
return"7090";}}
var strPlayerAPIError=GPlayerApi_DownloadAndPlay(strMasterId,g_strProviderID,sDirections.strDirections,blnForcePlay,true,0);if("0"!=strPlayerAPIError)
{return strPlayerAPIError;}
return"0";}
function AddGameToDownloadList(strMasterId,sDirections)
{var strPlayerAPIError=GPlayerApi_AddGameToDownloadList(strMasterId,g_strProviderID,sDirections.strDirections,false);if("0"!=strPlayerAPIError)
{return strPlayerAPIError;}
strPlayerAPIError=GPlayerApi_ResumeDownloadList(g_strProviderID);if("0"==strPlayerAPIError)
{GPlayerApi_RestorePlayer("SubsDownloads");}
return"0";}
function isGameActive(playButtonAction)
{return(playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.Running||playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.RunningWithDownloading||playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.Downloading||playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.Wait||playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.WaitToRun||playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.InstallPlayer||playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.Initializing);}
function PlayGame(strMasterId,strCmdLine,arrTrafficLight,strInstallationPackagePath,strMasterName)
{var playButtonAction=getPlayButton(strMasterId);if(isGameActive(playButtonAction))
{return;}
var trackValue=getTrackingEvent(strMasterId);var strTrafficLight="";for(var i=0;i<arrTrafficLight.length;i++)
{if(arrTrafficLight[i][0]==strMasterId)
{strTrafficLight=arrTrafficLight[i][1];}}
if("1"==g_bBlockRedTitle&&strTrafficLight.indexOf('NotOk.png')>-1)
{strURL=g_ContextPath+"/do/game?game="+strMasterId+"#SystemRequirements";if(window.location.href.indexOf(g_ContextPath+"/do/game?game="+strMasterId)>-1)
{try{showSystemRequirements();}catch(e){}}
DoRedirect(strURL);return;}
var strURL="";var strErrorCode=canRunApplication(strMasterId)
strURL=playAuthorizationErrorHandler(strErrorCode,strMasterId,strCmdLine,strInstallationPackagePath,strMasterName);if(strURL!="")
{DoRedirect(strURL);return;}
if(!GPlayerApi_IsActiveXInstalled(g_strActiveXVersion))
{InstallEXEtenderEx(strInstallationPackagePath,strMasterId,strMasterName);return;}
if(!g_bClientInstalled)
{var strGetEXEtenderInstallationPathOnlyURL=g_strBaseURL+"/do/installEXEtender/"+strMasterId+"/Default/installer.exe?type=getPathOnly";strGetEXEtenderInstallationPathOnlyURL=addTrackingParamsToUrl(strGetEXEtenderInstallationPathOnlyURL,trackValue);var strEXEtenderInstallationPath=getResponse(strGetEXEtenderInstallationPathOnlyURL);GPlayerApi_InstallPlayerWithGUI(strEXEtenderInstallationPath,false);return;}
var sDirections;var bAddToDownloadList=true;if(playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.Play)
{bAddToDownloadList=false;}
sDirections=GetDirections(strMasterId,bAddToDownloadList,trackValue);strURL=playAuthorizationErrorHandler(sDirections.strDirectionsErrCode,strMasterId,strCmdLine,strInstallationPackagePath,strMasterName);if(strURL!="")
{DoRedirect(strURL);return;}
if("0"!=sDirections.strDirectionsErrCode)
{WriteToLog(sDirections.strDirectionsErrCode);HandleLaunchError(strMasterId,"Normal",sDirections.strDirectionsErrCode);return;}
var strPlayerAPIError="0";if(playButtonAction==Exent1.Web.Beta.Defines.PlayButtonStatus.Play)
{strPlayerAPIError=DownloadAndPlayGame(strMasterId,true,sDirections);}
else
{strPlayerAPIError=AddGameToDownloadList(strMasterId,sDirections);}
if("0"!=strPlayerAPIError)
{WriteToLog(strPlayerAPIError);HandleLaunchError(strMasterId,"Normal",strPlayerAPIError);}}
function GetDirections(strMasterId,bAddToDownloadList,trackValue)
{var sDirections;var strCompnentsParameter="";try
{var strMuid=GPlayerApi_GetPCMuid();if(!bAddToDownloadList)
{var strUserCompnents=GPlayerApi_GetPCDependences();if(strUserCompnents!="")
{strCompnentsParameter="&components="+strUserCompnents}}
var strURL=g_ContextPath+"/do/mediaRGMX?appId="+strMasterId+"&runIndex=0&muid="+strMuid+"&bAddToDownloadList="+bAddToDownloadList+strCompnentsParameter;strURL=addTrackingParamsToUrl(strURL,trackValue);var xmlDoc=xmlDocLoadURLSync(strURL);var nodeDirections=xmlDoc.getElementsByTagName("Directions");if(null==nodeDirections.item(0))
{sDirections=new structDirections("","","Wrong Directions");return sDirections;}
var nodeErrorCode=xmlDoc.getElementsByTagName("ErrorCode");var nodeErrorString=xmlDoc.getElementsByTagName("ErrorString");if("0"!=nodeErrorCode.item(0).text)
{sDirections=new structDirections("",nodeErrorCode.item(0).text,"Error: Code = "+nodeErrorCode.item(0).text+", Message = "+nodeErrorString.item(0).text);return sDirections;}
var nodeBuffer=xmlDoc.getElementsByTagName("Buffer");if(null==nodeBuffer.item(0))
{sDirections=new structDirections("","","Wrong Directions");return sDirections;}
sDirections=new structDirections(nodeBuffer.item(0).text,nodeErrorCode.item(0).text,nodeErrorString.item(0).text);return sDirections;}
catch(e)
{sDirections=new structDirections("","","Exception in GetDirections() function");return sDirections;}}
function WriteToLog(strErrorId)
{try
{var logFile=g_ContextPath+"/opTools/remoteErrLog.jsp?strErrorId="+strErrorId+"&strKey=1234";xmlDocLoadURLSync(logFile);}
catch(e)
{}}
function getPlayButton(strGameId)
{if(!g_bClientInstalled||!GPlayerApi_IsActiveXInstalled(g_strActiveXVersion))
{return Exent1.Web.Beta.Defines.PlayButtonStatus.Download;}
var currentGame=GetGPlayerGameInfo(strGameId);if("1"==currentGame.strActive&&"0"!=currentGame.strDownloadPriority)
{return Exent1.Web.Beta.Defines.PlayButtonStatus.Downloading;}
if("0"<currentGame.strDownloadPriority)
{return Exent1.Web.Beta.Defines.PlayButtonStatus.InDownloadQueue;}
if("1"==currentGame.strGameRunning)
{return Exent1.Web.Beta.Defines.PlayButtonStatus.Running;}
if("0"==currentGame.strPlayerAPIErrCode&&"1"==currentGame.strReadyToUse)
{return Exent1.Web.Beta.Defines.PlayButtonStatus.Play;}
return Exent1.Web.Beta.Defines.PlayButtonStatus.Download;}
function addParamToURL(strPath,strParam,strParamValue)
{var strPrevSign="&";var iEndUrlIndex=strPath.indexOf("?");if(iEndUrlIndex==-1)
{strPrevSign="?";strPath=strPath+strPrevSign+strParam+"="+strParamValue;return strPath;}
var iParamIndex=strPath.indexOf(strParam+"=");if(iParamIndex==-1)
{strPath=strPath+strPrevSign+strParam+"="+strParamValue;return strPath;}
var iSeparatorIndex=strPath.indexOf("&",iParamIndex);if(iSeparatorIndex==-1)
{strPath=strPath.substr(0,iParamIndex)+strParam+"="+strParamValue;}
else
{var strNewPath=strPath.substr(0,iParamIndex)+strParam+"="+strParamValue+strPath.substr(iSeparatorIndex);strPath=strNewPath;}
return strPath;}
function getUrlEscapeString(str)
{var strURL=escape(str);strURL=replaceAll(strURL,"+","%2b");return strURL;}
function replaceAll(str,replaced,replacements){if(str.length<replaced.length)
{return;}
var returnStr="";for(var i=0;i<=str.length-replaced.length;i++){var tmpStr=str.substring(i,i+replaced.length);if(tmpStr==replaced)
{returnStr=returnStr+replacements;}
else
{returnStr=returnStr+tmpStr;}}
return returnStr;}
overflowCount=0;onLoadEvents=[];function processOnload(onLArray)
{onLArray=(onLArray&&typeof onLArray.length!="undefined"&&typeof onLArray!="string")?onLArray:((typeof onLoadEvents!="undefined"&&typeof onLoadEvents.length!="undefined"&&typeof onLoadEvents!="string")?onLoadEvents:["1+1"]);for(onLI=0;onLI<onLArray.length;onLI++)
{if(onLArray[onLI]!="")
{eval(onLArray[onLI]);}}}
function safeOnload(onL)
{onL=(onL)?onL:false;pageOtherOnLoad=(window.onload!=null&&overflowCount<101010&&((typeof onLoadEvents!="undefined")&&(onLoadEvents.length<1)))?window.onload:null;window.onload=null;otherOnloadStr=(pageOtherOnLoad&&typeof pageOtherOnLoad=="function")?"pageOtherOnLoad();":"";if(otherOnloadStr!="")
{onLoadEvents[onLoadEvents.length]=otherOnloadStr;}
onLoadEvents[onLoadEvents.length]=onL+""+((onL.toString().charAt(onL.toString().length-1)==";")?"":";");overflowCount++;if(overflowCount>=101010)
{return false;}
if(window.onload==null)
{window.onload=processOnload;}
return;}
function rNm(nM)
{nM=((nM&&!isNaN(parseInt(nM)))?parseInt(nM):9);rnV=(Math.round(Math.floor((Math.random()*nM))));return rnV;}
function getObjRef(objId)
{objRef=false;objRef=(document.layers)?findObj(objId):(document.getElementById)?eval("document.getElementById(\""+objId+"\")"):(document.all)?eval("document."+objId):false;if(document.layers&&!objRef){objRef=(typeof document[objId]!="undefined")?document[objId]:false;};if(!objRef)
objRef=findObj(objId);return objRef;}
function getStyRef(objId)
{styRef=false;styRef=(document.layers)?findObj(objId):(document.getElementById)?eval("document.getElementById(\""+objId+"\").style"):(document.all)?eval("document."+objId+".style"):false;if(document.layers&&!styRef){styRef=(typeof document[objId]!="undefined")?document[objId]:false;};return styRef;}
fadeObjTmrs={};fadeObjOpacities={};function fadeObjById(objId,sop,op,st,sp)
{obj=(objId)?getObjRef(objId):null;if(!obj)return;fade_direction=(sop<op)?"up":((sop==0)?"none":"down");op=((op>=0)||(op<=100))?op:((op<0)?0:(op>100)?100:op);sop=((sop>=0)||(sop<=100))?sop:((sop<0)?0:(sop>100)?100:sop);sop=((typeof window.fadeObjOpacities[objId]!="undefined")?window.fadeObjOpacities[objId]:sop);if(op==sop)return;if(obj!=null)
{if(typeof window.fadeObjTmrs[objId]!="undefined")
{clearTimeout(window.fadeObjTmrs[objId]);}
oOp=(typeof window.fadeObjOpacities[objId]!="undefined")?window.fadeObjOpacities[objId]:100;if((sop!=op)&&(op!=oOp))
{sop=(sop>op)?(sop-st):(sop+st);sop=(sop<=0)?0:((sop>100)?100:sop);if(!document.all&&typeof obj.style!="undefined"&&typeof obj.style.MozOpacity!="undefined")
{obj.style.MozOpacity=((sop==0)?0:(sop/100));}
else if(typeof obj.style!="undefined"&&typeof obj.style.opacity!="undefined")
{obj.style.opacity=((sop==0)?0:(sop/100));}
else if(document.all&&typeof obj.style!="undefined"&&typeof obj.style.filter!="undefined")
{obj.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity="+sop+")";}
oOp=sop;window.fadeObjTmrs[objId]=setTimeout("fadeObjById('"+objId+"',"+sop+","+op+","+st+","+sp+")",sp);window.fadeObjOpacities[objId]=oOp;}
return oOp;}
return-1;}
Array.prototype.shuffle=function()
{randomArray=new Array();trimArray=new Array();eval("baseArray = this");trimArray=baseArray;i=0;while(baseArray.length>0)
{var newPos=rNm(baseArray.length);randomArray[i]=baseArray[newPos]
baseLen=baseArray.length;for(oP=0;oP<baseLen;oP++)
{newIndex=(oP<newPos)?oP:(oP-1);if(oP!=newPos)trimArray[newIndex]=baseArray[oP];}
baseArray.length--;i++;}
return randomArray;}
Array.prototype.permute=Array.prototype.shuffle;Array.prototype.randomize=Array.prototype.shuffle;function setContent(layerRef,content,is_unicode)
{if(!layerRef||typeof layerRef!="object")
{return false;}
content=(content)?content:null;if(content)
{is_unicode=(is_unicode)?is_unicode:false;if(is_unicode)
{if(document.layers)
{with(layerRef.document)
{open();write(unescape(content));close();}}
else if(typeof layerRef.innerHTML!="undefined")
{layerRef.innerHTML=unescape(content);}}
else if(!is_unicode)
{if(document.layers||(typeof layerRef.innerHTML=="undefined"))
{with(layerRef.document)
{open();write(content);close();}
return layerRef;}
else if(typeof layerRef.innerHTML!="undefined")
{layerRef.innerHTML=content;return layerRef;}}}
return;}
function getMilSecs(secondsOffset,minutesOffset,hoursOffset,daysOffset)
{var expTime=new Date();expTime.setTime(expTime.getTime());var daysOffset=(daysOffset)?daysOffset:0;var hoursOffset=(hoursOffset)?hoursOffset:0;var minutesOffset=(minutesOffset)?minutesOffset:0;var secondsOffset=(secondsOffset)?secondsOffset:0;var totalOffset=0;if(daysOffset!=0)
{totalOffset+=(daysOffset*24*60*60*1000);}
if(hoursOffset!=0)
{totalOffset+=(hoursOffset*60*60*1000);}
if(minutesOffset!=0)
{totalOffset+=(minutesOffset*60*1000);}
if(secondsOffset!=0)
{totalOffset+=(secondsOffset*1000);}
expDate=new Date(expTime.getTime()+totalOffset)
return expDate;}
function setCookie(name,value,path,expires,domain,secure)
{var today=new Date();today.setTime(today.getTime());var expires=(expires)?expires:new Date();document.cookie=name+"="+escape(value)+((expires)?";expires="+expires.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"");}
function getCookie(name)
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
{return null;}
if(start==-1)
{return null;}
var end=document.cookie.indexOf(";",len);if(end==-1)
{end=document.cookie.length;}
return unescape(document.cookie.substring(len,end));return null;}
function deleteCookie(name,path,domain)
{if(getCookie(name))
{document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}}
function swapImg(imgName,fullPath)
{if(!imgName)
return false;imgObj=findObj(imgName);if(!imgObj)
imgObj=getObjRef(imgName);if(!imgObj)
return false;fullPath=(fullPath)?fullPath:"";imSrc=imgObj.src.toString();imgObj.src=(fullPath!="")?fullPath:imSrc;return imgObj.src;}
function rollOver(obj,oldSuffix,suffix)
{if(!obj)return;suffix=(typeof suffix!="undefined")?suffix:null;oldSuffix=(typeof oldSuffix!="undefined")?oldSuffix:null;obj.rollId=(obj.id.toString().substring((obj.id.toString().length-2),(obj.id.toString().length))=="_a")?(obj.id.toString().substring(0,(obj.id.toString().length-2))):obj.id.toString();obj.oldSrc=getObjRef(obj.rollId).src;obj.oldSrcExt=obj.oldSrc.substring((obj.oldSrc.toString().lastIndexOf(".")),obj.oldSrc.toString().length);obj.oldSrcTrim=obj.oldSrc.substring(0,(obj.oldSrc.toString().lastIndexOf(".")));obj.rollRe=new RegExp(obj.oldSrcTrim+'(\\.[a-z0-9]{3,4})','i');swapImg(obj.rollId,obj.oldSrc.replace(obj.rollRe,(obj.oldSrcTrim.substring(0,((obj.oldSrcTrim.lastIndexOf(oldSuffix)>-1)?obj.oldSrcTrim.lastIndexOf(oldSuffix):obj.oldSrcTrim.length()))+suffix+'$1')));}
function rollOut(obj)
{if(!obj)return;refId=(obj.id.toString().substring((obj.id.toString().length-2),(obj.id.toString().length))=="_a")?(obj.id.toString().substring(0,(obj.id.toString().length-2))):obj.id.toString();imgObj=getObjRef(refId);imgName=(typeof imgObj.name!="undefined"&&imgObj.name!="")?imgObj.name:((typeof imgObj.id!="undefined"&&imgObj.id!="")?imgObj.id:null);if(!imgName)imgObj.name,imgName=refId;swapImg(imgName,obj.oldSrc);}
function findObj(n,d)
{var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=findObj(n,d.layers[i].document);if(!x&&document.getElementById)x=document.getElementById(n);return x;}
MM_findObj=findObj;function toggleFavorites()
{favsOpen=getObjRef("favorites_fob").className=="opened_white";setCookie('vzufavsOpen',((favsOpen)?1:0),'/',getMilSecs(1,1,1,730));favsStateMsg=(favsOpen)?"Click to Expand":"Click to Collapse";getStyRef("my_favorites_001").display=(favsOpen)?"none":"block";setContent(getObjRef('favMsg'),escape(((favsOpen)?"<a href=\"javascript: void(0);\" onclick=\"toggleFavorites();\">Click to view &#34;My Favorites&#34;</a><br /><br /><a href=\"javascript: void(0);\" onclick=\"if(confirm('Clear ALL items from &#34;My Favorites&#34;?')) { deleteCookie('vzufavorites','/'); deleteCookie('vzufavorites'); deleteCookie('vzufavorites','/',g_ContextPath); renderFavorites(); };\">Click to Clear All Favorites</a>":window.favMsgTxt)),true);getStyRef("rc_my_favorites_001").overflow=(favsOpen)?"hidden":"auto";getObjRef("favorites_fob").className=(favsOpen)?"closed_white":"opened_white";getObjRef("favorites_minmax").src=(favsOpen)?getObjRef("favorites_minmax").src.toString().replace(/_min/,"_max"):getObjRef("favorites_minmax").src.toString().replace(/_max/,"_min");getObjRef("favorites_fob").title=favsStateMsg;getObjRef("favorites_minmax").title=favsStateMsg;getObjRef("favorites_minmax").alt=favsStateMsg;}
function toggleNewGames()
{nwGmsOpen=getObjRef("new_games_fob").className=="opened_black";setCookie('nwgmsOpen',((nwGmsOpen)?1:-1),'/',getMilSecs(1,1,1,730));nwGmsStateMsg=(nwGmsOpen)?"Click to Expand":"Click to Collapse";getStyRef("new_games_slides_001").display=(nwGmsOpen)?"none":"block";getStyRef("rc_new_games_001_nav").display=(nwGmsOpen)?"none":"block";setContent(getObjRef('nwGmMsg'),escape(((nwGmsOpen)?"<br class=\"font_4px\" /><a href=\"javascript: void(0);\" onclick=\"toggleNewGames();\">Click to view &#34;New Games&#34;</a>":"<div><a href=\"javascript: void(0);\" onclick=\"showSlide('next',getObjRef('new_games_slides_001'));\" title=\"previous\" class=\"left font_9px\">prev</a><a href=\"javascript: void(0);\" onclick=\"showSlide('previous',getObjRef('new_games_slides_001'));\" title=\"next\" class=\"right font_9px\">next</a></div><br class=\"clear\" style=\"font-size: 1px; height: 1px;\" />")),true);getStyRef("rc_new_games_001").height=(nwGmsOpen)?"0px":"170px";getObjRef("new_games_fob").className=(nwGmsOpen)?"closed_black":"opened_black";getObjRef("new_games_minmax").src=(nwGmsOpen)?getObjRef("new_games_minmax").src.toString().replace(/_min/,"_max"):getObjRef("new_games_minmax").src.toString().replace(/_max/,"_min");getObjRef("new_games_fob").title=nwGmsStateMsg;getObjRef("new_games_minmax").title=nwGmsStateMsg;getObjRef("new_games_minmax").alt=nwGmsStateMsg;}
function addToFavorites(favNm,favId,userUserName)
{favCookie=getCookie('vzufavorites');vzuFavsCur=(favCookie!=null&&favCookie!="")?unescape(favCookie).toString().split(","):null;vzuFavsNew=(vzuFavsCur!=null)?vzuFavsCur.copy():[];if(!favNm||!favId)
{return;}
var strValue=favNm+String.fromCharCode(58)+String.fromCharCode(58)+favId;if((vzuFavsNew.length>=10)&&!(vzuFavsNew.getIndexByValue(strValue)>-1))
{showMessageBox(g_strImageServerUrl+"/compatibility/compatibilityIconNotOkBg.png","FAVORITE GAMES","Favorite Games is limited to 10 games.\nPlease delete a game then try again.");}
else
{if(vzuFavsNew.getIndexByValue(strValue)>-1)
{showMessageBox(g_strImageServerUrl+"/products/"+favId+"/boxshot_preview.jpg","FAVORITE GAMES",favNm+"\n"+"is already in your Favorite Games.");}
else
{vzuFavsNew[((vzuFavsNew[0]==null)?0:vzuFavsNew.length)]=strValue;if(vzuFavsNew.length>0)
{setCookie('vzufavorites',escape(vzuFavsNew),'/',getMilSecs(1,1,1,730));}
showMessageBox(g_strImageServerUrl+"/products/"+favId+"/boxshot_preview.jpg","FAVORITE GAMES",favNm+"\n"+"has been added to your Favorite Games.");logActions("ADD_GAME_TO_FAVORITES",userUserName,favId,favId);}}
renderFavorites();}
function moveFavorite(moveDepth)
{}
function deleteFavorites(deleteIndices)
{favCookie=getCookie('vzufavorites');deleteIndices=((deleteIndices==0)?'0':deleteIndices);vzuFavsTemp=unescape(favCookie).toString().split(",");deleteIndices=(typeof deleteIndices.length!="undefined"&&typeof deleteIndices!="string")?deleteIndices:[((deleteIndices==0)?'0':deleteIndices)];for(dI=0;dI<deleteIndices.length;dI++)
{favNm=vzuFavsTemp[deleteIndices[dI]].toString().substring(0,(vzuFavsTemp[deleteIndices[dI]].toString().indexOf("::")));window.favMsgTxt=favNm+" "+"<span class=\"font_red\">removed</span>.";vzuFavsTemp=vzuFavsTemp.clip(deleteIndices[dI]);}
if(vzuFavsTemp.length>0)
{setCookie('vzufavorites',escape(vzuFavsTemp),'/',getMilSecs(1,1,1,730));}
else
{vzuFavs=[];deleteCookie('vzufavorites','/');}
renderFavorites();}
function renderFavorites()
{if(!getCookie('vzufavorites')||getCookie('vzufavorites')=='')
{deleteCookie('vzufavorites','/');vzuFavs=[];}
vzuFavs=(getCookie('vzufavorites'))?unescape(getCookie('vzufavorites')).toString().split(","):[];if(vzuFavs.length==0)
{vI=0;vzuFavs=[];}
if(!getObjRef("favoriteGamesRightNav"))
{return;}
getObjRef("favoriteGamesRightNav").innerHTML="";var favoriteGamesHTML="";for(vI=0;vI<vzuFavs.length;vI++)
{curFavArr=vzuFavs[vI].split("::");var strName=curFavArr[0];var strId=curFavArr[1];if(typeof strId=="undefined")
{continue;}
var strHREF=g_ContextPath+"/do/game?game="+strId;if(vI>0)
{favoriteGamesHTML=favoriteGamesHTML+"<img src=\""+g_strImageServerUrl+"/favoriteGamesLine.gif\" style=\"width:164;\"/><br/>";}
favoriteGamesHTML=favoriteGamesHTML+"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding-top:4px; padding-bottom:4px;\">";favoriteGamesHTML=favoriteGamesHTML+"<tr>";favoriteGamesHTML=favoriteGamesHTML+"<td align=\"left\"><div class=\"orangeBoldText\" style=\"padding-right:4px; width:140px; word-wrap:break-word; overflow:hidden;\"><a href=\""+strHREF+"\" target=\"_self\" class=\"tanBoldSmallText\">"+strName+"</a></div></td>";favoriteGamesHTML=favoriteGamesHTML+"<td align=\"left\"><a style=\"width:24px;\" href=\""+g_ContextPath+"/do/theme?theme=Home\" onclick=\"javascript:deleteFavorites( "+vI+" ); return false;\" target=\"_self\"><img src=\""+g_strImageServerUrl+"/deleteButton_norm.gif\" alt=\"Delete Game\" name=\"deleteButton"+strId+"\" width=\"24\" height=\"19\" border=\"0\" valign=\"top\" id=\"deleteButton"+strId+"\" onmousedown=\"MM_swapImage( 'deleteButton"+strId+"', '', '"+g_strImageServerUrl+"/deleteButton_down.gif', 1 )\" onmouseover=\"MM_swapImage( 'deleteButton"+strId+"', '', '"+g_strImageServerUrl+"/deleteButton_over.gif', 1 )\" onmouseout=\"MM_swapImgRestore()\"/></a></td>";favoriteGamesHTML=favoriteGamesHTML+"</tr>";favoriteGamesHTML=favoriteGamesHTML+"</table>";}
if(favoriteGamesHTML=="")
{favoriteGamesHTML="Create a list of games you plan to download and play:<br>Just select &#34;Add to My Favorite Games&#34; from any game page.";}
favoriteGamesHTML="<div class=\"whiteNormalText\" style=\"padding-left:6px; padding-top:2px; padding-bottom:2px; padding-right:6px; width:164;\">"+favoriteGamesHTML+"</div>";getObjRef("favoriteGamesRightNav").innerHTML=favoriteGamesHTML;}
Array.prototype.getIndexByValue=function(value,ignoreCase,is_matchAsString)
{tstVal=false;tstVal=(value)?value.toString():"FAILED_tstVal_CHECK";ignoreCase=(typeof ignoreCase!="undefined"&&((ignoreCase>0)&&(ignoreCase!=false)&&(ignoreCase!="false")))?ignoreCase:false;is_matchAsString=(typeof is_matchAsString!="undefined"&&((is_matchAsString>0)&&(is_matchAsString!=false)&&(is_matchAsString!="false")))?is_matchAsString:false;if(tstVal!="FAILED_tstVal_CHECK")
{indexArray=new Array();eval("baseArray = this");baseLen=baseArray.length;cB=(is_matchAsString)?((ignoreCase)?(value+"").toLowerCase():(value+"").toString()):((ignoreCase&&(typeof value)=="string")?(value).toLowerCase():value);for(oP=0;oP<baseLen;oP++)
{cA=(is_matchAsString)?((ignoreCase)?(baseArray[oP]+"").toLowerCase():(baseArray[oP]+"").toString()):((ignoreCase&&(typeof baseArray[oP])=="string")?(baseArray[oP]).toLowerCase():baseArray[oP]);if((cA==cB)||(is_matchAsString&&cA.match(cB)))
{indexArray[indexArray.length]=oP;}}
if((indexArray.length>0)&&(indexArray!=""))
{return indexArray;}
else
{return-1;}}
return-1;}
Array.prototype.push=function push(newElement)
{this[this.length]=newElement;return this.length;}
Array.prototype.copy=function copy()
{var l;var baseArray=new Array();for(l=0;l<this.length;l++)
{baseArray[l]=this[l];}
return baseArray;}
Array.prototype.clip=function clip(ndx)
{var l;var baseArray=new Array();for(l=0;l<this.length;l++)
{if(l<this.length-1)
{baseArray[l]=(l<ndx)?this[l]:this[l+1];}}
return baseArray;}
function getObjRef(objId)
{objRef=false;objRef=(document.layers)?findObj(objId):(document.getElementById)?eval("document.getElementById(\""+objId+"\")"):(document.all)?eval("document."+objId):false;if(document.layers&&!objRef){objRef=(typeof document[objId]!="undefined")?document[objId]:false;};if(!objRef)
objRef=findObj(objId);return objRef;}
function getStyRef(objId)
{styRef=false;styRef=(document.layers)?findObj(objId):(document.getElementById)?eval("document.getElementById(\""+objId+"\").style"):(document.all)?eval("document."+objId+".style"):false;if(document.layers&&!styRef){styRef=(typeof document[objId]!="undefined")?document[objId]:false;};return styRef;}
var defaultPopWinProps="scrollbars=1,status=0,toolbar=0,location=0,directories=0,menubar=0,resizable=1";var browserVersion=parseInt(navigator.appVersion);var agt=navigator.userAgent.toLowerCase();var is_major=parseInt(navigator.appVersion);var is_minor=parseFloat(navigator.appVersion);var is_safari=((agt.match(/safari/))?true:false);var is_ns4=(document.layers)?true:false;var hidden=(document.layers)?"hide":"hidden";var visible=(document.layers)?"show":"visible";var toggle="toggle";var px=(document.layers)?"":"px";var style=(document.layers)?"":".style";function canRunApplication(strMasterId)
{var strErrorCode="0";try
{var strURL=g_ContextPath+"/do/directionsSupplier?callType=canRunApplication&appId="+strMasterId+"&runIndex=0";var xmlDoc=xmlDocLoadURLSync(strURL);var nodeErrorCode=xmlDoc.getElementsByTagName("ErrorCode");if("0"!=nodeErrorCode.item(0).text)
{strErrorCode=nodeErrorCode.item(0).text;return strErrorCode;}
return strErrorCode;}
catch(e)
{return"-1";}}
function playAuthorizationErrorHandler(strErrorCode,strMasterId,strCmdLine,strInstallationPackagePath,strMasterName)
{var strUrl="";if("1110"==strErrorCode)
{setSessionCookie("strGameIdAction",strMasterId);setSessionCookie("strGameName",strMasterName);setSessionCookie("strCmdLine",strCmdLine);setSessionCookie("strRunGameStatus","wait_to_login");setSessionCookie("strInstallationPackagePath",strInstallationPackagePath);strUrl=g_ContextPath+"/do/login?action=login";if(g_bLogedIn=="true")
{deleteSessionCookie("strGameIdAction");deleteSessionCookie("strGameName");deleteSessionCookie("strCmdLine");deleteSessionCookie("strRunGameStatus");deleteSessionCookie("strInstallationPackagePath");strUrl=g_ContextPath+"/do/offer?offerAction=offers&gameId="+strMasterId;}}
else if("1109"==strErrorCode)
{strUrl=g_ContextPath+"/"+g_strServiceFolderName+"/opTools/activate.jsp";}
else if("1108"==strErrorCode)
{deleteSessionCookie("strGameIdAction");deleteSessionCookie("strGameName");deleteSessionCookie("strCmdLine");deleteSessionCookie("strRunGameStatus");deleteSessionCookie("strInstallationPackagePath");strUrl=g_ContextPath+"/do/offer?offerAction=offers&gameId="+strMasterId;}
return strUrl;}
function xmlDocLoadURLSync(strURL)
{var xmlDoc=getXMLDOMObject();if(isIE)
{xmlDoc.async="false";xmlDoc.load(strURL);}
else
{var res=getResponse(strURL);xmlDoc.loadXML(res);}
return xmlDoc;}
function getResponse(strUrl)
{var xmlHttp=null;if(window.ActiveXObject)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){}}}
if(null==xmlHttp)
{if(window.XMLHttpRequest)
{xmlHttp=new XMLHttpRequest()}
if(null==xmlHttp)
{return"";}}
var async=false;xmlHttp.open("POST",strUrl,async);xmlHttp.send("");var strResponse=xmlHttp.responseText;return strResponse;}
function imagePreload()
{var args=imagePreload.arguments;document.imagearray=new Array(args.length);for(var i=0;i<args.length;i++)
{document.imagearray[i]=new Image;document.imagearray[i].src=args[i];}}
function showMessageBox(iconUrl,messageHeader,message)
{var windowUrl=g_ContextPath+"/"+g_strServiceFolderName+"/theme/Common/popups/messages/messageBox.jsp";windowUrl+="?iconUrl="+iconUrl;windowUrl+="&messageHeader="+escape(messageHeader);windowUrl+="&message="+escape(message);showModalWindow(windowUrl,402,254);}
function isValidObject(obj)
{if((obj!=null)&&(typeof obj!="undefined"))
{return true;}
else
{return false;}}
function viewWindow(strUrl,strName,strFeatures)
{var win=null;try
{strName=(strName&&strName!="")?strName:"mywin";if(strUrl)
{win=window.open(strUrl,strName,strFeatures);try{win.focus();}catch(e){}}}
catch(e){}
return win;}
function MM_preloadImages()
{var d=document;if(d.images)
{if(!d.MM_p)
{d.MM_p=new Array();}
var i;var j=d.MM_p.length;var a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
{if(a[i].indexOf("#")!=0)
{d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}}
function MM_swapImgRestore()
{var i;var x;var a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
{x.src=x.oSrc;}}
function MM_findObj(n,d)
{var p;var i;var x;if(!d)
{d=document;}
if((p=n.indexOf("?"))>0&&parent.frames.length)
{d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)
{x=d.all[n];}
for(i=0;!x&&i<d.forms.length;i++)
{x=d.forms[i][n];}
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
{x=MM_findObj(n,d.layers[i].document);}
if(!x&&d.getElementById)
{x=d.getElementById(n);}
return x;}
function MM_swapImage()
{var i;var j=0;var x;var a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
{if((x=MM_findObj(a[i]))!=null)
{document.MM_sr[j++]=x;if(!x.oSrc)
{x.oSrc=x.src;}
x.src=a[i+2];}}}
function onMouseDownHandler(strMasterid)
{if(g_downloadButton!="playGameButton_norm.gif")
{return;}
var strButton=getPlayButton(strMasterid);if(strButton==Exent1.Web.Beta.Defines.PlayButtonStatus.Download)
{var imageId="btnPlay"+strMasterid;MM_swapImage(imageId,"",g_strImageServerUrl+"/playGame/playGameButton_down.gif",1);}
else
{refreshPlayButton(strMasterid,strButton);}}
function onMouseOverHandler(strMasterid)
{if(g_downloadButton!="playGameButton_norm.gif")
{return;}
var strButton=getPlayButton(strMasterid);if(strButton==Exent1.Web.Beta.Defines.PlayButtonStatus.Download)
{var imageId="btnPlay"+strMasterid;MM_swapImage(imageId,"",g_strImageServerUrl+"/playGame/playGameButton_over.gif",1);}
else
{refreshPlayButton(strMasterid,strButton);}}
function onMouseOutHandler(strMasterid)
{if(g_downloadButton!="playGameButton_norm.gif")
{return;}
var strButton=getPlayButton(strMasterid);if(strButton==Exent1.Web.Beta.Defines.PlayButtonStatus.Download)
{MM_swapImgRestore();}
else
{refreshPlayButton(strMasterid,strButton);}}
function gameImageOnMouseOver(gameId,rowIndex,colIndex)
{var gameImageBoxElement=document.getElementById("gameImageBox"+gameId);var rolloverPopupElement=document.getElementById("rolloverPopup"+gameId);var popupArrowLeftElement=document.getElementById("popupArrowLeft"+gameId);var popupArrowRightElement=document.getElementById("popupArrowRight"+gameId);var gameListHeaderElement=document.getElementById("gameListHeader");var gameListFooterElement=document.getElementById("gameListFooter");var documentElement=document.documentElement;if(colIndex==2)
{popupArrowLeftElement.style.visibility="hidden";popupArrowRightElement.style.visibility="visible";}
else
{popupArrowLeftElement.style.visibility="visible";popupArrowRightElement.style.visibility="hidden";}
rolloverPopupElement.style.visibility="visible";}
function gameImageOnMouseOut(gameId)
{var rolloverPopupElement=document.getElementById("rolloverPopup"+gameId);var popupArrowLeftElement=document.getElementById("popupArrowLeft"+gameId);var popupArrowRightElement=document.getElementById("popupArrowRight"+gameId);rolloverPopupElement.style.visibility="hidden";popupArrowLeftElement.style.visibility="hidden";popupArrowRightElement.style.visibility="hidden";}
function findPos(obj)
{var curleft=0;var curtop=0;if(obj.offsetParent)
{do
{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);}
return[curleft,curtop];}
function MM_jumpMenu(strTarget,selectElement,bRestore,strGenreName,strThemeName)
{var strSelectedValue=selectElement.options[selectElement.selectedIndex].value;if(strSelectedValue=="Popularity"&&strThemeName!="")
{strSelectedValue="PopularityByTheme";}
var strSortBy="&sortBy="+strSelectedValue;var strURL=getGameListURL(strGenreName);strURL=strURL+strSortBy;eval(strTarget+".location='"+strURL+"'");if(bRestore)
{selectElement.selectedIndex=0;}}
function GoogleSimpleSearch(ctrlSearchID,val)
{var ctrlSearch=document.getElementById(ctrlSearchID);if(ctrlSearch.value=='')
{alert('Please enter the text you would like to search for.');ctrlSearch.focus();}
else
{window.open('http://wapp.myfairpoint.net/bookmarks/bmredirex.asp?bm=goo_search');}
if(val=='n')
{return false;}}
function showhide(isOpen)
{if(isOpen==0)
{document.getElementById("pwrdGoogle").style.display="none";}
else
{document.getElementById("pwrdGoogle").style.display="";}}
function OpenWebGameWindow(gameId,gameTitle,userUserName)
{var windowWidth=985;var windowHeight=675;var windowTop=(screen.height-windowHeight)/2;var windowLeft=(screen.width-windowWidth)/2;var strUrl=g_strBaseURL+"/do/general?jspName=playWin&gameId="+gameId+"&gameTitle="+gameTitle;var strName="WG";var strFeatures="width="+windowWidth+",height="+windowHeight+",top="+windowTop+",left="+windowLeft+",toolbar=0,menubar=0,status=0,resizable=0,location=0";try{document.getElementById("btnPlayWebGame"+gameId).blur();}catch(e){}
logActions("PLAY_WEB_GAME",userUserName,gameId,gameId);return viewWindow(strUrl,strName,strFeatures);}
function getEsrbRatingImagePath(strEsrbRating)
{var strErsbRatingString;switch(strEsrbRating)
{case"EC":case"E":case"E10+":case"T":case"M":case"AO":strErsbRatingString=g_strImageServerUrl+"/ratingImages/esrb_"+strEsrbRating.toLowerCase()+"_medium.gif";break;case"RP":default:strErsbRatingString="";break;}
return strErsbRatingString;}
function getGodRatingImagePath(strGodRating)
{var strGodRatingString;switch(strGodRating)
{case"3+":case"6+":case"10+":case"13+":case"M":case"A":strGodRatingString=g_strImageServerUrl+"/ratingImages/god_"+strGodRating.toLowerCase()+"_medium.gif";break;default:strGodRatingString="";break;}
return strGodRatingString;}
function openParentalControls()
{if(!GPlayerApi_IsClientInstalled("7.2.5.0","255.255.255.255"))
{showMessageBox(g_strImageServerUrl+"/compatibility/compatibilityIconNotOkBg.png","PARENTAL CONTROLS","To use this feature, you need to <a href=\""+g_ContextPath+"/do/theme?theme=Home\" onclick=\"javascript:closeMessageBox(); InstallEXEtenderEx( '', '0', '' ); return false;\" title=\"Download Game Player\" target=\"_self\">download</a> the latest Games on Demand Player.");return false;}
GPlayerApi_MinimizePlayer(true);GPlayerApi_OpenSettings("ParentalControlPage");}
function getAverageRatingSmallStarsHTML(rateValue,gameId,onLineGamePage)
{var strHTML="";var onLineGamePageFlag=false;if(typeof onLineGamePage!="undefined")
{onLineGamePageFlag=onLineGamePage;}
if(typeof gameId!="undefined")
{if(onLineGamePage)
{strHTML="<span style=\"cursor: pointer; cursor: hand;\" onclick=\"parent.openGamePage('"+gameId+"', '&mainTab=ratingReviews#RatingsReviews' );return false;\">";}
else
{strHTML="<span style=\"cursor: pointer; cursor: hand;\" onclick=\"goToGamePage('"+gameId+"', '&mainTab=ratingReviews#RatingsReviews');return false;\">";}}
var imageStr;rateValue=Math.round(rateValue*10)/10;for(var iRate=0;iRate<5;iRate++)
{var jRate25=iRate+0.25;var jRate50=iRate+0.5;var jRate75=iRate+0.75;var jRate100=iRate+1;if(jRate100<=rateValue||jRate75<=rateValue)
{imageStr="starSmall_on.png";}
else if(jRate50<=rateValue||jRate25<=rateValue)
{imageStr="starSmall_half.png";}
else
{imageStr="starSmall_off.png";}
if(onLineGamePage)
{strHTML+="<span style=\"vertical-align: middle;line-height:8px;width=10px;height=8px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'"+g_strImageServerUrl+"/ratingsReviewsImages/"+imageStr+"\', enabled=true)\">";strHTML+="</span>"}
else
{strHTML=strHTML+"<img style=\"vertical-align: middle;line-height:8px;\" src=\""+g_strImageServerUrl+"/ratingsReviewsImages/"+imageStr+"\"";strHTML=strHTML+" width=\"10\" height=\"8\">";}}
if(typeof gameId!="undefined")
{strHTML+="</span>";}
return strHTML;}
function goToGamePage(gameId,urlPostFix)
{var url=g_ContextPath+"/do/game?game="+gameId;if(urlPostFix)
{url+=urlPostFix;}
top.document.location.href=url;}
function getAverageRatingLargeStarsHTML(rateValue)
{var strHTML="";rateValue=Math.round(rateValue*10)/10;for(var iRate=0;iRate<5;iRate++)
{strHTML=strHTML+"<img style=\"vertical-align: middle;\" src=\""+g_strImageServerUrl+"/ratingsReviewsImages/";var jRate25=iRate+0.25;var jRate50=iRate+0.5;var jRate75=iRate+0.75;var jRate100=iRate+1;if(jRate100<=rateValue||jRate75<=rateValue)
{strHTML=strHTML+"starLarge_on.png";}
else if(jRate50<=rateValue||jRate25<=rateValue)
{strHTML=strHTML+"starLarge_half.png";}
else
{strHTML=strHTML+"starLarge_off.png";}
var strAlt="";switch(iRate)
{case 0:strAlt="Not a Fan";break;case 1:strAlt="Needs Work"
break;case 2:strAlt="So-So"
break;case 3:strAlt="Liked It"
break;case 4:strAlt="Loved It"
break;}
strHTML=strHTML+"\" title=\""+strAlt+"\" width=\"20\" height=\"20\">";}
return strHTML;}
function setHelpfulHtmlString(reviewId,elementId,helpfulYes,helpfulNo,displayLinks)
{var peopleNum=parseInt(helpfulYes)+parseInt(helpfulNo);var resultHtml="";var element=document.getElementById(elementId);if(element)
{if(peopleNum==0)
{if(displayLinks)
{resultHtml="<span class=\"tanBoldText\"\>Did you found this review helpful?</span\>";}}
else
{resultHtml="<span id=\"helpfullYes\" class=\"tanBoldText\"\>"+helpfulYes+"</span>&nbsp;of&nbsp;";resultHtml+="<span id=\"helpfullAll\" class=\"tanBoldText\"\>"+peopleNum+"</span\>&nbsp;people found this review helpful. ";if(displayLinks)
{resultHtml+="<span class=\"tanBoldText\">Did you?</span\>";}}
if(displayLinks)
{resultHtml+="&nbsp;<a href=\"#\" class=\"orangeNormalText\" onClick=\"submitHelpful("+reviewId+",\'"+elementId+"\',\'yes\');return false\">Yes</a\>";resultHtml+="&nbsp;|&nbsp;";resultHtml+="<a href=\"#\" class=\"orangeNormalText\" onClick=\"submitHelpful("+reviewId+",\'"+elementId+"\',\'no\');return false\">No</a\>";}
element.innerHTML=resultHtml;}}
function getSyncResponseText(url)
{var request=null;if(typeof window.ActiveXObject!='undefined')
{request=new ActiveXObject("Microsoft.XMLHTTP");}
else
{request=new XMLHttpRequest();}
request.open("GET",url,false);request.send(null);return request.responseText;}
function getPointsLeaders(strTableId,strDuration,bIncreaseFontSize)
{var elem=document.getElementById(strTableId);var url=g_strBaseURL+"/do/loyaltyProgram?taskName=getPointsLeaders&criteria=CREDITS&increaseFontSize="+bIncreaseFontSize+"&duration="+strDuration.toUpperCase();elem.innerHTML=getSyncResponseText(url);}
function getTrophiesLeaders(strTableId,strDuration)
{var elem=document.getElementById(strTableId);var url=g_strBaseURL+"/do/loyaltyProgram?taskName=getChallengeLeaders&duration="+strDuration.toUpperCase();elem.innerHTML=getSyncResponseText(url);}
function getActionLeaders(strTableId,strActionName,strDuration,strCriteria,strGameId,bViewPlusSign)
{var elem=document.getElementById(strTableId);var url=g_strBaseURL+"/do/loyaltyProgram?taskName=getActionLeaders&actionName="+strActionName+"&duration="+strDuration.toUpperCase()+"&criteria="+strCriteria.toUpperCase()+"&gameId="+strGameId+"&viewPlusSign="+bViewPlusSign;elem.innerHTML=getSyncResponseText(url);}
function logActions(strActionName,strUserId,strGameId,strValue)
{if(strUserId==null||strUserId==""||strUserId=="Guest")
{return;}
var url=g_strBaseURL+"/do/loyaltyProgram?taskName=logActions&actionName="+strActionName+"&userId="+strUserId+"&gameId="+strGameId+"&value="+strValue;var responseText=getSyncResponseText(url);}
function OpenGlossaryPopupWindow(strAnchor)
{var windowWidth=400;var windowHeight=700;var windowTop=(screen.height-windowHeight)/2;var windowLeft=(screen.width-windowWidth)/2;var strUrl=g_strBaseURL+"/do/general?jspName=glossaryPopup";if(null!=strAnchor&&strAnchor!="")
{strUrl=strUrl+"#"+strAnchor;}
var strName="GP";var strFeatures="width="+windowWidth+",height="+windowHeight+",top="+windowTop+",left="+windowLeft+",toolbar=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1";return viewWindow(strUrl,strName,strFeatures);}
function OpenNameRulesPopupWindow()
{var windowWidth=600;var windowHeight=190;var windowTop=(screen.height-windowHeight)/2;var windowLeft=(screen.width-windowWidth)/2;var strUrl=g_strBaseURL+"/do/general?jspName=nameRulesPopup";var strName="NRP";var strFeatures="width="+windowWidth+",height="+windowHeight+",top="+windowTop+",left="+windowLeft+",toolbar=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1";return viewWindow(strUrl,strName,strFeatures);}
function OpenMobileGamePageWindow(strUrl)
{var windowWidth=640;var windowHeight=480;var windowTop=(screen.height-windowHeight)/2;var windowLeft=(screen.width-windowWidth)/2;var strName="MGP";var strFeatures="width="+windowWidth+",height="+windowHeight+",top="+windowTop+",left="+windowLeft+",toolbar=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1";return viewWindow(strUrl,strName,strFeatures);}
function OpenPrivacyPopupWindow()
{var windowWidth=500;var windowHeight=600;var windowTop=(screen.height-windowHeight)/2;var windowLeft=(screen.width-windowWidth)/2;var strUrl=g_strBaseURL+"/do/general?jspName=privacyPopup";var strName="PP";var strFeatures="width="+windowWidth+",height="+windowHeight+",top="+windowTop+",left="+windowLeft+",toolbar=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1";return viewWindow(strUrl,strName,strFeatures);}
function OpenInviteFriendWindow()
{if(g_strCurrentUsername==null||g_strCurrentUsername==""||g_strCurrentUsername=="Guest")
{DoRedirect(g_strBaseURL+"/do/login?action=login");return;}
showModalWindow(g_strBaseURL+"/do/inviteFriend?innerPage=true",562,590);}
function changeCaptchaImage(strCaptchaImgId)
{var objCaptchaImg=document.getElementById(strCaptchaImgId);if(isValidObject(objCaptchaImg))
{objCaptchaImg.src=g_ContextPath+"/do/captcha?rn="+rNm(5);}}
function getLoyaltyNews()
{var pausecontent=new Array();var url=g_strBaseURL+"/do/loyaltyProgram?taskName=getLoyaltyNews";var strResponseText=getSyncResponseText(url);arrResponse=strResponseText.split("<br/>");j=0;viewCount=0;for(var i=0;i<arrResponse.length;i++)
{if(arrResponse[i]!="")
{viewCount++;if(viewCount==1)
{pausecontent[j]=arrResponse[i];}
else if(viewCount==2)
{pausecontent[j]=pausecontent[j]+"<br/>"+arrResponse[i];j++;viewCount=0;}}}
return pausecontent;}
function getResponses(strUserId)
{if(strUserId==null||strUserId==""||strUserId=="Guest")
{return"";}
var url=g_strBaseURL+"/do/loyaltyProgram?taskName=getResponses&userId="+strUserId;var responseText=getSyncResponseText(url);return responseText;}
function getConfiguration()
{var url=g_strBaseURL+"/do/loyaltyProgram?taskName=getConfiguration";var responseText=getSyncResponseText(url);return responseText;}
function getTrophyCaseBackgroundClass()
{var today=new Date();var hour=today.getHours();if(hour>=0&&hour<6||hour>20)
{return"trophyCaseBackgroundNight";}
else if(hour>=6&&hour<11)
{return"trophyCaseBackgroundMorning";}
else if(hour>=11&&hour<17)
{return"trophyCaseBackgroundDay";}
else if(hour>=17&&hour<=20)
{return"trophyCaseBackgroundSunset";}}
function notifierLoading(args)
{try
{nitroWidget.embed("JSCONNECTOR",args);}
catch(e)
{alert("nitroWidget.embed fail "+e);}}
function pausescroller(content,divId,divClass,delay)
{this.content=content;this.tickerid=divId;this.delay=delay;this.mouseoverBol=0;this.hiddendivpointer=1;document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden">');document.write('<div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div>');document.write('<div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">');if(typeof content[1]!="undefined"){document.write(content[1]);}
else if(content.length==1){document.write(content[0]);}
document.write('</div>');document.write('</div>');var scrollerinstance=this;if(window.addEventListener)
window.addEventListener("load",function(){scrollerinstance.initialize()},false);else if(window.attachEvent)
window.attachEvent("onload",function(){scrollerinstance.initialize()});else if(document.getElementById)
setTimeout(function(){scrollerinstance.initialize()},500);}
pausescroller.prototype.initialize=function()
{this.tickerdiv=document.getElementById(this.tickerid);this.visiblediv=document.getElementById(this.tickerid+"1");this.hiddendiv=document.getElementById(this.tickerid+"2");this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv));this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px";this.getinline(this.visiblediv,this.hiddendiv);this.hiddendiv.style.visibility="visible";var scrollerinstance=this;document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1};document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0};if(window.attachEvent)
window.attachEvent("onunload",function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null});setTimeout(function(){scrollerinstance.animateup()},this.delay);}
pausescroller.prototype.animateup=function()
{var scrollerinstance=this;if(parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5))
{this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px";this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px";setTimeout(function(){scrollerinstance.animateup()},50);}
else
{this.getinline(this.hiddendiv,this.visiblediv);this.swapdivs();setTimeout(function(){scrollerinstance.setmessage()},this.delay);}}
pausescroller.prototype.swapdivs=function()
{var tempcontainer=this.visiblediv;this.visiblediv=this.hiddendiv;this.hiddendiv=tempcontainer;}
pausescroller.prototype.getinline=function(div1,div2)
{div1.style.top=this.visibledivtop+"px";div2.style.top=Math.max(div1.parentNode.offsetHeight,div1.offsetHeight)+"px";}
pausescroller.prototype.setmessage=function()
{var scrollerinstance=this;if(this.mouseoverBol==1)
setTimeout(function(){scrollerinstance.setmessage()},100);else
{var i=this.hiddendivpointer;var ceiling=this.content.length;this.hiddendivpointer=(i+1>ceiling-1)?0:i+1;if(typeof this.content[this.hiddendivpointer]!="undefined")
{this.hiddendiv.innerHTML=this.content[this.hiddendivpointer];}
this.animateup();}}
pausescroller.getCSSpadding=function(tickerobj)
{if(tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"];else if(window.getComputedStyle)
return window.getComputedStyle(tickerobj,"").getPropertyValue("padding-top");else
return 0;}
