function AjaxRequest(){var A=new Object();A.timeout=null;A.generateUniqueUrl=true;A.url=window.location.href;A.method="GET";A.async=true;A.username=null;A.password=null;A.parameters=new Object();A.requestIndex=AjaxRequest.numAjaxRequests++;
A.responseReceived=false;A.groupName=null;A.queryString="";A.responseText=null;A.responseXML=null;A.status=null;A.statusText=null;A.aborted=false;A.xmlHttpRequest=null;A.onTimeout=null;A.onLoading=null;
A.onLoaded=null;A.onInteractive=null;A.onComplete=null;A.onSuccess=null;A.onError=null;A.onGroupBegin=null;A.onGroupEnd=null;A.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(A.xmlHttpRequest==null){return null
}A.xmlHttpRequest.onreadystatechange=function(){if(A==null||A.xmlHttpRequest==null){return }if(A.xmlHttpRequest.readyState==1){A.onLoadingInternal(A)}if(A.xmlHttpRequest.readyState==2){A.onLoadedInternal(A)
}if(A.xmlHttpRequest.readyState==3){A.onInteractiveInternal(A)}if(A.xmlHttpRequest.readyState==4){A.onCompleteInternal(A)}};A.onLoadingInternalHandled=false;A.onLoadedInternalHandled=false;A.onInteractiveInternalHandled=false;
A.onCompleteInternalHandled=false;A.onLoadingInternal=function(){if(A.onLoadingInternalHandled){return }AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof (window["AjaxRequestBegin"])=="function"){AjaxRequestBegin()
}if(A.groupName!=null){if(typeof (AjaxRequest.numActiveAjaxGroupRequests[A.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[A.groupName]=0}AjaxRequest.numActiveAjaxGroupRequests[A.groupName]++;
if(AjaxRequest.numActiveAjaxGroupRequests[A.groupName]==1&&typeof (A.onGroupBegin)=="function"){A.onGroupBegin(A.groupName)}}if(typeof (A.onLoading)=="function"){A.onLoading(A)}A.onLoadingInternalHandled=true
};A.onLoadedInternal=function(){if(A.onLoadedInternalHandled){return }if(typeof (A.onLoaded)=="function"){A.onLoaded(A)}A.onLoadedInternalHandled=true};A.onInteractiveInternal=function(){if(A.onInteractiveInternalHandled){return 
}if(typeof (A.onInteractive)=="function"){A.onInteractive(A)}A.onInteractiveInternalHandled=true};A.onCompleteInternal=function(){if(A.onCompleteInternalHandled||A.aborted){return }A.onCompleteInternalHandled=true;
AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof (window["AjaxRequestEnd"])=="function"){AjaxRequestEnd(A.groupName)}if(A.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[A.groupName]--;
if(AjaxRequest.numActiveAjaxGroupRequests[A.groupName]==0&&typeof (A.onGroupEnd)=="function"){A.onGroupEnd(A.groupName)}}A.responseReceived=true;A.status=A.xmlHttpRequest.status;A.statusText=A.xmlHttpRequest.statusText;
A.responseText=A.xmlHttpRequest.responseText;A.responseXML=A.xmlHttpRequest.responseXML;if(typeof (A.onComplete)=="function"){A.onComplete(A)}if(A.xmlHttpRequest.status==200&&typeof (A.onSuccess)=="function"){A.onSuccess(A)
}else{if(typeof (A.onError)=="function"){A.onError(A)}}delete A.xmlHttpRequest["onreadystatechange"];A.xmlHttpRequest=null};A.onTimeoutInternal=function(){if(A!=null&&A.xmlHttpRequest!=null&&!A.onCompleteInternalHandled){A.aborted=true;
A.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof (window["AjaxRequestEnd"])=="function"){AjaxRequestEnd(A.groupName)}if(A.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[A.groupName]--;
if(AjaxRequest.numActiveAjaxGroupRequests[A.groupName]==0&&typeof (A.onGroupEnd)=="function"){A.onGroupEnd(A.groupName)}}if(typeof (A.onTimeout)=="function"){A.onTimeout(A)}delete A.xmlHttpRequest["onreadystatechange"];
A.xmlHttpRequest=null}};A.process=function(){if(A.xmlHttpRequest!=null){if(A.generateUniqueUrl&&A.method=="GET"){A.parameters["AjaxRequestUniqueId"]=new Date().getTime()+""+A.requestIndex}var C=null;for(var B in A.parameters){if(A.queryString.length>0){A.queryString+="&"
}A.queryString+=encodeURIComponent(B)+"="+encodeURIComponent(A.parameters[B])}if(A.method=="GET"){if(A.queryString.length>0){A.url+=((A.url.indexOf("?")>-1)?"&":"?")+A.queryString}}A.xmlHttpRequest.open(A.method,A.url,A.async,A.username,A.password);
if(A.method=="POST"){if(typeof (A.xmlHttpRequest.setRequestHeader)!="undefined"){A.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded")}C=A.queryString}if(A.timeout>0){setTimeout(A.onTimeoutInternal,A.timeout)
}A.xmlHttpRequest.send(C)}};A.handleArguments=function(B){for(var C in B){if(typeof (A[C])=="undefined"){A.parameters[C]=B[C]}else{A[C]=B[C]}}};A.getAllResponseHeaders=function(){if(A.xmlHttpRequest!=null){if(A.responseReceived){return A.xmlHttpRequest.getAllResponseHeaders()
}alert("Cannot getAllResponseHeaders because a response has not yet been received")}};A.getResponseHeader=function(B){if(A.xmlHttpRequest!=null){if(A.responseReceived){return A.xmlHttpRequest.getResponseHeader(B)
}alert("Cannot getResponseHeader because a response has not yet been received")}};return A}AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){/*@cc_on @*//*@if (@_jscript_version >= 5)
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				return null;
			}
		}
		@end @*/}else{return null
}}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0)};AjaxRequest.get=function(A){AjaxRequest.doRequest("GET",A)};AjaxRequest.post=function(A){AjaxRequest.doRequest("POST",A)
};AjaxRequest.doRequest=function(C,A){if(typeof (A)!="undefined"&&A!=null){var B=new AjaxRequest();B.method=C;B.handleArguments(A);B.process()}};AjaxRequest.submit=function(A,B){var D=new AjaxRequest();
if(D==null){return false}var C=AjaxRequest.serializeForm(A);D.method=A.method.toUpperCase();D.url=A.action;D.handleArguments(B);D.queryString=C;D.process();return true};AjaxRequest.serializeForm=function(B){var E=B.elements;
var A=E.length;var G="";this.addField=function(H,I){if(G.length>0){G+="&"}G+=encodeURIComponent(H)+"="+encodeURIComponent(I)};for(var D=0;D<A;D++){var F=E[D];if(!F.disabled){switch(F.type){case"text":case"password":case"hidden":case"textarea":this.addField(F.name,F.value);
break;case"select-one":if(F.selectedIndex>=0){this.addField(F.name,F.options[F.selectedIndex].value)}break;case"select-multiple":for(var C=0;C<F.options.length;C++){if(F.options[C].selected){this.addField(F.name,F.options[C].value)
}}break;case"checkbox":case"radio":if(F.checked){this.addField(F.name,F.value)}break}}}return G};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0
function getCookie(C){if(typeof document.cookie=="string"){var D=document.cookie.indexOf(C+"=");var A=D+C.length+1;if((!D)&&(C!=document.cookie.substring(0,C.length))){return null}if(D==-1){return null
}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(A,B))}else{return""}}function setCookie(B,D,A,F,C,E){if(typeof document.cookie=="string"){document.cookie=B+"="+escape(D)+((A)?";expires="+A.toGMTString():"")+((F)?";path="+F:"")+((C)?";domain="+C:"")+((E)?";secure":"")
}}function deleteCookie(A,C,B){if(getCookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-70 00:00:01 GMT"}}function collapseDrawer(){var B=document.getElementById("ctl00_GameDrawer1_drawerInner");B.style.display="none";var A=document.getElementById("ctl00_GameDrawer1_drawerHandle");A.src="css/cssimg/arrow_down.gif";
A.alt="Expand";A.title="Open Drawer";A.onclick=expandDrawer;deleteCookie("DrawerOpen","/",null)}function expandDrawer(){var E=document.getElementById("ctl00_GameDrawer1_drawerInner");var D=0,G;E.style.height="1px";
E.style.display="block";E.style.overflow="hidden";D=E.scrollHeight;var B=document.getElementById("ctl00_GameDrawer1_drawerHandle");B.src="css/cssimg/arrow_up.gif";B.alt="Collapse";B.title="Close Drawer";
var C=new Date();C.setTime(C.getTime()+(24*60*60*1000*365));setCookie("DrawerOpen","true",C,"/",null,false);var A;var F=function(H){H=H||0;if(H>=D){clearTimeout(A);E.style.height=D+"px";return }E.style.height=H+"px";
H+=30;A=setTimeout(function(){F(H)},10)};B.onclick=function(){clearTimeout(A);collapseDrawer()};F()}function getGameId(){var A=document.getElementById("frmGameId");if(A){return A.elements["GameId"].value
}return null}function userIsAuthenticated(){return Boolean(getCookie("AuthenticationTicket"))}function addFavorite(){var A=getGameId();if(A){AjaxRequest.post({"url":"AddFavorite.aspx","parameters":{"gameId":A},"onSuccess":function(F){var C=F.responseXML;
var H=C.getElementsByTagName("favorite");var B="<ul>";for(var D=0;D<H.length;D++){var G=H[D];B+="<li><a href='PlayGame.aspx?gameId="+escape(G.getAttribute("gameId"))+"'>"+G.firstChild.data+"</a></li>"}B+="</ul>";
var E=document.getElementById("favlist");E.innerHTML=B;document.getElementById("addFavorite").style.display="none"}})}}function getNextRandomQuote(B){var A="RandomQuote.aspx?lastQuoteId="+B;AjaxRequest.get({"url":A,"onSuccess":function(F){var D=F.responseText;
var C=document.createElement("div");C.innerHTML=D;var E=(C.getElementsByTagName("div")[0]).innerHTML;C=null;document.getElementById("randomQuoteWrapper").innerHTML=E}})}function tellAFriend(){var A="Recommend.aspx";
var B=new Validator();var D=document.getElementById("fmrTellAFriend");var E=D.elements["yourname"];var C="Required field";if(B.isEmpty(E.value)){B.indicateError(E,C);return false}else{B.clearError(E)}E=D.elements["youremail"];
if(B.isEmpty(E.value)){B.indicateError(E,C);return false}else{if(!B.isEmail(E.value)){B.indicateError(E,"This is not valid e-mail address");return false}else{B.clearError(E)}}E=D.elements["friendsemail"];
if(B.isEmpty(E.value)){B.indicateError(E,C);return false}else{if(!B.isEmail(E.value)){B.indicateError(E,"This is not valid e-mail address");return false}else{B.clearError(E)}}E=D.elements["message"];if(B.isEmpty(E.value)){B.indicateError(E,C);
return false}else{B.clearError(E)}E=D.elements["captcha"];if(B.isEmpty(E.value)){B.indicateError(E,C);return false}else{B.clearError(E)}AjaxRequest.post({"url":A,"hash":D.elements["hash"].value,"captcha":D.elements["captcha"].value,"youremail":D.elements["youremail"].value,"yourname":D.elements["yourname"].value,"friendsemail":D.elements["friendsemail"].value,"message":D.elements["message"].value,"submit":"submit","onError":function(){alert("There was an error while processing your request. Please try again later.")
},"onSuccess":function(I){var G=I.responseText;var F=document.createElement("div");F.innerHTML=G;var H=(F.getElementsByTagName("div")[0]).innerHTML;F=null;document.getElementById("tellAFriendWrapper").innerHTML=H
}});return false}Array.prototype.getLast=function(){return this[this.length-1]};Array.prototype.compact=function(){var A=this.length;for(var C=0;C<A;C++){if(typeof this[C]=="undefined"){for(var B=C;B<A-1;B++){this[B]=this[B+1]
}this.length--;return this.compact()}}};Array.prototype.shuffle=function(){var B,A;for(i=0,j=this.length;i<j;i++){B=Math.round(Math.random()*(j-i-1))+i;A=this[i];this[i]=this[B];this[B]=A}};Array.prototype.remove=function(B){for(var A=0;
A<this.length;A++){if(this[A]===B){delete this[A]}}};Array.prototype.getElementIndex=function(B){for(var A=0;A<this.length;A++){if(this[A]&&(this[A]===B)){return A}}};Array.prototype.contains=function(C){for(var B=0,A=this.length;
B<A;B++){if(this[B]&&(this[B]===C)){return true}}return false};function dbgIspisiSpil(A){var C=document.createElement("div");C.style.border="2px solid green";for(var B=0;B<A.length;B++){var E=A[B];var D=document.createElement("img");
D.src=E.slika;D.alt=D.title=E.ime+" "+E.boja;C.appendChild(D)}C.onclick=function(){this.parentNode.removeChild(this)};document.body.appendChild(C)}function Validator(){this.isNumeric=function(A){return(!isNaN(A)&&(new RegExp("^-?[0-9]*\\.[0-9]*$").test(A)))};this.isInteger=function(A){return/^-?[0-9]*$/.test(A)};this.isPositiveInteger=function(A){return(this.isInteger(A)&&(A>0))
};this.trim=function(A){return A.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1")};this.isEmpty=function(A){if(!A||(this.trim(A)=="")){return true}return false};this.isEmail=function(A){return(new RegExp("^[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+.[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+$").test(A))
};this.indicateError=function(B,A){B.focus();if(B.select){B.select()}window.status=A;B.style.borderColor="red"};this.clearError=function(A){window.status="";A.style.borderColor=""}}
