

var tcdacmd="dt";
var ANS_customer_id="e9681d3e-eead-4276-805a-74d2888d2419";
function popupWindow(url){window.open(url, 'popupWindow', 'toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = yes, resizable = yes, copyhistory = no, width = 400, height = 400, screenX = 150, screenY = 150, top = 150, left = 150');}
function popupWindowExtra(url){window.open(url, 'popupWindow', 'toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = yes, resizable = yes, copyhistory = no, width = 400, height = 400, screenX = 150, screenY = 150, top = 150, left = 150');}
function toggle(element){var id = document.getElementById(element);if(id.style.display == 'none'){id.style.display = '';}else{id.style.display = 'none';}}
function disable(element){document.getElementById(element).style.display = 'none';}
function enable(element){document.getElementById(element).style.display = '';}
function setBookmark(){if (document.all)window.external.AddFavorite(location.href, document.title);else alert('Click \'OK\' then Press CTRL and D to add a bookmark to:\n"' + document.title);} 
function phpOnlinePopupWindow() 
{
  var url = "http://thepartyworks.com/livechat/client.php";
  window.open(url,'popupWindow2','toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=550,height=400,screenX=150,screenY=150,top=150,left=150');
}

var form = "";
var submitted = false;
var error = false;
var error_message = "";

function check_input(field_name, field_size, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == '' || field_value.length < field_size) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_form(form_name) {
  if (submitted == true) {
    alert("<?php echo JS_ERROR_SUBMITTED; ?>");
    return false;
  }

  error = false;
  form = form_name;
  error_message = "<?php echo JS_ERROR; ?>";

  check_input("links_title", <?php echo ENTRY_LINKS_TITLE_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_TITLE_ERROR; ?>");
  check_input("links_url", <?php echo ENTRY_LINKS_URL_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_URL_ERROR; ?>");
  check_input("links_description", <?php echo ENTRY_LINKS_DESCRIPTION_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_DESCRIPTION_ERROR; ?>");
  check_input("links_contact_name", <?php echo ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_CONTACT_NAME_ERROR; ?>");
  check_input("links_contact_email", <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_EMAIL_ADDRESS_ERROR; ?>");
  check_input("links_reciprocal_url", <?php echo ENTRY_LINKS_URL_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_RECIPROCAL_URL_ERROR; ?>");

  if (error == true) {
    alert(error_message);
    return false;
  } else {
    submitted = true;
    return true;
  }
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
}