/**
	@version: $Id: main.js,v 1.4 2007/08/17 09:45:09 makhotkin Exp $
*/

var Browser = {
    IE:     !!(window.attachEvent && !window.opera),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
    Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
};

function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++){
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1)
      return element;
    elements.push(element);
  }
  return elements;
}

function toggle_block(t)
{
	tid = t.id;
	block = document.getElementById(tid+"_block");
	block.style.display == 'none' ? block.style.display = 'block' : block.style.display = 'none';
}
 //79
var sizes = [467,168,358];
var ie_height = 560;

function same_billing(m)
{
	if(m){
		$('billing_form').style.display = 'none';
		$('bb0').style.height = '467px';
		$('types-cont').style.height = (Browser.IE ? 560 : 546)+'px';
		if(Browser.IE) ie_height = 560;
		sizes[0] = 467;
	} else {
		$('billing_form').style.display = 'block';
		$('types-cont').style.height = (Browser.IE ? 741 : 727)+'px';
		if(Browser.IE) ie_height = 741;
		$('bb0').style.height = '648px';
		sizes[0] = 648;
	}
}

function update_height(n)
{
	height = sizes[n-1];
	$('types-cont').style.height = height+79+'px';
	if(Browser.IE && n==1) $('types-cont').style.height = ie_height+'px';
	$('bb'+(n-1)).style.height = height+'px';
}

function show_cvv()
{
	window.open('/cvv.html', '', 'width=500, height=340, top=50, left=50');
}
