// TURN ON DEBUG WINDOW FEEDBACK
// I WILL WANT TO DISABLE THIS IN THE LIVE VERSION…
var httpTesting = false;
// SET MY REQUEST OBJECT
var http = createRequestObject();
// VARIABLE TO TRACK IF WE ARE CURRENTLY IN A CALL
var inCall = false;
// QUEUE FOR CALLS
var callToArray = new Array();
// QUEUE FOR FUNCTION TO EXECUTE WHEN CALL COMPLETE
var returnToArray = new Array();
var indicator = "<div id='indicator_div' name='indicator_div'><img border='0' src='../../../../themes/BLVC/img/load_indicator.gif' width='100' height='100'></div>";

function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}

function createRequestObject() {
  var reqObj;
  var browser = navigator.appName;
  if(browser == "Microsoft Internet Explorer"){
    reqObj = new ActiveXObject("Microsoft.XMLHTTP");
    isIE = true;
  }else{
    reqObj = new XMLHttpRequest();
  }
  return reqObj;
}

function sendCall(whereTo, returnTo){
var myRand=parseInt(Math.random()*99999999); // cash buster
  // GET THE NEXT ARRAY ITEM AND REMOVE FROM THE ARRAY
  callToArray.push(whereTo+"&myRand="+myRand);
  returnToArray.push(returnTo);
}

function callQueue(){
  // IF WE HAVE A WAY OF MONITORING THE QUEUE, UPDATE IT
  if(httpTesting){
    calls = "";
    for(i=0;i<callToArray.length;i++){
      calls += callToArray[i];
      
    }

    parent.document.getElementById("queueTest").value = calls;
    parent.document.getElementById("queueInCall").value = inCall;
    parent.document.getElementById("queueReadyState").value = http.readyState;
  }
  // CHECK THE QUEUE AND SEND THE NEXT CALL IN LINE
  if(!inCall && callToArray.length > 0){
    // DO WE HAVE ANYTHING IN THE QUEUE?
    if(callToArray.length > 0){
      // WE DO, SO GET THE FIRST ITEM IN THE CALL ARRAY AND REMOVE IT
      whereTo = callToArray.shift();
      returnTo = returnToArray.shift();
      // SEND THAT CALL
      doCall(whereTo, returnTo);
    }else{
      // UPDATE DEBUG QUEUE
      if(httpTesting){
        parent.document.getElementById("queueMsg").value = "no items in queue1.";
      }
    }
  }else{
    // UPDATE DEBUG QUEUE
    if(httpTesting){
      if(inCall){
        parent.document.getElementById("queueMsg").value = "currently in a call.";
      }else{
      //alert(httpTesting);
        parent.document.getElementById("queueMsg").value = "no items in queue2.";
      }
    }
  }
}

function doCall(whereTo, returnTo){
  inCall = true;
  http.open('get', whereTo);
  // DO WE HAVE A FUNCTION TO CALL ONCE CALL IS COMPLETED?
  if(returnTo.length > 0){
    eval("http.onreadystatechange = "+returnTo);
  }
  // SEND CALL
  http.send(null);
}

function hr_inCall(){
  if(http.readyState == 4){
    inCall = false;
  }
}

var queueWatcher = setInterval(callQueue, 100);

function Check_User_ID(){
  setOverlaySizeloading();
  var user_id=document.getElementById("contentFrame").contentWindow.document.getElementById('retrieve_user_id').value;
  var func_name="Forget_Pwd";
  sendCall("include/consult.php?req="+func_name+"&user_id="+user_id, "hr_Check_User_ID");
}

function hr_Check_User_ID(){
  var curent_lang=document.getElementById("curent_lang").value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    if(response != ""){
      if(response.length < 10){
        response = trim(response);
        if(response=="ERR200"){
          setOveralMSG();
	  if(curent_lang=="" || curent_lang=="eng"){  
            document.getElementById("FloatLayerContent_div").innerHTML ="You must enter your User ID.<br><br>Please try again! If you forgot your userid contact costumer the support for more assistance."; 
	  }else if(curent_lang=="spn"){
            document.getElementById("FloatLayerContent_div").innerHTML ="Debes colocar tu ID de Usuario.<br><br>Por favor intente de nuevo! Si olvido su ID de Usuario contacte al Servicio de Soporte para mayor asistencia."; 
	  }else if(curent_lang=="por"){
            document.getElementById("FloatLayerContent_div").innerHTML ="Voc&ecirc; deve digitar o ID do usu&aacute;rio.<br><br>Por favor tente novamente! Se Você esqueceu seu ID do usu&acute;rio contate o suporte para obter mais assist&ecirc;ncia."; 
	  }			  
          document.getElementById("FloatLayerContent_div").style.fontSize="12px";
//          document.getElementById("FloatLayerContent_div").style.fontfamily="Tahoma, Verdana, Arial, Helvetica, sans-serif";
        }else if(response=="ERR201"){
          setOveralMSG();
  	  if(curent_lang=="" || curent_lang=="eng"){  
            document.getElementById("FloatLayerContent_div").innerHTML ="The User ID you entered does not exist in our records.<br><br>Please try again! If you forgot your userid contact costumer the support for more assistance."; 
	  }else if(curent_lang=="spn"){
            document.getElementById("FloatLayerContent_div").innerHTML ="El ID de Usuario que ha ingresado no existe en nuestra base de datos.<br><br>Por favor intente de nuevo! Si olvido su ID de Usuario contacte al Servicio de Soporte para mayor asistencia."; 
	  }else if(curent_lang=="por"){
            document.getElementById("FloatLayerContent_div").innerHTML ="O ID do usu&aacute;rio digitado n&atilde;o existe no nosso banco de dados; por favor tente novamente! Se voc&ecirc; esqueceu  ID de usu&aacute;rio, entre em contato com a equipe de suporte ao cliente para obter assist&ecirc;ncia."; 
	  } 		
          document.getElementById("FloatLayerContent_div").style.fontSize="12px";       
        }else if(response=="ERR202"){
          setOveralMSG();
	  if(curent_lang=="" || curent_lang=="eng"){ 
            document.getElementById("FloatLayerContent_div").innerHTML ="A technical error has occurred.<br><br>Please contact costumer the support for more assistance!";
          }else if(curent_lang=="spn"){
            document.getElementById("FloatLayerContent_div").innerHTML ="Un error t&eacute;cnico a ocurrido.<br><br>Por favor contacte al Servicio de Soporte para mayor asistencia!";
	  }else if(curent_lang=="por"){
            document.getElementById("FloatLayerContent_div").innerHTML ="Um erro t&eacute;cnico ocorreu.<br><br>Entre em contato com o suporte ao cliente para obter mais assist&ecirc;ncia!"; 
	  } 			  
          document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        }                
      }else{
         clearOverlaySizeloading();
    	if(curent_lang=="" || curent_lang=="eng"){ 		  
          document.getElementById("contentFrame").contentWindow.document.getElementById("headtxt").innerHTML="Please enter your Secret Answer to retrieve your password.";
          document.getElementById("contentFrame").contentWindow.document.getElementById("sec_tst").innerHTML="If you have forgotten the answer to your private question, please contact our customer support team and provide the reason for your correspondence as well as your personal details (user ID, first name and surname, address, birth date and your e-mail address, which is saved in your casino account). Thereafter our support team will send you your personal answer.";
 	}else if(curent_lang=="spn"){
          document.getElementById("contentFrame").contentWindow.document.getElementById("headtxt").innerHTML="Por favor ingrese su respuesta secreta para obtener su contrase&ntilde;a.";
          document.getElementById("contentFrame").contentWindow.document.getElementById("sec_tst").innerHTML="Si ha olvidado la respuesta para su pregunta privada, por favor contacte a nuestro servicio de soporte e indique lo sucedido, as&iacute; como tambi&eacute;n sus datos personales (ID de Usuario, Nombre y Apellido, direcci&oacute;n, fecha de nacimiento y su correo electr&oacute;nico, el que esta guardado en su cuenta de casino). De esa forma nuestro servicio de soporte podr&eacute; enviarle su respuesta secreta.";
	}else if(curent_lang=="por"){
          document.getElementById("contentFrame").contentWindow.document.getElementById("headtxt").innerHTML="Por favor, indique a sua resposta secreta para recuperar sua senha.";
          document.getElementById("contentFrame").contentWindow.document.getElementById("sec_tst").innerHTML="Se você tiver esquecido a resposta para sua pergunta secreta, entre em contato com nossa equipe de suporte ao cliente e fornece o motivo de sua correspondência, bem como seus dados pessoais (identificação de usuário, primeiro nome e sobrenome, endereço, data de nascimento e seu endereço de e-mail, que é guardado na sua conta do casino). Posteriormente nossa equipe de suporte lhe enviará a sua resposta pessoal.";
	}			  
        document.getElementById("contentFrame").contentWindow.document.getElementById("forgotpwd").innerHTML=response;
//        $("#forgotpwdmain").redrawShadow({left: 0, top: 0, opacity: 0.9, blur: 5});
//        $("#paymentsecurity").redrawShadow({left: 0, top: 0, opacity: 0.9, blur: 5});        
      }  
    }
  }
}

function Retrieve_User_Pwd(){

  var secret_answ=document.getElementById("contentFrame").contentWindow.document.getElementById('secret_answ').value;
  var retrieve_user_id=document.getElementById("contentFrame").contentWindow.document.getElementById('retrieve_user_id').value;
  var func_name="Retrieve_Pwd";
  setOverlaySizeloading();
  sendCall("include/consult.php?req="+func_name+"&secret_answ="+secret_answ+"&retrieve_user_id="+retrieve_user_id, "hr_Retrieve_User_Pwd");
}

function hr_Retrieve_User_Pwd(){
  var curent_lang=document.getElementById("curent_lang").value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    if(response != ""){
//    alert(response);
      response = trim(response);
      if(response=="ERR203"){
        setOveralMSG();
    	if(curent_lang=="" || curent_lang=="eng"){		
          document.getElementById("FloatLayerContent_div").innerHTML ="You must enter your secret answer in order to retrieve you password."; 
 	}else if(curent_lang=="spn"){
          document.getElementById("FloatLayerContent_div").innerHTML ="Debe ingresar su respuesta secreta para poder obtener su contrase&ntilde;a."; 
 	}else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML ="Voc&ecirc; deve digitar sua resposta secreta para recuperar sua senha."; 
	}			  
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        document.getElementById("contentFrame").contentWindow.document.getElementById('secret_answ').focus;
      }else if(response=="ERR205"){
        setOveralMSG();
    	if(curent_lang=="" || curent_lang=="eng"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="The answer to your secret question you entered is not correct.<br><br>Please try again! If you forgot your userid contact costumer the support for more assistance.";
 	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="La respuesta a su pregunta secreta no es correcta.<br><br>Por favor intente de nuevo!  Si olvido su ID de Usuario contacte al Servicio de Soporte para mayor asistencia.";
	}else if(curent_lang=="por"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="A resposta à sua pergunta secreta que você digitou não está correta.<br><br>Por favor, tente novamente! Se você esqueceu seu nome de usuário contate o suporte para obter mais assistência.";
	}			  
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        document.getElementById("contentFrame").contentWindow.document.getElementById('secret_answ').focus;       
      }else if(response=="ERR202"){
        setOveralMSG();
	if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML ="A technical error has occurred.<br><br>Please contact costumer the support for more assistance!"; 
 	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="Un error t&eacute;cnico a ocurrido.<br><br>Por favor contacte al Servicio de Soporte para mayor asistencia!"; 
 	}else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML ="Um erro t&eacute;cnico ocorreu.<br><br>Entre em contato com o suporte ao cliente para obter mais assist&ecirc;ncia!"; 
	}		  
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        document.getElementById("contentFrame").contentWindow.document.getElementById('secret_answ').focus;
      }else if(response=="ERR204"){
        setOveralMSG();
	if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML ="A technical error has occurred.<br />Your password could not been retrieved.<br /><br />Please contact the costumer support!";
	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="Un error t&eacute;cnico a ocurrido.<br />Su contrase&ntilde;a no pudo ser obtenida.<br /><br />Por favor contacte al Servicio de Soporte!";
 	}else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML ="Um erro t&eacute;cnico ocorreu.<br/>Sua senha pode n&atilde;o ser recuperada.<br/><br/>Entre em contato com o suporte ao cliente!"; 
	}			  
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        document.getElementById("contentFrame").contentWindow.document.getElementById('secret_answ').focus;
      }else if(response=="EXC200"){
        setOveralMSG();
 	if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML ="Dear client,<br>You have completed the process successful. We have sent you your <b>temporary password</b> by email.";
	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="Estimado cliente,<br>Usted ha completado el proceso satisfactoriamente. Le hemos enviado su <b>cotrase&ntilde;a temporal</b> por su correo electr&oacute;nico.";
	}else if(curent_lang=="por"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="Prezado cliente,<br>Você concluiu o processo bem sucedido. Nós enviamos a sua <b>senha temporária</b> por e-mail.";
	}			  
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        load_page('h', 'web', curent_lang, '');
      }  
    }
  }
}

