var active="RC4";
var activePrice=0;

var priceRC1=21.99; //lite
var priceRC2=34.99; //plus
var priceRC3=59.99; //pro
var priceRC4=59.99; //dual
var priceRC5=69; //multi
var priceRC6=39; //nano
var priceRC7=79; //4her
var priceRC8=119; //universal
var priceBPP=179; //Power Pack

var altActive=0;
var toggleplay=0;


function goBuy() {
if (document.cookie.length>0)
  {
  var dp=activePrice-2;
  document.PAYPAL.custom.value=document.cookie.substring(document.cookie.indexOf('AFFI=')+5);
  document.PAYPAL.amount.value=dp;
  }
document.PAYPAL.submit();	
}


function init() {
//LITE
document.getElementById("RC1").style.left = "3px";
document.getElementById("RC1").style.top = "9px";
document.getElementById("RC1").style.zIndex = "2"; //document.getElementById("RC1").style.backgroundImage = "url(http://www.pokerremotecontrol.com/images/RC1.jpg)";
//PLUS
document.getElementById("RC2").style.left = "3px";
document.getElementById("RC2").style.top = "44px";
document.getElementById("RC2").style.zIndex = "3"; //document.getElementById("RC2").style.backgroundImage = "url(http://www.pokerremotecontrol.com/images/RC2.jpg)";
//PROFESSIONAL
document.getElementById("RC3").style.left = "3px";
document.getElementById("RC3").style.top = "79px";
document.getElementById("RC3").style.zIndex = "4"; //document.getElementById("RC3").style.backgroundImage = "url(http://www.pokerremotecontrol.com/images/RC3.jpg)";
//DUAL
document.getElementById("RC4").style.left = "3px";
document.getElementById("RC4").style.top = "-5000px";
document.getElementById("RC4").style.zIndex = "5"; //document.getElementById("RC4").style.backgroundImage = "url(http://www.pokerremotecontrol.com/images/RC4.jpg)";
//sp("RC4"); 
showImage("DUAL");	 
activePrice=priceRC4; 
document.getElementById("BUYTOTAL").innerHTML="<em><b>ON SALE!</b></em> (Regular Price: $69.99) &nbsp; Dual only "; 
document.PAYPAL.item_name.value = "1 Poker Remote Control Dual"; 
document.PAYPAL.amount.value = priceRC4; 
////////////////////////
updatePrice();
}




function updatePrice() {
if (document.cookie.length>0)
  {
  var dp=activePrice-2;
  document.PAYPAL.custom.value=document.cookie.substring(document.cookie.indexOf('AFFI=')+5);
  document.getElementById("BUYTOTAL").innerHTML+="<font style='text-decoration: line-through;'>"+activePrice+"</font> $"+dp;
  }
else {document.getElementById("BUYTOTAL").innerHTML+=" $"+activePrice;}
}




function sp(x) { 
hideAll();
if (active != x) { 

ot(x);
var templ=document.getElementById(x).style.left;
var tempt=document.getElementById(x).style.top;
var tempz=document.getElementById(x).style.zIndex;

document.getElementById(x).style.top = document.getElementById(active).style.top;
document.getElementById(x).style.left = document.getElementById(active).style.left;
document.getElementById(x).style.zIndex = document.getElementById(active).style.zIndex;

document.getElementById(active).style.top = tempt;
document.getElementById(active).style.left = templ;
document.getElementById(active).style.zIndex = tempz;

active=x;
if (x == "RC1") {activePrice=priceRC1; document.getElementById("BUYTOTAL").innerHTML="Lite ";updatePrice();showImage('LITE');  document.PAYPAL.item_name.value = "1 Poker Remote Control Lite"; document.PAYPAL.amount.value = priceRC1; }
if (x == "RC2") {activePrice=priceRC2; document.getElementById("BUYTOTAL").innerHTML="Plus ";updatePrice();showImage('PLUS');  document.PAYPAL.item_name.value = "1 Poker Remote Control Plus"; document.PAYPAL.amount.value = priceRC2; }
if (x == "RC3") {activePrice=priceRC3; document.getElementById("BUYTOTAL").innerHTML="<em>(Coming Soon...)</em> Professional ";updatePrice();showImage('PRO');  document.PAYPAL.item_name.value = "1 Poker Remote Control Professional"; document.PAYPAL.amount.value = priceRC3; }
if (x == "RC4") {activePrice=priceRC4; document.getElementById("BUYTOTAL").innerHTML="<em><b>ON SALE!</b></em> (Regular Price: $69.99) &nbsp; Dual only ";updatePrice();showImage('DUAL');  document.PAYPAL.item_name.value = "1 Poker Remote Control Dual"; document.PAYPAL.amount.value = priceRC4; }
} 
} 
function showSpecial() { document.getElementById("SPECIAL").style.top="45px"; }
function hideSpecial() { document.getElementById("SPECIAL").style.top="-9999999px"; }


function ov(x) {
if (active != x) {
var y=parseInt(document.getElementById(x).style.top) -15;
document.getElementById(x).style.top = y + "px";
}} 

function ovs(x) {
if (active != x) {
var y=parseInt(document.getElementById(x).style.top) - 5;
document.getElementById(x).style.top = y + "px";
}} 

function ot(x) {
if (active != x) {
var y=parseInt(document.getElementById(x).style.top) + 15;
document.getElementById(x).style.top = y + "px";
}} 

function ots(x) {
if (active != x) {
var y=parseInt(document.getElementById(x).style.top) + 5;
document.getElementById(x).style.top = y + "px";
}} 










function hideImage (name) {
  var c = document.getElementById(name);
  c.style.left        = -5000+"px";
}



function hideAll () {
hideImage('LITE');
hideImage('PLUS');
hideImage('DUAL');
hideImage('PRO');
}





function showImage (name) {
  var c = document.getElementById(name);
  c.style.left        = "225px";
}

function showImageY (name) {
  var c = document.getElementById(name);
  c.style.top        = "0px";
}


function switchFnc (name) {
  var c = document.getElementById(name);
  var val = document.getElementById(name).style.backgroundImage;
if ( (val.indexOf('-b')) < 0) {
  c.style.backgroundImage = "url(http://www.pokerremotecontrol.com/images/"+name+"-b.jpg)";
}
else {
	c.style.backgroundImage = "url(http://www.pokerremotecontrol.com/images/"+name+".jpg)";
}
}




var numx = 1;
function cycleThrough() {
  numx++;
  if (numx == 4) {
    numx = 1;
  }
document.getElementById("MAININFO").style.backgroundImage="url(images/playingpoker"+numx+".jpg)";
  setTimeout("cycleThrough()", 4*1000);
}


