var r,g,b;
var colorFlag = 0;
var r1,g1,b1;
var colorFlag1 = 0;

function mouseOver(div1)
{
	if(div1.tagName == 'DIV'){
		div1.className = 'buttonLink';
		for(i=0;;i++){
			ch = div1.childNodes[i];
			if(!ch)break;
			if(ch.tagName=='A')
				ch.style['textDecoration'] = 'underline';
		}
	}
	else{
		div1.style['textDecoration'] = 'underline';
		div1.parentNode.className = 'buttonLink';
	}
	r = 110;
	g = 131;
	b = 152;	
	
	div2 = document.getElementById('div28');
	div2.innerHTML = div1.attributes.getNamedItem('descr').value;
	div2.style['color'] = 'RGB('+r+', '+g+', '+b+')'
	div2.style['display'] = 'block';
	colorFlag = 0;
	
	r1 = 255;
	g1 = 255;
	b1 = 255;	
	colorFlag1 = 0;
	div1.parentNode.style['backgroundColor'] = 'RGB(255, 255, 255)';
	
}

function fadeToBlue(div){
	if((r1>208)&&(colorFlag1 == 1)){
		--r1;
		if(b1>249)--b1;
		if(g1>230)--g1;
		div.style['backgroundColor'] = 'RGB('+ (r1)+', '+ (g1)+', '+ (b1)+')';
		setTimeout(function(){fadeToBlue(div)},1);
	}
	else{
		div.style['backgroundColor'] = 'RGB(208, 230, 249)';
	}
}

function fadeToBlack(){
	
	if((b<250)&&(colorFlag == 1)){
		document.getElementById('div28').style['color'] = 'RGB('+ (++r)+', '+ (++g)+', '+ (++b)+')';
		setTimeout(fadeToBlack,1);
	}
}

function mouseOut(div1)
{
	if(div1.tagName == 'DIV'){
		div1.className = 'buttonLinkDis';
		for(i=0;;i++){
			ch = div1.childNodes[i];
			if(!ch)break;
			if(ch.tagName=='A')
				ch.style['textDecoration'] = 'none';
		}
	}
	else{
		div1.style['textDecoration'] = 'none';
		div1.parentNode.className = 'buttonLinkDis';
	}
	
	colorFlag = 1;
	colorFlag1 = 1;
	setTimeout(fadeToBlack,1);
	setTimeout(function(){fadeToBlue(div1.parentNode)},1);
}

var currency_dropdown_change = function(){
	
	var process_change = function(){
		var currency_id = currency_dropdown.val();

		if($.inArray(currency_id, ['GBP', 'USD', 'EUR']) == -1){
			return false;
		}

		changeable_elements.hide();

		change_currency_area.find('.'+currency_id).show();
		
//		currencySelector.value = currency_id;
//		currencySelector.onchange();
	}

	var currency_dropdown = $('#currency_dropdown');
	var change_currency_area = $('.change_currency_area');
	var changeable_elements = change_currency_area.find('.GBP, .USD, .EUR');


//	var frameWindow = document.getElementById('myFrame').contentWindow;
//	var currencySelector = frameWindow.document.getElementById('currencySelector');

	currency_dropdown.change(process_change);
}

var init__alternative_payment_options = function(){
	
	currency_dropdown_change();
	
}

if(typeof(jQuery) != 'undefined'){
	
	$(document).ready(function(){
		var body = document.getElementsByTagName('body')[0];

		if(body.id == 'alternative_payment_options'){
			init__alternative_payment_options();
		}
	});
}
	