function CheckAccountStatus(){
  var user_hash = document.getElementById('curent_user_hash_id').value;
  var sitekey_id = document.getElementById('sitekey_id').value;
  
  sendCall("include/consult.php?req=CheckAccountStatus&user_hash="+user_hash+"&sitekey_id="+sitekey_id, "hr_CheckAccountStatus");
}

function hr_CheckAccountStatus(){
  var curent_lang=document.getElementById("curent_lang").value;
  var statusIntervalID=document.getElementById('statusIntervalID').value;

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    response = trim(response);
//    alert(response);
    if(response != ""){   
      setOverlaySizeloading();
      setOveralMSG();   	    
      if(response=="TECH_PROBLEM"){
        clearInterval(statusIntervalID);
        
        if(curent_lang=="" || curent_lang=="eng"){        
          document.getElementById("FloatLayerContent_div").innerHTML='You are experiencing a connection problem to the Casino. Please try again later!<br><br>If the problem persists, please contact our customer support for further assistance!';
        } else if(curent_lang=="spn"){
          document.getElementById("FloatLayerContent_div").innerHTML='Su conexi&oacuten hacia el Casino esta experimentando problemas. Por favor, intentelo m&aacutes tarde<br><br>Intentelo de nuevo en 30 M&iacute;n! S&iacute; el problema persiste, por favor contacte a nuestro Servicio de Soporte para mayor asistencia!';
        }else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML='Voc&ecirc; est&aacute; enfrentando um problema de conex&atilde;o para o Casino. Por favor tente<br><br>novamente mais tarde! Se o problema persistir entre em contato com nosso suporte ao cliente para obter mais informa&ccedil;&otilde;es!';
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="13px";      
      }else if(response=="BLOCKED"){
        clearInterval(statusIntervalID);
        
        if(curent_lang=="" || curent_lang=="eng"){        
          document.getElementById("FloatLayerContent_div").innerHTML='Your account has been blocked. Please contact the customer support for more information';
        } else if(curent_lang=="spn"){
          document.getElementById("FloatLayerContent_div").innerHTML='Su cuenta ha sido bloqueada. Por favor contacte a Servicio de Soporte para mayor informaci&oacute;n';
        }else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML='A sua conta foi bloqueada. Entre em contato com o atendimento ao cliente para obter mais informa&ccedil;&otilde;es.';
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="13px";        
      }else if(response=="MAINTENANCE"){
        clearInterval(statusIntervalID);

        if(curent_lang=="" || curent_lang=="eng"){        
          document.getElementById("FloatLayerContent_div").innerHTML='Because of maintenance you are not able to login to your account. Please try again later';
        } else if(curent_lang=="spn"){
          document.getElementById("FloatLayerContent_div").innerHTML='Estamos en Mantenimiento, y por ello usted no puede accesar a su cuenta. Por favor, intentelo mas tarde.';
        }else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML='Por motivo de manuten&ccedil;&atilde;o voc&ecirc; n&atilde;o pode entrar em sua conta. Tente novamente mais tarde.';
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="13px";
      }
      
      document.getElementById("curent_user_hash_id").value="";
      document.getElementById("curent_user_id").value="";
      document.getElementById("curent_user_pwd").value="";
      document.getElementById("curent_session").value="";
      document.getElementById("sitekey_id").value="";        
      document.getElementById("play_for_real").value="0";
      document.getElementById("curent_status").value="0";
      document.getElementById("statusIntervalID").value="0";              
		
      load_page('s', 'web', '', '');        
    }
  }
}

//Send request to server to check if the loged in user if correct if yes hendle the response on the server side
function CheckUserLogin(func_name){
  var curent_lang=document.getElementById("curent_lang").value;  
  var user_id=document.getElementById("contentFrame").contentWindow.document.getElementById('user_id').value;
  var pwd=document.getElementById("contentFrame").contentWindow.document.getElementById('pwd').value;
//alert(user_id+""+pwd);
  if(user_id=="" || pwd==""){
        setOverlaySizeloading();
        setOveralMSG();   	  
   	if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML ="Please enter your user id and password to login.";
          document.getElementById("contentFrame").contentWindow.document.getElementById('pwd').className="login_input_highlight";
          document.getElementById("contentFrame").contentWindow.document.getElementById('user_id').className="login_input_highlight";
	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="Por favor ingrese su ID de Usuario y Contrase&ntilde;a para ingresar.";
          document.getElementById("contentFrame").contentWindow.document.getElementById('pwd').className="login_input_highlight";
          document.getElementById("contentFrame").contentWindow.document.getElementById('user_id').className="login_input_highlight";
	}else if(curent_lang=="por"){
	  document.getElementById("FloatLayerContent_div").innerHTML ="Por favor, entre com seu nome de usu&aacute;rio e senha.";
          document.getElementById("contentFrame").contentWindow.document.getElementById('pwd').className="login_input_highlight";
          document.getElementById("contentFrame").contentWindow.document.getElementById('user_id').className="login_input_highlight";
	}			  
  }else if(user_id!="" && pwd!=""){
    setOverlaySizeloading();  
//    pwd=md5_pwd(pwd);    
    sendCall("include/consult.php?req="+func_name+"&user_id="+user_id+"&pwd="+pwd, "hr_CheckUserLogin");
  }
}

//Check if the loged in user if correct if yes hendle the response on the client side
function hr_CheckUserLogin(){
var curent_lang=document.getElementById("curent_lang").value; 
var curent_page=document.getElementById("curent_page").value;
var curent_session=document.getElementById('curent_session').value;
var func_name="get_logedin_user_details";

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    response = trim(response);
//    alert(response);
    if(response != ""){
        //alert(response);
      if(response == "NONE"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML ="You did not enter a valid user id or password!"; 
       	} else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML ="No ingreso un correcto ID de Usuario o Contrase&ntilde;a!"; 
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Voc&ecircl n&atilde;o inseriu seu  ID de usu&aacute;rio v&aacute;lido ou senha!"; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";   
      }else if(response == "BLOCKED"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){        
          document.getElementById("FloatLayerContent_div").innerHTML='Your account has been blocked. Please contact the customer support for more information';
        } else if(curent_lang=="spn") {
          document.getElementById("FloatLayerContent_div").innerHTML='Su cuenta ha sido bloqueada. Por favor contacte a Servicio de Soporte para mayor informaci&oacute;n';
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="A sua conta foi bloqueada. Entre em contato com o suporte ao cliente para obter mais informa&ccedil;&otilde;es."; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
        document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").value="";
	document.getElementById("contentFrame").contentWindow.document.getElementById("pwd").value="";        	  
	document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").focus();
      }else if(response == "MAINTENANCE"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){        
          document.getElementById("FloatLayerContent_div").innerHTML='Because of maintanace you are not able to login to your account. Please try again later';
        } else if(curent_lang=="spn") {
          document.getElementById("FloatLayerContent_div").innerHTML='Estamos en Mantenimiento, y por ello usted no puede accesar a su cuenta. Por favor, intentelo mas tarde.';
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Por motivo de manuten&ccedil;&atilde;o voc&ecirc; n&atilde;o pode entrar em sua conta. Tente novamente mais tarde."; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
        document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").value="";
	document.getElementById("contentFrame").contentWindow.document.getElementById("pwd").value="";        	  
	document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").focus();
      }else if(response == "TECH_PROBLEM"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){        
          document.getElementById("FloatLayerContent_div").innerHTML='You are experiencing a connection problem to the Casino. Please try again later!<br><br>If the problem persists, please contact our customer support for further assistance!';
        } else if(curent_lang=="spn") {
          document.getElementById("FloatLayerContent_div").innerHTML='Su conexi&oacuten hacia el Casino esta experimentando problemas. Por favor, intentelo m&aacutes tarde<br><br>Intentelo de nuevo en 30 M&iacute;n! S&iacute; el problema persiste, por favor contacte a nuestro Servicio de Soporte para mayor asistencia!';
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Voc&ecirc; est&aacute; enfrentando um problema de conex&atilde;o para o Casino. Por favor tente novamente<br><br> mais tarde! Se o problema persistir entre em contato com nosso suporte ao cliente para obter mais informa&ccedil;&otilde;es!"; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
        document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").value="";
	document.getElementById("contentFrame").contentWindow.document.getElementById("pwd").value="";        	  
	document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").focus();
      }else if(response == "NO_USER_ID"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){        
        document.getElementById("FloatLayerContent_div").innerHTML='The user id you entered is not correct or this account may be disabled. Please try again, or contact the customer support';
        } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML='El ID de usuario que suministro no es correcto o su cuenta ha sido bloqueada. Intente de nuevo, o contacte al Servicio de Soporte';
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="O ID do usu&aacute;rio digitado n&atilde;o &eacute; correto ou sua conta pode estar desabilitada. Por favor tente novamente ou entre em contato com o suporte ao cliente"; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
        document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").value="";
	document.getElementById("contentFrame").contentWindow.document.getElementById("pwd").value="";        	  
	document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").focus();
      }else if(response == "ALLREADY_LOGGED_SAME_IP"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Your account status indicates that you are already logged in on this computer. It may be that you have not logged out correctly during your last visit.<br><br>Please try again in 30 min! If the problem persists, please contact our customer support for further assistance!";
        } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="El estatus de su cuenta indica que usted realmente ya ha ingresado en esta computadora. Si se ha debido a que usted no ha cerrado su sesi&oacute;n correctamente durante su &uacute;ltima visita.<br><br>Intentelo de nuevo en 30 M&iacute;n! S&iacute; el problema persiste, por favor contacte a nuestro Servicio de Soporte para mayor asistencia!";
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Seu status de conta indica que voc&ecirc; j&aacute; est&aacute; conectado nesse computador. Pode ser que voc&eacute; n&atilde;o efetuou a sa&iactue;da corretamente durante sua &uacute;ltima visita. Por favor tente novamente em 30 min! Se o problema persistir entre em contato com nosso suporte ao cliente para obter mais informa&ccedil;&otilde;es!"; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
      }else if(response == "LOGGED_IN_DB"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="During your last visit you seem not to have logged out correctly. Please try again in 30 min! If the problem persists, please contact our customer support for further assistance!";
        } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Durante su &uacute;ltima visita usted no cerro su sesi&oacute;n correctamente. Por favor intentelo en 30 m&iacute;n! S&iacute; el problema persiste, por favor contacte a nuestro Servicio de Soporte para mayor asistencia!";
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Durante sua &uacute;ltima visita voc&ecirc; parece n&atilde;o ter registrado a sa&iactue;da corretamente. Por favor tente novamente em 30 min! Se o problema persistir por favor entre em contato com nosso suporte ao cliente para obter assist&ecirc;ncia!"; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
      }else if(response == "ACCOUNT_DISABLE"){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Your account is not active.\nPlease contact the customer support for more information!";      
        } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Su cuenta no est&aacute; activa.\nPor favor contacte a Servicio de Soporte para mayor informaci&oacute;n!";      
       	} else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="A sua conta n&atilde;o est&aacute; ativa.<br>Entre em contato com o atendimento ao cliente para obter mais informa&ccedil;&otilde;es!"; 
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
      }else{
        //filter response here
        //
        var server_responce = response;
        var server_responce_array = new Array();
        server_responce_array = server_responce.split('|');
        server_responce_array[0];
        server_responce_array[1];
        server_responce_array[2];
                
        document.getElementById('curent_user_hash_id').value=server_responce_array[0];
        
        document.getElementById('curent_session').value=server_responce_array[1];
        document.getElementById('sitekey_id').value=server_responce_array[2];
        curent_session=document.getElementById('curent_session').value;
        
        if(curent_session!=""){
          document.getElementById('play_for_real').value="1";
          var play_for_real=document.getElementById('play_for_real').value;
 
          if(curent_page=="h" || curent_page=="p" || curent_page=="p_1" || curent_page=="p_2" || curent_page=="p_3" || curent_page=="p_4" || curent_page=="t" || curent_page=="au" || curent_page=="tac" || curent_page=="ap" || curent_page=="cg" || curent_page=="fg" || curent_page=="rg" || curent_page=="l" || curent_page=="sm" || curent_page=="sat" || curent_page=="pp"){
//            document.getElementById("contentFrame").contentWindow.load_minislot(300, 230, curent_session, play_for_real);
          }
        }
        
        document.getElementById('curent_user_id').value=document.getElementById("contentFrame").contentWindow.document.getElementById("user_id").value;
        document.getElementById('curent_user_pwd').value=document.getElementById("contentFrame").contentWindow.document.getElementById("pwd").value;
        var user_id = document.getElementById('curent_user_id').value;
        var pwd = document.getElementById('curent_user_pwd').value;
        
        //document.getElementById("contentFrame").contentWindow.document.getElementById("login_content_div").innerHTML=indicator;
       
        //Login user so they can play for real money
        sendCall("include/consult.php?req="+func_name+"&curent_lang="+curent_lang+"&sitekey_id="+server_responce_array[2]+"&user_hash="+server_responce_array[0], "hr_SetUserLoginInfo");        
      }
    }else{
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){      
        document.getElementById("FloatLayerContent_div").innerHTML="An unexpected error accrued during the request. Please try again!";
      }else if(curent_lang=="spn") {      
        document.getElementById("FloatLayerContent_div").innerHTML="Un error inesperado ocurrio durante el requerimiento. Por favor, intente de nuevo!";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Voc&ecirc; n&atilde;o inseriu direito seu ID de usu&aacute;rio v&aacute;lido ou sua senha!"; 
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
    }
  }
}

