// we always need to set some defaults near the start
var xmlHttp;

// This function is used to verify and delete a post from the manage posts page
function deletePost(id) {
  // First use a confim verify box
  var confirmination = confirm("Are You Sure You Want To Delete This Link?\nRemember to remove the link from your site before you delete it from here");
  
  if(confirmination == true) {
    var formName = 'deleteForm'+id;
    document.getElementById(formName).submit();
  }
  
  if(confirmination == false) {
    return false;
  }
}

// This function is used to verify and delete a post from the manage posts page
function deletekeyitem(id) {
  // First use a confim verify box
  var confirmination = confirm("Are You Sure You Want To Delete This Keyword?\nRemoving it will also remove all conversion data along with it");
  
  if(confirmination == true) {
    var formName = 'deleteForm'+id;
    document.getElementById(formName).submit();
  }
  
  if(confirmination == false) {
    return false;
  }
}

// This function is used to verify and delete a post from the manage posts page
function deletekeys(id) {
  // First use a confim verify box
  var confirmination = confirm("Are You Sure You Want To Delete This Keyword?\nThis will remove all stats along with it");
  
  if(confirmination == true) {
    var formName = 'deleteKeyword'+id;
    document.getElementById(formName).submit();
  }
  
  if(confirmination == false) {
    return false;
  }
}

function deleteconverts(id) {
  // First use a confim verify box
  var confirmination = confirm("Are You Sure You Want To Delete This Conversion?\nThis will remove all stats along with it");
  
  if(confirmination == true) {
    var formName = 'deleteConvert'+id;
    document.getElementById(formName).submit();
  }
  
  if(confirmination == false) {
    return false;
  }
}

function viewItem(afflink,tracklink) {
  document.getElementById('showitem').style.display = 'block';
  document.getElementById('showitem').innerHTML = '<br /><p><b>Affiliate Link: </b>'+afflink+'<br /><b>Tracking Link: </b>'+tracklink+'</p>';
}
