 /**********************************************************
 *             Popup Window Definition Part                *
 *                                                         *
 * To add a popup window, add a string definition below.   *
 * To include the item in the printing friendly page,      *
 * modify the longStr by adding the item to it.            *
 * Don't change anything else.                             *
 **********************************************************/


/***************************Tooltip Part Begins***************************/
  var style = ((NS4 && document.test) || (IE4 || FF1)) ? 1 : 0;
  var timerID = null;
  var padding = 2; // < 4 recommended
  var bgcolor = "beige";
  var borWid = 1; // for no border, assign null
  var borCol = "#0000cc";
  var borSty = "solid";
  var str = "<STYLE TYPE=\"text/css\">";
  var active;
  IE4 = (document.all);
  NS4 = (document.layers);
  ver4 = (IE4 || NS4);
  for (i = 0; i <= 5000; i++)
  {
  }


  str += ".tooltip {";
  str += "position: absolute;";
  str += "visibility: hidden;";
  str += "left: 0; top: 0;";

  if (borWid > 0) { // if a border is specified

     str += "border-width: " + borWid + ";";
     str += "border-color: " + borCol + ";";
     str += "border-style: " + borSty + ";";

  }

  if (NS4) {

     if (borWid > 0 && padding <= 3) {
       str += "padding: 0;";
       str += "layer-background-color: " + bgcolor + ";"; 

     } else if (borWid > 0 && padding > 3) {
       str += "padding: " + (padding-3) + ";";
       str += "background-color: " + bgcolor + ";";

     } else if (borWid == 0) {
       str += "padding: " + padding + ";";
       str += "layer-background-color: " + bgcolor + ";";

     }

  } else {
     str += "padding: " + padding + ";";
     str += "background-color: " + bgcolor + ";";
  }

  str += "}";
  str += "</STYLE>";

  if (style) {
    document.write(str);
    if (NS4) window.onload = init;
  }


/**************************************************
*        Making your tooltip text here            *
* This is the only place that need tobe modified.*
* The first argument is the name of the tooltip.  *
* The second argument is the width and last one   *
* is the content of the tooltip.                  *
**************************************************/

makeEl("LocTip", 300, "<font size=1>Gene in genomic location according to Ensembl data</font>");
makeEl("TVTip", 400, "<font size=1>Experimental tissue vectors: Duplicate measurements were obtained for twelve normal human tissues hybridized against Affymetrix GeneChips HG-U95A-E. The intensity values (shown on the y-axis) were normalized and drawn on a novel scale, which is an intermediate between log and linear scales. This enables displaying several orders of magnitude on the same graph, while emphasizing the differences between them.  Noise was not subtracted out, so values below 10 may be suspect. Further, each probeset's expression profile was converted into binary form when possible. At most 5 unique binary patterns, which reflect the over-expression (in black) and under-expression (in white) in different tissues, are shown per gene, with their counts on the left. (The grey stripes show undefined binary patterns.) Please note: under-expression does not always mean the lack of expression..</font>");
makeEl("TVVARTip", 200, "<font size=1>Multiple probe-sets corresponding to this gene are included for its tissue vector calculation only if their normalized intensity levels reach a threshold in at least one tissue. The variation of included and excluded probe-sets are visualized in the x-y plane: the x-axis shows Pearson's correlations between individual probe-sets vectors and the average tissue vector; the y-axis shows the relative length of an individual probe-set vector (its scalar length divided by that of the average vector). The average is shown as a black square, while individual probe-sets are depicted as colored circles.</font>");
makeEl("EnorthTip", 400, "<font size=1>Electronic Northern: For the shown set of  non-fetal normal human tissues, NCBI's Unigene dataset (Hs.data) is mined for information about the number of unique clones per gene per tissue. Clones are assigned to particular tissues by applying data-mining heuristics to Unigene's library information file (Hs.lib.info). Electronic expression results were calculated by dividing the number of clones per gene by the number of clones per tissue. They were then normalized by multiplyingby 1M, and  the obtained normalized counts are presented on the same root scale as theexperimental tissue vectors. </font>");
makeEl("SageTip", 400, "<font size=1>Serial Analysis of Gene Expression: For ten normal human tissues (currently the relevant SAGE libraries are not  available  for spleen and thymus, shown in lower case and flagged with a *). CGAP datasets <i>Hs.frequencies</i> and <i>Hs.libraries</i> are mined for information about the number of SAGE tags per tissue. Tags are reassigned to a Unigene cluster and after that to a particular gene by mining <i>Hs.best_gene</i>, <i>Hs.best_tag</i> and <i>Hs_GeneData</i>. The expression level of a particular gene in a particular tissue was calculated as the number of appearances of the corresponding tag divided by the total number of tags in libraries derived from that tissue. These fractions were then normalized by multiplying by 1.2M and the obtained normalized counts are presented on the same root scale as  that is used for the electronic Northern pictures. Please note: Currently, only associations with minimal ambiguity participate in the  analysis.</font>");
makeEl("ExpLegendTip", 100, "<font size=1>Figure legend</font>");
/***makeEl("SageTip", 400, "<font size=1>Serial Analysis of Gene Expression: For ten normal human tissues (currently the relevant SAGE libraries are not  available  for spleen and thymus), CGAP datasets <i>Hs.frequencies</i> and <i>Hs.libraries</i> are mined for information about the number of SAGE tags per tissue. Tags are reassigned to a Unigene cluster and after that to a particular gene by mining <i>Hs.best_gene</i>, <i>Hs.best_tag</i> and <i>Hs_GeneData</i>. The expression level of a particular gene in a particular tissue was calculated as the number of appearances of the corresponding tag divided by the total number of tags in libraries derived from that tissue. The obtained fractions are presented on the same root scale that is used for the electronic Northern pictures. Please note: Currently, only associations with minimal ambiguity participate in the  analysis.</font>");***/
makeEl("SageLegendTip", 100, "<font size=1>Figure legend</font>");
makeEl("SNPSort", 100, "<font size=1>Choose the priority to sort by this field</font>");
makeEl("SNPTip", 400, "<font size=1>SNP information is currently extracted from dbSNP (ftp://ncbi.nih.gov/snp/human/XML). Filtering is done to include only those that are not artifacts, not connected to gene duplication, fully specified, without ambiguous locations or low map quality, and having single EntrezGene and contig ids. A gene's SNPs are prioritized by location type: (coding non synonymous, coding synonymous, coding, splice site, mRNA-UTR, intron, locus). Each displayed line includes SNP-related, contig-related, and expression level data sections. The initial number of top-priority summaries shown is expandable, thereby balancing compactness vs completeness.</font>");
makeEl("EnorthLegendTip", 100, "<font size=1>Figure legend</font>");