function hr_SetUserLoginInfo(){

var path="../../../../";
var curent_page=document.getElementById("curent_page").value;
var curent_status=parseInt(document.getElementById("curent_status").value);
var curent_lang=document.getElementById("curent_lang").value;

var user_hash = document.getElementById('curent_user_hash_id').value;
var sitekey_id = document.getElementById('sitekey_id').value;
var curent_session = document.getElementById('curent_session').value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText   
    
//  alert(response);
    if(response != ""){
      //sendCall("include/consult.php?req=getSession&user_hash="+user_hash+"&sitekey_id="+sitekey_id, "hr_SetCasinoSess");
      
      document.getElementById("contentFrame").contentWindow.document.getElementById("login_content_div").innerHTML=response;
      document.getElementById("contentFrame").contentWindow.document.getElementById("login_div").style.backgroundImage="url('../../../../themes/BLVC/img/lang/"+curent_lang+"/lgn_bg2.png')";
      
      if(curent_page!="h" || curent_page=="t_detail"){
        document.getElementById("contentFrame").contentWindow.document.getElementById("get_started_div").style.visibility="hidden";
        document.getElementById("contentFrame").contentWindow.document.getElementById("get_started_div").style.position="absolute";
        //set active layer promotion

        if(curent_page=="p" || curent_page=="p_1" || curent_page=="p_2" || curent_page=="p_3" || curent_page=="p_4" || curent_page=="p_5" || curent_page=="t" || curent_page=="au" || curent_page=="tac" || curent_page=="ap" || curent_page=="cg" || curent_page=="fg" || curent_page=="rg" || curent_page=="l" || curent_page=="sm" || curent_page=="sat" || curent_page=="pp"|| curent_page=="rng"){
          document.getElementById("contentFrame").contentWindow.document.getElementById("promotion_div").style.visibility="visible";
          document.getElementById("contentFrame").contentWindow.document.getElementById("promotion_div").style.position="relative";
        }
//        document.getElementById("contentFrame").contentWindow.document.getElementById("promotion_div").innerHTML=signup_block(path, curent_lang, "promotion_div");  
      }

      if(curent_page=="h"){
        document.getElementById("contentFrame").contentWindow.document.getElementById("readmore_h").style.visibility="visible";
        document.getElementById("contentFrame").contentWindow.document.getElementById("readmore_h").style.position="relative";
        document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_casino2_div").style.visibility="visible";
        document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_casino2_div").style.position="relative";
        document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_register_div").style.visibility="hidden";
        document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_register_div").style.position="absolute";
        document.getElementById("contentFrame").contentWindow.arrowbtn_Casino2();
      }

      if(document.getElementById("contentFrame").contentWindow.document.getElementById("userpoints")){ 
        document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').innerHTML=""; 
        parent.getUserPoint();
        if(curent_page=="casino"){
          document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').style.top=0+'px';        
        }else{
          document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').style.top=-18+'px';
        }
      }  
            
      document.getElementById("contentFrame").contentWindow.document.getElementById("btn_buychips").style.visibility="visible";
      document.getElementById("contentFrame").contentWindow.document.getElementById("btn_buychips").style.position="absolute";
      if(curent_status==1){
        //clearOverlaySizeloading();
      }
      if(curent_status==0){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML="Welcome to <b>Bingo Las Vegas Casino</b><br>You are now playing with <u>Real Money</u>. Enjoy the awesome world of online gaming.<br><br>Remember to logout properly when you leave!<br><br>We will bring Las Vegas in to your room.";
        }else if(curent_lang=="spn") {
          document.getElementById("FloatLayerContent_div").innerHTML="Bienvenido a <b>Bingo Las Vegas Casino</b><br>Actualmente estas jugando con <u>Dinero Real</u>. Disfruta del emocionante mundo del Juego en L&iacute;nea.<br><br>Recuerda cerrar su sesi&oacute;n correctamente cuando se vaya!<br><br>Nosotros le traemos las Vegas a su hogar.";
        }else if(curent_lang=="por") {
          document.getElementById("FloatLayerContent_div").innerHTML="Bem-vindo ao <b>Bingo Las Vegas Casino</b><br>Você agora está jogando com <u>dinheiro real</u>. Aproveite a incrível mundo dos jogos online.<br><br>Lembre-se de sair corretamente!<br><br>Nós vamos trazer de Las Vegas para sua casa.";
        }
        
        document.getElementById("FloatLayerContent_div").style.textAlign="left";
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";
        var setintervatID = setInterval("CheckAccountStatus()", 20000);
        document.getElementById('statusIntervalID').value=setintervatID;
        document.getElementById("curent_promo").value=0;          
      }
      if(curent_page=="ps" && curent_status==0){
        document.getElementById('curent_status').value="1";
        load_syspage('ps', 'web', '', sitekey_id, '', ''); 
      }

      if(curent_status!=1){
        document.getElementById('curent_status').value="1";
      }
            
    }else{
      setOveralMSG();
      if(curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="There seems to be a problem with your account.<br>Please contact the help desk for more information!";
      }else if(curent_lang=="spn"){
        document.getElementById("FloatLayerContent_div").innerHTML="Hemos encontrado un problema con su cuenta.<br>Por favor, contacte a nuestro Servicio de Soporte para m&aacute;s informaci&oacute;n!";		  
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Encontramos um problema em sua conta.<br>Por favor entre em contato com o suporte t&eacute;cnico para obter mais informa&ccedil;&otilde;es!"; 
      }

      LogoutUser("problem", sitekey_id);
      document.getElementById("FloatLayerContent_div").style.textAlign="center";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
    }
  }
}

//Send request to server to check if the loged in user if correct if yes hendle the response on the server side
function GetCasinoGameFull(curent_session,mode,gameid){
    //alert(curent_session+" "+mode+" "+gameid);
    var curent_session=document.getElementById('curent_session').value;
    var mode=document.getElementById('play_for_real').value;
    var gameid=document.getElementById('gameid').value;
    var gamelang=document.getElementById('gamelang').value;
    if(curent_session!=""){
      popup("../../../../include/consult_game.php?gameID="+gameid+"&curent_session="+curent_session+"&mode="+mode+"&gamelang="+gamelang, "GameWindow");
    }else{
      popup("../../../../include/consult_game.php?gameID="+gameid+"&mode="+mode+"&gamelang="+gamelang, "GameWindow");    
    }
    load_page('casino', 'web', '', '');
//    sendCall("include/consult_game.php?gameID="+gameid+"&curent_session="+curent_session+"&mode="+mode, "hr_SetGameInPlace");
}

function GetUserGameHistory(){
    var curent_session=document.getElementById('curent_session').value;
    var mode=document.getElementById('play_for_real').value;
    var gameid=document.getElementById('gameid').value;
    var gamelang=document.getElementById('gamelang').value;
    
    window.open("https://bingolasvegas-proxy.casinomodule.com/game/history?sessionId="+curent_session+"&lang="+gamelang+"&gameId="+gameid+"", "GameHistory", "width=590px, height=465px, scrollbars=no, toolbar=no, resizable=no, status=no, address=yes, copyhistory=no, location=no, menubar=yes");
}

//Send request to server to check if the loged in user if correct if yes hendle the response on the server side
function GetCasinoGame(curent_session,mode,gameid,gamelang){
    //alert(curent_session+" "+mode+" "+gameid);
    if(curent_session!=""){
      document.getElementById("contentFrame").contentWindow.load_flashgame(curent_session,mode,gameid,gamelang);
//      sendCall("include/consult_normal_game.php?gameID="+gameid+"&curent_session="+curent_session+"&mode="+mode+"&gamelang="+gamelang, "hr_SetGameInPlace");
    }else{
      document.getElementById("contentFrame").contentWindow.load_flashgame("",mode,gameid,gamelang);
//      sendCall("include/consult_normal_game.php?gameID="+gameid+"&mode="+mode+"&gamelang="+gamelang, "hr_SetGameInPlace");    
    }
//    sendCall("include/consult_game.php?gameID="+gameid+"&curent_session="+curent_session+"&mode="+mode, "hr_SetGameInPlace");
}

