function MM_findObj(n, d) { //v4.01
  	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=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function detectBrowser() {
	var webClient_obj = MM_findObj("appBigWebClient");
	if (navigator.userAgent.indexOf("Firefox")!=-1){
		webClient_obj.externalCall("onBrowserDetected","Firefox");
	}else{
		webClient_obj.externalCall("onBrowserDetected",navigator.userAgent);
	}
}

function openGame(userId, tokenId, gameType, gameIdCollection, spotId) {
	var webClient_obj = MM_findObj("appBigWebClient");
	if (webClient_obj != null)
		webClient_obj.externalCall("openGame", {user:userId, token:tokenId, type:gameType, idCollection:gameIdCollection, spot:spotId});
	else
		alert("Error: Web client not found")

}

function close() {
	var webClient_obj = MM_findObj("appBigWebClient");
	if (webClient_obj != null)
		webClient_obj.externalCall("close");
	else
		alert("Error: Web client not found");
}

function changeLanguage(languageId) {
	var webClient_obj = MM_findObj("appBigWebClient");
	if (webClient_obj != null)
		webClient_obj.externalCall("currentLanguage", languageId);
	else
		alert("Error: Web client not found")
}

function callAccount ( login, token ){
	demo();
}

function callProfile ( login, token ) {
	demo();
}

function callContacts ( login, token ) {
	demo();
}

function callOptions ( login, token ) {
	demo();
}

function demo () {
	if ( opener != null ){
		opener.location.href = 'http://192.168.2.242:58080/big/rw/pages/index.fr.do';
		opener.focus();
	} else
		window.open('http://192.168.2.242:58080/big/rw/pages/index.fr.do','_blank');
}

function callExit() {
	window.location="kill.html";
}

function forgotPassword () {
	demo ();
}