
<!--


function display(name){

  var element=name;
  if (element.style.display=="none"){
    element.style.display="";
  }else{
    element.style.display="none";
  }
}

function message(){
  var mesg = "";
  if (document.contact.name.value == ""){
    mesg += "Please enter your name.\n";
  }
  var emailcheck = document.contact.email.value;
  var emailReg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var emailReg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/; // valid
  if (!emailReg1.test(emailcheck) && emailReg2.test(emailcheck)) {// if syntax is valid
    mesg += "";
  }else{
    mesg += "Please enter a valid email address.\n";
  }
  if (document.contact.message.value == ""){
    mesg += "Please enter a message.\n";
  }
  if(mesg == ""){
    document.contact.submit();
  }else{
    alert(mesg);
  }
}

function search(){
  var mesg = "";
  if (document.searcher.keywords.value == ""){
    mesg += "Please enter a search term.\n";
  }
  if(mesg == ""){
    document.searcher.submit();
  }else{
    alert(mesg);
    return false;
  }
}

function clearemail(){
  if(document.subscribe.email.value == "Your email here"){
    document.subscribe.email.value = "";
  }
}

function clearinput(theitem, thetext){
  if(theitem.value == thetext){
    theitem.value = "";
  }
}

function checkemail(){
  var emailform = /^([\w\-\.])+@[\w\-]+\.[\w\.]+$/;
  var emailerrors = /(\.\.)|(@\.)|(\.@)|(^\.)/;
  if(emailform.test(document.subscribe.email.value) && !emailerrors.test(document.subscribe.email.value)){
    return true;
  }else{
    alert("Please enter a valid email address");
    return false;
  }
}

function logmein(){
  var mesg = "";
  if(document.login.username){
    if (document.login.username.value == ""){
      mesg += "Please enter your username.\n"
    }
  }
  if(document.login.email){
    if (document.login.email.value == ""){
      mesg += "Please enter your email.\n"
    }
  }
  if (document.login.password.value == ""){
    mesg += "Please enter your password.\n"
  }
  if(mesg == ""){
    return true
    //document.login.submit();
  }else{
    alert(mesg);
    return false;
  }
}

function popUnder( windowURL, windowName, windowFeatures ){
//  var windowname = new String(window.name.tostring);
  var regex = new RegExp("^popunder","i");
  if(!regex.test(window.name)){
    window.open( windowURL, windowName, windowFeatures );
    window.focus();
  }
}

function openWin( windowURL, windowName, windowFeatures ){
  window.open( windowURL, windowName, windowFeatures );
}

function noharvest(name,domain){
  document.write ("<a href='mailto:" + name + "@" + domain + "'>" + name + "@" + domain+ "</a>");
}

function reloadParent() {
  var newUrl;
  var url = window.opener.location.href;
  var exp = '\\?.*';
  var argUrl = new RegExp(exp,"gi");
  newUrl = url.replace(argUrl,"");
  window.opener.location = newUrl;
}

function loadInParent(toLoad) {
  window.opener.location = toLoad;
}

function switchToTab(tabType) {
  oppositeTabType = (tabType == 'image') ? 'video' : 'image';

  tabHeaderId = tabType + "TabHeader";
  jQuery(".speakerDetails .current").removeClass("current");
  jQuery("#" + tabHeaderId).addClass("current");

  jQuery(".speakerDetails .image.invisible").removeClass("invisible");
  oppositeTab = oppositeTabType + "Tab";
  jQuery("#" + oppositeTab).addClass("invisible");
}

function showVideoDialog() {


    var dialog = jQuery('#videobody');

    dialog.show();
    stashVideo();
    recenterDiv(dialog);
    dialog.hide();

    dialog.slideDown("slow", function() {
            restoreStashedVideo();
            jQuery('#videobody').removeClass('invisible');
    });

    $(window).scroll(function() {
      if(!jQuery('#videobody').hasClass('invisible')) {
        recenterDiv(jQuery('#videobody'));
      }
    });
}


function recenterDiv(dialog) {
    var radius = [];
    var middle = [];
    var win = jQuery(window);

    radius[0] = Number(dialog.outerWidth()) / 2;
    radius[1] = Number(dialog.outerHeight()) / 2;
    middle[0] = Number(win.width()) / 2;
    middle[1] = Number(win.height()) / 2;

    dialog.css('left', (middle[0] - radius[0]) + "px");
    dialog.css('top', (win.scrollTop() + middle[1] - radius[1]) + "px");
}

function closeVideoDialog() {
    /* Remove flash object from page, stop it playing */
    stashVideo();
    jQuery('#videobody').slideUp("slow", function() {
            stashVideo();
            jQuery('#videobody').addClass('invisible');
    });
}

function stashVideo() {
    videoBox = jQuery('#videobody .video');
    if(!window.stashedVideoHTML) {
        window.vidHeight = videoBox.height();
        window.vidWidth = videoBox.width();
        window.stashedVideoHTML = videoBox.html();
    }
    videoBox.html('<div style="height: ' + window.vidHeight + 'px; width: ' + window.vidWidth + 'px;"> </div>');
}

function restoreStashedVideo() {
    jQuery('#videobody .video').html(window.stashedVideoHTML);
}

//-->