//Send request to server to check if the loged in user if correct if yes hendle the response on the server side
function GetCasinoTournamentGameFull(curent_session,mode,gameid){
    //alert(curent_session+" "+mode+" "+gameid);
    var curent_session=document.getElementById('curent_session').value;
    var mode=document.getElementById('play_for_real').value;
    var gameid=document.getElementById('gameid').value;
    var gamelang=document.getElementById('gamelang').value;
    if(curent_session!=""){
      popup("../../../../include/consult_game.php?gameID="+gameid+"&curent_session="+curent_session+"&mode="+mode+"&gamelang="+gamelang, "GameWindow");
    }
    load_page('t_detail', 'web', '', '');
//    sendCall("include/consult_game.php?gameID="+gameid+"&curent_session="+curent_session+"&mode="+mode, "hr_SetGameInPlace");
}

function hr_SetGameInPlace(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText 
    if(response != ""){   
      document.getElementById("contentFrame").contentWindow.document.getElementById('FloatLayerGame_div').innerHTML=response;
      //alert(response);
    }  
  }
}

function GetLoginDetails(){
  var func_name="get_logedin_user_details";
//  var user_id = document.getElementById('curent_user_id').value;
//  var pwd = document.getElementById('curent_user_pwd').value;
  var curent_lang=document.getElementById("curent_lang").value; 
  var user_hash = document.getElementById('curent_user_hash_id').value;
  var sitekey_id = document.getElementById('sitekey_id').value;
//        document.getElementById("contentFrame").contentWindow.document.getElementById("login_content_div").innerHTML=indicator;
        //alert(parent.document.getElementById('curent_user_id').value);
        //Login user so they can play for real money
        
  sendCall("include/consult.php?req="+func_name+"&curent_lang="+curent_lang+"&user_hash="+user_hash+"&sitekey_id="+sitekey_id, "hr_SetUserLoginInfo"); 
}

function JustGetLoginDetails(){
  var func_name="get_logedin_user_details";
//  var user_id = document.getElementById('curent_user_id').value;
//  var pwd = document.getElementById('curent_user_pwd').value;
  var user_hash = document.getElementById('curent_user_hash_id').value;
  var sitekey_id = document.getElementById('sitekey_id').value;
  var curent_lang=document.getElementById("curent_lang").value;   
//        document.getElementById("contentFrame").contentWindow.document.getElementById("login_content_div").innerHTML=indicator;
        //alert(parent.document.getElementById('curent_user_id').value);
        //Login user so they can play for real money
  setOverlaySizeloading();
  sendCall("include/consult.php?req="+func_name+"&curent_lang="+curent_lang+"&user_hash="+user_hash+"&sitekey_id="+sitekey_id, "hr_JustSetUserLoginInfo"); 
}

function hr_JustSetUserLoginInfo(){

var path="../../../../";
var curent_lang=document.getElementById("curent_lang").value; 
var curent_page=document.getElementById("curent_page").value;
var curent_status=parseInt(document.getElementById("curent_status").value);

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    
//    alert(response);
    if(response != ""){
//      clearOverlaySizeloading();    
      document.getElementById("contentFrame").contentWindow.document.getElementById("login_content_div").innerHTML=response;
      document.getElementById("contentFrame").contentWindow.document.getElementById("login_div").style.backgroundImage="url('../../../../themes/BLVC/img/lang/"+curent_lang+"/lgn_bg2.png')";
      
    }else{
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="There seems to be a problem with your account.<br>Please contact the help desk for more information!";
      } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Hemos encontrado un problema con su cuenta.<br>Por favor, contacte a nuestro Servicio de Soporte para m&aacute;s informaci&oacute;n!";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Encontramos um problema em sua conta.<br>Por favor entre em contato com o suporte t&eacute;cnico para obter mais informa&ccedil;&otilde;es!"; 
      }
      document.getElementById("FloatLayerContent_div").style.textAlign="center";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";
    }
  }
}

function LogoutUser(func_name, sitekey_id){
  if(confirm('Are you sure you want to logout?')){
    var user_id=document.getElementById('curent_user_id').value;
    var pwd=document.getElementById('curent_user_pwd').value;
    var user_hash=document.getElementById('curent_user_hash_id').value;
    setOverlaySizeloading();      
    if(func_name!="problem"){
      sendCall("include/consult.php?req="+func_name+"&user_hash="+user_hash+"&user_id="+user_id+"&pwd="+pwd+"&sitekey_id="+sitekey_id, "hr_LogoutUser");
    }else{
      func_name="logout_user";	
      sendCall("include/consult.php?req="+func_name+"&user_hash="+user_hash+"&user_id="+user_id+"&pwd="+pwd+"&sitekey_id="+sitekey_id, "hr_ProblemLogoutUser");	  	
    }
  }
}

function ForsLogoutUser(func_name, sitekey_id){
  var user_id=document.getElementById('curent_user_id').value;
  var pwd=document.getElementById('curent_user_pwd').value;
  var user_hash=document.getElementById('curent_user_hash_id').value;
  if(user_hash!=""){
    window.open("include/consult.php?req="+func_name+"&user_hash="+user_hash+"&user_id="+user_id+"&pwd="+pwd+"&sitekey_id="+sitekey_id+"", "logout", "fullscreen, scrollbars=no, toolbar=no, resizable=no, status=no, address=yes, copyhistory=no, location=no, menubar=yes");

 //   setOverlaySizeloading(); 
//    setOveralMSG();
//    document.getElementById("FloatLayerContent_div").innerHTML ="Dear Client,<br>Please wait while you are being logged out<br><br>Next time please logout before you exit!"; 
//    document.getElementById("FloatLayerContent_div").style.fontSize="12px";   
  }
}


function hr_ProblemLogoutUser(){
var curent_lang=document.getElementById('curent_lang').value;
var curent_page=document.getElementById('curent_page').value;
var curent_status=document.getElementById('curent_status').value;

var path="../../../../";
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    response = trim(response);
    if(response != ""){
      setOveralMSG();
      if(curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="There seems to be a connection problem while logging in to your account.<br>Please try again! If the problem persists contact the customer support for more assistance.";
      }else if(curent_lang=="spn"){
        document.getElementById("FloatLayerContent_div").innerHTML="Ocurrio un problema con la conexión mientras se realizaba el acceso a su Cuenta.<br>Intente de nuevo! Si el problema persiste contacte a nuestro soporte tecnico para mayor asistencia.";		  
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Ocorreu um problema de conex&atilde;o ao mesmo tempo em efetuar a entrada em sua conta.<br>Por favor tente novamente! Se o problema persistir contato o suporte ao cliente para obter mais assist&ecirc;ncia."; 
      }
	  
      document.getElementById("FloatLayerContent_div").style.textAlign="left";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px"; 
    }
  }
}
	
	
function hr_LogoutUser(){
var curent_lang=document.getElementById('curent_lang').value;
var curent_page=document.getElementById('curent_page').value;
var curent_status=document.getElementById('curent_status').value;
var statusIntervalID=document.getElementById('statusIntervalID').value;
var statusIntervalID2=document.getElementById('statusIntervalID2').value;

var path="../../../../";
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    response = trim(response);
    if(response != ""){
           //alert(response);
      if(response == "LOGGED_OUT"){
        if(curent_page=="casino"){
          //set active layer 123 easy signup
          document.getElementById("contentFrame").contentWindow.document.getElementById("get_started_div").style.visibility="visible";
          document.getElementById("contentFrame").contentWindow.document.getElementById("get_started_div").style.position="relative";
          //set inactive layer promotion
          if(curent_page!="psd" || curent_page!="ps"){                  
            document.getElementById("contentFrame").contentWindow.document.getElementById("promotion_div").style.visibility="hidden";
            document.getElementById("contentFrame").contentWindow.document.getElementById("promotion_div").style.position="absolute";
          }
      
          document.getElementById("contentFrame").contentWindow.document.getElementById("get_started_content_div").innerHTML=signup_block(path, curent_lang, "get_started_content_div");
          document.getElementById("contentFrame").contentWindow.easy_signup();
        }

        if(curent_status==1 && curent_page!="casino_gp"){
           document.getElementById("contentFrame").contentWindow.document.getElementById("btn_buychips").style.visibility="hidden";
           document.getElementById("contentFrame").contentWindow.document.getElementById("btn_buychips").style.position="absolute";    
        }
        
        if(curent_page=="h"){
	  document.getElementById("contentFrame").contentWindow.load_minislot(300, 230, response, 0);
//          document.getElementById("contentFrame").contentWindow.document.getElementById("readmore_h").style.visibility="hidden";
          document.getElementById("contentFrame").contentWindow.document.getElementById("readmore_h").style.position="absolute";
          document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_register_div").style.visibility="visible";
          document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_register_div").style.position="relative";
          document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_casino2_div").style.visibility="hidden";
          document.getElementById("contentFrame").contentWindow.document.getElementById("arrowbtn_casino2_div").style.position="absolute";
        }  
        
        if(curent_page!="casino_gp"){
          document.getElementById("contentFrame").contentWindow.login_logout_user("logout", "", path, "login_div", "login_header_div", "login_content_div");
        }
		
        document.getElementById("curent_user_hash_id").value="";
        document.getElementById("curent_user_id").value="";
        document.getElementById("curent_user_pwd").value="";
        document.getElementById("curent_session").value="";
        document.getElementById("sitekey_id").value="";        
        document.getElementById("play_for_real").value="0";
        document.getElementById("curent_status").value="0";
        document.getElementById("statusIntervalID").value="0";        
		
        if(curent_page=="casino_gp"){
          load_page('casino', 'web', '', '');
        }else if((curent_page!="h") && (curent_page!="casino")){
          load_page('h', 'web', '', '');        
        }
        clearInterval(statusIntervalID);		
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML="<br><br>Thank you for playing with Bingo Las Vegas Casino!";
        }else if(curent_lang=="spn") {
          document.getElementById("FloatLayerContent_div").innerHTML="<br><br>Gracias por jugar con Bingo Las Vegas Casino!";
        } else if(curent_lang=="por") {
          document.getElementById("FloatLayerContent_div").innerHTML="<br><br>Obrigado por jogar com o Bingo Las Vegas Casino!";
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
        document.getElementById("FloatLayerContent_div").style.textAlign="center";		
        document.getElementById("curent_promo").value=1;
        if(curent_lang=="" || curent_lang=="eng"){
          onlinemsg='<div id="userpoints" style="visibility: visible; position: relative;"><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="14">&nbsp;</td><td><font style="font-size:12px;" color="#FFFFFF"><div id="nrusers">* ... players in casino room</div><div id="txtpromonrgames">* More than 100 amazing casino games online!</div</font></td></tr></table></div>';
        }else if(curent_lang=="spn"){
          onlinemsg='<div id="userpoints" style="visibility: visible; position: relative;"><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="14">&nbsp;</td><td><font style="font-size:12px;" color="#FFFFFF"><div id="nrusers">* ... jugadores en el Casino</div><div id="txtpromonrgames">* Más de 100 increibles juegos de casino en línea!</div</font></td></tr></table></div>';
        }else if(curent_lang=="por"){
          onlinemsg='<div id="userpoints" style="visibility: visible; position: relative;"><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="14">&nbsp;</td><td><font style="font-size:12px;" color="#FFFFFF"><div id="nrusers">* ... jogadores no Casino</div><div id="txtpromonrgames">* mais de 100 incr&iacute;veis Jogos de casino online!</div></font></td></tr></table></div>';
        }
        if(document.getElementById("contentFrame").contentWindow.document.getElementById("userpoints")){ 
          document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').innerHTML=onlinemsg;
          if(curent_page=="casino"){
            document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').style.top=0+'px';        
          }else{
            document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').style.top=-18+'px';
          }
        }
        
        clearInterval(statusIntervalID);
        clearInterval(statusIntervalID2);
      }
    }
  }
}

