function toggleState(element){
  element1 = "H" + element;
  element = document.getElementById(element)||element;
  element1 = document.getElementById(element1)||element1;
  if (element.id == 'fullInt') {
    $('shortInt').style.display='none';
  }
  if (element.style.display=='none'){
    element.style.display='block';
    element1.className='annoExp';
  } else{
    element.style.display='none';
    element1.className='annoNorm';
  }
  if (element.id == 'fullInt') {
    $('annoBox').style.height="auto";
    var tmpH = $('annoBox').offsetHeight + 10;
  }
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 }
}
 
window.onload = externalLinks;

function popHelp(i) {
    var m;
    if (i ==1) {
        m ="Paste a protein sequence you wish to analyze. Spaces, numbers and FASTA headers will be automatically removed.<p>To analyze multiple sequences, please use <a href='/smart/batch.pl'>batch access</a> to SMART database.";
    } else if (i == 2) {
        m = "Use a Uniprot or Ensembl protein sequence identifier or accession number. If SMART does not find the identifier in its database, please submit the full protein sequence for analysis using the field below.<p>To submit multiple identifiers, please use <a href='/smart/batch.pl'>batch access</a> to SMART database.";
    } else if (i==3) {
        m = "Architecture analysis queries support basic boolean logic using operators <b>AND</b> and <b>AND NOT</b>. In addition, you can use the keyword <b>UNIQUE</b> to search for proteins containing only one particular domain, and nothing else (for example, you could query for <b>UNIQUE SH2</b> to find proteins with only one SH2 domain predicted, and no other domains or features).<p>Protein intrinsic features can be included in the search using keywords <b>SIGNAL</b> for signal peptides, <b>TRANS</b> for transmembrane regions and <b>COIL</b> for coiled coils.<p>To include Pfam domains, please add prefix <b>Pfam:</b> in front of the domain name (for example, <b>Pfam:Inhibitor_Mig-6</b>)";
    } else if (i==4) {
        m="Architecture analysis based on GO terms is a two step process and supports only <b>AND</b> operator. In the first step, SMART will identify all domains associated to your GO terms. After selecting the domains of interest, standard architecture analysis will be performed in the second step.";
    } else if (i==5) {
        m="If you wish to restrict your domain architecture query to a particular species or taxonomic class, either use one of the pre-selected classes or type it into the input box.";
    } else if (i==6) {
        m="Use this field (which is also available in the top right corner of each page) to search SMART and Pfam domain annotations. In addition, complete Uniprot and Ensembl protein descriptions will be searched as well.<p>You can use boolean logic operators (<b>AND</b>, <b>OR</b> and <b>NOT</b>). <b>AND</b> operator will be used by default when none are specified. To search for a particular phrase, please enclose it into quotes.<p>Type a SMART domain name or accession number to directly view its annotation pages.";
    }

    return overlib("<div style='text-align: justify; width: 300px; padding: 5px; font-size: 14px'>" + m + "</div>", CLOSECLICK, STICKY, WRAP,CAPTION,"Help");
}

function popMetaHelp(i) {
    var m;
    if (i ==1) {
        m="Architecture analysis queries support basic boolean logic using operators <b>AND</b> and <b>AND NOT</b>.<p>To include Pfam domains, please add prefix <b>Pfam:</b> in front of the domain name (for example, <b>Pfam:Inhibitor_Mig-6</b>).<p>Note that protein intrinsic features (signal peptides, coiled coils and transmembrane regions) aren't supported in metaSMART at the moment.";;
    } else if (i == 2) {
        m='You can list all architectures present in a particular dataset, or display only those unique to it. When checking for uniqueness, each architecture is compared to all other metagenomics datasets <b>AND</b> complete regular SMART protein databases (Uniprot, Ensembl and STRING).<p>Note that due to the nature of metagenomics data, many protein fragments will be falsely detected as having a unique novel architecture.</p>';
    } else if (i == 3) {
	m='Select two datasets and desired more of comparison. When displaying unique architectures, only the selected datasets will be compared.';
    }
    return overlib("<div style='text-align: justify; width: 300px; padding: 5px; font-size: 14px'>" + m + "</div>", CLOSECLICK, STICKY, WRAP,CAPTION,"Help");
}

