function roll(img_name, img_src)
{
	document[img_name].src = img_src;
}
   
function PopupPic(sPicURL) 
{ 
	window.open( "popup.html?"+sPicURL, "", "resizable=1", "scrollbars=auto"); 
}
  
function showbox(url, width, height) 
{
    return tb_show('',url+'?height='+height+'&width='+width);
}

var selectedPriceIndex = -1;
var priceSelectionsText = new Array();

function rollWithCheckSelected(index, img_name, img_src) {
        if (index == selectedPriceIndex) return;
        roll(img_name, img_src);
}
 
function selectImgPrice(index, img_root, country) {
        selectedPriceIndex = index;
        
        document["but_" + country + "_monthly"].src = img_root + "/payment/img_" + country + "_monthly_01.png";
        document["but_" + country + "_6months"].src = img_root + "/payment/img_" + country + "_6months_01.png";
        document["but_" + country + "_12months"].src = img_root + "/payment/img_" + country + "_12months_01.png";
        
        switch(selectedPriceIndex)
        {
                case 1:
                        document["but_" + country + "_monthly"].src = img_root + "/payment/img_" + country + "_monthly_03.png";
                break;
                case 2:
                        document["but_" + country + "_6months"].src = img_root + "/payment/img_" + country + "_6months_03.png";
                break;
                case 3:
                        document["but_" + country + "_12months"].src = img_root + "/payment/img_" + country + "_12months_03.png";
                break;
        }
                        
        document.getElementById("selectedPeriodIndi").innerHTML = "<b><u>" + priceSelectionsText[selectedPriceIndex] + "</u></b>";
}


var tableSelectedColor = "#FCCB4F";
var tableOnMouseOverColor = "#FCCB4F";
var tableOnMouseOutColor= "#FCF18B";

var selectedGatewayIndex = -1;
var gatewayTableName = "gatewaySelectionInd";	
var gatewayRadioImgName = "img_gateway_selection_";

function selectGateway(index, maxIndex, img_root) {
	selectedGatewayIndex = index;

	for( i = 1 ; i < maxIndex + 1 ; i++ )
	{
		document.getElementById(gatewayTableName + i).style.backgroundColor = tableOnMouseOutColor;
		document[gatewayRadioImgName + i].src = img_root + "/payment/but_radio_regular.png";	
	}
	document.getElementById(gatewayTableName + selectedGatewayIndex).style.backgroundColor = tableSelectedColor;
	document[gatewayRadioImgName + selectedGatewayIndex].src = img_root + "/payment/but_radio_selected.png";
}

function onMouseOverGateway(index) {
	if (index == selectedGatewayIndex) return;
	document.getElementById(gatewayTableName + index).style.backgroundColor = tableOnMouseOverColor;
}

function onMouseOutGateway(index) {
	if (index == selectedGatewayIndex) return;
	document.getElementById(gatewayTableName + index).style.backgroundColor = tableOnMouseOutColor;
}



var selectedProductIndex = -1;
var productTableName = "productSelectionInd";
var productRadioImgName = "img_product_selection_";
var productSelectionsText = new Array();

function selectProduct(index, maxIndex, img_root) {
	selectedProductIndex = index;

	for( i = 1 ; i < maxIndex + 1 ; i++ )
	{
		document.getElementById(productTableName + i).style.backgroundColor = tableOnMouseOutColor;
		document[productRadioImgName + i].src = img_root + "/payment/but_radio_regular.png";	
	}
	document.getElementById(productTableName + selectedProductIndex).style.backgroundColor = tableSelectedColor;
	document[productRadioImgName + selectedProductIndex].src = img_root + "/payment/but_radio_selected.png";
	
	document.getElementById("selectedProductIndi").innerHTML = "<b><u>" + productSelectionsText[selectedProductIndex][0] + "</u></b>";
	document.getElementById("selectedProductDurationIndi").innerHTML = "<b>" + productSelectionsText[selectedProductIndex][1] + "</b>";
	document.getElementById("selectedProductPriceIndi").innerHTML = "<b>" + productSelectionsText[selectedProductIndex][2] + "</b>";
}

function onMouseOverProduct(index) {
	if (index == selectedProductIndex) return;
	document.getElementById(productTableName + index).style.backgroundColor = tableOnMouseOverColor;
}

function onMouseOutProduct(index) {
	if (index == selectedProductIndex) return;
	document.getElementById(productTableName + index).style.backgroundColor = tableOnMouseOutColor;
}