//get personal details from user
function GetPersonalDetails(func_name, sitekey_id, lang){         

//  alert(sitekey_id+' '+lang);

  var user_id=document.getElementById('curent_user_id').value;
  var pwd=document.getElementById('curent_user_pwd').value;
  var user_hash=document.getElementById('curent_user_hash_id').value;
  
//  alert(user_id+" "+pwd+" "+sitekey_id+" "+lang);
  sendCall("include/consult.php?req="+func_name+"&user_id="+user_id+"&pwd="+pwd+"&sitekey_id="+sitekey_id+"&user_hash="+user_hash+"&curent_lang="+lang, "hr_GetPersonalDetails");
}

function hr_GetPersonalDetails(){
var path="../../../../";
var curent_lang=document.getElementById("curent_lang").value;

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    if(response.length <= 12){
      response = trim(response);
    }
   if(response != ""){
           //alert(response);
      if(response == "NO_ACCESS"){
        setOverlaySizeloading();
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="You have no access to this page!";
        } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Usted no tiene acceso a esta p&aacute;gina!";
        } else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Você n&atilde;o tem acesso a esta p&aacute;gina!";
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
      }else{
        document.getElementById("contentFrame").contentWindow.document.getElementById('page_content').innerHTML=response;
      }
    }
  }
}

function hr_SubscribeUser(){
var path="../../../../";
var curent_lang=document.getElementById("curent_lang").value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    setOveralMSG();
//alert(response);
//showhideFloatLayer("FloatLayer_div", "show");
//document.getElementById("FloatLayerContent_div").innerHTML=response;    
//document.getElementById("FloatLayerContent_div").style.textAlign="left";

//document.getElementById("blankout").style.visibility = "hidden";
    var server_responce = response;
    var server_responce_array = new Array();
    server_responce_array = server_responce.split('|');
    server_responce_array[0];
    server_responce_array[1];
      
    if(server_responce_array[0]=="DONE"){
      document.getElementById("FloatLayerContent_div").innerHTML=server_responce_array[1];
      document.getElementById("FloatLayerContent_div").style.textAlign="left";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";
    
      load_page('h', 'web', '', '');
    }else if(server_responce_array[0]=="NO_CREATE"){
    
      response = trim(server_responce_array[1]);  
      if(response=="USER_ID_EXS"){
        if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML="This user id already exist.";
        }else if(curent_lang=="spn") {
          document.getElementById("FloatLayerContent_div").innerHTML="Este usuario ya existe.";
        }else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML="ID do usu&aacute;rio j&aacute; existe.";
        }
      }
    }
  }
}

function GetHistoryContent(where, what, from, to, curent_lang){
  var func_name="GetHistoryContent";
  var user_hash=document.getElementById('curent_user_hash_id').value;
  
  sendCall("include/consult.php?req="+func_name+"&where="+where+"&what="+what+"&user_hash="+user_hash+"&from="+from+"&to="+to+"&curent_lang="+curent_lang, "hr_GetHistoryContent");
}

function hr_GetHistoryContent(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;  
//    alert(response);
    document.getElementById("contentFrame").contentWindow.document.getElementById("deposithistory").innerHTML=response;
  }
}

function activateAccount(casino_id, hash, email){
  var func_name="activate_account";
  setOverlaySizeloading();  
  if(casino_id=="BingoLasVegasCasino" && hash.length==32 && email!=""){
    sendCall("include/consult.php?req="+func_name+"&casino_id="+casino_id+"&hash="+hash+"&email="+email, "hr_activateAccount");
  }
}

function hr_activateAccount(){
var curent_lang=document.getElementById("curent_lang").value; 
var path="../../../../";
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;

    response=trim(response);

    if(response=="ACTIVED"){
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){	      
      document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>Your account has been activated successfully.<br><br>Bingo Las Vegas Casino wishes you a great welcome to the awesome world of online gaming.<br><br>Enjoy your stay at our website!<br>";
      } else if(curent_lang=="spn") {
      document.getElementById("FloatLayerContent_div").innerHTML="Estimado Cliente,<br>Su cuenta ha sido activada correctamente.<br><br>Bingo Las Vegas Casino desea darle una gran bienvenida al excitante mundo del juego en l&iacute;nea.<br><br>Disfrute su estadia en nuestro Sitio!<br>";
      } else if(curent_lang=="por") {
      document.getElementById("FloatLayerContent_div").innerHTML="Prezado Cliente,<br>Sua conta foi ativada com sucesso.<br><br>Bingo Las Vegas deseja-lhe uma grande import&acirc;ncia &agrave; jogos on-line incr&iactue;el mundo.<br><br>Aproveite sua estadia em nossa p&aacute;gina!<br>";
      }
      document.getElementById("FloatLayerContent_div").style.textAlign="left";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";

      setTimeout("rederect()",3000);

    }else if(response=="PROBLEM"){
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){	      
        document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>Because of an Connection problem <br><br>your account could not be activated this moment.<br><br>Please try again later.<br>";
      } else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente,<br>debido a un problema de coneccion <br><br>su cuenta no puede ser activada en este momento.<br><br>Por favor, int&eacute;ntelo de nuevo m&aacute;s tarde.<br>";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Prezado Cliente,<br>Por devido a um problema com a conec&cecedil;o<br><br>sua conta n&atilde;o pode ser ativada no momento.<br><br>Por favor tente de novo mais tarde.<br>"; 
      }
      document.getElementById("FloatLayerContent_div").style.textAlign="left";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";

      setTimeout("rederect()",3000);

    }else if(response=="ACTIVE"){
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){	      
      document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>This account has been activated already.<br><br>Please contact our customer support if you encounters any problem while accessing your account.";
      } else if(curent_lang=="spn") {
      document.getElementById("FloatLayerContent_div").innerHTML="Estimado Cliente,<br>Ya su cuenta ha sido activada.<br><br>Por favor contacte a nuestro servicio de soporte si usted encuentra alg&uacute;n problema accesando a su cuenta.";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML ="Prezado cliente,<br>esta conta j&aacute; foi ativada.<br><br>Entre em contato com nosso suporte ao cliente se voc&ecirc; encontrar qualquer problema ao acessar sua conta."; 
      }
      document.getElementById("FloatLayerContent_div").style.textAlign="left";
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";

      setTimeout("rederect()",3000);
    }else{
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){	      
      document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>Your account has <b><u>NOT</u></b> been activated.<br><br>Please click on the URL we have send to your email address ("+response+").<br>If clicking on the link doesn't work, try copying and pasting it into your browser.<br>";
      } else if(curent_lang=="spn") {
      document.getElementById("FloatLayerContent_div").innerHTML="Estimado Cliente,<br>Su cuenta a&uacute;n <b><u>NO</u></b> ha sido activada.<br><br>Por favor, haga clic en la URL que nosotros le hemos enviado a su correo eletr&oacute;nico ("+response+").<br>Si al hacer clic el enlace no funciona, trate de cortarlo y pegarlo en la barra del navegador.<br>";
      } else if(curent_lang=="por") {
      document.getElementById("FloatLayerContent_div").innerHTML="Prezado Cliente,<br>Sua conta ainda <b><u>n&atilde;o</u></b> foi bem ativado.<br><br>Por favor clique na URL que enviamos a seu endere&ccedil;o de e-mail ("+response+").<br>Se voc&ecirc; clicar no link e n&atilde;o funcionar, tente copiar e colar em seu navegador.<br>";
      }
      document.getElementById("FloatLayerContent_div").style.textAlign="left";  
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";      
    }
  }
}

function rederect(){
  window.location="http://www.bingolasvegascasino.com";
}

function getnewCasinoBalance(){
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;

  parent.sendCall("include/consult.php?req=setCasinoBalance&user_hash="+user_hash+"&sitekey_id="+sitekey_id, "hr_SetNewBalance");
}

function hr_SetNewBalance(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    document.getElementById("contentFrame").contentWindow.document.getElementById('casino_balance_div').innerHTML=response;
  }
}

function getNrUsersOnline(){
  sendCall("include/consult.php?req=UsersOnline", "hr_getNrUsersOnline");
}

function hr_getNrUsersOnline(){
  var txt="";
  var curent_lang=document.getElementById("curent_lang").value;

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    response=parseInt(trim(response));
    var number_of_users=parseInt(document.getElementById("number_of_users").value);
    
    var nrusers=number_of_users+response;
    if(curent_lang=="" || curent_lang=="eng"){ 
      txt="* <font style='color:#ffff00; font-weight:bold;'>"+nrusers+" players</font> in Casino room";
    }else if(curent_lang=="spn"){
      txt="* <font style='color:#ffff00; font-weight:bold;'>"+nrusers+" jugadores</font> en el Casino";    
    }else if(curent_lang=="por"){
      txt="* <font style='color:#ffff00; font-weight:bold;'>"+nrusers+" jogadores</font> no Casino";    
    }
    if(document.getElementById("contentFrame").contentWindow.document.getElementById('nrusers')){
      document.getElementById("contentFrame").contentWindow.document.getElementById('nrusers').innerHTML=txt;
    }
  }
}

function getUserPoint(){
  var user_hash=document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  
  sendCall("include/consult.php?req=getUserCasinoPoints&user_hash="+user_hash+'&sitekey_id='+sitekey_id, "hr_getUserPoint");
}

function hr_getUserPoint(){
  var curent_lang=document.getElementById("curent_lang").value;
  var curent_page=document.getElementById("curent_page").value;  

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    response=trim(response);

    if(curent_lang=="" || curent_lang=="eng"){ 
      var txt="<p align='center'><font style='color:#d3cb95; font-weight:bold; font-size:24px;'>"+response+" Points</font></p>";
    }else if(curent_lang=="spn"){
      var txt="<p align='center'><font style='color:#d3cb95; font-weight:bold; font-size:24px;'>"+response+" Puntos</font></p>";    
    }else if(curent_lang=="por") {
      var txt="<p align='center'><font style='color:#d3cb95; font-weight:bold; font-size:24px;'>"+response+" Puntos</font></p>"; 
    }
    if(document.getElementById("contentFrame").contentWindow.document.getElementById("userpoints")){     
      document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').innerHTML=txt;
      if(curent_page=="casino"){
        document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').style.top=0+'px';        
      }else{
        document.getElementById("contentFrame").contentWindow.document.getElementById('userpoints').style.top=-18+'px';
      }
    }      
  }
}

/*function popup_blocked() {
  var popup = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
  if (!popup) {
    return true;
  } else {
    popup.close();
    return false;
  }
}*/

function cerrarlayer(){
  try{
  //         alert("1");         
    document.body.removeChild(document.getElementById('blankout'));
    document.body.removeChild(document.getElementById('FloatLayer_div'));
  }catch(e){
    parentNode.removeChild(document.getElementById('blankout'));
    parentNode.removeChild(document.getElementById('FloatLayer_div'));           
//           alert("2");
  }  
}

function getDepositPageClickandBuy(amount, method){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  if(method=="clickandbuy"){
    sendCall("include/consult.php?req=eWalletProviders&user_hash="+user_hash+"&sitekey_id="+sitekey_id+"&amount="+amount+"&curent_lang="+curent_lang+"&method="+method, "hr_getDepositPageClickandBuy");  
  }
}

