// JavaScript Document

function acceptCard()
{

var accept = confirm("Please confirm the acceptance.\nOn acceptance, Card will be mailed to your provided Email Address.");

if(accept)
{
  mailCard();
  document.getElementById('configureContent').style.display='block';
  document.getElementById('cardacceptbox').style.display='none';
  //alert('eBusinessCard has been mailed to your email.');
  
}else
{
  return false;
}

}


function ClipBoard() {
var Copied = document.getElementById('copytext').innerHTML;
  if (window.clipboardData) {
    window.clipboardData.setData("Text",Copied);
  }
}


function selectIt(id)
{
  document.getElementById(id).focus();
  document.getElementById(id).select();
}


function unselectIt()
{

}


function mailCard()
{
	 var err = false;
	 var succes = false;	
	
	$.ajax({
		type: "get",
		url: "emailcard.php",
		error: function() {
			err = true; 	
			//alert("Error loading page.");
			//alert('Internal Error: eBusinessCard has not been mailed to your email. Try Again.');
			
		},
		success: function(html) {
		       succes = true;
			   //alert(html);
      		
      }
      
	});
	//alert(err + '[]' + succes)
	//alert('eBusinessCard has been mailed to your email2.');	
}



function showMailClient(id)
{


if(id =='')
  return false;
 
 var htmldata =  document.getElementById(id).innerHTML;
//alert(htmldata);

  document.getElementById("mainBox").innerHTML = htmldata;
}

