    
  function findObj(n, d) {
    var p,i,x;  if(!d) d = document; 
    if((p = n.indexOf("?")) > 0 && parent.frames.length) {
      d = parent.frames[n.substring(p+1)].document; 
      n = n.substring(0,p);
    }
    if(!(x=d[n]) && d.all) x = d.all[n]; 
    for (i=0; !x && i<d.forms.length; i++) x = d.forms[i][n];
    for(i=0; !x && d.layers&&i < d.layers.length; i++) x = findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x = d.getElementById(n); 
    return x;
  }
  
  function changeProp(objName,x,theProp,theValue) { //v6.0
    var obj = findObj(objName);
    if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
      if (theValue == true || theValue == false)
        eval("obj."+theProp+"="+theValue);
      else eval("obj."+theProp+"='"+theValue+"'");
    }
  }
  
  function changeVisibility(img, visibility){
    document.getElementById(img).visisbility = visibility;
    alert(document.getElementById(img).visisbility);
  }

	function fullScreenFlash(game) {
		window.location.href="casino-lobby.php";
		newFeatures="toolbar=0,scrollbars=0,menubar=0,location=0,resizable=0,directories=0,status=0,fullscreen=yes,width=" + (screen.width) + ",height=" + (screen.height) + ",left=0,top=0";
		var remote = open("casino-game.php?gameid=" + game + "&fullscreen=1", "FullScreenFlash", newFeatures);
	}
	
  //select hry
  var xpos=0;
  var ypos=0;
  
  var bubblexdistance=10;
  var bubbleydistance=12;
  
  function storepos(event) {
    if (document.all) {
      xpos= (document.body.scrollLeft +window.event.clientX) + bubblexdistance;
      ypos= (document.body.scrollTop + window.event.clientY) + bubbleydistance;
    } else {
      xpos= event.pageX + bubblexdistance;
      ypos= event.pageY + bubbleydistance;
    }
  }
  
  var coinsId = null;
  
  function selectCoin(id) {
  	if (document.forms[id + '_form'].doubleUp) {
  		document.forms[id + '_form'].doubleUp.checked = (document.forms.gameForm.doubleUp.value == "true" ? true:false);
  	}
  	if(document.all || document.getElementById) {
  		if (document.all) {
  			document.getElementById(id + '_coins').style.pixelLeft = xpos - bubblexdistance-15;
  			document.getElementById(id + '_coins').style.pixelTop = ypos - bubbleydistance-65;
  		} else {
  			document.getElementById(id + '_coins').style.left = xpos - bubblexdistance-15+"px";
  			document.getElementById(id + '_coins').style.top = ypos - bubbleydistance-65+"px";
  		}
      document.getElementById(id + '_coins').style.visibility="visible";
  	} else {
      document.layers[id + '_coins'].left = xpos - bubblexdistance-15;
      document.layers[id + '_coins'].top = ypos - bubbleydistance-65;
      document.layers[id + '_coins'].visibility="show";
    }
  	coinsId = id;
  }
  
  function selectFullscreen(id) {
  	if(document.all || document.getElementById) {
  		if (document.all) {
  			document.getElementById(id + '_coins').style.pixelLeft = xpos - bubblexdistance-30;
  			document.getElementById(id + '_coins').style.pixelTop = ypos - bubbleydistance-28;
  		} else {
  			document.getElementById(id + '_coins').style.left = xpos - bubblexdistance-15+"px";
  			document.getElementById(id + '_coins').style.top = ypos - bubbleydistance-65+"px";
  		}
      document.getElementById(id + '_coins').style.visibility="visible";
  	} else {
  	    document.layers[id + '_coins'].left = xpos - bubblexdistance-15;
  	    document.layers[id + '_coins'].top = ypos - bubbleydistance-65;
  	    document.layers[id + '_coins'].visibility="show";
    }
  	coinsId = id;
  }
  
  function coinsHide() {
  	if (coinsId) {
  		if(document.all || document.getElementById) {
    	  document.getElementById(coinsId + '_coins').style.visibility="hidden";
  		} else {
    	  document.layers[coinsId + '_coins'].visibility="hide";
  		}
    }
  }
  
  function play(game,coin) {
  	document.forms.gameForm.game.value = game;
  	document.forms.gameForm.coinValue.value = coin;
  	document.forms.gameForm.submit();
  }
  
  function setDoubleUp(checkbox) {
  	document.forms.gameForm.doubleUp.value = checkbox.checked ? "true":"false";
  }
  
  
  function changeImage(img,src){
  	document.getElementById(img).src=src;
  }

	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);
	}
	
	function leaderboardhelp(url) {
	  var features="directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=480,height=420";
	  var remote = open(url, "Leaderboard", features);
	}
	
  function go(objName)   {
  
      var box = findObj(objName);
  
  	destination = box.options[box.selectedIndex].value;
  
  	if (destination) location.href = destination;
  
  }

function cvvInfo() {
  window.open('../info-cvv.html', 'cvv', 'resizable,width=325,height=200');
}