function hr_getDepositPageClickandBuy(){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    if(response=="ERR305"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>You did not enter a valid amount.!";
      }else if(curent_lang=="spn") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Estimado Usuario,<br>No ingreso un monto valido!";
      }else if(curent_lang=="por") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Caro cliente,<br>voc&eacute; n&atilde;o inseriu um valor v&aacute;lido!";
      }
    }else{
      var server_responce = response;
      var server_responce_array = new Array();
      server_responce_array = server_responce.split('|');
      server_responce_array[0];
      server_responce_array[1];
    
      if(server_responce_array[0]=="EXC304"){
//	if(popup_blocked()) {
	  setOveralMSG3();
          if(curent_lang=="" || curent_lang=="eng"){ 
            parent.document.getElementById("FloatLayerContent_div").innerHTML="Click Continue,<br>You will be redirected to a secure page to proceed with your payment.<br><a href=\"javascript:void(0);\" onclick=\"Open_new_Window('"+server_responce_array[1]+"', 'ClickandBuy');cerrarlayer();load_syspage('ps', 'web', "+curent_lang+", "+sitekey_id+", '', '');\"><div id=\"close_btn\" name=\"close_btn\" class=\"close_btn\">&nbsp;</div></a>";
          }else if(curent_lang=="spn") {
            parent.document.getElementById("FloatLayerContent_div").innerHTML="Clic en Continue,<br>Usted sera enviado a una pagina segura para proceder con su pago.<br><a href=\"javascript:void(0);\" onclick=\"Open_new_Window('"+server_responce_array[1]+"', 'ClickandBuy');cerrarlayer();load_syspage('ps', 'web', "+curent_lang+", "+sitekey_id+", '', '');\"><div id=\"close_btn\" name=\"close_btn\" class=\"close_btn\">&nbsp;</div></a>";
          }else if(curent_lang=="por") {
            parent.document.getElementById("FloatLayerContent_div").innerHTML="Clique em Continuar,<br>Voc&ecirc; ser&aacute; redirecionado para uma p&aacute;gina segura para prosseguir com o seu pagamento.<br><a href=\"javascript:void(0);\" onclick=\"Open_new_Window('"+server_responce_array[1]+"', 'ClickandBuy');cerrarlayer();load_syspage('ps', 'web', "+curent_lang+", "+sitekey_id+", '', '');\"><div id=\"close_btn\" name=\"close_btn\" class=\"close_btn\">&nbsp;</div></a>";
          }          
          
          document.getElementById("FloatLayerContent_div").style.textAlign="left";
          document.getElementById("FloatLayerContent_div").style.fontSize="13px";
//        }else{
//          Open_new_Window(server_responce_array[1], "ClickandBuy");
//          clearOverlaySizeloading();
//        }
      }
    }  
  }  
}

function getDepositPageAPCO(amount, method){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  if(method=="apco"){
    load_syspage('psd', 'web', curent_lang, sitekey_id, amount, method);
  }
}

function getDepositPageSafeCharge(amount, method){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  if(method=="safecharge"){
    sendCall("include/consult.php?req=eWalletProviders&user_hash="+user_hash+"&sitekey_id="+sitekey_id+"&amount="+amount+"&curent_lang="+curent_lang+"&method="+method, "hr_getDepositPageSafeCharge"); 

  }
}

function hr_getDepositPageSafeCharge(){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
//    alert(response);
    if(response=="ERR305"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>You did not enter a valid amount.!";
      }else if(curent_lang=="spn") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Estimado Cliente,<br>Usted ingreso un monto no valido!";
      }else if(curent_lang=="por") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Caro cliente,<br>voc&eacute; n&atilde;o inseriu um valor v&aacute;lido!";
      }
    }else{
      var server_responce = trim(response);
      var server_responce_array = new Array();
      var link_array = new Array();
      server_responce_array = server_responce.split('|');
      link_array = server_responce_array[1].split('|');
      server_responce_array[0];

      server_responce_array[1]=link_array[0];
      
      if(server_responce_array[0]=="EXC304"){
        setOveralMSG3();

        if(curent_lang=="" || curent_lang=="eng"){        
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Click Continue,<br>You will be redirected to a secure page to proceed with your payment.<br><a href=\"javascript:void(0);\" onclick=\"Open_new_Window('"+server_responce_array[1]+"','SafeCharge');cerrarlayer();load_syspage('ps', 'web', "+curent_lang+", "+sitekey_id+", '', '');\"><div id=\"close_btn\" name=\"close_btn\" class=\"close_btn\">&nbsp;</div></a>";
        }else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Oprima continuar,<br>Usted sera dirijido a una pagina segura para procesar con su pago.<br><a href=\"javascript:void(0);\" onclick=\"Open_new_Window('"+server_responce_array[1]+"','SafeCharge');cerrarlayer();load_syspage('ps', 'web', "+curent_lang+", "+sitekey_id+", '', '');\"><div id=\"close_btn\" name=\"close_btn\" class=\"close_btn\">&nbsp;</div></a>";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Clique em continuar,<br>voc&ecirc; vai ser direcionado a uma p&aacute;gina de seguran&ccedil;a para processar seu pagamento.<br><a href=\"javascript:void(0);\" onclick=\"Open_new_Window('"+server_responce_array[1]+"','SafeCharge');cerrarlayer();load_syspage('ps', 'web', "+curent_lang+", "+sitekey_id+", '', '');\"><div id=\"close_btn\" name=\"close_btn\" class=\"close_btn\">&nbsp;</div></a>";
        }        
        document.getElementById("FloatLayerContent_div").style.textAlign="left";
        document.getElementById("FloatLayerContent_div").style.fontSize="13px";        
      }
    }  
  }  
}


function getDepositClick2Pay(amount, pan, method){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
   
  sendCall("include/consult.php?req=eWalletProviders&user_hash="+user_hash+"&sitekey_id="+sitekey_id+"&amount="+amount+"&curent_lang="+curent_lang+"&method="+method+"&pan="+pan, "hr_getDepositClick2Pay");
}

function hr_getDepositClick2Pay(){
  var curent_lang=document.getElementById("curent_lang").value; 
  var sitekey_id=document.getElementById('sitekey_id').value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    setOveralMSG();
    
    var server_responce = response;
    var server_responce_array = new Array();
    server_responce_array = server_responce.split('|');
    response=server_responce_array[0];
//    alert("header"+server_responce_array[1]+" output"+server_responce_array[2]);

    if(response=="ERR305"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>You did not enter a valid amount.!";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Estimado Cliente,<br>Usted ingreso un monto no valido!";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Caro cliente,<br>voc&eacute; n&atilde;o inseriu um valor v&aacute;lido!";
      }
    }else if(response=="ERR306"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="Dear Client,<br>You did not enter your <u>pan</u> code!";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Estimado Cliente, Usted no ingreso su codigo <u>pan</u>!";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Caro cliente,<br>voc&eacute; n&atilde;o digitou seu c&oacute;digo pin!";
      }
    }else if(response=="ERR911"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="You are performing an illegal operation.<br>Your IP has been logged for security reason.";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Usted esta ejecutando una operaci&oacute;n ilegal.<br>Su IP ha sido guardada por razones de seguridad.";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Voc&ecirc; est&aacute; executando uma opera&ccedil;&atilde;o ilegal.<br>Seu IP foi registrado por motivos de seguran&ccedil;a.";
      }
      setTimeout("load_page('h', 'web', '', '')",100);
    }else if(response=="EXC300"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="Your transfer is completed successfully.<br /><br />You are being redirect to the Buy Casino Chip page!";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Su transferencia ha sido completada exitosamente.<br /><br />Esta siendo redireccionado a la p&aacute;gina de Compra de Fichas de Casino!";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Sua transfer&ecirc;ncia foi conclu&iacute;da com &ecirc;xito.<br /><br />Est&aacute; sendo redireccionado para a p&aacute;gina do Casino!";
      }
      setTimeout("load_syspage('bcc', 'web', '', '"+sitekey_id+"', '', '')",100);          
    }else if(response=="ERR301"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br>No funds were removed from your account.";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br>Los fondos no han sido retirados de su cuenta.";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML=" Um erro t&eacute;cnico ocorreu.<br>N&atilde;o foram removidos fundos de sua conta.";
      }
    }else if(response=="ERR302"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br>No funds were removed from your account.";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br>Los fondos no han sido retirados de su cuenta.";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Um erro t&eacute;cnico ocorreu.<br>N&atilde;o foram removidos fundos de sua conta.";
      }
      setTimeout("load_page('h', 'web', '', '')",100);
    }else if(response=="ERR303"){
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="Insufficient balance";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Balance Insuficiente";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Saldo insuficiente";
      }
    }else{
        document.getElementById("FloatLayerContent_div").innerHTML="Click2Pay informed us that: "+response;
    }
  }else{
    if(curent_lang=="" || curent_lang=="eng"){ 
      document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br>No funds were removed from your account.<br /><br />You are being redirect to the Support Page!";
    }else if(curent_lang=="spn") {
      document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br>Los fondos no han sido retirados de su cuenta.<br /><br />Lo redireccionaremos a la P&aacute;gina de Soporte!";
    }else if(curent_lang=="por") {
      document.getElementById("FloatLayerContent_div").innerHTML="Um erro t&eacute;cnico ocorreu.<br>N&atilde;o foram removidos fundos de sua conta.<br /><br />Voc&ecirc; vai ser redirecionado a p&aacute;gina de suporte!";
    }
    setTimeout("load_page('s', 'web', '', '')",100);    
  }  
}


function getTournamentshedule(){
now = new Date();

  var curent_lang=document.getElementById("curent_lang").value;
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;
  document.getElementById("contentFrame").contentWindow.document.getElementById('tournament_content').innerHTML=indicator;
  document.getElementById("contentFrame").contentWindow.document.getElementById('indicator_div').style.position="relative";
  document.getElementById("contentFrame").contentWindow.document.getElementById('indicator_div').style.left = (580 / 2) - (100 / 2) + 'px';
  document.getElementById("contentFrame").contentWindow.document.getElementById('indicator_div').style.top = 50 + 'px';
  sendCall("include/consult.php?req=Tournamentshedule&user_hash="+user_hash+"&sitekey_id="+sitekey_id+"&curent_lang="+curent_lang, "hr_getTournamentshedule");
  
  document.getElementById("time1").value=now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
}


function hr_getTournamentshedule(){
  var curent_lang=document.getElementById("curent_lang").value;

  now = new Date();
  
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    document.getElementById("time3").value=now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
        
    if(response=="ERR911"){
      setOverlaySizeloading();
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="You are performing an illegal operation.<br>Your IP has been logged for security reason.";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Usted esta ejecutando una operaci&oacute;n ilegal.<br>Su IP ha sido guardada por razones de seguridad.";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Voc&ecirc; est&aacute; executando uma opera&ccedil;&atilde;o ilegal.<br>Seu IP foi registrado por motivos de seguran&ccedil;a.";
      }
      setTimeout("load_page('h', 'web', '', '')",100);
    }else{
      document.getElementById("contentFrame").contentWindow.document.getElementById('tournament_content').innerHTML=response;
    }  
  }
}

function getTournamentDetail(currentid){
  document.getElementById("tournamentID").value=currentid;
  var sitekey_id=document.getElementById('sitekey_id').value;
  var curent_lang=document.getElementById("curent_lang").value;
  
  load_page("t_detail", "web", curent_lang, sitekey_id);
  //sendCall("include/consult.php?req=TournamentDetail&sitekey_id="+sitekey_id+"&currentid="+currentid+"&user_hash="+user_hash ,"hr_getTournamentDetail");
}