/*************************End of making tooltip  text*************************/

function init() {
  setTimeout("window.onresize = redo", 1000);
}
 
function redo() {
  window.location.reload();
}

function makeEl(id, width, code) {
  if (!style) return;

  var str = "<STYLE TYPE='text/css'>";
  str += "#" + id + " {";
  str += "width: " + width + ";";
  str += "}";
  str += "</STYLE>";
  str += "<div class='tooltip' id='" + id + "'><center>" + code + "</center></div>";
  document.write(str);
}

function displayEl(left, top) {
	if (!window.pageLoaded) return;

  if (NS4) document.releaseEvents(Event.MOUSEMOVE);
  document.onmousemove = null;

  var whichEl = null;
  if (!IE4){
  		var obj=document.getElementById("active");
  		if(obj)
	  		whichEl = obj.style 
  	}else
  	{ whichEl =document.all[active].style;}
  
  if(whichEl == null) return;
  
  whichEl.left = left;
  whichEl.top = top;
  whichEl.visibility = (NS4) ? "show" : "visible";
}

function clearEl() {

  if (!style) return;
  var whichEl = (!IE4) ? document.getElementById(active).style : document.all[active].style;
  whichEl.visibility = (NS4) ? "hide" : "hidden";
  active = null;

  if (timerID) clearTimeout(timerID);
  if (NS4) document.releaseEvents(Event.MOUSEMOVE);
  document.onmousemove = null;

}

function activateEl(id, e) {
  if (!style) return;
  active = id;

  if (NS4) document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove = checkEl;
  checkEl(e);

  }

function checkEl(e) {
  if (timerID) clearTimeout(timerID);
  if (NS4){ 
     var left =  e.pageX; 
     var top =  e.pageY;
  }
  if (IE4){
     var left = event.clientX + document.body.scrollLeft;
     var top = event.clientY + document.body.scrollTop + 20;
  }
  else {
     var left = e.clientX + document.body.scrollLeft;
     var top = e.clientY + document.body.scrollTop + 20;
  }

  timerID = setTimeout("displayEl(" + left + ", " + top + ")", 300);
}

	function validateForm()
	{
    	var good=1;
    	if(!document.myform.email.value) {
			document.myform.email.focus();
			alert("Please specify your email address!");
			good = 0;
    	}
    	if(!document.myform.name.value) {
			document.myform.name.focus();
			alert("Please specify your name!");
			good = 0;
    	}
    	if (-1 == document.myform.email.value.indexOf("@") || -1 == document.myform.email.value.indexOf('.')) { 
			document.myform.email.focus(); 
			alert("Please enter a valid email address."); 
			good = 0;
    	}
	if(!document.myform.institution.value) {
                        document.myform.institution.focus();
                        alert("Please specify your institution!");
                        good = 0;
        }
    	var pattern = /[a-z]/i;
    	if (!pattern.test(document.myform.name.value)) {
			document.myform.name.focus();
			alert("Please enter a valid name.");
			good = 0;
    	}
    	if (good==1) {
			document.myform.submit();
    	}
	}

      function popup(loc, winName, winDim) {
         myWindow = window.open(loc,winName,winDim);
      }

 


