function swapImage(e, src){
  $(e).src = src;
}

function swapBkgImage(e, src){
  //alert_debug($(e));
  $(e).style.backgroundImage = 'url('+src+')';
  //alert("image swapped :"+$(e).style.backgroundImage+":");
}

function alert_debug(obj)
{
  // debugging function
  
  var str = "";
  for (var prop in obj) {
    str = str + prop + " = " + obj[prop] + ";";
  }
  //if($('debug')){
    //$('debug').innerHTML = str;
  //}else{
    alert("Debug: " + str);
  //}
}

function my_hide(el){
  el.style.display = "none";
}

function my_show(el){
  el.style.display = "block";
}


function hide_existing_login()
{
  $("#existing_customer_login").hide();
  $("#signup").show();
}

function show_existing_login()
{
  $("#existing_customer_login").show();
  $("#signup").hide();
}


function hide_dd_form()
{
    $("#credit_card_form").show();
    $("#direct_debit_form").hide();
}

function hide_cc_form()
{
    $("#credit_card_form").hide();
    $("#direct_debit_form").show();
}


function show_standalone_form()
{
  $("#standalone_form").show();
}


function show_click_to_call(){

  var screen = document.getElementById('clicktocall');
  if (screen.style.zIndex != "90000")
  {
  screen.style.position = "fixed";
  screen.style.zIndex   = "90000";
  screen.style.top      = "70px";
  
  screen.style.left     = ((document.body.offsetWidth/2)-175) + "px";
  }

  var blocker = document.getElementById( "blocker" );
  blocker.style.filter = "alpha(opacity=90)";
  blocker.style.MozOpacity = ".9";
  blocker.style.opacity = ".9";
  blocker.style.width   = "100%";
  //blocker.style.height  = "100%"; // not enough ..
  
  blocker.style.height  = document.getElementById('body_table').offsetHeight + "px";
  blocker.style.overflow= "hidden";
  blocker.style.left    = "0px";
  blocker.style.top     = "0px";
  blocker.style.position= "absolute";
  blocker.style.zIndex  = "89999"; //phew, just under 9000 ;)
  blocker.style.backgroundColor = "#EBECFF";
  
  my_show( blocker );
  my_show( screen );
}

function hide_click_to_call(){
  my_hide( document.getElementById( "blocker" ) );
  my_hide( document.getElementById( "clicktocall" ) );
}