function hr_getTournamentDetail(){
  var curent_lang=document.getElementById("curent_lang").value;
  
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
        
    if(response=="ERR911"){
      setOverlaySizeloading();
      setOveralMSG();
      if(curent_lang=="" || curent_lang=="eng"){ 
        document.getElementById("FloatLayerContent_div").innerHTML="You are performing an illegal operation.<br>Your IP has been logged for security reason.";
      }else if(curent_lang=="spn") {
        document.getElementById("FloatLayerContent_div").innerHTML="Usted esta ejecutando una operaci&oacute;n ilegal.<br>Su IP ha sido guardada por razones de seguridad.";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Voc&ecirc; est&aacute; executando uma opera&ccedil;&atilde;o ilegal.<br>Seu IP foi registrado por motivos de seguran&ccedil;a.";
      }
      setTimeout("load_page('h', 'web', '', '')",100);
    }else{
      document.getElementById("contentFrame").contentWindow.document.getElementById('tournament_content').innerHTML=response;
    }  
  }
}

function CasinoBalancetransfer(amount, method, id){

  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;

  parent.sendCall("include/consult.php?req=CasinoBalanceTransfer&user_hash="+user_hash+"&sitekey_id="+sitekey_id+"&amount="+amount+"&method="+method+"&action="+id, "hr_getCasinoTransactionResult");
}

function hr_getCasinoTransactionResult(){
  var curent_lang=document.getElementById("curent_lang").value;
  var user_id=document.getElementById('curent_user_id').value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
    setOveralMSG2();
    enable();

    if(user_id=="madman"){
//      alert(response);
    }
    if((response.indexOf("ERR911")==0) || (response.indexOf("EXC000")==0) || (response.indexOf("ERR001")==0) || (response.indexOf("ERR002")==0) || (response.indexOf("ERR003")==0) || (response.indexOf("ERR004")==0) || (response.indexOf("ERR005")==0) || (response.indexOf("ERR199")==0)){
      response = trim(response);

      if(response=="ERR911"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="You are performing an illegal operation.<br>Your IP has been logged for security reason.";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Usted esta ejecutando una operaci&oacute;n ilegal.<br>Su IP ha sido guardada por razones de seguridad.";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Voc&ecirc; est&aacute; realizando uma opera&ccedil;&atilde;o ilegal. Seu IP foi registrado por motivo de seguran&ccedil;a.";
        }
        setTimeout("load_page('h', 'web', '', '')",100);
      }else if(response=="ERR002"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br>No funds were removed from your account.";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br>Los fondos no han sido retirados de su cuenta.";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Um erro t&eacute;cnico ocorreu.<br>N&atilde;o foram removidos fundos de sua conta.";
        }
        setTimeout("load_page('h', 'web', '', '')",100);
      }else if(response=="EXC000"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Your transfer is completed successfully.<br /><br />You are being redirect to the Casino Page!";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Su transferencia ha sido completada exitosamente.<br /><br />Espere mientras es redireccionado ha la p&aacute;gina del Casino!";
        } else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Sua transfer&ecirc;ncia foi conclu&iacute;da com &ecirc;xito. <br /><br />Est&aacute; sendo redireccionado para a p&aacute;gina do Casino!";
        }
        setTimeout("load_page('casino', 'web', '', '')",100);    
      }else if(response=="ERR001"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br />Your chips purchase has not been fully processed.<br /><br />You are being redirect to the Support Page!";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br />La compra de sus fichas no ha sido suficientemente procesada.<br /><br />Lo redireccionaremos a la P&aacute;gina de Soporte!";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Um erro t&eacute;cnico ocorreu.<br />Sua compra de fichas n&atilde;o foi processada completamente.<br /><br />Voc&ecirc; vai ser redirecionado a p&aacute;gina de suporte!";
        }
        setTimeout("load_page('s', 'web', '', '')",100);    
      }else if(response=="ERR003"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Insufficient balance";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Balance Insuficiente";
        }else if(curent_lang=="por") {
          document.getElementById("FloatLayerContent_div").innerHTML="Saldo insuficiente";
        }
//        setTimeout("load_page('h', 'web', '', 1)",100);
      }else if(response=="ERR004"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br />Your chips purchase has not been fully processed.<br /><br />You are being redirect to the Support Page!";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br />La compra de sus fichas no ha sido suficientemente procesada.<br /><br />Lo redireccionaremos a la P&aacute;gina de Soporte!";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Um erro t&eacute;cnico ocorreu.<br />Sua compra de fichas n&atilde;o foi processada completamente.<br /><br />Voc&ecirc; vai ser redirecionado a p&aacute;gina de suporte!";
        }
        setTimeout("load_page('s', 'web', '', '')",100);
      }else if(response=="ERR005"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br />Your chips purchase has not been fully processed.<br /><br />You are being redirect to the Support Page!";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br />La compra de sus fichas no ha sido suficientemente procesada.<br /><br />Lo redireccionaremos a la P&aacute;gina de Soporte!";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Um erro t&eacute;cnico ocorreu.<br />Sua compra de fichas n&atilde;o foi processada completamente.<br /><br />Voc&ecirc; vai ser redirecionado a p&aacute;gina de suporte!";
        }
        setTimeout("load_page('s', 'web', '', '')",100);
      }else if(responce=="ERR199"){
        if(curent_lang=="" || curent_lang=="eng"){ 
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Your transfer was Canceled Because of an illegal operation.<br /><br />Your IP has been logged for security reason!<br /><br />If the problem remain please contact the costumer support!";
        } else if(curent_lang=="spn") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Su transferencia ha sido cancelada porque ha efectuado una operaci&oacute;n ilegal.<br /><br />Su IP ha sido guardada por razones de seguridad!<br /><br />Si el problema se mantiene por favor contacte al Servicio de Soporte!";
        }else if(curent_lang=="por") {
          parent.document.getElementById("FloatLayerContent_div").innerHTML="Sua transfer&ecirc;ncia foi cancelada devido a uma opera&ccedil;&atilde;o ilícita.<br /><br />Seu IP foi registrado por motivo de segurança!br /><br />Se o problema permanecer entre em contato com o suporte ao cliente!";
        }
        setTimeout("load_page('h', 'web', '', '')",100);  
      }
    }else{
      parent.document.getElementById("FloatLayerContent_div").innerHTML=""+response+"";
 //     setTimeout("load_page('h', 'web', '', 1)",100);
    }
    parent.document.getElementById("FloatLayerContent_div").style.textAlign="left";
    parent.document.getElementById("FloatLayerContent_div").style.fontSize="12px";
  }
}

function WithdrawfromAccount(amount, method, id){
  var user_hash=parent.document.getElementById('curent_user_hash_id').value;
  var sitekey_id=parent.document.getElementById('sitekey_id').value;

  parent.sendCall("include/consult.php?req=WithdrawfromAccount&user_hash="+user_hash+"&sitekey_id="+sitekey_id+"&amount="+amount+"&method="+method+"&action="+id, "hr_WithdrawfromAccount");
}

function hr_WithdrawfromAccount(){
  var curent_lang=document.getElementById("curent_lang").value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
//    response = trim(response);

    setOveralMSG();

    if(response=="ILLEGAL"){
      if(curent_lang=="" || curent_lang=="eng"){  
        parent.document.getElementById("FloatLayerContent_div").innerHTML="You are performing an illegal operation.<br>Your IP has been logged for security reason.";
      } else if(curent_lang=="spn") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Usted est&aacute; realizando una operaci&oacute;n ilegal.<br>Su IP ser&aacute; guardada por razones legales.";
      }else if(curent_lang=="por") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Voc&ecirc; est&aacute; realizando uma opera&ccedil;&atilde;o ilegal. Seu IP foi registrado por motivo de seguran&ccedil;a.";
      }
      setTimeout("parent.load_page('h', 'web', '', '')",100);
    }else if(response=="TOMUCH"){
      if(curent_lang=="" || curent_lang=="eng"){  
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Insufficient balance";
      } else if(curent_lang=="spn") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Balance Insuficiente";
      }else if(curent_lang=="por") {
        document.getElementById("FloatLayerContent_div").innerHTML="Saldo insuficiente";
      }
    }else if(response=="PENDING"){
      if(curent_lang=="" || curent_lang=="eng"){  
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Your withdraw request has been reported to our payment department.<br /><br />Check your <a href=\"javascript:load_syspage('ph', 'web', '', '');\" style=\"font-size:11px; color: #00FFFF\">Payment History</a> for more info!";
      } else if(curent_lang=="spn") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Su retiro de fondos ha sido reportado a nuestro departamento de Pagos.<br /><br />Verifique su <a href=\"javascript:load_syspage('ph', 'web', '', '');\" style=\"font-size:11px; color: #00FFFF\">Historia de Pagos</a> para mayor informaci&oacute;n!";
      }else if(curent_lang=="por") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Seu pedido de retirada foi comunicado &agrave; nosso Departamento de pagamento.<br /><br />Verifique o <a href=\"javascript:load_syspage('ph', 'web', '', '');\" style=\"font-size:11px; color: #00FFFF\">hist&oacute;rico de pagamento</a> para obter mais informações!";
      }
      setTimeout("parent.load_page('casino', 'web', '', '')",100);
    }else if(response=="CANCELED"){
      if(curent_lang=="" || curent_lang=="eng"){  
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Your transfer was Canceled.<br /><br />You are being redirect to the Support Page!";
      } else if(curent_lang=="spn") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="Su transferencia ha sido Cancelada.<br /><br />Lo redireccionaremos a la P&aacute;gina de Soporte!";
      }else if(curent_lang=="por") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="A transfer&ecirc;ncia foi cancelada.<br /><br />Voc&ecirc; vai ser redirecionado a p&aacute;gina de suporte!";
      }
      setTimeout("parent.load_page('s', 'web', '', '')",100);
    }else{
//    alert(response);
      if(curent_lang=="" || curent_lang=="eng"){  
      parent.document.getElementById("FloatLayerContent_div").innerHTML="Your transfer was Canceled Because of an illegal operation.<br /><br />Your IP has been logged for security reason!<br /><br />If the problem remain please contact the costumer support!";
      } else if(curent_lang=="spn") {
      parent.document.getElementById("FloatLayerContent_div").innerHTML="Su transferencia fue Cancelada por una operaci&oacute;n ilegal.<br /><br />Su IP ha sido guardada por razones de seguridad!<br /><br />S&iacute; el problema continua, contacte a nuestro Servicio de Soporte!";
      }else if(curent_lang=="por") {
        parent.document.getElementById("FloatLayerContent_div").innerHTML="A transfer&ecirc;ncia foi cancelada devido a uma opera&ccedil;&atilde;o il&iacute;cita.<br /><br />Seu IP foi registrado por motivo de seguran&ccedil;a!<br /><br />Se o problema permanecer entre em contato com o suporte ao cliente!";
      }
      setTimeout("parent.load_page('h', 'web', '', '')",100);
    }
    parent.document.getElementById("FloatLayerContent_div").style.textAlign="left";
    parent.document.getElementById("FloatLayerContent_div").style.fontSize="12px";
  }
}

//save personal details from user
function SavePersonalDetails(func_name, sitekey_id, curent_lang){
  var curent_lang=document.getElementById("curent_lang").value;
  var the_iframe=parent.frames['contentFrame'].document;
  var user_id=document.getElementById('curent_user_id').value;
  var pwd=document.getElementById('curent_user_pwd').value;
  var user_hash=document.getElementById('curent_user_hash_id').value;
  
  var e=the_iframe.getElementById("street").value;
  var f=the_iframe.getElementById("zip_code").value;
  var g=the_iframe.getElementById("city").value;
  var h=the_iframe.getElementById("state").value;
  var i=the_iframe.getElementById("country").value;
  var m=the_iframe.getElementById("email").value;
  var n=the_iframe.getElementById("mobile_phone").value;
  
//  alert(user_id+" "+pwd+" "+sitekey_id);
  sendCall("include/consult.php?req="+func_name+"&user_id="+user_id+"&pwd="+pwd+"&sitekey_id="+sitekey_id+"&street="+e+"&zip_code="+f+"&city="+g+"&state="+h+"&country="+i+"&mobile="+n+"&email="+m+"&user_hash="+user_hash+"&curent_lang="+curent_lang, "hr_SavePersonalDetails");
}

