﻿function wndOpenCasinoGame(sURL) {
  var iWidth = 830;
  var iHeight = 600;
  var iLeft = (((window.screen.availWidth - iWidth) / 2));
  var iTop = (((window.screen.availHeight - iHeight) / 2))
  if (iTop < 30) { iTop = 1 }
  if (iLeft < 30) { iLeft = 1 }
  window.open(sURL, "gm", 'top=' + iTop + ', left=' + iLeft + ', width=' + iWidth + ', height=' + iHeight + ', location=no, address=no, scrollbars=no, resizable=no, status=no')
}

function wndOpenTransferMoney(sURL) {
  var iWidth = 400;
  var iHeight = 400;
  var iLeft = (((window.screen.availWidth - iWidth) / 2));
  var iTop = (((window.screen.availHeight - iHeight) / 2))
  if (iTop < 30) { iTop = 1 }
  if (iLeft < 30) { iLeft = 1 }
  window.open(sURL, "tm", 'top=' + iTop + ', left=' + iLeft + ', width=' + iWidth + ', height=' + iHeight + ', location=no, address=no, scrollbars=no, resizable=no, status=no')
}

function wndOpenCasinoMiniGame(sURL) {
  var iWidth = 400;
  var iHeight = 400;
  var iLeft = (((window.screen.availWidth - iWidth) / 2));
  var iTop = (((window.screen.availHeight - iHeight) / 2))
  if (iTop < 30) { iTop = 1 }
  if (iLeft < 30) { iLeft = 1 }
  window.open(sURL, "gm", 'top=' + iTop + ', left=' + iLeft + ', width=' + iWidth + ', height=' + iHeight + ', location=no, address=no, scrollbars=no, resizable=no, status=no')
}

function wndGotoPoker(sURL, pok_sho_co, pok_ses_id, pok_cus_id, pok_cst_id, pok_cus_ac) {
	window.location.href = sURL + "?type=first-page&pok_sho_co=" + pok_sho_co + "&pok_ses_id=" + pok_ses_id + "&pok_cus_id=" + pok_cus_id + "&pok_cst_id=" + pok_cst_id + "&pok_cus_ac=" + pok_cus_ac
}

function OpenerLocation(iTypeID) {
  var wOpener = window.opener;
  if (iTypeID == 0) {
    wOpener.location = '/';
  }
  else if (iTypeID == 1) {
  wOpener.location = 'https://www.incasino.gr/my-account/account_forgotpwd.asp';
}
  else if (iTypeID == 2) {
    wOpener.location = 'https://www.incasino.gr/my-account/account_create.asp';
}
  else if (iTypeID == 3) {
  wOpener.location = 'https://www.incasino.gr/article.aspx?entid=1775';
}
  else if (iTypeID == 4) {
  wOpener.location = 'https://www.incasino.gr/article.aspx?entid=1772';
}

  else if (iTypeID == 10) {
  wOpener.location = 'https://www.incasino.gr/my-account/';
}
  else if (iTypeID == 11) {
  wOpener.location = 'https://www.incasino.gr/my-account/deposit-money/';
}
  else if (iTypeID == 12) {
  wOpener.location = 'https://www.incasino.gr/my-account/withdraw-money/';
}
  
  
  
}


function transferMoney() {
  newFeatures = "toolbar=0,scrollbars=0,menubar=0,location=0,resizable=0,directories=0,status=0,width=400,height=400,left=400,top=400";
  var TransferMoney = open("/popup/Transfer.aspx", "Transfer_Money", newFeatures);
}


function disableButton(button, resetDelay) 
{ 
    button.oldonclick = button.onclick; 
    button.onclick=noClick;
    setTimeout("enableButton('"+ button.id + "');", resetDelay);
} 
function noClick() 
{ 
    alert("Έχετε ήδη πατήσει το πλήκτρο μία φορά"); 
    return false; 
} 
function enableButton(buttonId) 
{ 
    var button = document.getElementById(buttonId); 
    if(button!=null) 
    { 
        button.onclick = button.oldonclick; 
    }
  }

  function rules(url) {
    var features = "directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=440,height=420";
    var remote = open(url, "rules", features);
  }

  //rotation

  var iSelNR_Box = 1;

  function pict_prev( iMax ) {
    iSelNR_Box -= 1;
    if (iSelNR_Box < 1) {
      iSelNR_Box = iMax;
    }
    pict_sel(iSelNR_Box, iMax);
  }

  function pict_next(iMax) {
    iSelNR_Box += 1;
    if (iSelNR_Box > iMax) {
      iSelNR_Box = 1;
    }
    pict_sel(iSelNR_Box, iMax);
  }

  function pict_num(iMax) {
    iSelNR_Box = num;
    if (iSelNR_Box > iMax) {
      iSelNR_Box = 1;
    }
    pict_sel(iSelNR_Box, iMax);
  }

  function pict_sel(iTr, iMax) {
    for (var i = 1; i <= iMax; i++) {
      if (i.toString() == iTr) {
        document.getElementById('pict_' + i).style.display = 'block';
      }
      else {
        document.getElementById('pict_' + i).style.display = 'none';
      }
    }
  }

  function fApplyClass(sObj, sClas) {
    if (document.getElementById && document.createTextNode) {
      if (document.getElementById(sObj)) {
        document.getElementById(sObj).className = sClas;
      }
    }
  }

function jToggle(id) {
	var e = document.getElementById(id);
	if (e.style.display == 'block')
		e.style.display = 'none';
	else
		e.style.display = 'block';
}

function dRecent() {
	document.getElementById('top_choice_recent').style.display = 'block';
	document.getElementById('top_choice_top').style.display = 'none';
	fApplyClass('new-winners', 'recent-winners');
}

function dTop() {
	document.getElementById('top_choice_recent').style.display = 'none';
	document.getElementById('top_choice_top').style.display = 'block';
	fApplyClass('new-winners', 'top-winners');
}


function dSwitchTopRecent() {
	if (document.getElementById('top_choice_recent').style.display == 'block') {
		dTop();
	}
	else {
		dRecent();
	}
}

function dSwitchMainImage() {
	var sImgSrc = document.getElementById('main_image').src;
	if ( sImgSrc.indexOf('/ast/img/incasino-taramas-002.jpg') > 0 ) {
		document.getElementById('main_image').src = 'https://www.incasino.gr/ast/img/themaNewGames.jpg';
	}
	if ( sImgSrc.indexOf('/ast/img/themaNewGames.jpg') > 0 ) {
		document.getElementById('main_image').src = 'https://www.incasino.gr/ast/img/incasino-taramas-002.jpg';
	}
}
