// JavaScript Document


// can be changed by oncontextmenu="return false;"- more effective unfortunatly the client requests the alert message

function block(){
	if(document.images){
		var i = 0;
		for(i=0;i<document.images.length;i++){
		document.images[i].onmousedown = direito;
		document.images[i].onmouseup = direito;
		}
	}
}


function direito(e) {
var mensagem = "Copyright Copper Masters.";
	if (navigator.appName == 'Netscape' && e.which == 3) {
		alert(mensagem);
		return false;
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
		alert(mensagem);
		return false;
	}else return true;
}

// used to define the address where the payment type form is going to
// it's a paypal payment is goes to a different address 
function decide_action()
{
  var file_destination=check_buttons();
  if(file_destination!="")
  {
	if(file_destination == 1)
    {
      document.paymentType.action="https://www.paypal.com/cgi-bin/webscr";
	  //document.paymentType.action="https://www.sandbox.paypal.com/cgi-bin/webscr";
      document.paymentType.submit();
	}
	else
	{
      document.paymentType.action="checkout_step4.php";
      document.paymentType.submit();
	}
  }
}

function check_buttons()
{
  var val="";
  for(i=0; i<document.paymentType.iPaymentId.length; i++)
  {
    if(document.paymentType.iPaymentId[i].checked==true)
    {
      val=document.paymentType.iPaymentId[i].value;
    }
  }

  if(val=="")
  {
    alert("Select at least one option.");
  }

  return val;

}