function hr_SavePersonalDetails(){
var curent_lang=document.getElementById("curent_lang").value; 
var path="../../../../";

  if(http.readyState == 4){
    inCall = false;
    response = http.responseText;
//    response = trim(response);

    if(response != ""){
           //alert(response);
      if(response.length <= 12){
        setOveralMSG();
        if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML="You have no access to this page!";
	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML="Usted no tiene acceso a esta p&aacute;gina!";
     	}else if(curent_lang=="por"){
          document.getElementById("FloatLayerContent_div").innerHTML="Voc&ecirc; n&atilde;o tem acesso a esta p&aacute;gina!";
        }
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
      }else{
        document.getElementById("contentFrame").contentWindow.document.getElementById('page_content').innerHTML=response;
        setOveralMSG();
	if(curent_lang=="" || curent_lang=="eng"){
          document.getElementById("FloatLayerContent_div").innerHTML="<br><br>Your changes have been saved successfully!";
	}else if(curent_lang=="spn"){
	  document.getElementById("FloatLayerContent_div").innerHTML="<br><br>Sus cambios han sido guardados satisfactoriamente!";
        }else if(curent_lang=="por"){
          parent.document.getElementById("FloatLayerContent_div").innerHTML="As altera&ccedil;&otilde;es foram salvas com &ecirc;xito!";
        }
        document.getElementById("FloatLayerContent_div").style.textAlign="center";
        document.getElementById("FloatLayerContent_div").style.fontSize="12px";  
      }
    }
  }
}

function hr_loginUser(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    if(response != ""){
      alert(response);
    }else{
      //document.getElementById("loginSubmit").innerHTML = "<font color='red'>Login Failed</font>";
    }
  }
}

//Check Subscription form instant
function checkLoginID(id){
//alert(id);
  var user_id=document.getElementById("contentFrame").contentWindow.document.getElementById(id).value;
  
  if(user_id.length < 6){
    errormsg(id, "SHORT");
//    alert(user_id.length);
    return false
  }else{
    var func_name="check_"+id;
    sendCall("include/consult.php?req="+func_name+"&user_id="+user_id, "hr_checkLoginID");
  }
}

function hr_checkLoginID(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    response = trim(response);

    if(response == "OK"){
      errormsg("user_id", response);
      return true
    }else if(response == "EXIST"){
      errormsg("user_id", response);
      return false
    }else if(response == "EMTY"){
      errormsg("user_id", response);
      return false
    }
  }
}

function send_content_email(email, name, msg){
  var email = document.getElementById(email).value;
 
  sendCall("include/consult.php?req="+func_name+"&email="+email, "hr_send_content_email");
}

function hr_send_content_email(){
  document.getElementById("DIV_TO_LOAD_RESULT INTO").innerHTML = "";
  
  setTimeout("mail_template()",2000);

}

//not used any more
function payment_hystory(){
  var user_hash=document.getElementById('curent_user_hash_id').value;
  var sitekey_id = document.getElementById('sitekey_id').value;
  
  var func_name="Payment_History";
//  sendCall("include/consult.php?req="+func_name+"&user_hash="+user_hash+"&sitekey_id="+sitekey_id, "hr_payment_hystory");
}

function hr_payment_hystory(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    document.getElementById("contentFrame").contentWindow.document.getElementById("payment_hystory").innerHTML=response;  
  } 
}

function mail_template(){
  document.getElementById("DIV_TO_LOAD_RESULT INTO").innerHTML = "template_email();";
}

function loadCasinoGames(path){
//alert(path);
  sendCall(""+path+"gamelist.php", "hr_loadCasinoGames");
}

/*Function to load casino game list into header*/
function hr_loadCasinoGames(){
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    //alert(response);
    document.getElementById("contentFrame").contentWindow.document.getElementById("center_game_list_div").innerHTML=response;
    
  }  
//      alert(response);

}

function BuyTournamentTicket(user_hash, tournamentID, tournament_name, ticket_prize){
  var curent_lang=document.getElementById("curent_lang").value;
  var sitekey_id=document.getElementById("sitekey_id").value;
  var user_hash_client=document.getElementById('curent_user_hash_id').value;

  if(user_hash_client==user_hash){
    setOverlaySizeloading();
    sendCall("include/consult.php?req=BuyTournamentTicket&user_hash="+user_hash+"&tournamentID="+tournamentID+"&tournament_name="+tournament_name+"&sitekey_id="+sitekey_id+"&ticket_prize="+ticket_prize, "hr_BuyTournamentTicket");
  }
}


function hr_BuyTournamentTicket(){
  var curent_lang=document.getElementById("curent_lang").value;
  var theframe=document.getElementById("contentFrame").contentWindow;
  var tournamentID=document.getElementById("tournamentID").value;
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    response=parseInt(trim(response));
    setOveralMSG();
  
//    var server_responce = response;
//    var server_responce_array = new Array();
//    server_responce_array = server_responce.split('|');

//    alert(response+' '+server_responce_array[0]+' '+server_responce_array[1]+' '+server_responce_array[2]);
//alert(response);        
    if(response=="904"){
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Your Tournament ticket has been bought successfully.";
      }else if(curent_lang=="spn"){
	document.getElementById("FloatLayerContent_div").innerHTML="La compra de su ticket para el torneo ha sido efectuada.";
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";
      getTournamentDetail(tournamentID);            
      
    }else if(response=="900"){
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Dear client,<br>you are not allowed to play in this tournament.";
      }else if(curent_lang=="spn"){
	document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente,<br> usted no esta permitido participar en este torneo.";
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";
    }else if(response=="901"){
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Dear client,<br />the maximum number of tickets is already purchased.";
      }else if(curent_lang=="spn"){
	document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente,<br /> se ha alcanzado el m&aacute;ximo numero de tickets han sido comprados.";
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
    }else if(response=="902"){
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Dear client,<br />you tried to purchase ticket outside the allowed time span.";
      }else if(curent_lang=="spn"){
        document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente, usted esta tratando de adquirir un ticket fuera del tiempo.";
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
    }else if(response=="903"){

      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Dear client,<br/>you have already bought a ticket for this tournament.";
      }else if(curent_lang=="spn"){
        document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente, ya usted ha adquirido un ticket para este evento.";
      }
      
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
      getTournamentDetail(tournamentID);                  
    }else if(response=="100"){
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br />Your chips purchase has not been fully processed.<br /><br />You are being redirect to the Support Page!";
      }else if(curent_lang=="spn"){
        document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br />La compra de sus fichas no ha sido suficientemente procesada.<br /><br />Lo redireccionaremos a la P&aacute;gina de Soporte!";
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
      setTimeout("load_page('s', 'web', '', '')",100);
    }else if(response=="201"){
      if(curent_lang=="" || curent_lang=="eng"){
        document.getElementById("FloatLayerContent_div").innerHTML="Dear client,<br/>you you don't have enough money in your casino account.";
      }else if(curent_lang=="spn"){
        document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente, usted no posee suficiente dinero en la cuenta de casino.";
      }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
    }
  }
}

function ChangeCurentPWD(){
  var curent_lang=document.getElementById("curent_lang").value;
  var theframe=document.getElementById("contentFrame").contentWindow;
  var sitekey_id=document.getElementById("sitekey_id").value;
  var user_hash=document.getElementById('curent_user_hash_id').value;

  var var_user_id = parent.document.getElementById("curent_user_id").value;
  var var_password = theframe.document.getElementById("password_cp").value;
  var var_old_password = theframe.document.getElementById("old_password_cp").value;
  var var_verify_password = theframe.document.getElementById("verify_password").value;

  if(var_password==""){errormsg("password_cp", "EMTY");}
  if(var_old_password==""){errormsg("old_password_cp", "EMTY");}
  if(var_verify_password==""){errormsg("verify_password", "EMTY");}


  if(theframe.checkPasswordlenght("password_cp", "", "")==true && theframe.verify_password("password_cp", "verify_password")==true  && theframe.checkPasswordOld("old_password_cp")==true){
    setOverlaySizeloading();
    sendCall("include/consult.php?req=ChangePassword&user_id="+var_user_id+"&pwd="+var_password+"&old_pwd="+var_old_password+"&sitekey_id="+sitekey_id+"&user_hash="+user_hash, "hr_ChangeCurentPWD");
  }else{
    setOverlaySizeloading();
    setOveralMSG();
	if(curent_lang=="" || curent_lang=="eng"){
    document.getElementById("FloatLayerContent_div").innerHTML="You did not complete all fields!";
	} else if(curent_lang=="spn") {
	document.getElementById("FloatLayerContent_div").innerHTML="Usted no ha completado todos los campos!";
	}
    document.getElementById("FloatLayerContent_div").style.fontSize="12px";    
  }
}

function hr_ChangeCurentPWD(){
  var curent_lang=document.getElementById("curent_lang").value;
  var theframe=document.getElementById("contentFrame").contentWindow;
  
  if(http.readyState == 4){
    inCall = false;
    response = http.responseText
    response=trim(response);
    setOveralMSG();
    
    if(response=="ERR911"){
	  if(curent_lang=="" || curent_lang=="eng"){
      document.getElementById("FloatLayerContent_div").innerHTML="You are performing an illegal operation.<br>Your IP has been logged for security reason.";
	  } else if(curent_lang=="spn") {
	  document.getElementById("FloatLayerContent_div").innerHTML="Usted esta realizando una operaci&oacute;n ilegal.<br>Su IP ser&aacute; guardada por razones de seguridad.";
	  }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px"; 
    }else if(response=="EXC100"){
	  if(curent_lang=="" || curent_lang=="eng"){
      document.getElementById("FloatLayerContent_div").innerHTML="Dear client,<br>Your password was changed succesfully.";
	  } else if(curent_lang=="spn") {
	  document.getElementById("FloatLayerContent_div").innerHTML="Estimado cliente,<br>Su contrase&ntilde;a ha sido actualizada.";
	  }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";
      document.getElementById("curent_user_pwd").value=theframe.document.getElementById("password_cp").value;
      load_syspage('gas', 'web', '', '', '', '');
    }else if(response=="ERR101"){
	  if(curent_lang=="" || curent_lang=="eng"){
      document.getElementById("FloatLayerContent_div").innerHTML="A technical error has occurred.<br />Your password has not been changed.<br /><br />If the problem remain please contact the costumer support!";
	  } else if(curent_lang=="spn") {
	  document.getElementById("FloatLayerContent_div").innerHTML="Un error tecnico ha ocurrido.<br />Su contrase&ntilde;a no ha sido cambiada.<br /><br />Si el problema continua, por favor contacte a nuestro Servicio de Soporte!";
	  }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
    }else if(response=="ERR102"){
	  if(curent_lang=="" || curent_lang=="eng"){
      document.getElementById("FloatLayerContent_div").innerHTML="Your Password has not been changed for securety reason because of an illegal operation.<br /><br />Your IP has been logged for security reason!<br /><br />If the problem remain please contact the costumer support!";
	  } else if(curent_lang=="spn") {
	  document.getElementById("FloatLayerContent_div").innerHTML="Su Contrase&ntilde;a no ha sido cambiado por razones de seguridad al realizarse una operaci&oacute;n ilegal.<br><br>Su IP ser&aacute; guardada por razones de seguridad.!<br /><br />Si el problema continua, por favor contacte a nuestro Servicio de Soporte!";
	  }
      document.getElementById("FloatLayerContent_div").style.fontSize="12px";     
    }
  }
}