jQuery.noConflict();

function createAppletHTML(p) {
  var html = '<applet code="';
  html += p.code + '" ';
  html += 'width="'+p.width+'" ';
  html += 'height="'+p.height+'" ';
  html += 'archive="';
  for (var i in p.archives) {
    if (i > 0) { html += ','; }
    html += p.archives[i];
  }
  html += '">';
  for (var pname in p.parameters) {
    html += '<param name="';
    html += pname + '" value="';
    html += p.parameters[pname] + '" />';
  }
  if (p.extraHTML) html += p.extraHTML;
  html += '</applet>';
  return html;
}

function fixEmails() {
  jQuery('.dotComEmail').each(function() {
    var a = jQuery(this).find(':first');
    var b = a.next();
    var e = a.html() + '@' + b.html() + '.com';
    jQuery(this).html('<a href="mailto:'+e+'">'+e+'</a>');
  });
}

function focusFirstTextField() {
  jQuery(document).ready(function() {
    jQuery("input:text:first").focus();
  });
}

jQuery(document).ready(function() {
  fixEmails();
  jQuery('.gradient').each(function() { jQuery(this).addClass('gradient_'+Math.ceil(Math.random()*3)); });
  jQuery('.locagoPage').each(function() { jQuery(this).addClass('bg_' + Math.ceil(Math.random()*3)); });
  jQuery('.layerInfo').hide();
  jQuery('.layerTitle').click(function() { jQuery(this).parent().parent().find('.layerInfo').toggle(); });
  jQuery('#phoneText').animate({right: 0}, 500, function() {});
});
